Search in sources :

Example 11 with ThemeImageColumnGenerator

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;
}
Also used : Table(com.vaadin.ui.Table) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer)

Example 12 with ThemeImageColumnGenerator

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;
}
Also used : Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) Table(com.vaadin.ui.Table) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) Model(org.activiti.engine.repository.Model) Property(com.vaadin.data.Property)

Example 13 with ThemeImageColumnGenerator

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);
}
Also used : Item(com.vaadin.data.Item) Table(com.vaadin.ui.Table) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) ClickEvent(com.vaadin.ui.Button.ClickEvent) Embedded(com.vaadin.ui.Embedded) ClickListener(com.vaadin.ui.Button.ClickListener)

Aggregations

Table (com.vaadin.ui.Table)13 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)13 Item (com.vaadin.data.Item)11 Property (com.vaadin.data.Property)10 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)10 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)10 UriFragment (org.activiti.explorer.navigation.UriFragment)8 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)4 ClickEvent (com.vaadin.ui.Button.ClickEvent)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 Embedded (com.vaadin.ui.Embedded)1 Model (org.activiti.engine.repository.Model)1 ProcessInstanceDetailPanel (org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel)1