Moved public re-writes of protected methods from GEF editor to adapter
since they are only used in outline and are not relevant for clients
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/ContentOutlinePageAdapterFactory.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/ContentOutlinePageAdapterFactory.java
index 2cac3b5..3392383 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/ContentOutlinePageAdapterFactory.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/ContentOutlinePageAdapterFactory.java
@@ -16,7 +16,10 @@
package org.eclipse.graphiti.examples.common.outline;
import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.gef.KeyHandler;
import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.parts.SelectionSynchronizer;
import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.graphiti.internal.pref.GFPreferences;
import org.eclipse.graphiti.ui.editor.DiagramEditor;
@@ -37,10 +40,14 @@
if (diagramEditor.getDiagramTypeProvider() != null) { // diagram
// editor
// initialized?
- GraphicsEditorOutlinePage outlinePage = new GraphicsEditorOutlinePage(new TreeViewer(), diagramEditor
- .getGraphicalViewer(), diagramEditor.getActionRegistryInternal(), diagramEditor.getEditDomain(),
- diagramEditor.getCommonKeyHandler(), diagramEditor.getAdapter(ZoomManager.class), diagramEditor
-.getSelectionSynchronizerInternal(), diagramEditor);
+ GraphicsEditorOutlinePage outlinePage = new GraphicsEditorOutlinePage(new TreeViewer(),
+ diagramEditor.getGraphicalViewer(),
+ (ActionRegistry) diagramEditor.getAdapter(ActionRegistry.class),
+ diagramEditor.getEditDomain(),
+ (org.eclipse.gef.KeyHandler) diagramEditor.getAdapter(KeyHandler.class),
+ diagramEditor.getAdapter(ZoomManager.class),
+ (SelectionSynchronizer) diagramEditor.getAdapter(SelectionSynchronizer.class),
+ diagramEditor);
return outlinePage;
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java
index 7b5b497..9cb047b 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java
@@ -813,6 +813,12 @@
if (type == Diagram.class) {
return getDiagramTypeProvider().getDiagram();
}
+ if (type == KeyHandler.class) {
+ return getCommonKeyHandler();
+ }
+ if (type == SelectionSynchronizer.class) {
+ return getSelectionSynchronizer();
+ }
return super.getAdapter(type);
}
@@ -905,18 +911,6 @@
}
/**
- * Returns the internal SelectionSynchronizer (because
- * {@link #getSelectionSynchronizer()} is protected).
- *
- * @return The internal SelectionSynchronizer (because
- * {@link #getSelectionSynchronizer()} is protected).
- * @since 0.9
- */
- public SelectionSynchronizer getSelectionSynchronizerInternal() {
- return getSelectionSynchronizer();
- }
-
- /**
* @since 0.9
*/
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
@@ -1089,18 +1083,6 @@
// ---------------------- Other ----------------------------------------- //
/**
- * Returns the internal ActionRegistry (because {@link #getActionRegistry()}
- * is protected).
- *
- * @return The internal ActionRegistry (because {@link #getActionRegistry()}
- * is protected).
- * @since 0.9
- */
- public ActionRegistry getActionRegistryInternal() {
- return getActionRegistry();
- }
-
- /**
* Returns the KeyHandler with common bindings for both the Outline and the
* Graphical Viewer.
*
@@ -1108,7 +1090,7 @@
* Graphical Viewer.
* @since 0.9
*/
- public KeyHandler getCommonKeyHandler() {
+ protected KeyHandler getCommonKeyHandler() {
if (keyHandler == null) {
keyHandler = new KeyHandler();
keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId()));