make DiagramEditor and peers public
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java
index bc13ed1..78dedaf 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java
@@ -59,7 +59,7 @@
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.graphiti.services.IPeService;
import org.eclipse.graphiti.testtool.sketch.SketchFeatureProvider;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditor;
+import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal;
import org.eclipse.graphiti.ui.internal.editor.GFFigureCanvas;
import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal;
import org.eclipse.swt.SWT;
@@ -89,13 +89,13 @@
private static IPath DIAGRAMS_FOLDER = SOURCE_FOLDER.append("diagrams");
private class DiagramEditorHolder {
- DiagramEditor diagramEditor;
+ DiagramEditorInternal diagramEditor;
- public DiagramEditor getDiagramEditor() {
+ public DiagramEditorInternal getDiagramEditor() {
return diagramEditor;
}
- public void setDiagramEditor(DiagramEditor diagramEditor2) {
+ public void setDiagramEditor(DiagramEditorInternal diagramEditor2) {
this.diagramEditor = diagramEditor2;
}
}
@@ -168,7 +168,7 @@
}
}
- protected void closeEditor(final DiagramEditor diagramEditor) {
+ protected void closeEditor(final DiagramEditorInternal diagramEditor) {
if (diagramEditor == null) {
return;
@@ -304,7 +304,7 @@
}
}
- protected DiagramEditor openDiagram(final String type) {
+ protected DiagramEditorInternal openDiagram(final String type) {
final DiagramEditorHolder deh = new DiagramEditorHolder();
syncExec(new VoidResult() {
public void run() {
@@ -317,12 +317,12 @@
// use TestUtil to open editor since this waits for late
// initialization
- DiagramEditor diagramEditor = (DiagramEditor) GraphitiUiInternal.getWorkbenchService().openDiagramEditor(newDiagram,
+ DiagramEditorInternal diagramEditor = (DiagramEditorInternal) GraphitiUiInternal.getWorkbenchService().openDiagramEditor(newDiagram,
getTransactionalEditingDomain(), false);
deh.setDiagramEditor(diagramEditor);
}
});
- DiagramEditor diagramEditor = deh.getDiagramEditor();
+ DiagramEditorInternal diagramEditor = deh.getDiagramEditor();
if (ITestConstants.DIAGRAM_TYPE_ID_SKETCH.equals(type)) {
IFeatureProvider featureProvider = diagramEditor.getDiagramTypeProvider().getFeatureProvider();
if (featureProvider instanceof ConfigurableFeatureProviderWrapper) {
@@ -458,7 +458,7 @@
/**
* @param diagramEditor
*/
- protected void shutdownEditor(final DiagramEditor diagramEditor) {
+ protected void shutdownEditor(final DiagramEditorInternal diagramEditor) {
syncExec(new VoidResult() {
public void run() {
// Using SWTBot yields an exception since a keyboard layout file for DE is not available.
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFDialogTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFDialogTests.java
index d6ef3ce..a9c6af2 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFDialogTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFDialogTests.java
@@ -23,7 +23,7 @@
import org.eclipse.graphiti.features.IPrintFeature;
import org.eclipse.graphiti.ui.internal.Messages;
import org.eclipse.graphiti.ui.internal.action.PrintGraphicalViewerAction;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditor;
+import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal;
import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal;
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.printing.Printer;
@@ -49,7 +49,7 @@
// check if default printer is configured, otherwise SWT throws a "no more handles" error in Printer.checkNull(..)
if (Printer.getDefaultPrinterData() != null) {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
asyncExec(new VoidResult() {
public void run() {
IDiagramTypeProvider dtp = diagramEditor.getDiagramTypeProvider();
@@ -76,7 +76,7 @@
@Test
public void testSaveDialog() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
asyncExec(new VoidResult() {
public void run() {
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java
index b0489e1..b6a6cd2 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java
@@ -44,7 +44,7 @@
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.testtool.sketch.SketchFeatureProvider;
import org.eclipse.graphiti.ui.internal.command.CreateModelObjectCommand;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditor;
+import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal;
import org.eclipse.graphiti.ui.internal.editor.GFFigureCanvas;
import org.eclipse.graphiti.ui.internal.policy.ShapeXYLayoutEditPolicy;
import org.eclipse.swt.SWT;
@@ -76,7 +76,7 @@
public void testSelectionTool() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final SWTBotGefEditor ed = getGefEditor();
createClassesAndConnection(x, y, diagramEditor, ed, null);
Thread.sleep(1000);
@@ -94,7 +94,7 @@
public void testMarqueeTool() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final SWTBotGefEditor ed = getGefEditor();
createClassesAndConnection(x, y, diagramEditor, ed, "Marquee");
Thread.sleep(1000);
@@ -120,7 +120,7 @@
public void testGFWFigureCanvas() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -218,7 +218,7 @@
*/
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -302,7 +302,7 @@
public void testContextButtons() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -414,7 +414,7 @@
final int height = 60;
final int DIL = 30;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -498,7 +498,7 @@
public void testDirectEditingMultiText() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -551,7 +551,7 @@
public void testDirectEditingSingleText() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -607,7 +607,7 @@
public void testDropIntoContainer() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -658,7 +658,7 @@
final int yContainer3 = 300;
final int containerSize = 100;
final int rectangleSize = 60;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -756,7 +756,7 @@
public void testCreateConnection() throws Exception {
final int x = 100;
final int y = 100;
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
syncExec(new VoidResult() {
@@ -845,7 +845,7 @@
@Test
public void testSketchAll() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
final GFSWTBotGefEditor ed = (GFSWTBotGefEditor) getGefEditor();
PaletteFinder paletteFinder = new PaletteFinder(diagramEditor.getEditDomain());
List<PaletteEntry> objectCreationTools = paletteFinder.findEntries(new AbstractToolEntryMatcher() {
@@ -886,7 +886,7 @@
shutdownEditor(diagramEditor);
}
- private void createClassesAndConnection(final int x, final int y, final DiagramEditor diagramEditor, final SWTBotGefEditor ed,
+ private void createClassesAndConnection(final int x, final int y, final DiagramEditorInternal diagramEditor, final SWTBotGefEditor ed,
final String toolToActivate) {
syncExec(new VoidResult() {
public void run() {
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java
index cf4a3c7..311104b 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java
@@ -88,12 +88,12 @@
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.ui.editor.DiagramEditorFactory;
+import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
import org.eclipse.graphiti.ui.features.AbstractDrillDownFeature;
import org.eclipse.graphiti.ui.internal.GraphitiUIPlugin;
import org.eclipse.graphiti.ui.internal.command.CreateModelObjectCommand;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditor;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditorFactory;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInput;
+import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal;
import org.eclipse.graphiti.ui.internal.feature.DebugFeature;
import org.eclipse.graphiti.ui.internal.figures.ColoredArea;
import org.eclipse.graphiti.ui.internal.figures.ColoredLocation;
@@ -201,7 +201,7 @@
@Test
public void testOnEcoreDiagram() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
syncExec(new VoidResult() {
public void run() {
@@ -258,7 +258,7 @@
// @Test
public void xxtestUndoRedo() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
syncExec(new VoidResult() {
public void run() {
@@ -303,7 +303,7 @@
@Test
public void testAbstractDrillDownFeature() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
Object rootModelObject = diagramEditor.getGraphicalViewer().getContents().getModel();
assertTrue(rootModelObject instanceof Diagram);
Diagram diagram = (Diagram) rootModelObject;
@@ -380,7 +380,7 @@
@Test
public void testOnPatternDiagram() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_PATTERN);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_PATTERN);
final IDiagramTypeProvider dtp = diagramEditor.getDiagramTypeProvider();
syncExec(new VoidResult() {
@@ -431,11 +431,11 @@
@Test
public void testPlatformUtil() throws Exception {
- final DiagramEditor ed = syncExec(new Result<DiagramEditor>() {
- public DiagramEditor run() {
+ final DiagramEditorInternal ed = syncExec(new Result<DiagramEditorInternal>() {
+ public DiagramEditorInternal run() {
final Diagram newDiagram = createDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
assertTrue("create diagram does not work", newDiagram != null);
- return (DiagramEditor) GraphitiUiInternal.getWorkbenchService().openDiagramEditor(newDiagram,
+ return (DiagramEditorInternal) GraphitiUiInternal.getWorkbenchService().openDiagramEditor(newDiagram,
getTransactionalEditingDomain(), false);
}
});
@@ -451,7 +451,7 @@
@Test
public void testOnSketchDiagram() throws Exception {
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_SKETCH);
syncExec(new VoidResult() {
public void run() {
@@ -1002,8 +1002,8 @@
public Integer run() {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
- IEditorPart ed = IDE.openEditor(page, diagFile, DiagramEditor.DIAGRAM_EDITOR_ID);
- assertTrue("Editor must be a diagram editor: " + ed, ed instanceof DiagramEditor);
+ IEditorPart ed = IDE.openEditor(page, diagFile, DiagramEditorInternal.DIAGRAM_EDITOR_ID);
+ assertTrue("Editor must be a diagram editor: " + ed, ed instanceof DiagramEditorInternal);
} catch (PartInitException e) {
fail(e.getMessage());
}
@@ -1022,8 +1022,8 @@
try {
IEditorInput input = DiagramEditorInput.createEditorInput(diagram, domain, GraphitiUi.getExtensionManager()
.getDiagramTypeProviderId(diagram.getDiagramTypeId()), false);
- IEditorPart ed = IDE.openEditor(page, input, DiagramEditor.DIAGRAM_EDITOR_ID);
- assertTrue("Editor must be a diagram editor: " + ed, ed instanceof DiagramEditor);
+ IEditorPart ed = IDE.openEditor(page, input, DiagramEditorInternal.DIAGRAM_EDITOR_ID);
+ assertTrue("Editor must be a diagram editor: " + ed, ed instanceof DiagramEditorInternal);
} catch (PartInitException e) {
fail(e.getMessage());
}
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java
index 113569c..5388a1a 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java
@@ -71,7 +71,7 @@
import org.eclipse.graphiti.ui.features.DefaultFeatureProvider;
import org.eclipse.graphiti.ui.internal.GraphitiUIPlugin;
import org.eclipse.graphiti.ui.internal.ImagePool;
-import org.eclipse.graphiti.ui.internal.editor.DiagramEditor;
+import org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal;
import org.eclipse.graphiti.ui.internal.editor.GFMarqueeSelectionTool;
import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal;
import org.eclipse.graphiti.ui.internal.util.clipboard.ModelClipboard;
@@ -100,7 +100,7 @@
@Test
public void testGraphitiUi() throws Exception {
- String id = DiagramEditor.DIAGRAM_EDITOR_ID;
+ String id = DiagramEditorInternal.DIAGRAM_EDITOR_ID;
assertNotNull(id);
assertTrue(!("".equals(id)));
assertNotNull(GraphitiUIPlugin.getDefault());
@@ -141,7 +141,7 @@
assertNotNull(myConfigurableFeatureProviderWrapper.getAddFeature(addContext));
//test canLayout
- DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
PictogramElement pe = getPictogramElement(diagramEditor);
LayoutContext layoutContext = new LayoutContext(pe);
assertFalse(myConfigurableFeatureProviderWrapper.canLayout(layoutContext).toBoolean());
@@ -195,7 +195,7 @@
String s = null;
TestDiagramTypeProvider myDiagramTypeProvider = new TestDiagramTypeProvider();
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final Diagram diagram = diagramEditor.getDiagramTypeProvider().getDiagram();
myDiagramTypeProvider.init(diagram, diagramEditor);
PictogramElement pe = getPictogramElement(diagramEditor);
@@ -341,7 +341,7 @@
closeEditor(diagramEditor);
}
- private PictogramElement getPictogramElement(DiagramEditor diagramEditor) {
+ private PictogramElement getPictogramElement(DiagramEditorInternal diagramEditor) {
Diagram diagram = diagramEditor.getDiagramTypeProvider().getDiagram();
addClassesAndReferencesToDiagram(diagramEditor);
@@ -353,7 +353,7 @@
return pe;
}
- private void addClassesAndReferencesToDiagram(final DiagramEditor diagramEditor) {
+ private void addClassesAndReferencesToDiagram(final DiagramEditorInternal diagramEditor) {
syncExec(new VoidResult() {
public void run() {
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
@@ -471,7 +471,7 @@
expect(diagramMock.getConnections()).andReturn(connections).anyTimes();
replay(diagramMock);
- final DiagramEditor diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
+ final DiagramEditorInternal diagramEditor = openDiagram(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final Diagram diagram = diagramEditor.getDiagramTypeProvider().getDiagram();
syncExec(new VoidResult() {