Search in sources :

Example 11 with UriFragment

use of org.activiti.explorer.navigation.UriFragment in project Activiti by Activiti.

the class DatabasePage method createList.

@Override
protected Table createList() {
    final Table tableList = new Table();
    // Listener to change right panel when clicked on a task
    tableList.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 8811553575319455854L;

        public void valueChange(ValueChangeEvent event) {
            // The itemId of the table list is the tableName
            String tableName = (String) event.getProperty().getValue();
            setDetailComponent(new DatabaseDetailPanel(tableName));
            // Update URL
            ExplorerApp.get().setCurrentUriFragment(new UriFragment(DatabaseNavigator.TABLE_URI_PART, tableName));
        }
    });
    // Create column headers
    tableList.addContainerProperty("icon", Embedded.class, null);
    tableList.setColumnWidth("icon", 22);
    tableList.addContainerProperty("tableName", String.class, null);
    tableList.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return tableList;
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) Table(com.vaadin.ui.Table) Property(com.vaadin.data.Property) UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 12 with UriFragment

use of org.activiti.explorer.navigation.UriFragment in project Activiti by Activiti.

the class RunReportsPage method createList.

protected Table createList() {
    reportTable = new Table();
    reportListQuery = new ReportListQuery();
    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 processDefinitionId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new ReportDetailPanel(processDefinitionId, RunReportsPage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ReportNavigator.REPORT_URI_PART, processDefinitionId));
            } else {
                // Nothing selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ReportNavigator.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 13 with UriFragment

use of org.activiti.explorer.navigation.UriFragment 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 14 with UriFragment

use of org.activiti.explorer.navigation.UriFragment in project Activiti by Activiti.

the class InvolvedPage method getUriFragment.

@Override
protected UriFragment getUriFragment(String taskId) {
    UriFragment taskFragment = new UriFragment(TaskNavigator.TASK_URI_PART);
    if (taskId != null) {
        taskFragment.addUriPart(taskId);
    }
    taskFragment.addParameter(TaskNavigator.PARAMETER_CATEGORY, TaskNavigator.CATEGORY_INVOLVED);
    return taskFragment;
}
Also used : UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 15 with UriFragment

use of org.activiti.explorer.navigation.UriFragment in project Activiti by Activiti.

the class UserPage method createList.

protected Table createList() {
    userTable = new Table();
    userListQuery = new UserListQuery();
    userListContainer = new LazyLoadingContainer(userListQuery, 30);
    userTable.setContainerDataSource(userListContainer);
    // Column headers
    userTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.USER_22));
    userTable.setColumnWidth("icon", 22);
    userTable.addContainerProperty("name", String.class, null);
    userTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    // Listener to change right panel when clicked on a user
    userTable.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 = userTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String userId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new UserDetailPanel(UserPage.this, userId));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(UserNavigator.USER_URI_PART, userId));
            } else {
                // Nothing is selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(UserNavigator.USER_URI_PART));
            }
        }
    });
    return userTable;
}
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)

Aggregations

UriFragment (org.activiti.explorer.navigation.UriFragment)20 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)13 Item (com.vaadin.data.Item)12 Property (com.vaadin.data.Property)12 Table (com.vaadin.ui.Table)12 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)10 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)8 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)3 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)1 ProcessInstanceDetailPanel (org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel)1