Search in sources :

Example 1 with ProcessInstanceDetailPanel

use of org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel in project Activiti by Activiti.

the class ProcessInstancePage method createList.

@Override
protected Table createList() {
    final Table processInstanceTable = new Table();
    processInstanceTable.addStyleName(ExplorerLayout.STYLE_PROCESS_INSTANCE_LIST);
    // Listener to change right panel when clicked on a process instance
    processInstanceTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 8811553575319455854L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = processInstanceTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String processInstanceId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new ProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
                UriFragment taskFragment = getUriFragment(processInstanceId);
                ExplorerApp.get().setCurrentUriFragment(taskFragment);
            } else {
                // Nothing is selected
                setDetailComponent(null);
                UriFragment taskFragment = getUriFragment(null);
                ExplorerApp.get().setCurrentUriFragment(taskFragment);
            }
        }
    });
    this.lazyLoadingQuery = createLazyLoadingQuery();
    this.processInstanceListContainer = new LazyLoadingContainer(lazyLoadingQuery, 30);
    processInstanceTable.setContainerDataSource(processInstanceListContainer);
    // Create column header
    processInstanceTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
    processInstanceTable.setColumnWidth("icon", 22);
    processInstanceTable.addContainerProperty("name", String.class, null);
    processInstanceTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return processInstanceTable;
}
Also used : Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ProcessInstanceDetailPanel(org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel) Table(com.vaadin.ui.Table) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) Property(com.vaadin.data.Property) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) UriFragment(org.activiti.explorer.navigation.UriFragment)

Aggregations

Item (com.vaadin.data.Item)1 Property (com.vaadin.data.Property)1 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)1 Table (com.vaadin.ui.Table)1 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)1 UriFragment (org.activiti.explorer.navigation.UriFragment)1 ProcessInstanceDetailPanel (org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel)1 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)1