Search in sources :

Example 1 with Property

use of com.vaadin.data.Property in project Activiti by Activiti.

the class ActiveProcessDefinitionPage method createList.

protected Table createList() {
    processDefinitionTable = new Table();
    processDefinitionListQuery = new ActiveProcessDefinitionListQuery();
    processDefinitionListContainer = new LazyLoadingContainer(processDefinitionListQuery);
    processDefinitionTable.setContainerDataSource(processDefinitionListContainer);
    // Column headers
    processDefinitionTable.addContainerProperty("name", String.class, null);
    processDefinitionTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    // Listener to change right panel when clicked on a user
    processDefinitionTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = processDefinitionTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String processDefinitionId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new ActiveProcessDefinitionDetailPanel(processDefinitionId, ActiveProcessDefinitionPage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ActiveProcessDefinitionNavigator.ACTIVE_PROC_DEF_URI_PART, processDefinitionId));
            } else {
                // Nothing selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ActiveProcessDefinitionNavigator.ACTIVE_PROC_DEF_URI_PART));
            }
        }
    });
    return processDefinitionTable;
}
Also used : Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) Table(com.vaadin.ui.Table) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) Property(com.vaadin.data.Property) UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 2 with Property

use of com.vaadin.data.Property 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)

Example 3 with Property

use of com.vaadin.data.Property in project Activiti by Activiti.

the class SavedReportsPage method createList.

protected Table createList() {
    reportTable = new Table();
    reportListQuery = new SavedReportsListQuery();
    reportListContainer = new LazyLoadingContainer(reportListQuery);
    reportTable.setContainerDataSource(reportListContainer);
    // Column headers
    reportTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.REPORT_22));
    reportTable.setColumnWidth("icon", 22);
    reportTable.addContainerProperty("name", String.class, null);
    reportTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    // Listener to change right panel when clicked on a report
    reportTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = reportTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String historicProcessInstanceId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new SavedReportDetailPanel(historicProcessInstanceId));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART, historicProcessInstanceId));
            } else {
                // Nothing selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART));
            }
        }
    });
    return reportTable;
}
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) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) Property(com.vaadin.data.Property) UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 4 with Property

use of com.vaadin.data.Property in project Activiti by Activiti.

the class JobPage method createList.

@Override
protected Table createList() {
    final Table jobTable = new Table();
    LazyLoadingQuery jobListQuery = new JobListQuery();
    jobListContainer = new LazyLoadingContainer(jobListQuery, 30);
    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) {
            // the value of the property is the itemId of the table entry
            Item item = jobTable.getItem(event.getProperty().getValue());
            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;
}
Also used : Table(com.vaadin.ui.Table) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) UriFragment(org.activiti.explorer.navigation.UriFragment) Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) Property(com.vaadin.data.Property) LazyLoadingQuery(org.activiti.explorer.data.LazyLoadingQuery)

Example 5 with Property

use of com.vaadin.data.Property in project Activiti by Activiti.

the class AdminCompletedInstancesPanel method initInstancesTable.

protected void initInstancesTable() {
    instancesTable = new Table();
    instancesTable.setWidth(100, UNITS_PERCENTAGE);
    instancesTable.setHeight(250, UNITS_PIXELS);
    instancesTable.setEditable(false);
    instancesTable.setImmediate(true);
    instancesTable.setSelectable(true);
    instancesTable.setSortDisabled(false);
    instancesTable.addContainerProperty("id", String.class, null, i18nManager.getMessage(Messages.PROCESS_INSTANCE_ID), null, Table.ALIGN_LEFT);
    instancesTable.addContainerProperty("business key", String.class, null, i18nManager.getMessage(Messages.PROCESS_INSTANCE_BUSINESSKEY), null, Table.ALIGN_LEFT);
    instancesTable.addContainerProperty("start user id", String.class, null, i18nManager.getMessage(Messages.ADMIN_STARTED_BY), null, Table.ALIGN_LEFT);
    instancesTable.addContainerProperty("start activity id", String.class, null, i18nManager.getMessage(Messages.ADMIN_START_ACTIVITY), null, Table.ALIGN_LEFT);
    instancesTable.addContainerProperty("start time", String.class, null, i18nManager.getMessage(Messages.PROCESS_INSTANCE_STARTED), null, Table.ALIGN_LEFT);
    instancesTable.addContainerProperty("end time", String.class, null, i18nManager.getMessage(Messages.TASK_COMPLETE_TIME), null, Table.ALIGN_LEFT);
    instancesTable.addContainerProperty("duration", String.class, null, i18nManager.getMessage(Messages.TASK_DURATION), null, Table.ALIGN_LEFT);
    instancesTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = instancesTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String instanceId = (String) item.getItemProperty("id").getValue();
                HistoricProcessInstance processInstance = null;
                for (HistoricProcessInstance instance : selectedManagementDefinition.runningInstances) {
                    if (instance.getId().equals(instanceId)) {
                        processInstance = instance;
                        break;
                    }
                }
                if (processInstance != null)
                    addProcessImage(selectedManagementDefinition.processDefinition, processInstance);
                addTasks(processInstance);
                addVariables(processInstance);
            }
        }
    });
    instancesLayout.addComponent(instancesTable);
}
Also used : Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) Table(com.vaadin.ui.Table) HistoricProcessInstance(org.activiti.engine.history.HistoricProcessInstance) HistoricFormProperty(org.activiti.engine.history.HistoricFormProperty) Property(com.vaadin.data.Property)

Aggregations

Property (com.vaadin.data.Property)26 Item (com.vaadin.data.Item)18 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)16 Table (com.vaadin.ui.Table)15 UriFragment (org.activiti.explorer.navigation.UriFragment)11 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)10 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)8 HistoricProcessInstance (org.activiti.engine.history.HistoricProcessInstance)4 WeakItemChangeListener (com.haulmont.cuba.gui.data.impl.WeakItemChangeListener)3 Label (com.vaadin.ui.Label)3 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)3 MetaClass (com.haulmont.chile.core.model.MetaClass)2 WeakItemPropertyChangeListener (com.haulmont.cuba.gui.data.impl.WeakItemPropertyChangeListener)2 ErrorMessage (com.vaadin.server.ErrorMessage)2 Collection (java.util.Collection)2 HistoricFormProperty (org.activiti.engine.history.HistoricFormProperty)2 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)2 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)2 ClickableLabel (au.com.vaadinutils.fields.ClickableLabel)1 Enumeration (com.haulmont.chile.core.datatypes.Enumeration)1