当前位置: 首页>>代码示例>>Java>>正文


Java Table.addGeneratedColumn方法代码示例

本文整理汇总了Java中com.vaadin.ui.Table.addGeneratedColumn方法的典型用法代码示例。如果您正苦于以下问题:Java Table.addGeneratedColumn方法的具体用法?Java Table.addGeneratedColumn怎么用?Java Table.addGeneratedColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Table的用法示例。


在下文中一共展示了Table.addGeneratedColumn方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addGeneratedColumn

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private static void addGeneratedColumn(final Table table) {
    table.addGeneratedColumn(CREATE_MODIFIED_DATE_UPLOAD, new ColumnGenerator() {
        private static final long serialVersionUID = 1L;

        @Override
        public String generateCell(final Table source, final Object itemId, final Object columnId) {
            final Long createdDate = (Long) table.getContainerDataSource().getItem(itemId)
                    .getItemProperty(CREATED_DATE).getValue();
            final Long modifiedDATE = (Long) table.getContainerDataSource().getItem(itemId)
                    .getItemProperty(LAST_MODIFIED_DATE).getValue();
            if (modifiedDATE != null) {
                return SPDateTimeUtil.getFormattedDate(modifiedDATE);
            }
            return SPDateTimeUtil.getFormattedDate(createdDate);
        }
    });
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:18,代码来源:ArtifactDetailsLayout.java

示例2: addGeneratedColumnButton

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private void addGeneratedColumnButton(final Table table) {
    table.addGeneratedColumn(ACTION, new ColumnGenerator() {
        private static final long serialVersionUID = 1L;

        @Override
        public Button generateCell(final Table source, final Object itemId, final Object columnId) {
            final String fileName = (String) table.getContainerDataSource().getItem(itemId)
                    .getItemProperty(PROVIDED_FILE_NAME).getValue();
            final Button deleteIcon = SPUIComponentProvider.getButton(
                    fileName + "-" + UIComponentIdProvider.UPLOAD_FILE_DELETE_ICON, "",
                    SPUILabelDefinitions.DISCARD, ValoTheme.BUTTON_TINY + " " + "blueicon", true,
                    FontAwesome.TRASH_O, SPUIButtonStyleSmallNoBorder.class);
            deleteIcon.setData(itemId);
            deleteIcon.addClickListener(event -> confirmAndDeleteArtifact((Long) itemId, fileName));
            return deleteIcon;
        }
    });

}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:20,代码来源:ArtifactDetailsLayout.java

示例3: initMatchingUsersTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected void initMatchingUsersTable() {
 matchingUsersTable = new Table();
 matchingUsersTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
 matchingUsersTable.setSelectable(true);
 matchingUsersTable.setEditable(false);
 matchingUsersTable.setImmediate(true);
 matchingUsersTable.setNullSelectionAllowed(false);
 matchingUsersTable.setSortDisabled(true);
 
 if (multiSelect) {
   matchingUsersTable.setMultiSelect(true);
 }
 
 matchingUsersTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.USER_16));
 matchingUsersTable.setColumnWidth("icon", 16);
 matchingUsersTable.addContainerProperty("userName", String.class, null);

 matchingUsersTable.setWidth(300, UNITS_PIXELS);
 matchingUsersTable.setHeight(200, UNITS_PIXELS);
 userSelectionLayout.addComponent(matchingUsersTable);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:SelectUsersPopupWindow.java

示例4: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
  taskTable = new Table();
  taskTable.addStyleName(ExplorerLayout.STYLE_TASK_LIST);
  taskTable.addStyleName(ExplorerLayout.STYLE_SCROLLABLE);
  
  // Listener to change right panel when clicked on a task
  taskTable.addListener(getListSelectionListener());
  
  this.lazyLoadingQuery = createLazyLoadingQuery();
  this.taskListContainer = new LazyLoadingContainer(lazyLoadingQuery, 10);
  taskTable.setContainerDataSource(taskListContainer);
  
  // Create column header
  taskTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.TASK_22));
  taskTable.setColumnWidth("icon", 22);
  
  taskTable.addContainerProperty("name", String.class, null);
  taskTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return taskTable;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:TaskPage.java

