本文整理匯總了Java中com.vaadin.ui.Table.setColumnCollapsed方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.setColumnCollapsed方法的具體用法?Java Table.setColumnCollapsed怎麽用?Java Table.setColumnCollapsed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Table
的用法示例。
在下文中一共展示了Table.setColumnCollapsed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: applyTo
import com.vaadin.ui.Table; //導入方法依賴的package包/類
public void applyTo(Table t) {
final Object[] saved;
saved = t.getVisibleColumns();
if (saved.length != visibleColumns.length)
return;
try {
t.setVisibleColumns(visibleColumns);
} catch (IllegalArgumentException nothing) {
t.setVisibleColumns(saved);
return;
}
for (int i = 0; i < visibleColumns.length; i++) {
t.setColumnWidth(visibleColumns[i], widths[i]);
t.setColumnCollapsed(visibleColumns[i], collapsed[i]);
}
}
示例2: setupTablePropertyColumn
import com.vaadin.ui.Table; //導入方法依賴的package包/類
/**
* Setup column configuration for given <code>property</code> using its {@link PropertyColumn} definition.
* @param property Property to which the column is bound
* @param table Table to setup
*/
protected void setupTablePropertyColumn(P property, Table table) {
PropertyColumn<T, P> propertyColumn = getPropertyColumn(property);
if (propertyColumn != null) {
// header
if (propertyColumn.getCaption() != null) {
String header = LocalizationContext.translate(propertyColumn.getCaption(), true);
if (header != null) {
table.setColumnHeader(property, header);
}
}
// alignment
if (propertyColumn.getAlignment() != null) {
switch (propertyColumn.getAlignment()) {
case CENTER:
table.setColumnAlignment(property, Align.CENTER);
break;
case LEFT:
table.setColumnAlignment(property, Align.LEFT);
break;
case RIGHT:
table.setColumnAlignment(property, Align.RIGHT);
break;
default:
break;
}
}
// width
if (propertyColumn.getWidth() > -1) {
table.setColumnWidth(property, propertyColumn.getWidth());
}
// expand
if (propertyColumn.getTableExpandRatio() > -1) {
table.setColumnExpandRatio(property, propertyColumn.getTableExpandRatio());
}
// hiding
if (propertyColumn.isHidable()) {
table.setColumnCollapsible(property, true);
if (propertyColumn.isHidden()) {
table.setColumnCollapsed(property, true);
}
} else {
table.setColumnCollapsible(property, false);
}
// icon
if (propertyColumn.getIcon() != null) {
table.setColumnIcon(property, propertyColumn.getIcon());
}
}
}