Преглед на файлове

#755 when toggle documentation is selected, walk up the container (#761)

hierachy to apply the toggle on an IPrimaryEditPart.
Andreas Mülder преди 9 години
родител
ревизия
9aa1cb61fa
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/commands/ToggleShowDocumentationCommand.java

+ 4 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/commands/ToggleShowDocumentationCommand.java

@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
 import org.eclipse.gmf.runtime.common.core.command.ICommand;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
 import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
 import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
 import org.eclipse.gmf.runtime.notation.NotationFactory;
@@ -89,6 +90,9 @@ public class ToggleShowDocumentationCommand extends AbstractHandler {
 		for (@SuppressWarnings("unchecked")
 		Iterator<IGraphicalEditPart> iter = structuredSelection.iterator(); iter.hasNext();) {
 			IGraphicalEditPart next = iter.next();
+			while(next != null && !(next instanceof IPrimaryEditPart)){
+				next = (IGraphicalEditPart) next.getParent();
+			}
 			result.add(next.getNotationView());
 		}
 		return result;