}
private void displayDefinitionList() {
definitionList.removeAllComponents();
ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
ProcessToolRegistry registry = ctx.getRegistry();
ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
List<ProcessDefinitionConfig> latestConfigurations = new ArrayList(dao.getActiveConfigurations());
Collections.sort(latestConfigurations, ProcessDefinitionConfig.DEFAULT_COMPARATOR);
for (final ProcessDefinitionConfig cfg : latestConfigurations) {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setSpacing(true);
buttonLayout.addComponent(linkButton(getLocalizedMessage(!cfg.getEnabled() ? "processdefinitions.console.enable" : "processdefinitions.console.disable"),
new Runnable() {
@Override
public void run() {
ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
final ProcessToolRegistry registry = ctx.getRegistry();
final ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
dao.setConfigurationEnabled(cfg, !cfg.getEnabled());
String msg = getLocalizedMessage(!cfg.getEnabled() ? "processdefinitions.console.enable.success" : "processdefinitions.console.disable.success");
Window.Notification n = new Window.Notification(msg);
n.setDelayMsec(-1);
getApplication().getMainWindow().showNotification(n);