use of org.osate.ge.internal.diagram.runtime.DiagramElementPredicates in project osate2 by osate.
the class SelectAllConnectionsHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final IEditorPart activeEditor = HandlerUtil.getActiveEditor(event);
if (!(activeEditor instanceof InternalDiagramEditor)) {
throw new RuntimeException("Unexpected editor: " + activeEditor);
}
final InternalDiagramEditor editor = (InternalDiagramEditor) activeEditor;
final List<DiagramElement> connectionDiagramElements = editor.getDiagram().getAllDiagramNodes().filter(dn -> dn instanceof DiagramElement).map(DiagramElement.class::cast).filter(DiagramElementPredicates::isConnection).collect(Collectors.toList());
editor.selectDiagramNodes(connectionDiagramElements);
return null;
}
Aggregations