use of org.whole.lang.e4.ui.jobs.ISynchronizableRunnable in project whole by wholeplatform.
the class DerivedLinkableSelectionListener method updateViewerContents.
protected void updateViewerContents(boolean relink) {
if (lastSelection == null)
return;
if (shareEditDomain && relink) {
IEntityPartViewer toViewer = (IEntityPartViewer) lastSelection.wGetValue("viewer");
viewer.linkEditDomain(toViewer);
fireViewerLinked(toViewer);
}
if (!changeTracker.testChangedAndUpdate(lastSelection, lastSelection.wGet("self")))
return;
if (functionUri != null) {
ISynchronizableRunnable runnable = new DeriveModelRunnable(context, lastSelection, LABEL, functionUri, functionIsTransactional, resultShowingPolicy) {
@Override
protected void updateUI(IEntity result) {
super.updateUI(result);
if (result != null)
fireContentsDerived(result);
}
};
runnable.asyncExec("Executing " + LABEL + " operation...");
} else {
IEntity newContents = lastSelection.wGet("self");
if (viewer.getEntityContents() != newContents)
viewer.setContents(newContents);
}
if (isSynchronizeSelection() && lastSelection.wIsSet("primarySelectedEntity")) {
IEntity selectedEntities = lastSelection.wGet("selectedEntities");
List<IEntity> selection = new ArrayList<>();
for (int i = 0, size = selectedEntities.wSize(); i < size; i++) selection.add(selectedEntities.wGet(i));
viewer.selectAndReveal(selection);
}
}
use of org.whole.lang.e4.ui.jobs.ISynchronizableRunnable in project whole by wholeplatform.
the class AbstractModelTextAction method run.
@Override
public void run() {
ESelectionService selectionService = getContext().get(ESelectionService.class);
IBindingManager bm = (IBindingManager) selectionService.getSelection();
ISynchronizableRunnable runnable = new TextualFunctionRunnable(getContext(), bm, getText(), getBehaviorUri());
runnable.syncExec(3000);
}
use of org.whole.lang.e4.ui.jobs.ISynchronizableRunnable 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();
}
use of org.whole.lang.e4.ui.jobs.ISynchronizableRunnable in project whole by wholeplatform.
the class E4SampleGraphicalPart method execute.
protected void execute() {
if (behaviorModel == null || selfBindings == null)
return;
else {
ISynchronizableRunnable runnable = new ExecuteSampleModelRunnable(context, behaviorLabel, contextModel, selfBindings, selfModel, bm, behaviorModel);
runnable.asyncExec("Executing " + behaviorLabel + " operation...");
}
}
Aggregations