c1.add(current);
c1.add(l);
ButtonSelector add = new ButtonSelector();
add.addListener(SWT.Selection, new SWTEventListener() {
public void handleEvent(AbstractUIElement element, Event event) {
currNSBinding.setName("Current Namespace");
currNSBinding.setDescription("Add New Namespace");
currNSBinding.setValue("", null);
CompositeEditor ce = new CompositeEditor(currNSBinding) {
protected void update(AbstractUIElement<?> container) {
super.update(container);
getControl().pack(true);
}
};
OneLineTextElement<String> f = new OneLineTextElement(
currNSBinding);
ce.setLayout(new FillLayout());
ce.add(f);
TitledDialog td = new TitledDialog(ce) {
protected void okPressed() {
currNSBinding.commit();
super.okPressed();
}
public int open() {
int ch = super.open();
return ch;
}
};
td.create();
td.getShell().setSize(300, 190);
td.open();
String curr = (String) currNSBinding.getValue();
if (!l.getRealm().contains(curr)) {// curr.length() != 0) {
l.addValue(curr);
}
return;
}
});
add.setText("add");
add.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false));
ButtonSelector remove = new ButtonSelector();
remove.addListener(SWT.Selection, new SWTEventListener() {
public void handleEvent(AbstractUIElement element, Event event) {
IStructuredSelection s = l.getSelection();
StructuredSelection ss = (StructuredSelection) s;
String selected = (String) ss.getFirstElement();