use of org.whole.lang.e4.ui.jobs.DeriveModelRunnable 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);
}
}
Aggregations