示例5: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
  final Table deploymentTable = new Table();
  
  LazyLoadingQuery deploymentListQuery = new DeploymentListQuery();
  deploymentListContainer = new LazyLoadingContainer(deploymentListQuery, 10);
  deploymentTable.setContainerDataSource(deploymentListContainer);
          
  // Listener to change right panel when clicked on a deployment
  deploymentTable.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 8811553575319455854L;
    public void valueChange(ValueChangeEvent event) {
      Item item = deploymentTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      if(item != null) {
        String deploymentId = (String) item.getItemProperty("id").getValue();
        setDetailComponent(new DeploymentDetailPanel(deploymentId, DeploymentPage.this));
        
        // Update URL
        ExplorerApp.get().setCurrentUriFragment(
          new UriFragment(DeploymentNavigator.DEPLOYMENT_URI_PART, deploymentId));
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(new UriFragment(DeploymentNavigator.DEPLOYMENT_URI_PART));
      }
    }
  });
  
  // Create column headers
  deploymentTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.DEPLOYMENT_22));
  deploymentTable.setColumnWidth("icon", 22);
  
  deploymentTable.addContainerProperty("name", String.class, null);
  deploymentTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return deploymentTable;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:38,代码来源:DeploymentPage.java

示例6: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
  final Table jobTable = new Table();
  
  LazyLoadingQuery jobListQuery = new JobListQuery();
  jobListContainer = new LazyLoadingContainer(jobListQuery, 10);
  jobTable.setContainerDataSource(jobListContainer);
          
  // Listener to change right panel when clicked on a deployment
  jobTable.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 8811553575319455854L;
    public void valueChange(ValueChangeEvent event) {
      Item item = jobTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      if(item != null) {
        String jobId = (String) item.getItemProperty("id").getValue();

        setDetailComponent(new JobDetailPanel(jobId, JobPage.this));
        // Update URL
        ExplorerApp.get().setCurrentUriFragment(
          new UriFragment(JobNavigator.JOB_URL_PART, jobId));
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(new UriFragment(JobNavigator.JOB_URL_PART));
      }
    }
  });
  
  // Create column headers
  jobTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.JOB_22));
  jobTable.setColumnWidth("icon", 22);
  
  jobTable.addContainerProperty("name", String.class, null);
  jobTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return jobTable;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:38,代码来源:JobPage.java

示例7: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table createList() {
  final Table table = new Table();
  
  LazyLoadingQuery query = new ProcessInstanceListQuery();
  processInstanceContainer = new LazyLoadingContainer(query);
  table.setContainerDataSource(processInstanceContainer);
  
  table.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      Item item = table.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      if(item != null) {
        String processInstanceId = (String) item.getItemProperty("id").getValue();
        setDetailComponent(new AlfrescoProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
        
        // Update URL
        ExplorerApp.get().setCurrentUriFragment(
          new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART, processInstanceId));
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART));
      }
    }
  });
  
  // Create column headers
  table.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
  table.setColumnWidth("icon", 22);
  
  table.addContainerProperty("name", String.class, null);
  table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return table;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:36,代码来源:ProcessInstancePage.java

示例8: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table createList() {
  userTable = new Table();
  
  userListQuery = new UserListQuery();
  userListContainer = new LazyLoadingContainer(userListQuery, 20);
  userTable.setContainerDataSource(userListContainer);
  
  // Column headers
  userTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.USER_22));
  userTable.setColumnWidth("icon", 22);
  userTable.addContainerProperty("name", String.class, null);
  userTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
          
  // Listener to change right panel when clicked on a user
  userTable.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      Item item = userTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      if(item != null) {
        String userId = (String) item.getItemProperty("id").getValue();
        setDetailComponent(new UserDetailPanel(UserPage.this, userId));
        
        // Update URL
        ExplorerApp.get().setCurrentUriFragment(
          new UriFragment(UserNavigator.USER_URI_PART, userId));
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(new UriFragment(UserNavigator.USER_URI_PART));
      }
    }
  });
  
  return userTable;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:36,代码来源:UserPage.java

