Removed internal usages
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/GraphicsEditorOutlinePage.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/GraphicsEditorOutlinePage.java
index 3050f1c..b1c20d0 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/GraphicsEditorOutlinePage.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/GraphicsEditorOutlinePage.java
@@ -22,6 +22,7 @@
import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.EditDomain;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.KeyHandler;
@@ -34,7 +35,7 @@
import org.eclipse.graphiti.examples.common.ISampleImageConstants;
import org.eclipse.graphiti.examples.common.outline.tree.PictogramsTreeEditPartFactory;
import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.ui.internal.config.IEditPartFactory;
+import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal;
import org.eclipse.graphiti.ui.internal.fixed.FixedScrollableThumbnail;
import org.eclipse.graphiti.ui.services.GraphitiUi;
@@ -142,9 +143,9 @@
* update of the contents of the outline page.
*/
public void initContents() {
- IEditPartFactory treeEditPartFactory = new PictogramsTreeEditPartFactory(_diagramEditor.getConfigurationProvider());
+ EditPartFactory treeEditPartFactory = new PictogramsTreeEditPartFactory();
getViewer().setEditPartFactory(treeEditPartFactory);
- Diagram diagram = _diagramEditor.getConfigurationProvider().getDiagram();
+ Diagram diagram = ((DiagramEditorInput) _diagramEditor.getEditorInput()).getDiagram();
getViewer().setContents(diagram);
}
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/AbstractGraphicsTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/AbstractGraphicsTreeEditPart.java
index a4c2058..2504923 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/AbstractGraphicsTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/AbstractGraphicsTreeEditPart.java
@@ -31,16 +31,13 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.graphiti.examples.common.util.uiprovider.TwoObjectsContainer;
-import org.eclipse.graphiti.internal.services.GraphitiInternal;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProviderHolder;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
/**
*
*/
-public class AbstractGraphicsTreeEditPart extends AbstractTreeEditPart implements IConfigurationProviderHolder {
+public class AbstractGraphicsTreeEditPart extends AbstractTreeEditPart {
private Map<TwoObjectsContainer, Image> _imageRegistry = new HashMap<TwoObjectsContainer, Image>(); // ImageDescriptor
@@ -94,32 +91,12 @@
*/
public static final String TUPLE_TEXT_START = "("; //$NON-NLS-1$
- private IConfigurationProvider configurationProvider;
-
- /**
- *
- */
- public AbstractGraphicsTreeEditPart(IConfigurationProvider configurationProvider) {
- super();
- setConfigurationProvider(configurationProvider);
- }
/**
* @param model
*/
- public AbstractGraphicsTreeEditPart(IConfigurationProvider configurationProvider, Object model) {
+ public AbstractGraphicsTreeEditPart(Object model) {
super(model);
- setConfigurationProvider(configurationProvider);
- }
-
- /**
- * Returns the IConfigurationProvider of this EditPart
- *
- * @return The IConfigurationProvider of this EditPart
- */
- @Override
- public IConfigurationProvider getConfigurationProvider() {
- return configurationProvider;
}
/**
@@ -153,14 +130,6 @@
}
/**
- * @param configurationProvider
- * The configurationProvider to set.
- */
- private void setConfigurationProvider(IConfigurationProvider configurationProvider) {
- this.configurationProvider = configurationProvider;
- }
-
- /**
* Adds the all elements if not null.
*
* @param resultList
@@ -209,9 +178,9 @@
if (element instanceof EObject) {
EObject casted = (EObject) element;
- if (GraphitiInternal.getEmfService().isObjectAlive(casted)) {
+ if (casted != null && casted.eResource() != null) {
final EObject eObject = casted.eClass();
- if (GraphitiInternal.getEmfService().isObjectAlive(eObject) && eObject instanceof EClass) {
+ if (eObject instanceof EClass && eObject.eResource() != null) {
EClass eClass = (EClass) eObject;
String className = eClass.getName();
return className + " (" + casted.toString() + ")";
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ColorTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ColorTreeEditPart.java
index 9814ab6..e317769 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ColorTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ColorTreeEditPart.java
@@ -16,7 +16,6 @@
package org.eclipse.graphiti.examples.common.outline.tree;
import org.eclipse.graphiti.mm.algorithms.styles.Color;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
/**
* A default-implementation for a TreeEditPart, which wraps a Shape. It can be
@@ -32,8 +31,8 @@
* @param shape
* The Shape of this EditPart.
*/
- public ColorTreeEditPart(IConfigurationProvider configurationProvider, Color color) {
- super(configurationProvider, color);
+ public ColorTreeEditPart(Color color) {
+ super(color);
}
public Color getColor() {
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ConnectionDecoratorTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ConnectionDecoratorTreeEditPart.java
index 6f01d58..9ef46d1 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ConnectionDecoratorTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/ConnectionDecoratorTreeEditPart.java
@@ -20,7 +20,6 @@
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
/**
* A default-implementation for a TreeEditPart, which wraps a Shape. It can be
@@ -36,8 +35,8 @@
* @param shape
* The Shape of this EditPart.
*/
- public ConnectionDecoratorTreeEditPart(IConfigurationProvider configurationProvider, ConnectionDecorator connectionDecorator) {
- super(configurationProvider, connectionDecorator);
+ public ConnectionDecoratorTreeEditPart(ConnectionDecorator connectionDecorator) {
+ super(connectionDecorator);
}
/**
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/GraphicsAlgorithmTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/GraphicsAlgorithmTreeEditPart.java
index a522d12..a877996 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/GraphicsAlgorithmTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/GraphicsAlgorithmTreeEditPart.java
@@ -18,10 +18,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.graphiti.internal.services.GraphitiInternal;
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
/**
* A default-implementation for a TreeEditPart, which wraps a Shape. It can be
@@ -37,8 +35,8 @@
* @param shape
* The Shape of this EditPart.
*/
- public GraphicsAlgorithmTreeEditPart(IConfigurationProvider configurationProvider, GraphicsAlgorithm graphicsAlgorithm) {
- super(configurationProvider, graphicsAlgorithm);
+ public GraphicsAlgorithmTreeEditPart(GraphicsAlgorithm graphicsAlgorithm) {
+ super(graphicsAlgorithm);
}
/**
@@ -69,7 +67,7 @@
protected List<Object> getModelChildren() {
List<Object> retList = new ArrayList<Object>();
GraphicsAlgorithm graphicsAlgorithm = getGraphicsAlgorithm();
- if (GraphitiInternal.getEmfService().isObjectAlive(graphicsAlgorithm)) {
+ if (graphicsAlgorithm != null && graphicsAlgorithm.eResource() != null) {
final List<GraphicsAlgorithm> graphicsAlgorithmChildren = graphicsAlgorithm.getGraphicsAlgorithmChildren();
addAllElementsIfNotNull(retList, graphicsAlgorithmChildren);
if (graphicsAlgorithm instanceof Polyline) {
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramElementTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramElementTreeEditPart.java
index 404049c..300909d 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramElementTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramElementTreeEditPart.java
@@ -31,7 +31,6 @@
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
/**
* A default-implementation for a TreeEditPart, which wraps a Shape. It can be
@@ -47,8 +46,8 @@
* @param shape
* The Shape of this EditPart.
*/
- public PictogramElementTreeEditPart(IConfigurationProvider configurationProvider, PictogramElement pictogramElement) {
- super(configurationProvider, pictogramElement);
+ public PictogramElementTreeEditPart(PictogramElement pictogramElement) {
+ super(pictogramElement);
}
/**
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramsTreeEditPartFactory.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramsTreeEditPartFactory.java
index 9a30889..436cd69 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramsTreeEditPartFactory.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PictogramsTreeEditPartFactory.java
@@ -16,27 +16,25 @@
package org.eclipse.graphiti.examples.common.outline.tree;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
import org.eclipse.graphiti.mm.algorithms.styles.Color;
import org.eclipse.graphiti.mm.algorithms.styles.Point;
import org.eclipse.graphiti.mm.algorithms.styles.Style;
import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.internal.config.AbstractConfigurationProviderHolder;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
-import org.eclipse.graphiti.ui.internal.config.IEditPartFactory;
/**
* A concrete implementation of the interface IEditPartFactory for Trees, which
* works on a pictogram model.
*/
-public class PictogramsTreeEditPartFactory extends AbstractConfigurationProviderHolder implements IEditPartFactory {
+public class PictogramsTreeEditPartFactory implements EditPartFactory {
/**
* Creates a new PictogramsEditPartFactory.
*/
- public PictogramsTreeEditPartFactory(IConfigurationProvider configurationProvider) {
- super(configurationProvider);
+ public PictogramsTreeEditPartFactory() {
+ super();
}
/*
@@ -46,20 +44,21 @@
* org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,
* java.lang.Object)
*/
+ @Override
public EditPart createEditPart(EditPart context, Object model) {
EditPart ret = null;
if (model instanceof PictogramElement) {
- ret = new PictogramElementTreeEditPart(getConfigurationProvider(), (PictogramElement) model);
+ ret = new PictogramElementTreeEditPart((PictogramElement) model);
} else if (model instanceof GraphicsAlgorithm) {
- ret = new GraphicsAlgorithmTreeEditPart(getConfigurationProvider(), (GraphicsAlgorithm) model);
+ ret = new GraphicsAlgorithmTreeEditPart((GraphicsAlgorithm) model);
} else if (model instanceof ConnectionDecorator) {
- ret = new ConnectionDecoratorTreeEditPart(getConfigurationProvider(), (ConnectionDecorator) model);
+ ret = new ConnectionDecoratorTreeEditPart((ConnectionDecorator) model);
} else if (model instanceof Point) {
- ret = new PointTreeEditPart(getConfigurationProvider(), (Point) model);
+ ret = new PointTreeEditPart((Point) model);
} else if (model instanceof Color) {
- ret = new ColorTreeEditPart(getConfigurationProvider(), (Color) model);
+ ret = new ColorTreeEditPart((Color) model);
} else if (model instanceof Style) {
- ret = new StyleTreeEditPart(getConfigurationProvider(), (Style) model);
+ ret = new StyleTreeEditPart((Style) model);
}
return ret;
}
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PointTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PointTreeEditPart.java
index de27405..6ceb95c 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PointTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/PointTreeEditPart.java
@@ -16,7 +16,6 @@
package org.eclipse.graphiti.examples.common.outline.tree;
import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
/**
* A default-implementation for a TreeEditPart, which wraps a Shape. It can be
@@ -32,8 +31,8 @@
* @param shape
* The Shape of this EditPart.
*/
- public PointTreeEditPart(IConfigurationProvider configurationProvider, Point point) {
- super(configurationProvider, point);
+ public PointTreeEditPart(Point point) {
+ super(point);
}
public Point getPoint() {
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/StyleTreeEditPart.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/StyleTreeEditPart.java
index 8da9f36..fd5d20f 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/StyleTreeEditPart.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/outline/tree/StyleTreeEditPart.java
@@ -20,7 +20,6 @@
import java.util.List;
import org.eclipse.graphiti.mm.algorithms.styles.Style;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
/**
* A default-implementation for a TreeEditPart, which wraps a Shape. It can be
@@ -36,8 +35,8 @@
* @param shape
* The Shape of this EditPart.
*/
- public StyleTreeEditPart(IConfigurationProvider configurationProvider, Style style) {
- super(configurationProvider, style);
+ public StyleTreeEditPart(Style style) {
+ super(style);
}
public Style getStyle() {
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/preference/GraphicsTestPreferencePage.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/preference/GraphicsTestPreferencePage.java
index d55764c..f4543b7 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/preference/GraphicsTestPreferencePage.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/preference/GraphicsTestPreferencePage.java
@@ -32,6 +32,9 @@
/**
* The workbench-preference-page of this Plugin.
*/
+@SuppressWarnings("restriction")
+// The Test preference page is allowed to use the preference settings
+// defined and used in the framework
public class GraphicsTestPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
/**
@@ -87,6 +90,7 @@
label.setText(message);
}
+ @Override
public void init(IWorkbench workbench) {
// nothing to do
}
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/util/Util.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/util/Util.java
index ca7ecbf..d6720e2 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/util/Util.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/util/Util.java
@@ -35,7 +35,6 @@
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal;
/**
* Collection of general static helper methods.
@@ -117,7 +116,9 @@
// This may of course be different in a concrete tool
// implementation, so tool builders should use their own
// way of retrieval here
- Diagram diag = GraphitiUiInternal.getEmfService().getDiagramFromFile(file, rSet);
+ @SuppressWarnings("restriction")
+ Diagram diag = org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal.getEmfService().getDiagramFromFile(
+ file, rSet);
if (diag != null) {
diagrams.add(diag);
} else {
@@ -127,7 +128,8 @@
// use their own logic to browse through their files
// (e.g. known by a special extension or residing in
// a special folder) instead of this generic logic.
- URI uri = GraphitiUiInternal.getEmfService().getFileURI(file, rSet);
+ @SuppressWarnings("restriction")
+ URI uri = org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal.getEmfService().getFileURI(file, rSet);
Resource fileResource = rSet.getResource(uri, true);
if (fileResource != null) {
EList<EObject> contents = fileResource.getContents();