use of org.whole.lang.environment.model.Environment in project whole by wholeplatform.
the class EnvironmentPart method getModelSpecificChildren.
@Override
protected List<IEntity> getModelSpecificChildren() {
Environment entity = getModelEntity();
List<IEntity> list = new ArrayList<IEntity>(3);
list.add(entity.getName());
list.add(entity.getFilter());
list.add(entity.getBindings());
return list;
}
use of org.whole.lang.environment.model.Environment in project whole by wholeplatform.
the class EnvironmentPart method createFigure.
protected IFigure createFigure() {
Environment entity = getModelEntity();
return new EnvironmentFigure(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Environment entity = getModelEntity();
ModelTransactionCommand command = new ModelTransactionCommand(entity);
try {
command.begin();
IBindingManager bm = entity.getBindingManager().getValue();
if (Matcher.match(EnvironmentEntityDescriptorEnum.Bindings, entity.getBindings()))
entity.setBindings((BindingsModel) BindingManagerFactory.instance.createFlatScopedBindingsModel(bm));
else
entity.setBindings((BindingsModel) BindingManagerFactory.instance.createFlatBindingsModel(bm));
command.commit();
getViewer().getEditDomain().getCommandStack().execute(command);
} catch (Exception e) {
command.rollbackIfNeeded();
}
}
}, Matcher.matchImpl(EnvironmentEntityDescriptorEnum.ScopedBindings, entity.getBindings()));
}
Aggregations