示例9: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
  final Table processDefinitionTable = new Table();
  processDefinitionTable.addStyleName(ExplorerLayout.STYLE_PROCESS_DEFINITION_LIST);
  
  // Set non-editable, selectable and full-size
  processDefinitionTable.setEditable(false);
  processDefinitionTable.setImmediate(true);
  processDefinitionTable.setSelectable(true);
  processDefinitionTable.setNullSelectionAllowed(false);
  processDefinitionTable.setSortDisabled(true);
  processDefinitionTable.setSizeFull();
  
  
  LazyLoadingQuery lazyLoadingQuery = new ProcessDefinitionListQuery(repositoryService);
  this.processDefinitionContainer = new LazyLoadingContainer(lazyLoadingQuery, 10);
  processDefinitionTable.setContainerDataSource(processDefinitionContainer);
  
  // Listener to change right panel when clicked on a task
  processDefinitionTable.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 1L;

    public void valueChange(ValueChangeEvent event) {
      Item item = processDefinitionTable.getItem(event.getProperty().getValue());
      String processDefinitionId = (String) item.getItemProperty("id").getValue();
      showProcessDefinitionDetail(processDefinitionId);
    }
  });
  
  // Create columns
  processDefinitionTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
  processDefinitionTable.setColumnWidth("icon", 22);
  
  processDefinitionTable.addContainerProperty("name", String.class, null);
  processDefinitionTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return processDefinitionTable;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:39,代码来源:ProcessDefinitionPage.java

示例10: setPropertyColumns

import com.vaadin.ui.Table; //导入方法依赖的package包/类
public void setPropertyColumns(Iterable<P> columns) {
	ObjectUtils.argumentNotNull(columns, "Property columns must be not null");

	final Object[] columnsArray = ConversionUtils.iterableAsList(columns).toArray();

	switch (getRenderingMode()) {
	case GRID: {
		final Grid grid = getGrid();
		// set columns
		grid.setColumns(columnsArray);
		// setup columns
		for (P column : columns) {
			Column c = grid.getColumn(column);
			// setup column
			setupGridPropertyColumn(column, c);
			// setup renderer and converter
			setupRendererAndConverter(column, c);
		}
	}
		break;
	case TABLE: {
		final Table table = getTable();
		try {
			duringSetup = true;
			// Setup columns and check Component generated columns
			for (P property : columns) {
				// column settings
				setupTablePropertyColumn(property, table);
				// generated columns
				Class<?> type = getPropertyColumnType(property);
				if (type != null && Component.class.isAssignableFrom(type)) {
					if (table.getColumnGenerator(property) == null) {
						table.addGeneratedColumn(property, new VirtualPropertyGenerator());
					}
				}
			}
		} finally {
			duringSetup = false;
		}
		// set columns
		table.setVisibleColumns(columnsArray);
	}
		break;
	default:
		break;
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:48,代码来源:DefaultItemListing.java

示例11: createList

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table createList() {
  groupTable = new Table();
  
  groupTable.setEditable(false);
  groupTable.setImmediate(true);
  groupTable.setSelectable(true);
  groupTable.setNullSelectionAllowed(false);
  groupTable.setSortDisabled(true);
  groupTable.setSizeFull();
  
  groupListQuery = new GroupListQuery();
  groupListContainer = new LazyLoadingContainer(groupListQuery, 20);
  groupTable.setContainerDataSource(groupListContainer);
  
  // Column headers
  groupTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.GROUP_22));
  groupTable.setColumnWidth("icon", 22);
  groupTable.addContainerProperty("name", String.class, null);
  groupTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
          
  // Listener to change right panel when clicked on a user
  groupTable.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      Item item = groupTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      if(item != null) {
        String groupId = (String) item.getItemProperty("id").getValue();
        setDetailComponent(new GroupDetailPanel(GroupPage.this, groupId));
        
        // Update URL
        ExplorerApp.get().setCurrentUriFragment(
          new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
      }
    }
  });
  
  return groupTable;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:43,代码来源:GroupPage.java


注:本文中的com.vaadin.ui.Table.addGeneratedColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。