com.vaadin.ui.Table.setContainerDataSource()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(15.2k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中com.vaadin.ui.Table.setContainerDataSource()方法的一些代码示例,展示了Table.setContainerDataSource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setContainerDataSource()方法的具体详情如下:
包路径:com.vaadin.ui.Table
类名称:Table
方法名:setContainerDataSource

Table.setContainerDataSource介绍

暂无

代码示例

代码示例来源:origin: org.opencms/opencms-core

/**
 * Creates a new instance.<p>
 *
 * This constructor does *not* set up the columns of the table; use the ColumnBuilder inner class for this.
 */
public CmsResourceTable() {
  m_fileTable.setContainerDataSource(m_container);
  setCompositionRoot(m_fileTable);
  m_fileTable.setRowHeaderMode(RowHeaderMode.HIDDEN);
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void populateArtifactDetails(final Long baseSwModuleId, final String swModuleName) {
  if (!readOnly) {
    if (StringUtils.isEmpty(swModuleName)) {
      setTitleOfLayoutHeader();
    } else {
      titleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId(swModuleName, i18n));
      titleOfArtifactDetails.setContentMode(ContentMode.HTML);
    }
  }
  final Map<String, Object> queryConfiguration;
  if (baseSwModuleId != null) {
    queryConfiguration = Maps.newHashMapWithExpectedSize(1);
    queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
  } else {
    queryConfiguration = Collections.emptyMap();
  }
  final LazyQueryContainer artifactContainer = getArtifactLazyQueryContainer(queryConfiguration);
  artifactDetailsTable.setContainerDataSource(artifactContainer);
  if (fullWindowMode && maxArtifactDetailsTable != null) {
    maxArtifactDetailsTable.setContainerDataSource(artifactContainer);
  }
  setTableColumnDetails(artifactDetailsTable);
}

代码示例来源:origin: eclipse/hawkbit

private void populateArtifactDetails(final Long baseSwModuleId, final String swModuleName) {
  if (!readOnly) {
    if (StringUtils.isEmpty(swModuleName)) {
      setTitleOfLayoutHeader();
    } else {
      titleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId(swModuleName, i18n));
      titleOfArtifactDetails.setContentMode(ContentMode.HTML);
    }
  }
  final Map<String, Object> queryConfiguration;
  if (baseSwModuleId != null) {
    queryConfiguration = Maps.newHashMapWithExpectedSize(1);
    queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
  } else {
    queryConfiguration = Collections.emptyMap();
  }
  final LazyQueryContainer artifactContainer = getArtifactLazyQueryContainer(queryConfiguration);
  artifactDetailsTable.setContainerDataSource(artifactContainer);
  if (fullWindowMode && maxArtifactDetailsTable != null) {
    maxArtifactDetailsTable.setContainerDataSource(artifactContainer);
  }
  setTableColumnDetails(artifactDetailsTable);
}

代码示例来源:origin: org.aperteworkflow/gui-commons

@Override
public void setContainerDataSource(Container newDataSource) {
  if (!(newDataSource instanceof Container.Indexed)) {
    throw new IllegalArgumentException("PagedTable can only use containers that implement Container.Indexed");
  }
  PagedTableContainer pagedTableContainer = new PagedTableContainer((Container.Indexed) newDataSource);
  pagedTableContainer.setPageLength(getPageLength());
  if (newDataSource instanceof Container.ItemSetChangeNotifier) {
    Container.ItemSetChangeNotifier notifier = (ItemSetChangeNotifier) newDataSource;
    notifier.addListener(this);
  }
  super.setContainerDataSource(pagedTableContainer);
  this.container = pagedTableContainer;
  firePagedChangedEvent();
}

代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin

/**
 * Set the listing data source.
 * @param <D> Data source type
 * @param container The data source to set (not null)
 */
