use of eu.esdihumboldt.hale.ui.functions.custom.pages.internal.BindingOrType in project hale by halestudio.
the class CustomPropertyFunctionEntitiesPage method createEntityGroup.
/**
* Create an entity group
*
* @param ssid the schema space id
* @param parent the parent composite
* @return the main group control
*/
protected Control createEntityGroup(SchemaSpaceID ssid, Composite parent) {
// return another Composite, since the returned Control's layoutData are
// overwritten.
Composite holder = new Composite(parent, SWT.NONE);
holder.setLayout(GridLayoutFactory.fillDefaults().create());
// Important: Field does rely on DynamicScrolledComposite to be the
// parent of its parent,
// because sadly layout(true, true) on the Shell does not seem to
// propagate to this place.
ScrolledComposite sc = new DynamicScrolledComposite(holder, SWT.V_SCROLL);
sc.setExpandHorizontal(true);
sc.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(300, 400).create());
Group main = new Group(sc, SWT.NONE);
sc.setContent(main);
main.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(10, 5).create());
// load from initial function
DefaultCustomPropertyFunction cf = getWizard().getResultFunction();
// set group title
switch(ssid) {
case SOURCE:
main.setText("Input variables");
sources = new CustomPropertyFunctionEntityList(null, null, main, cf.getSources());
break;
case TARGET:
main.setText("Output");
target = new BindingOrTypeEditor(main, SchemaSpaceID.TARGET);
GridDataFactory.fillDefaults().grab(true, false).applyTo(target.getControl());
if (cf.getTarget() != null) {
BindingOrType bot = new BindingOrType();
bot.setType(cf.getTarget().getBindingType());
bot.setBinding(cf.getTarget().getBindingClass());
bot.setUseBinding(cf.getTarget().getBindingType() == null);
target.setValue(bot);
}
break;
}
return holder;
}
Aggregations