@Override
public void valueChange(ValueChangeEvent event) {
if(processesSelect.getValue() == null)
return;
final ProcessDefinitionConfig definition = getSelectedDefinition();
if(!logoEmbeddedCache.containsKey(definition)){
logoEmbeddedCache.put(definition, new Embedded(null, logoResourceCache.get(definition)));
}
Embedded logo = logoEmbeddedCache.get(definition);
if(descriptionPanel.getComponentCount() == 0){
secondButton = VaadinUtility.link(getMessage("newProcess.start-task"), this);
secondButton.setImmediate(true);
secondButton.addListener(new ProcessStartListener());
selectedTitleLabel = new Label(getMessage(definition.getDescription()));
selectedTitleLabel.addStyleName("h3 color");
descriptionPanel.addComponent(logoWrapper = VaadinUtility.horizontalLayout(Alignment.MIDDLE_LEFT, logo, selectedTitleLabel));
logoWrapper.setHeight(36, Sizeable.UNITS_PIXELS);
HorizontalLayout hl = new HorizontalLayout();
hl.addComponent(descriptionLabel = new Label(nvl(getMessage(definition.getComment()), ""), Label.CONTENT_XHTML) {{
setWidth("100%");
}});
hl.addComponent(secondButton);
hl.setExpandRatio(hl.getComponent(0), 1.0f);
hl.setSpacing(true);
hl.setWidth("100%");
hl.setComponentAlignment(secondButton, Alignment.BOTTOM_RIGHT);
descriptionPanel.addComponent(hl);
} else {
logoWrapper.addComponentAsFirst(logo);
logoWrapper.removeComponent(previousLogo);
selectedTitleLabel.setValue(getMessage(definition.getDescription()));
// selectedTitleLabel.setIcon(logoResourceCache.get(definition));
descriptionLabel.setValue(nvl(getMessage(definition.getComment()), ""));
}
previousLogo = logo;
}