本文整理匯總了Java中com.vaadin.ui.Table.setColumnHeader方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.setColumnHeader方法的具體用法?Java Table.setColumnHeader怎麽用?Java Table.setColumnHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Table
的用法示例。
在下文中一共展示了Table.setColumnHeader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setTableColumnDetails
import com.vaadin.ui.Table; //導入方法依賴的package包/類
private void setTableColumnDetails(final Table table) {
table.setColumnHeader(PROVIDED_FILE_NAME, i18n.getMessage("upload.file.name"));
table.setColumnHeader(SIZE, i18n.getMessage("upload.size"));
if (fullWindowMode) {
table.setColumnHeader(SHA1HASH, i18n.getMessage("upload.sha1"));
table.setColumnHeader(MD5HASH, i18n.getMessage("upload.md5"));
}
table.setColumnHeader(CREATE_MODIFIED_DATE_UPLOAD, i18n.getMessage("upload.last.modified.date"));
if (!readOnly) {
table.setColumnHeader(ACTION, i18n.getMessage("upload.action"));
}
table.setColumnExpandRatio(PROVIDED_FILE_NAME, 3.5F);
table.setColumnExpandRatio(SIZE, 2F);
if (fullWindowMode) {
table.setColumnExpandRatio(SHA1HASH, 2.8F);
table.setColumnExpandRatio(MD5HASH, 2.4F);
}
table.setColumnExpandRatio(CREATE_MODIFIED_DATE_UPLOAD, 3F);
if (!readOnly) {
table.setColumnExpandRatio(ACTION, 2.5F);
}
table.setVisibleColumns(getVisbleColumns().toArray());
}
示例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());
}
}
}
示例3: 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(" ", 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);
}
}