本文整理汇总了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());
}
}
}