public <D extends ItemDataSource<T, P> & Indexed> void setDataSource(D container) {
  ObjectUtils.argumentNotNull(container, "Container datasource must be not null");
  this.dataSource = container;
  switch (getRenderingMode()) {
  case GRID:
    getGrid().setContainerDataSource(container);
    break;
  case TABLE:
    getTable().setContainerDataSource(container);
    break;
  default:
    break;
  }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

/**
 * Create Max artifact details Table.
 */
public void createMaxArtifactDetailsTable() {
  maxArtifactDetailsTable = createArtifactDetailsTable();
  maxArtifactDetailsTable.setId(UIComponentIdProvider.UPLOAD_ARTIFACT_DETAILS_TABLE_MAX);
  maxArtifactDetailsTable.setContainerDataSource(artifactDetailsTable.getContainerDataSource());
  addGeneratedColumn(maxArtifactDetailsTable);
  if (!readOnly) {
    addGeneratedColumnButton(maxArtifactDetailsTable);
  }
  setTableColumnDetails(maxArtifactDetailsTable);
}

代码示例来源:origin: eclipse/hawkbit

/**
 * Create Max artifact details Table.
 */
public void createMaxArtifactDetailsTable() {
  maxArtifactDetailsTable = createArtifactDetailsTable();
  maxArtifactDetailsTable.setId(UIComponentIdProvider.UPLOAD_ARTIFACT_DETAILS_TABLE_MAX);
  maxArtifactDetailsTable.setContainerDataSource(artifactDetailsTable.getContainerDataSource());
  addGeneratedColumn(maxArtifactDetailsTable);
  if (!readOnly) {
    addGeneratedColumnButton(maxArtifactDetailsTable);
  }
  setTableColumnDetails(maxArtifactDetailsTable);
}

代码示例来源:origin: org.aperteworkflow/gui-commons

public static Table simpleTable(Container dataSource, Object[] visiblePropertyIds, Map<String, ColumnGenerator> customColumns) {
  Table table = new Table();
  table.addStyleName("big striped borderless");
  table.setSizeFull();
  table.setPageLength(0);
  table.setImmediate(false);
  table.setSelectable(false);
  table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  table.setColumnCollapsingAllowed(false);
  table.setSortDisabled(true);
  if (customColumns != null) {
    for (Map.Entry<String, ColumnGenerator> entry : customColumns.entrySet()) {
      table.addGeneratedColumn(entry.getKey(), entry.getValue());
    }
  }
  table.setContainerDataSource(dataSource);
  table.setVisibleColumns(visiblePropertyIds);
  table.setColumnExpandRatio(visiblePropertyIds[visiblePropertyIds.length - 1], 1.0f);
  return table;
}

代码示例来源:origin: org.activiti/activiti-explorer

@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, 30);
 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;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initGroupTable() {
 groupTable = new Table();
 groupTable.setNullSelectionAllowed(false);
 groupTable.setSelectable(true);
 groupTable.setMultiSelect(true);
 groupTable.setSortDisabled(true);
 groupTable.setWidth(460, UNITS_PIXELS);
 groupTable.setHeight(275, UNITS_PIXELS);
 addComponent(groupTable);
 
 GroupSelectionQuery query = new GroupSelectionQuery(identityService, userId);
 LazyLoadingContainer container = new LazyLoadingContainer(query, 30);
 groupTable.setContainerDataSource(container);
 
 groupTable.addContainerProperty("id", String.class, null);
 groupTable.addContainerProperty("name", String.class, null);
 groupTable.addContainerProperty("type", String.class, null);
}

代码示例来源:origin: org.activiti/activiti-explorer

table.setContainerDataSource(processInstanceContainer);

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void createComponents(final String labelSoftwareModule) {
  titleOfArtifactDetails = new LabelBuilder().id(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID)
      .name(HawkbitCommonUtil.getArtifactoryDetailsLabelId(labelSoftwareModule, i18n)).buildCaptionLabel();
  titleOfArtifactDetails.setContentMode(ContentMode.HTML);
  titleOfArtifactDetails.setSizeFull();
  titleOfArtifactDetails.setImmediate(true);
  maxMinButton = createMaxMinButton();
  artifactDetailsTable = createArtifactDetailsTable();
  artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer());
  addGeneratedColumn(artifactDetailsTable);
  if (!readOnly) {
    addGeneratedColumnButton(artifactDetailsTable);
  }
  setTableColumnDetails(artifactDetailsTable);
}

