]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java
Minor improvement for Plant3DEditor extensibility
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / editor / Plant3DEditor.java
index 72f2c2066e4329bcac5c306786805ce4146eff01..af7a67f5f96f8e21221c8197c81179fb6b4b0a5e 100644 (file)
@@ -7,6 +7,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
@@ -332,7 +333,7 @@ public class Plant3DEditor extends ResourceEditorPart {
                });
                
        }
-       
+
        protected IMappingSchema<Resource, INode> getSchema(ReadGraph graph) throws DatabaseException {
                IMappingSchema<Resource,INode> schema = SchemaBuilder.getSchema(graph);
                return schema;
@@ -516,7 +517,7 @@ public class Plant3DEditor extends ResourceEditorPart {
                }
        }
 
-       private class FitToWindow extends Action {
+       protected class FitToWindow extends Action {
                private List<INode> selected;
                public FitToWindow(List<INode> selected) {
                        super("Fit to Window");
@@ -536,7 +537,7 @@ public class Plant3DEditor extends ResourceEditorPart {
        }
 
        protected void createFocusMenu(IMenuManager m, List<INode> selected) {
-               m.add(new FitToWindow(selected));
+               m.add(createFitToWindowAction(selected));
 
                if (!selected.isEmpty()) {
                        List<vtkProp3D> actors = new ArrayList<>();
@@ -548,7 +549,11 @@ public class Plant3DEditor extends ResourceEditorPart {
                        }
                }
        }
-       
+
+       protected IAction createFitToWindowAction(List<INode> selected) {
+               return new FitToWindow(selected);
+       }
+
        private IContentOutlinePage createOutline() {
                if (rootNode == null || selectionProvider == null)
                        return null;