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


Java Table.setSelectable方法代码示例

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


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

示例1: createTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private Table createTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing email table with empty values
    table.addItem(new Object[] { "Outgoing Mail Server (SMTP): ", "" }, new Integer(1));
    table.addItem(new Object[] { "Port: ", "" }, new Integer(2));
    table.addItem(new Object[] { "Email Id: ", "" }, new Integer(3));

    return table;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:21,代码来源:EmailLayout.java

示例2: createNetworkTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private Table createNetworkTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing network table with empty values
    table.addItem(new Object[] { "IPv4 Address: ", "" }, new Integer(1));
    table.addItem(new Object[] { "Netmask:", "" }, new Integer(2));
    table.addItem(new Object[] { "Default Gateway: ", "" }, new Integer(3));
    table.addItem(new Object[] { "Primary DNS Server: ", "" }, new Integer(4));
    table.addItem(new Object[] { "Secondary DNS Server: ", "" }, new Integer(5));
    return table;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:22,代码来源:NetworkLayout.java

示例3: createNATTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private Table createNATTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing network table with empty values
    table.addItem(new Object[] { "Public IPv4 Address: ", "" }, new Integer(1));
    return table;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:18,代码来源:NetworkLayout.java

示例4: buildSelectedTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
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);
    }
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:24,代码来源:CreateUpdateDistSetTypeLayout.java

示例5: 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

示例6: initMembersTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
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, 10);
    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);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:GroupDetailPanel.java

示例7: initGroupTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
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, 10);
  groupTable.setContainerDataSource(container);
  
  groupTable.addContainerProperty("id", String.class, null);
  groupTable.addContainerProperty("name", String.class, null);
  groupTable.addContainerProperty("type", String.class, null);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:GroupSelectionPopupWindow.java

示例8: createTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private Table createTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Status", String.class, null);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    return table;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:15,代码来源:SummaryLayout.java

示例9: buildSourceTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
/**
*
*/
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);
    getSourceTableData();
    addTooltip();
    sourceTable.select(sourceTable.firstItemId());
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:30,代码来源:CreateUpdateDistSetTypeLayout.java

