本文整理汇总了Java中com.vaadin.ui.Table.setColumnWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Table.setColumnWidth方法的具体用法?Java Table.setColumnWidth怎么用?Java Table.setColumnWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Table
的用法示例。
在下文中一共展示了Table.setColumnWidth方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
final Table tableList = new Table();
// Listener to change right panel when clicked on a task
tableList.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 8811553575319455854L;
public void valueChange(ValueChangeEvent event) {
// The itemId of the table list is the tableName
String tableName = (String) event.getProperty().getValue();
setDetailComponent(new DatabaseDetailPanel(tableName));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(DatabaseNavigator.TABLE_URI_PART, tableName));
}
});
// Create column headers
tableList.addContainerProperty("icon", Embedded.class, null);
tableList.setColumnWidth("icon", 22);
tableList.addContainerProperty("tableName", String.class, null);
tableList.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return tableList;
}
示例4: initRelatedContentTable
import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table initRelatedContentTable() {
Table table = new Table();
table.setWidth(100, UNITS_PERCENTAGE);
table.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_LIST);
// Invisible by default, only shown when attachments are present
table.setVisible(false);
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
table.addContainerProperty("type", Embedded.class, null);
table.setColumnWidth("type", 16);
table.addContainerProperty("name", Component.class, null);
relatedContentLayout.addComponent(table);
return table;
}
示例5: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
taskTable = new Table();
taskTable.addStyleName(ExplorerLayout.STYLE_TASK_LIST);
taskTable.addStyleName(ExplorerLayout.STYLE_SCROLLABLE);
// Listener to change right panel when clicked on a task
taskTable.addListener(getListSelectionListener());
this.lazyLoadingQuery = createLazyLoadingQuery();
this.taskListContainer = new LazyLoadingContainer(lazyLoadingQuery, 10);
taskTable.setContainerDataSource(taskListContainer);
// Create column header
taskTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.TASK_22));
taskTable.setColumnWidth("icon", 22);
taskTable.addContainerProperty("name", String.class, null);
taskTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return taskTable;
}
示例6: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
final Table deploymentTable = new Table();
LazyLoadingQuery deploymentListQuery = new DeploymentListQuery();
deploymentListContainer = new LazyLoadingContainer(deploymentListQuery, 10);
deploymentTable.setContainerDataSource(deploymentListContainer);
// Listener to change right panel when clicked on a deployment
deploymentTable.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 8811553575319455854L;
public void valueChange(ValueChangeEvent event) {
Item item = deploymentTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if(item != null) {
String deploymentId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new DeploymentDetailPanel(deploymentId, DeploymentPage.this));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(DeploymentNavigator.DEPLOYMENT_URI_PART, deploymentId));
} else {
// Nothing is selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(DeploymentNavigator.DEPLOYMENT_URI_PART));
}
}
});
// Create column headers
deploymentTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.DEPLOYMENT_22));
deploymentTable.setColumnWidth("icon", 22);
deploymentTable.addContainerProperty("name", String.class, null);
deploymentTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return deploymentTable;
}
示例7: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
@Override
protected Table createList() {
final Table jobTable = new Table();
LazyLoadingQuery jobListQuery = new JobListQuery();
jobListContainer = new LazyLoadingContainer(jobListQuery, 10);
jobTable.setContainerDataSource(jobListContainer);
// Listener to change right panel when clicked on a deployment
jobTable.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 8811553575319455854L;
public void valueChange(ValueChangeEvent event) {
Item item = jobTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if(item != null) {
String jobId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new JobDetailPanel(jobId, JobPage.this));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(JobNavigator.JOB_URL_PART, jobId));
} else {
// Nothing is selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(JobNavigator.JOB_URL_PART));
}
}
});
// Create column headers
jobTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.JOB_22));
jobTable.setColumnWidth("icon", 22);
jobTable.addContainerProperty("name", String.class, null);
jobTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return jobTable;
}
示例8: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table createList() {
final Table table = new Table();
LazyLoadingQuery query = new ProcessInstanceListQuery();
processInstanceContainer = new LazyLoadingContainer(query);
table.setContainerDataSource(processInstanceContainer);
table.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
Item item = table.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if(item != null) {
String processInstanceId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new AlfrescoProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART, processInstanceId));
} else {
// Nothing is selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART));
}
}
});
// Create column headers
table.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
table.setColumnWidth("icon", 22);
table.addContainerProperty("name", String.class, null);
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return table;
}
示例9: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table createList() {
userTable = new Table();
userListQuery = new UserListQuery();
userListContainer = new LazyLoadingContainer(userListQuery, 20);
userTable.setContainerDataSource(userListContainer);
// Column headers
userTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.USER_22));
userTable.setColumnWidth("icon", 22);
userTable.addContainerProperty("name", String.class, null);
userTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
// Listener to change right panel when clicked on a user
userTable.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
Item item = userTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if(item != null) {
String userId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new UserDetailPanel(UserPage.this, userId));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(UserNavigator.USER_URI_PART, userId));
} else {
// Nothing is selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(UserNavigator.USER_URI_PART));
}
}
});
return userTable;
}
示例10: 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;
}
示例11: 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());
}
}
}
示例12: 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);
}
示例13: addTasks
import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected void addTasks() {
Label header = new Label(i18nManager.getMessage(Messages.PROCESS_INSTANCE_HEADER_TASKS));
header.addStyleName(ExplorerLayout.STYLE_H3);
header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
header.addStyleName(ExplorerLayout.STYLE_NO_LINE);
panelLayout.addComponent(header);
panelLayout.addComponent(new Label(" ", Label.CONTENT_XHTML));
Table taskTable = new Table();
taskTable.addStyleName(ExplorerLayout.STYLE_PROCESS_INSTANCE_TASK_LIST);
taskTable.setWidth(100, UNITS_PERCENTAGE);
// Fetch all tasks
List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery()
.processInstanceId(processInstance.getId())
.orderByHistoricTaskInstanceEndTime().desc()
.orderByHistoricActivityInstanceStartTime().desc()
.list();
if(tasks.size() > 0) {
// Finished icon
taskTable.addContainerProperty("finished", Component.class, null, "", null, Table.ALIGN_CENTER);
taskTable.setColumnWidth("finished", 22);
taskTable.addContainerProperty("name", String.class, null, i18nManager.getMessage(Messages.TASK_NAME),
null, Table.ALIGN_LEFT);
taskTable.addContainerProperty("priority", Integer.class, null, i18nManager.getMessage(Messages.TASK_PRIORITY),
null, Table.ALIGN_LEFT);
taskTable.addContainerProperty("assignee", Component.class, null, i18nManager.getMessage(Messages.TASK_ASSIGNEE),
null, Table.ALIGN_LEFT);
taskTable.addContainerProperty("dueDate", Component.class, null, i18nManager.getMessage(Messages.TASK_DUEDATE),
null, Table.ALIGN_LEFT);
taskTable.addContainerProperty("startDate", Component.class, null, i18nManager.getMessage(Messages.TASK_CREATE_TIME),
null, Table.ALIGN_LEFT);
taskTable.addContainerProperty("endDate", Component.class, null, i18nManager.getMessage(Messages.TASK_COMPLETE_TIME),
null, Table.ALIGN_LEFT);
panelLayout.addComponent(taskTable);
panelLayout.setExpandRatio(taskTable, 1.0f);
for(HistoricTaskInstance task : tasks) {
addTaskItem(task, taskTable);
}
taskTable.setPageLength(taskTable.size());
} else {
// No tasks
Label noTaskLabel = new Label(i18nManager.getMessage(Messages.PROCESS_INSTANCE_NO_TASKS));
panelLayout.addComponent(noTaskLabel);
}
}
示例14: createList
import com.vaadin.ui.Table; //导入方法依赖的package包/类
protected Table createList() {
groupTable = new Table();
groupTable.setEditable(false);
groupTable.setImmediate(true);
groupTable.setSelectable(true);
groupTable.setNullSelectionAllowed(false);
groupTable.setSortDisabled(true);
groupTable.setSizeFull();
groupListQuery = new GroupListQuery();
groupListContainer = new LazyLoadingContainer(groupListQuery, 20);
groupTable.setContainerDataSource(groupListContainer);
// Column headers
groupTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.GROUP_22));
groupTable.setColumnWidth("icon", 22);
groupTable.addContainerProperty("name", String.class, null);
groupTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
// Listener to change right panel when clicked on a user
groupTable.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
Item item = groupTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if(item != null) {
String groupId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new GroupDetailPanel(GroupPage.this, groupId));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
} else {
// Nothing is selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
}
}
});
return groupTable;
}