代码示例来源:origin: eclipse/hawkbit

private void createComponents(final String labelSoftwareModule) {
  titleOfArtifactDetails = new LabelBuilder().id(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID)
      .name(HawkbitCommonUtil.getArtifactoryDetailsLabelId(labelSoftwareModule, i18n)).buildCaptionLabel();
  titleOfArtifactDetails.setContentMode(ContentMode.HTML);
  titleOfArtifactDetails.setSizeFull();
  titleOfArtifactDetails.setImmediate(true);
  maxMinButton = createMaxMinButton();
  artifactDetailsTable = createArtifactDetailsTable();
  artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer());
  addGeneratedColumn(artifactDetailsTable);
  if (!readOnly) {
    addGeneratedColumnButton(artifactDetailsTable);
  }
  setTableColumnDetails(artifactDetailsTable);
}

代码示例来源:origin: org.activiti/activiti-explorer

jobTable.setContainerDataSource(jobListContainer);

代码示例来源:origin: org.activiti/activiti-explorer

protected void initMembersTable() {
 LazyLoadingQuery query = new GroupMembersQuery(group.getId(), this);
 if (query.size() > 0) {
  membersTable = new Table();
  membersTable.setWidth(100, UNITS_PERCENTAGE);
  membersTable.setHeight(400, UNITS_PIXELS);
  
  membersTable.setEditable(false);
  membersTable.setSelectable(false);
  membersTable.setSortDisabled(false);
  
  LazyLoadingContainer container = new LazyLoadingContainer(query, 30);
  membersTable.setContainerDataSource(container);
  
  membersTable.addContainerProperty("id", Button.class, null);
  membersTable.addContainerProperty("firstName", String.class, null);
  membersTable.addContainerProperty("lastName", String.class, null);
  membersTable.addContainerProperty("email", String.class, null);
  membersTable.addContainerProperty("actions", Component.class, null);
  
  membersLayout.addComponent(membersTable);
 } else {
  noMembersTable = new Label(i18nManager.getMessage(Messages.GROUP_NO_MEMBERS));
  membersLayout.addComponent(noMembersTable);
 }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void buildSelectedTable() {
  selectedTable = new Table();
  selectedTable.setId(SPUIDefinitions.TWIN_TABLE_SELECTED_ID);
  selectedTable.setSelectable(true);
  selectedTable.setMultiSelect(true);
  selectedTable.setSortEnabled(false);
  selectedTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
  selectedTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
  selectedTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
  selectedTable.addStyleName(ValoTheme.TABLE_SMALL);
  selectedTable.addStyleName("dist_type_twin-table");
  selectedTable.setSizeFull();
  createSelectedTableContainer();
  selectedTable.setContainerDataSource(selectedTableContainer);
  addTooltTipToSelectedTable();
  selectedTable.setImmediate(true);
  selectedTable.setVisibleColumns(DIST_TYPE_NAME, DIST_TYPE_MANDATORY);
  selectedTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.selected"), STAR);
  selectedTable.setColumnExpandRatio(DIST_TYPE_NAME, 0.75F);
  selectedTable.setColumnExpandRatio(DIST_TYPE_MANDATORY, 0.25F);
  selectedTable.setRequired(true);
}

代码示例来源:origin: eclipse/hawkbit

private void buildSelectedTable() {
  selectedTable = new Table();
  selectedTable.setId(SPUIDefinitions.TWIN_TABLE_SELECTED_ID);
  selectedTable.setSelectable(true);
  selectedTable.setMultiSelect(true);
  selectedTable.setSortEnabled(false);
  selectedTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
  selectedTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
  selectedTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
  selectedTable.addStyleName(ValoTheme.TABLE_SMALL);
  selectedTable.addStyleName("dist_type_twin-table");
  selectedTable.setSizeFull();
  createSelectedTableContainer();
  selectedTable.setContainerDataSource(selectedTableContainer);
  addTooltTipToSelectedTable();
  selectedTable.setImmediate(true);
  selectedTable.setVisibleColumns(DIST_TYPE_NAME, DIST_TYPE_MANDATORY);
  selectedTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.selected"), STAR);
  selectedTable.setColumnExpandRatio(DIST_TYPE_NAME, 0.75F);
  selectedTable.setColumnExpandRatio(DIST_TYPE_MANDATORY, 0.25F);
  selectedTable.setRequired(true);
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initGroupsTable() {
 groupsForUserQuery = new GroupsForUserQuery(identityService, this, user.getId());
 if (groupsForUserQuery.size() > 0) {
  groupTable = new Table();
  groupTable.setSortDisabled(true);
  groupTable.setHeight(150, UNITS_PIXELS);
  groupTable.setWidth(100, UNITS_PERCENTAGE);
  groupLayout.addComponent(groupTable);
  
  groupContainer = new LazyLoadingContainer(groupsForUserQuery, 30);
  groupTable.setContainerDataSource(groupContainer);
  
  groupTable.addContainerProperty("id", Button.class, null);
  groupTable.setColumnExpandRatio("id", 22);
  groupTable.addContainerProperty("name", String.class, null);
  groupTable.setColumnExpandRatio("name", 45);
  groupTable.addContainerProperty("type", String.class, null);
  groupTable.setColumnExpandRatio("type", 22);
  groupTable.addContainerProperty("actions", Component.class, null);
  groupTable.setColumnExpandRatio("actions", 11);
  groupTable.setColumnAlignment("actions", Table.ALIGN_CENTER);
 } else {
  noGroupsLabel = new Label(i18nManager.getMessage(Messages.USER_NO_GROUPS));
  groupLayout.addComponent(noGroupsLabel);
 }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void buildSourceTable() {
  sourceTable = new Table();
  sourceTable.setId(SPUIDefinitions.TWIN_TABLE_SOURCE_ID);
  sourceTable.setSelectable(true);
  sourceTable.setMultiSelect(true);
  sourceTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
  sourceTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
  sourceTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
  sourceTable.addStyleName(ValoTheme.TABLE_SMALL);
  sourceTable.setImmediate(true);
  sourceTable.setSizeFull();
  sourceTable.addStyleName("dist_type_twin-table");
  sourceTable.setSortEnabled(false);
  sourceTableContainer = new IndexedContainer();
  sourceTableContainer.addContainerProperty(DIST_TYPE_NAME, String.class, "");
  sourceTableContainer.addContainerProperty(DIST_TYPE_DESCRIPTION, String.class, "");
  sourceTable.setContainerDataSource(sourceTableContainer);
  sourceTable.setVisibleColumns(DIST_TYPE_NAME);
  sourceTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.available"));
  sourceTable.setColumnExpandRatio(DIST_TYPE_NAME, 1.0F);
  createSourceTableData();
  addTooltip();
  sourceTable.select(sourceTable.firstItemId());
}

代码示例来源:origin: eclipse/hawkbit

private void buildSourceTable() {
  sourceTable = new Table();
  sourceTable.setId(SPUIDefinitions.TWIN_TABLE_SOURCE_ID);
  sourceTable.setSelectable(true);
  sourceTable.setMultiSelect(true);
  sourceTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
  sourceTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
  sourceTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
  sourceTable.addStyleName(ValoTheme.TABLE_SMALL);
  sourceTable.setImmediate(true);
  sourceTable.setSizeFull();
  sourceTable.addStyleName("dist_type_twin-table");
  sourceTable.setSortEnabled(false);
  sourceTableContainer = new IndexedContainer();
  sourceTableContainer.addContainerProperty(DIST_TYPE_NAME, String.class, "");
  sourceTableContainer.addContainerProperty(DIST_TYPE_DESCRIPTION, String.class, "");
  sourceTable.setContainerDataSource(sourceTableContainer);
  sourceTable.setVisibleColumns(DIST_TYPE_NAME);
  sourceTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.available"));
  sourceTable.setColumnExpandRatio(DIST_TYPE_NAME, 1.0F);
  createSourceTableData();
  addTooltip();
  sourceTable.select(sourceTable.firstItemId());
}

相关文章

微信公众号

最新文章

更多