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);
}
}
Aggregations