Composite composite = new Composite(baseComposite, SWT.NONE);
composite.setLayout(new RowLayout(SWT.HORIZONTAL));
composite.setBackground(Display.getDefault().getSystemColor(
SWT.COLOR_WIDGET_LIGHT_SHADOW));
composite.setLayoutData(new RowData(690, 30));
final EmbeddedLink link = new EmbeddedLink(composite, SWT.NONE, false);
// add link
link.setTarget(property);
if (property.getName() != null)
link.setText(property.getName());
else
link.setText("");
link.setLayoutData(new RowData(650, 25));
property.addModelElementChangeListener(new ModelElementChangeListener() {
@Override
public void onChange(final Notification notification) {
if (notification.getEventType() == Notification.SET)
if (notification.getFeature().getClass().getName() == "name") {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
link.setText(notification.getNewStringValue());
}
});
} else if (notification.getFeature().getClass().getName() == "description") {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
link.setTargetDescription(notification
.getNewStringValue());
}
});
}