本文整理匯總了Java中com.vaadin.ui.Table.setMultiSelect方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.setMultiSelect方法的具體用法?Java Table.setMultiSelect怎麽用?Java Table.setMultiSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Table
的用法示例。
在下文中一共展示了Table.setMultiSelect方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}
示例4: 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());
}
示例5: 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;
}
}
}
示例6: 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;
}