use of org.osate.ge.services.GraphicalEditorService in project AGREE by loonwerks.
the class VariablesView method showInGraphicalView.
private void showInGraphicalView(final InstanceObject io) {
assert (io != null);
// Open the graphical editor
final GraphicalEditorService editorService = Objects.requireNonNull(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(GraphicalEditorService.class), "unable to retrieve Graphical Editor Service");
final SimulationEngine engine = simulationUiService.getCurrentState().getSimulationEngine();
if (engine != null && engine.getSystemInstance() != null) {
final GraphicalEditor editor = editorService.openBusinessObject(engine.getSystemInstance());
editor.selectDiagramElementsForBusinessObject(io);
}
;
}
use of org.osate.ge.services.GraphicalEditorService in project AGREE by loonwerks.
the class OpenGraphicalViewHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
// Open the graphical editor
final SimulationUIService simulationUiService = (SimulationUIService) Objects.requireNonNull(PlatformUI.getWorkbench().getService(SimulationUIService.class), "unable to get simulation UI service");
final GraphicalEditorService editorService = Objects.requireNonNull((GraphicalEditorService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(GraphicalEditorService.class), "unable to retrieve Graphical Editor Service");
final SimulationEngine engine = simulationUiService.getCurrentState().getSimulationEngine();
if (engine != null && engine.getSystemInstance() != null) {
editorService.openBusinessObject(engine.getSystemInstance());
}
;
} catch (final Exception ex) {
final Status status = new Status(IStatus.ERROR, FrameworkUtil.getBundle(getClass()).getSymbolicName(), "Error", ex);
StatusManager.getManager().handle(status, StatusManager.SHOW | StatusManager.LOG);
}
return null;
}
Aggregations