Search in sources :

Example 11 with LazyLoadingContainer

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

Example 12 with LazyLoadingContainer

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

the class DatabaseDetailPanel method addTableData.

protected void addTableData() {
    LazyLoadingQuery lazyLoadingQuery = new TableDataQuery(tableName, managementService);
    LazyLoadingContainer lazyLoadingContainer = new LazyLoadingContainer(lazyLoadingQuery, 30);
    if (lazyLoadingContainer.size() > 0) {
        Table data = new Table();
        data.setContainerDataSource(lazyLoadingContainer);
        data.setEditable(false);
        data.setSelectable(true);
        data.setColumnReorderingAllowed(true);
        if (lazyLoadingQuery.size() < 10) {
            data.setPageLength(0);
        } else {
            data.setPageLength(10);
        }
        addDetailComponent(data);
        data.setWidth(100, UNITS_PERCENTAGE);
        data.setHeight(100, UNITS_PERCENTAGE);
        data.addStyleName(ExplorerLayout.STYLE_DATABASE_TABLE);
        setDetailExpandRatio(data, 1.0f);
        // Create column headers
        TableMetaData metaData = managementService.getTableMetaData(tableName);
        for (String columnName : metaData.getColumnNames()) {
            data.addContainerProperty(columnName, String.class, null);
        }
    } else {
        Label noDataLabel = new Label(i18nManager.getMessage(Messages.DATABASE_NO_ROWS));
        noDataLabel.addStyleName(Reindeer.LABEL_SMALL);
        addDetailComponent(noDataLabel);
        setDetailExpandRatio(noDataLabel, 1.0f);
    }
}
Also used : TableMetaData(org.activiti.engine.management.TableMetaData) Table(com.vaadin.ui.Table) Label(com.vaadin.ui.Label) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) LazyLoadingQuery(org.activiti.explorer.data.LazyLoadingQuery)

Example 13 with LazyLoadingContainer

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

the class SuspendedProcessDefinitionPage method createList.

protected Table createList() {
    processDefinitionTable = new Table();
    processDefinitionListQuery = new SuspendedProcessDefinitionListQuery();
    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 SuspendedProcessDefinitionDetailPanel(processDefinitionId, SuspendedProcessDefinitionPage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(SuspendedProcessDefinitionNavigator.SUSPENDED_PROC_DEF_URI_PART, processDefinitionId));
            } else {
                // Nothing selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(SuspendedProcessDefinitionNavigator.SUSPENDED_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 14 with LazyLoadingContainer

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

the class UserDetailPanel method initGroupsTable.

protected void initGroupsTable() {
    groupsForUserQuery = new GroupsForUserQuery(identityService, this, user.getId());
    if (groupsForUserQuery.size() > 0) {
        groupTable = new Table();
        groupTable.setSortDisabled(true);
        groupTable.setHeight(150, UNITS_PIXELS);
        groupTable.setWidth(100, UNITS_PERCENTAGE);
        groupLayout.addComponent(groupTable);
        groupContainer = new LazyLoadingContainer(groupsForUserQuery, 30);
        groupTable.setContainerDataSource(groupContainer);
        groupTable.addContainerProperty("id", Button.class, null);
        groupTable.setColumnExpandRatio("id", 22);
        groupTable.addContainerProperty("name", String.class, null);
        groupTable.setColumnExpandRatio("name", 45);
        groupTable.addContainerProperty("type", String.class, null);
        groupTable.setColumnExpandRatio("type", 22);
        groupTable.addContainerProperty("actions", Component.class, null);
        groupTable.setColumnExpandRatio("actions", 11);
        groupTable.setColumnAlignment("actions", Table.ALIGN_CENTER);
    } else {
        noGroupsLabel = new Label(i18nManager.getMessage(Messages.USER_NO_GROUPS));
        groupLayout.addComponent(noGroupsLabel);
    }
}
Also used : Table(com.vaadin.ui.Table) Label(com.vaadin.ui.Label) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer)

Example 15 with LazyLoadingContainer

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

the class GroupSelectionPopupWindow method initGroupTable.

protected void initGroupTable() {
    groupTable = new Table();
    groupTable.setNullSelectionAllowed(false);
    groupTable.setSelectable(true);
    groupTable.setMultiSelect(true);
    groupTable.setSortDisabled(true);
    groupTable.setWidth(460, UNITS_PIXELS);
    groupTable.setHeight(275, UNITS_PIXELS);
    addComponent(groupTable);
    GroupSelectionQuery query = new GroupSelectionQuery(identityService, userId);
    LazyLoadingContainer container = new LazyLoadingContainer(query, 30);
    groupTable.setContainerDataSource(container);
    groupTable.addContainerProperty("id", String.class, null);
    groupTable.addContainerProperty("name", String.class, null);
    groupTable.addContainerProperty("type", String.class, null);
}
Also used : Table(com.vaadin.ui.Table) 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