use of org.osate.ge.internal.diagram.runtime.AgeDiagram in project osate2 by osate.
the class ShowDefaultContentsHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final List<DiagramElement> selectedDiagramElements = AgeHandlerUtil.getSelectedDiagramElements();
final AgeDiagram diagram = UiUtil.getDiagram(selectedDiagramElements);
if (diagram == null) {
throw new RuntimeException("Unable to get diagram");
}
final DiagramType diagramType = diagram.getConfiguration().getDiagramType();
final ContentFilterProvider contentFilterProvider = getContentFilterProvider();
final Function<DiagramElement, ImmutableSet<ContentFilter>> getContentFilters = (diagramElement) -> DiagramTypeUtil.getApplicableDefaultContentFilters(diagramType, diagramElement.getBusinessObject(), contentFilterProvider);
// Show elements matching the filter
ShowContentsUtil.addContentsToSelectedElements(event, getContentFilters);
return null;
}
Aggregations