Search in sources :

Example 16 with LazyLoadingContainer

use of org.activiti.explorer.data.LazyLoadingContainer 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 17 with LazyLoadingContainer

use of org.activiti.explorer.data.LazyLoadingContainer in project Activiti by Activiti.

the class AlfrescoProcessDefinitionDetailPanel method initProcessInstancesTable.

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

Aggregations

Table (com.vaadin.ui.Table)17 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)17 Item (com.vaadin.data.Item)11 Property (com.vaadin.data.Property)11 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)11 UriFragment (org.activiti.explorer.navigation.UriFragment)10 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)10 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)6 Label (com.vaadin.ui.Label)4 TableMetaData (org.activiti.engine.management.TableMetaData)1 ProcessInstanceDetailPanel (org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel)1