use of org.activiti.explorer.ui.util.ThemeImageColumnGenerator in project Activiti by Activiti.
the class TaskPage method createList.
@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, 30);
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;
}
use of org.activiti.explorer.ui.util.ThemeImageColumnGenerator in project Activiti by Activiti.
the class EditorProcessDefinitionPage method createList.
@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();
// Listener to change right panel when clicked on a model
processDefinitionTable.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
showProcessDefinitionDetail((String) event.getProperty().getValue());
}
});
// 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);
List<Model> modelList = repositoryService.createModelQuery().list();
for (Model modelData : modelList) {
Item item = processDefinitionTable.addItem(modelData.getId());
item.getItemProperty("name").setValue(modelData.getName());
}
return processDefinitionTable;
}
use of org.activiti.explorer.ui.util.ThemeImageColumnGenerator in project Activiti by Activiti.
the class SelectUsersPopupWindow method initSelectedUsersTable.
protected void initSelectedUsersTable() {
selectedUsersTable = new Table();
selectedUsersTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
selectedUsersTable.setEditable(false);
selectedUsersTable.setSortDisabled(true);
// Icon column
selectedUsersTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.USER_ADD));
selectedUsersTable.setColumnWidth("icon", 16);
// Name column
selectedUsersTable.addContainerProperty("userName", String.class, null);
// Role column
if (showRoles) {
selectedUsersTable.addContainerProperty("role", ComboBox.class, null);
}
// Delete icon column
selectedUsersTable.addGeneratedColumn("delete", new ThemeImageColumnGenerator(Images.DELETE, new com.vaadin.event.MouseEvents.ClickListener() {
public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
Object itemId = ((Embedded) event.getSource()).getData();
// Add to left table (if possible)
String searchFieldValue = (String) searchField.getValue();
if (searchFieldValue != null && searchFieldValue.length() >= 2) {
String userName = (String) selectedUsersTable.getItem(itemId).getItemProperty("userName").getValue();
if (matchesSearchField(userName)) {
Item item = matchingUsersTable.addItem(itemId);
item.getItemProperty("userName").setValue(userName);
}
}
// Delete from right table
selectedUsersTable.removeItem(itemId);
}
}));
selectedUsersTable.setColumnWidth("icon", 16);
if (showRoles) {
selectedUsersTable.setWidth(420, UNITS_PIXELS);
} else {
selectedUsersTable.setWidth(300, UNITS_PIXELS);
}
selectedUsersTable.setHeight(200, UNITS_PIXELS);
userSelectionLayout.addComponent(selectedUsersTable);
}
Aggregations