use of org.eclipse.e4.core.di.annotations.CanExecute in project whole by wholeplatform.
the class ActionCallHandler method canExecute.
@CanExecute
public boolean canExecute(@Named(FUNCTION_URI_PARAMETER_ID) String functionUri, @Named(PREDICATE_XWL_PARAMETER_ID) String predicateXwl, @Optional @Named(ANALYSING_PARAMETER_ID) String analyzing, @Optional @Named(IServiceConstants.ACTIVE_SELECTION) IBindingManager bm) throws Exception {
ITransactionScope ts = BindingManagerFactory.instance.createTransactionScope();
try {
bm.wEnterScope(ts);
defineBindings(functionUri, predicateXwl, analyzing, bm);
return HandlersBehavior.canCallAction(bm);
} catch (Exception e) {
return false;
} finally {
ts.rollback();
bm.wExitScope();
}
}
use of org.eclipse.e4.core.di.annotations.CanExecute in project whole by wholeplatform.
the class ModelTransactionHandler method canExecute.
@CanExecute
public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) IBindingManager bm) {
ITransactionScope ts = BindingManagerFactory.instance.createTransactionScope();
try {
bm.wEnterScope(ts);
return isEnabled(bm);
} catch (Exception e) {
return false;
} finally {
ts.rollback();
bm.wExitScope();
}
}
use of org.eclipse.e4.core.di.annotations.CanExecute in project whole by wholeplatform.
the class PerformHandler method canExecute.
@CanExecute
public boolean canExecute(@Named(BEHAVIOR_XWL_PARAMETER_ID) String behaviorXwl, @Named(PREDICATE_XWL_PARAMETER_ID) String predicateXwl, @Optional @Named(IServiceConstants.ACTIVE_SELECTION) IBindingManager bm) throws Exception {
ITransactionScope ts = BindingManagerFactory.instance.createTransactionScope();
try {
bm.wEnterScope(ts);
defineBindings(behaviorXwl, predicateXwl, bm);
return HandlersBehavior.canPerform(bm);
} catch (Exception e) {
return false;
} finally {
ts.rollback();
bm.wExitScope();
}
}
Aggregations