});
//richToolTipMessageManager = new RichMessageToolTipManager(managedForm);
//form.getForm().setMessageToolTipManager(richToolTipMessageManager);
final IMessageManager mmng = managedForm.getMessageManager();
TableWrapLayout layout = new TableWrapLayout();
form.getBody().setLayout(layout);
Section section = toolkit.createSection(form.getBody(),
Section.TITLE_BAR);
section.setText("Local field messages");
Composite sbody = toolkit.createComposite(section);
section.setClient(sbody);
GridLayout glayout = new GridLayout();
glayout.horizontalSpacing = 10;
glayout.numColumns = 2;
sbody.setLayout(glayout);
toolkit.paintBordersFor(sbody);
createDecoratedTextField("Field1", toolkit, sbody, mmng);
createDecoratedTextField("Field2", toolkit, sbody, mmng);
createDecoratedTextField("Field3", toolkit, sbody, mmng);
final Button button1 = toolkit.createButton(form.getBody(),
"Add general error", SWT.CHECK);
button1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (button1.getSelection()) {
mmng.addMessage("saveError", "Save Error", null,
IMessageProvider.ERROR);
} else {
mmng.removeMessage("saveError");
}
}
});
final Button button2 = toolkit.createButton(form.getBody(),
"Add static message", SWT.CHECK);
button2.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (button2.getSelection()) {
mmng.addMessage("info", "Secondary info", null,
IMessageProvider.NONE);
} else {
mmng.removeMessage("info");
}
}
});
final Button button3 = toolkit.createButton(form.getBody(),
"Auto update", SWT.CHECK);
button3.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
mmng.setAutoUpdate(button3.getSelection());
}
});
button3.setSelection(true);
}