use of org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart in project statecharts by Yakindu.
the class ToggleShowDocumentationCommand method unwrap.
protected List<View> unwrap(ISelection selection) {
List<View> result = new ArrayList<View>();
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
for (@SuppressWarnings("unchecked") Iterator<GraphicalEditPart> iter = structuredSelection.iterator(); iter.hasNext(); ) {
GraphicalEditPart next = iter.next();
while (next != null && !(next instanceof IPrimaryEditPart)) {
next = (GraphicalEditPart) next.getParent();
}
if (next != null && next.getModel() instanceof View)
result.add((View) next.getModel());
}
return result;
}
use of org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart in project statecharts by Yakindu.
the class HighlightingSupportAdapter method lockEditorInternal.
private void lockEditorInternal() {
setSanityCheckEnablementState(false);
for (Object editPart : diagramWorkbenchPart.getDiagramGraphicalViewer().getEditPartRegistry().values()) {
if (editPart instanceof IPrimaryEditPart) {
IGraphicalEditPart graphicalEditPart = (IGraphicalEditPart) editPart;
IFigure figure = getTargetFigure(graphicalEditPart);
figureStates.put(figure, new ColorMemento(figure));
}
}
locked = true;
}
use of org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart in project statecharts by Yakindu.
the class DiagramPartitioningUtil method selectElementsInDiagram.
public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
diagramPart.getDiagramGraphicalViewer().deselectAll();
EditPart firstPrimary = null;
for (Iterator<EditPart> it = editParts.iterator(); it.hasNext(); ) {
EditPart nextPart = it.next();
diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
firstPrimary = nextPart;
}
}
if (!editParts.isEmpty()) {
diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart) editParts.get(0));
}
}
Aggregations