Search in sources :

Example 16 with OperationCanceledException

use of org.whole.lang.operations.OperationCanceledException in project whole by wholeplatform.

the class TestsInterpreterVisitor method evaluate.

protected IEntity evaluate(Expression subject, boolean catchExceptions) {
    // null;
    IEntity entity = NullEntity.instance;
    try {
        subject.accept(this);
        entity = getResult();
    } catch (OperationCanceledException e) {
        throw e;
    } catch (RuntimeException e) {
        if (catchExceptions)
            // save exception for later evaluation
            getBindings().wDefValue("thrownException", e);
        else
            throw e;
    }
    return entity == null ? NullEntity.instance : entity;
}
Also used : IWholeRuntimeException(org.whole.lang.exceptions.IWholeRuntimeException) IEntity(org.whole.lang.model.IEntity) OperationCanceledException(org.whole.lang.operations.OperationCanceledException)

Aggregations

OperationCanceledException (org.whole.lang.operations.OperationCanceledException)16 IEntity (org.whole.lang.model.IEntity)8 CommandStack (org.eclipse.gef.commands.CommandStack)6 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)6 ModelTransactionCommand (org.whole.lang.ui.commands.ModelTransactionCommand)5 UISynchronize (org.eclipse.e4.ui.di.UISynchronize)3 ITransactionScope (org.whole.lang.bindings.ITransactionScope)3 IWholeRuntimeException (org.whole.lang.exceptions.IWholeRuntimeException)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IOperationProgressMonitor (org.whole.lang.operations.IOperationProgressMonitor)2 AfterTest (org.whole.lang.tests.model.AfterTest)2 BeforeTest (org.whole.lang.tests.model.BeforeTest)2 InputStream (java.io.InputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 TreeSet (java.util.TreeSet)1 IWorkspace (org.eclipse.core.resources.IWorkspace)1 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)1 IWorkspaceRunnable (org.eclipse.core.resources.IWorkspaceRunnable)1 CoreException (org.eclipse.core.runtime.CoreException)1