示例10: addTableData

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected void addTableData() {
  LazyLoadingQuery lazyLoadingQuery = new TableDataQuery(tableName, managementService);
  LazyLoadingContainer lazyLoadingContainer = new LazyLoadingContainer(lazyLoadingQuery, 10);
  
  if (lazyLoadingContainer.size() > 0) {
    
    Table data = new Table();
    data.setContainerDataSource(lazyLoadingContainer);
    data.setEditable(false);
    data.setSelectable(true);
    data.setColumnReorderingAllowed(true);
    if (lazyLoadingQuery.size() < 10) {
      data.setPageLength(0);
    } else {
      data.setPageLength(10);
    }
    addDetailComponent(data);
    
    data.setWidth(100, UNITS_PERCENTAGE);
    data.setHeight(100, UNITS_PERCENTAGE);
    data.addStyleName(ExplorerLayout.STYLE_DATABASE_TABLE);
    setDetailExpandRatio(data, 1.0f);
    
    // Create column headers
    TableMetaData metaData = managementService.getTableMetaData(tableName);
    for (String columnName : metaData.getColumnNames()) {
      data.addContainerProperty(columnName, String.class, null);
    }
    
  } else {
    Label noDataLabel = new Label(i18nManager.getMessage(Messages.DATABASE_NO_ROWS));
    noDataLabel.addStyleName(Reindeer.LABEL_SMALL);
    addDetailComponent(noDataLabel);
    setDetailExpandRatio(noDataLabel, 1.0f);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:37,代码来源:DatabaseDetailPanel.java

示例11: 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

示例12: setSelectionMode

import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
public void setSelectionMode(SelectionMode selectionMode) {
	ObjectUtils.argumentNotNull(selectionMode, "SelectionMode must be not null");
	if (this.selectionMode != selectionMode) {
		this.selectionMode = selectionMode;
		switch (getRenderingMode()) {
		case GRID: {
			final Grid grid = getGrid();
			grid.removeSelectionListener(this);
			switch (selectionMode) {
			case MULTI:
				grid.setSelectionMode(Grid.SelectionMode.MULTI);
				grid.addSelectionListener(this);
				break;
			case SINGLE:
				grid.setSelectionMode(Grid.SelectionMode.SINGLE);
				grid.addSelectionListener(this);
				break;
			case NONE:
			default:
				grid.setSelectionMode(Grid.SelectionMode.NONE);
				break;
			}
		}
			break;
		case TABLE: {
			final Table table = getTable();
			table.removeValueChangeListener(tableSelectionChangeListener);
			table.setValue(null);
			if (selectionMode != null && selectionMode != SelectionMode.NONE) {
				table.setSelectable(true);
				table.setMultiSelect(selectionMode == SelectionMode.MULTI);
				table.addValueChangeListener(tableSelectionChangeListener);
			} else {
				table.setSelectable(false);
			}
		}
			break;
		default:
			break;
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:44,代码来源:DefaultItemListing.java

示例13: buildTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
private Table buildTable() {
    final Table table = new Table() {
        @Override
        protected String formatPropertyValue(final Object rowId,
                final Object colId, final Property<?> property) {
            String result = super.formatPropertyValue(rowId, colId,
                    property);
            if (colId.equals("time")) {
                result = DATEFORMAT.format(((Date) property.getValue()));
            } else if (colId.equals("price")) {
                if (property != null && property.getValue() != null) {
                    return "$" + DECIMALFORMAT.format(property.getValue());
                } else {
                    return "";
                }
            }
            return result;
        }
    };
    table.setSizeFull();
    table.addStyleName(ValoTheme.TABLE_BORDERLESS);
    table.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TABLE_COMPACT);
    table.setSelectable(true);

    table.setColumnCollapsingAllowed(true);
    table.setColumnCollapsible("time", false);
    table.setColumnCollapsible("price", false);

    table.setColumnReorderingAllowed(true);
    table.setContainerDataSource(new TempTransactionsContainer(DashboardUI
            .getDataProvider().getRecentTransactions(200)));
    table.setSortContainerPropertyId("time");
    table.setSortAscending(false);

    table.setColumnAlignment("seats", Align.RIGHT);
    table.setColumnAlignment("price", Align.RIGHT);

    table.setVisibleColumns("time", "country", "city", "theater", "room",
            "title", "seats", "price");
    table.setColumnHeaders("Time", "Country", "City", "Theater", "Room",
            "Title", "Seats", "Price");

    table.setFooterVisible(true);
    table.setColumnFooter("time", "Total");

    table.setColumnFooter(
            "price",
            "$"
                    + DECIMALFORMAT.format(DashboardUI.getDataProvider()
                            .getTotalSum()));

    // Allow dragging items to the reports menu
    table.setDragMode(TableDragMode.MULTIROW);
    table.setMultiSelect(true);

    table.addActionHandler(new TransactionsActionHandler());

    table.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(final ValueChangeEvent event) {
            if (table.getValue() instanceof Set) {
                Set<Object> val = (Set<Object>) table.getValue();
                createReport.setEnabled(val.size() > 0);
            }
        }
    });
    table.setImmediate(true);

    return table;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:72,代码来源:TransactionsView.java

示例14: initProcessInstancesTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected void initProcessInstancesTable() {
  ProcessInstanceTableLazyQuery query = new ProcessInstanceTableLazyQuery(processDefinition.getId());
  
  // Header
  Label instancesTitle = new Label(i18nManager.getMessage(Messages.PROCESS_INSTANCES) + " (" + query.size() + ")");
  instancesTitle.addStyleName(ExplorerLayout.STYLE_H3);
  instancesTitle.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
  instancesTitle.addStyleName(ExplorerLayout.STYLE_NO_LINE);
  detailPanelLayout.addComponent(instancesTitle);

  if (query.size() > 0) {
    
    Label emptySpace = new Label("&nbsp;", Label.CONTENT_XHTML);
    detailPanelLayout.addComponent(emptySpace);
    
    Table instancesTable = new Table();
    instancesTable.setWidth(400, UNITS_PIXELS);
    if (query.size() > 6) {
      instancesTable.setPageLength(6);
    } else {
      instancesTable.setPageLength(query.size());
    }
    
    LazyLoadingContainer container = new LazyLoadingContainer(query);
    instancesTable.setContainerDataSource(container);
    
    // container props
    instancesTable.addContainerProperty(AlfrescoProcessInstanceTableItem.PROPERTY_ID, String.class, null);
    instancesTable.addContainerProperty(AlfrescoProcessInstanceTableItem.PROPERTY_BUSINESSKEY, String.class, null);
    instancesTable.addContainerProperty(AlfrescoProcessInstanceTableItem.PROPERTY_ACTIONS, Component.class, null);
    
    // column alignment
    instancesTable.setColumnAlignment(AlfrescoProcessInstanceTableItem.PROPERTY_ACTIONS, Table.ALIGN_CENTER);
    
    // column header
    instancesTable.setColumnHeader(AlfrescoProcessInstanceTableItem.PROPERTY_ID, i18nManager.getMessage(Messages.PROCESS_INSTANCE_ID));
    instancesTable.setColumnHeader(AlfrescoProcessInstanceTableItem.PROPERTY_BUSINESSKEY, i18nManager.getMessage(Messages.PROCESS_INSTANCE_BUSINESSKEY));
    instancesTable.setColumnHeader(AlfrescoProcessInstanceTableItem.PROPERTY_ACTIONS, i18nManager.getMessage(Messages.PROCESS_INSTANCE_ACTIONS));
    
    instancesTable.setEditable(false);
    instancesTable.setSelectable(true);
    instancesTable.setNullSelectionAllowed(false);
    instancesTable.setSortDisabled(true);
    detailPanelLayout.addComponent(instancesTable);
    
  } else {
    Label noInstances = new Label(i18nManager.getMessage(Messages.PROCESS_NO_INSTANCES));
    detailPanelLayout.addComponent(noInstances);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:51,代码来源:AlfrescoProcessDefinitionDetailPanel.java

示例15: initSelectionTable

import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected void initSelectionTable() {
  selectionTable = new Table();
  selectionTable.setSizeUndefined();
  selectionTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  selectionTable.setSelectable(true);
  selectionTable.setImmediate(true);
  selectionTable.setNullSelectionAllowed(false);
  selectionTable.setWidth(150, UNITS_PIXELS);
  selectionTable.setHeight(100, UNITS_PERCENTAGE);

  selectionTable.setCellStyleGenerator(new CellStyleGenerator() {
    private static final long serialVersionUID = 1L;
    public String getStyle(Object itemId, Object propertyId) {
      if("name".equals(propertyId)) {
        return ExplorerLayout.STYLE_RELATED_CONTENT_CREATE_LIST_LAST_COLUMN;
      }
      return null;
    }
  });

  selectionTable.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_CREATE_LIST);

  selectionTable.addContainerProperty("type", Embedded.class, null);
  selectionTable.setColumnWidth("type", 22);
  selectionTable.addContainerProperty("name", String.class, null);

  // Listener to switch to the selected component
  selectionTable.addListener(new ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      String name = (String) event.getProperty().getValue();
      if (name != null) {
        currentSelection = name;
        currentComponent = components.get(name);
        selectedComponentLayout.removeComponent(selectedComponentLayout.getComponent(0, 0));
        if (currentComponent != null) {
          currentComponent.setSizeFull();
          selectedComponentLayout.addComponent(currentComponent, 0, 0);
          okButton.setEnabled(true);
        } else {
          okButton.setEnabled(false);
        }
      } 
    }
  });
  windowLayout.addComponent(selectionTable);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:48,代码来源:TabbedSelectionWindow.java


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