Search in sources :

Example 6 with LazyLoadingQuery

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

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