use of org.activiti.explorer.data.LazyLoadingContainer in project Activiti by Activiti.
the class ActiveProcessDefinitionPage method createList.
protected Table createList() {
processDefinitionTable = new Table();
processDefinitionListQuery = new ActiveProcessDefinitionListQuery();
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 ActiveProcessDefinitionDetailPanel(processDefinitionId, ActiveProcessDefinitionPage.this));
// Update URL
ExplorerApp.get().setCurrentUriFragment(new UriFragment(ActiveProcessDefinitionNavigator.ACTIVE_PROC_DEF_URI_PART, processDefinitionId));
} else {
// Nothing selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(ActiveProcessDefinitionNavigator.ACTIVE_PROC_DEF_URI_PART));
}
}
});
return processDefinitionTable;
}
use of org.activiti.explorer.data.LazyLoadingContainer 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;
}
use of org.activiti.explorer.data.LazyLoadingContainer in project Activiti by Activiti.
the class ProcessInstancePage method createList.
@Override
protected Table createList() {
final Table processInstanceTable = new Table();
processInstanceTable.addStyleName(ExplorerLayout.STYLE_PROCESS_INSTANCE_LIST);
// Listener to change right panel when clicked on a process instance
processInstanceTable.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 = processInstanceTable.getItem(event.getProperty().getValue());
if (item != null) {
String processInstanceId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new ProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
UriFragment taskFragment = getUriFragment(processInstanceId);
ExplorerApp.get().setCurrentUriFragment(taskFragment);
} else {
// Nothing is selected
setDetailComponent(null);
UriFragment taskFragment = getUriFragment(null);
ExplorerApp.get().setCurrentUriFragment(taskFragment);
}
}
});
this.lazyLoadingQuery = createLazyLoadingQuery();
this.processInstanceListContainer = new LazyLoadingContainer(lazyLoadingQuery, 30);
processInstanceTable.setContainerDataSource(processInstanceListContainer);
// Create column header
processInstanceTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
processInstanceTable.setColumnWidth("icon", 22);
processInstanceTable.addContainerProperty("name", String.class, null);
processInstanceTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return processInstanceTable;
}
use of org.activiti.explorer.data.LazyLoadingContainer in project Activiti by Activiti.
the class SavedReportsPage method createList.
protected Table createList() {
reportTable = new Table();
reportListQuery = new SavedReportsListQuery();
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 historicProcessInstanceId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new SavedReportDetailPanel(historicProcessInstanceId));
// Update URL
ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART, historicProcessInstanceId));
} else {
// Nothing selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART));
}
}
});
return reportTable;
}
use of org.activiti.explorer.data.LazyLoadingContainer 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;
}
Aggregations