Search in sources :

Example 1 with FunctionRunnable

use of org.whole.lang.e4.ui.jobs.FunctionRunnable in project whole by wholeplatform.

the class AbstractModelTextAction method calculateEnabled.

protected boolean calculateEnabled(IBindingManager bm) {
    IEntityPartViewer viewer = (IEntityPartViewer) bm.wGetValue("viewer");
    if (!Tools.TEXTUAL.isActive(viewer) || !(ModelObserver.getObserver(bm.wGet("focusEntity"), viewer.getEditPartRegistry()) instanceof ITextualEntityPart))
        return false;
    IEclipseContext context = (IEclipseContext) bm.wGetValue("eclipse#eclipseContext");
    ISynchronizableRunnable runnable = new FunctionRunnable(context, bm, getText(), getEnablementUri());
    IEntity result = runnable.syncExec(3000).getResult();
    return result != null && result.wBooleanValue();
}
Also used : ISynchronizableRunnable(org.whole.lang.e4.ui.jobs.ISynchronizableRunnable) ITextualEntityPart(org.whole.lang.ui.editparts.ITextualEntityPart) IEntity(org.whole.lang.model.IEntity) IEclipseContext(org.eclipse.e4.core.contexts.IEclipseContext) FunctionRunnable(org.whole.lang.e4.ui.jobs.FunctionRunnable) TextualFunctionRunnable(org.whole.lang.e4.ui.jobs.TextualFunctionRunnable) IEntityPartViewer(org.whole.lang.ui.viewers.IEntityPartViewer)

Aggregations

IEclipseContext (org.eclipse.e4.core.contexts.IEclipseContext)1 FunctionRunnable (org.whole.lang.e4.ui.jobs.FunctionRunnable)1 ISynchronizableRunnable (org.whole.lang.e4.ui.jobs.ISynchronizableRunnable)1 TextualFunctionRunnable (org.whole.lang.e4.ui.jobs.TextualFunctionRunnable)1 IEntity (org.whole.lang.model.IEntity)1 ITextualEntityPart (org.whole.lang.ui.editparts.ITextualEntityPart)1 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)1