use of org.talend.commons.ui.swt.composites.MessagesWithActionComposite in project tdi-studio-se by Talend.
the class MissingSettingsMultiThreadDynamicComposite method afterCreateMessagesComposite.
@Override
public void afterCreateMessagesComposite(MessagesComposite messComposite) {
final Element ele = this.getElement();
if (ele instanceof Node && isVisibleTopMessages()) {
final IComponent component = ((Node) ele).getComponent();
messComposite.updateTopMessages(//$NON-NLS-1$
Messages.getString(//$NON-NLS-1$
"MissingSettingsMultiThreadDynamicComposite_missingModulesMessages", component.getName()), IStatus.WARNING);
if (messComposite instanceof MessagesWithActionComposite) {
MessagesWithActionComposite messWithActionComposite = (MessagesWithActionComposite) messComposite;
messWithActionComposite.updateActionButton(//$NON-NLS-1$
Messages.getString("MissingSettingsMultiThreadDynamicComposite.installName") + "...", //$NON-NLS-1$
null);
messWithActionComposite.addActionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (!missModulesNeeded.isEmpty()) {
ModulesInstallerUtil.forceInstallModules(getShell(), component, missModulesNeeded);
checkVisibleTopMessages();
}
}
});
}
}
super.afterCreateMessagesComposite(messComposite);
}
use of org.talend.commons.ui.swt.composites.MessagesWithActionComposite in project tdi-studio-se by Talend.
the class MissingSettingsMultiThreadDynamicComposite method createMessagesComposite.
@Override
protected MessagesComposite createMessagesComposite() {
MessagesWithActionComposite messagesComposite = new MessagesWithActionComposite(getComposite(), SWT.NONE) {
@Override
protected void changeBackgroundColor(int status) {
switch(status) {
case IStatus.WARNING:
CoreUIPlugin.setCSSId(this, CSS_MESSAGES_WITH_ACTION_COMPOSITE_WARN);
break;
case IStatus.ERROR:
CoreUIPlugin.setCSSId(this, CSS_MESSAGES_WITH_ACTION_COMPOSITE_ERROR);
break;
default:
}
}
};
// CSS
CoreUIPlugin.setCSSClass(messagesComposite, MessagesWithActionComposite.class.getSimpleName());
return messagesComposite;
}
Aggregations