all.setLayoutData(allgd);
// all.setBordered(true);
final Binding currNSBinding = bnd.getBinding("current");
final OneLineTextElement<String> current = new OneLineTextElement(
currNSBinding);
current.setReadOnly(true);
final Binding nsListBinding = bnd.getBinding("namespaces");
nsListBinding.setMaxCardinality(1);
final ListEnumeratedValueSelector<String> l = new ListEnumeratedValueSelector<String>(
nsListBinding) {
protected void updateSize(TableViewer newCheckList) {
TableColumn tableColumn = (TableColumn) columnWidget;
tableColumn.pack();
}
};
l.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection s = event.getSelection();
if (s instanceof StructuredSelection) {
StructuredSelection ss = (StructuredSelection) s;
String selected = (String) ss.getFirstElement();
if (selected != null) {
currNSBinding.setValue(selected, null);
}
}
return;
}
});
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) {