use of org.whole.lang.environment.ui.figures.EnvironmentFigure 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