Search in sources :

Example 1 with LazyLoadingQuery

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

the class ProcessDefinitionPage 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();
    LazyLoadingQuery lazyLoadingQuery = new ProcessDefinitionListQuery(repositoryService, definitionFilter);
    this.processDefinitionContainer = new LazyLoadingContainer(lazyLoadingQuery, 30);
    processDefinitionTable.setContainerDataSource(processDefinitionContainer);
    // Listener to change right panel when clicked on a task
    processDefinitionTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            Item item = processDefinitionTable.getItem(event.getProperty().getValue());
            String processDefinitionId = (String) item.getItemProperty("id").getValue();
            showProcessDefinitionDetail(processDefinitionId);
        }
    });
    // 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);
    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) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) Property(com.vaadin.data.Property) LazyLoadingQuery(org.activiti.explorer.data.LazyLoadingQuery)

Example 2 with LazyLoadingQuery

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

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

the class GroupDetailPanel method initMembersTable.

protected void initMembersTable() {
    LazyLoadingQuery query = new GroupMembersQuery(group.getId(), this);
    if (query.size() > 0) {
        membersTable = new Table();
        membersTable.setWidth(100, UNITS_PERCENTAGE);
        membersTable.setHeight(400, UNITS_PIXELS);
        membersTable.setEditable(false);
        membersTable.setSelectable(false);
        membersTable.setSortDisabled(false);
        LazyLoadingContainer container = new LazyLoadingContainer(query, 30);
        membersTable.setContainerDataSource(container);
        membersTable.addContainerProperty("id", Button.class, null);
        membersTable.addContainerProperty("firstName", String.class, null);
        membersTable.addContainerProperty("lastName", String.class, null);
        membersTable.addContainerProperty("email", String.class, null);
        membersTable.addContainerProperty("actions", Component.class, null);
        membersLayout.addComponent(membersTable);
    } else {
        noMembersTable = new Label(i18nManager.getMessage(Messages.GROUP_NO_MEMBERS));
        membersLayout.addComponent(noMembersTable);
    }
}
Also used : Table(com.vaadin.ui.Table) Label(com.vaadin.ui.Label) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) LazyLoadingQuery(org.activiti.explorer.data.LazyLoadingQuery)

Example 4 with LazyLoadingQuery

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

the class ProcessInstancePage method createList.

protected Table createList() {
    final Table table = new Table();
    LazyLoadingQuery query = new ProcessInstanceListQuery();
    processInstanceContainer = new LazyLoadingContainer(query);
    table.setContainerDataSource(processInstanceContainer);
    table.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 = table.getItem(event.getProperty().getValue());
            if (item != null) {
                String processInstanceId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new AlfrescoProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART, processInstanceId));
            } else {
                // Nothing is selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART));
            }
        }
    });
    // Create column headers
    table.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
    table.setColumnWidth("icon", 22);
    table.addContainerProperty("name", String.class, null);
    table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return table;
}
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 LazyLoadingQuery

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

the class DeploymentPage method createList.

@Override
protected Table createList() {
    final Table deploymentTable = new Table();
    LazyLoadingQuery deploymentListQuery = new DeploymentListQuery(deploymentFilter);
    deploymentListContainer = new LazyLoadingContainer(deploymentListQuery, 30);
    deploymentTable.setContainerDataSource(deploymentListContainer);
    // Listener to change right panel when clicked on a deployment
    deploymentTable.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 = deploymentTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String deploymentId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new DeploymentDetailPanel(deploymentId, DeploymentPage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(DeploymentNavigator.DEPLOYMENT_URI_PART, deploymentId));
            } else {
                // Nothing is selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(DeploymentNavigator.DEPLOYMENT_URI_PART));
            }
        }
    });
    // Create column headers
    deploymentTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.DEPLOYMENT_22));
    deploymentTable.setColumnWidth("icon", 22);
    deploymentTable.addContainerProperty("name", String.class, null);
    deploymentTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return deploymentTable;
}
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)

Aggregations

Table (com.vaadin.ui.Table)6 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)6 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)6 Item (com.vaadin.data.Item)4 Property (com.vaadin.data.Property)4 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)4 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)4 UriFragment (org.activiti.explorer.navigation.UriFragment)3 Label (com.vaadin.ui.Label)2 TableMetaData (org.activiti.engine.management.TableMetaData)1