l.setText("Source folder");
Text t = new Text(parent, SWT.BORDER);
t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
t.setEditable(false);
final Binding bd = dbc.bindValue(
WidgetProperties.text().observe(t),
BeanProperties.value("fragmentRoot").observe(clazz),
new UpdateValueStrategy(),
new UpdateValueStrategy().setConverter(new PackageFragmentRootToStringConverter())
);
Button b = new Button(parent, SWT.PUSH);
b.setText("Browse ...");
b.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IPackageFragmentRoot root = choosePackageRoot();
if( root != null ) {
froot = root;
clazz.setFragmentRoot(root);
}
bd.updateModelToTarget(); //TODO Find out why this is needed
}
});
}
{
Label l = new Label(parent, SWT.NONE);
l.setText("Package");
Text t = new Text(parent, SWT.BORDER);
t.setEditable(false);
t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
final Binding bd = dbc.bindValue(
WidgetProperties.text().observe(t),
BeanProperties.value("packageFragment").observe(clazz),
new UpdateValueStrategy(),
new UpdateValueStrategy().setConverter(new PackageFragmentToStringConverter())
);
Button b = new Button(parent, SWT.PUSH);
b.setText("Browse ...");
b.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IPackageFragment fragment = choosePackage();
if( fragment != null ) {
clazz.setPackageFragment(fragment);
}
bd.updateModelToTarget(); //TODO Find out why this is needed
}
});
}
{