diff options
author | Martin Fluegge | 2010-08-16 19:02:50 +0000 |
---|---|---|
committer | Martin Fluegge | 2010-08-16 19:02:50 +0000 |
commit | 4f4858e5bf322975962a943485b15bc8f3c8e564 (patch) | |
tree | cef00cecef15627308a390482db1cbb92237bef8 /plugins | |
parent | dbf095a1a006074e7ef15bd29bfe033d42bdba78 (diff) | |
download | cdo-4f4858e5bf322975962a943485b15bc8f3c8e564.tar.gz cdo-4f4858e5bf322975962a943485b15bc8f3c8e564.tar.xz cdo-4f4858e5bf322975962a943485b15bc8f3c8e564.zip |
[320193] [Dawn] Provide a flexible testing environment for UI tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=320193
Diffstat (limited to 'plugins')
24 files changed, 2266 insertions, 143 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawn.launch b/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawn.launch new file mode 100644 index 0000000000..4adfcd682e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawn.launch @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawn.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.dawn.tests.AllTestsDawn"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.dawn.tests"/> +</launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawnUI.launch b/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawnUI.launch new file mode 100644 index 0000000000..dc0e97d134 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawnUI.launch @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="askclear" value="false"/> +<booleanAttribute key="automaticAdd" value="true"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="true"/> +<booleanAttribute key="clearws" value="true"/> +<booleanAttribute key="clearwslog" value="false"/> +<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> +<booleanAttribute key="default" value="true"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawnUI.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.dawn.tests.AllTestsDawnUI"/> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.dawn.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.platform.ide"/> +<booleanAttribute key="run_in_ui_thread" value="true"/> +<booleanAttribute key="show_selected_only" value="false"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useCustomFeatures" value="false"/> +<booleanAttribute key="useDefaultConfig" value="true"/> +<booleanAttribute key="useDefaultConfigArea" value="false"/> +<booleanAttribute key="useProduct" value="true"/> +</launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawnUISWTBot.launch b/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawnUISWTBot.launch new file mode 100644 index 0000000000..cf29a7e9f7 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/AllTestsDawnUISWTBot.launch @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig"> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="askclear" value="false"/> +<booleanAttribute key="automaticAdd" value="true"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="true"/> +<booleanAttribute key="clearws" value="true"/> +<booleanAttribute key="clearwslog" value="false"/> +<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> +<booleanAttribute key="default" value="true"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawnUISWTBot.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.dawn.tests.AllTestsDawnUISWTBot"/> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.dawn.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.platform.ide"/> +<booleanAttribute key="show_selected_only" value="false"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useCustomFeatures" value="false"/> +<booleanAttribute key="useDefaultConfig" value="true"/> +<booleanAttribute key="useDefaultConfigArea" value="false"/> +<booleanAttribute key="useProduct" value="true"/> +</launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnTest.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnTest.java index d8352dbc82..465909842e 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnTest.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnTest.java @@ -17,7 +17,6 @@ import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.tests.AbstractCDOTest; import org.eclipse.emf.cdo.transaction.CDOTransaction; import org.eclipse.emf.cdo.util.CommitException; -import org.eclipse.emf.cdo.view.CDOView; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EPackage; @@ -35,7 +34,7 @@ import java.net.URL; /** * @author Martin Fluegge */ -public class AbstractDawnTest extends AbstractCDOTest +public abstract class AbstractDawnTest extends AbstractCDOTest { @Override public void setUp() throws Exception @@ -53,7 +52,6 @@ public class AbstractDawnTest extends AbstractCDOTest protected void createCDOResourcesFromXMI(String resourceName, EPackage ePackage, CDOSession session) throws CommitException { - NotationPackage.eINSTANCE.getClass(); String packageName = ePackage.getName(); ResourceSet resourceSet = new ResourceSetImpl(); @@ -62,9 +60,6 @@ public class AbstractDawnTest extends AbstractCDOTest resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(packageName, new XMIResourceFactoryImpl()); - System.out.println(GMFTest.class.getResource(".")); - System.out.println(GMFTest.class.getResource("/")); - URL resourceURI = GMFTest.class.getResource(""); String resourcePath = resourceURI.toString().substring(0, resourceURI.toString().lastIndexOf("/bin")); @@ -93,14 +88,4 @@ public class AbstractDawnTest extends AbstractCDOTest transaction.commit(); transaction.close(); } - - protected boolean resourceExists(String resourcePath) - { - CDOSession session = openSession(); - CDOView view = session.openView(); - - CDOResource resource = view.getResource(resourcePath); - - return resource != null ? true : false; - } } diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnUITest.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnUITest.java index de6a7354c7..7a9bcd4ba7 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnUITest.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AbstractDawnUITest.java @@ -14,109 +14,30 @@ import org.eclipse.emf.cdo.dawn.ui.DawnEditorInput; import org.eclipse.emf.cdo.dawn.ui.helper.EditorDescriptionHelper; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.tests.ui.AbstractCDOUITest; import org.eclipse.emf.cdo.view.CDOView; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swtbot.swt.finder.SWTBot; +import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor; import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; -import org.eclipse.swtbot.swt.finder.keyboard.Keyboard; -import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory; -import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes; import org.eclipse.swtbot.swt.finder.results.VoidResult; import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences; -import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; -import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; /** * @author Martin Fluegge */ -public class AbstractDawnUITest extends AbstractDawnTest +public abstract class AbstractDawnUITest extends AbstractCDOUITest// AbstractDawnTest { @Override public void setUp() throws Exception { - super.setUp(); SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; - SWTBotPreferences.SCREENSHOTS_DIR = System.getProperty("java.io.tmpdir") + "/dawntests"; - } - - protected void closeAllEditors() - { - UIThreadRunnable.syncExec(new VoidResult() - { - public void run() - { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); - } - }); - } - - protected void resetWorkbench() - { - UIThreadRunnable.syncExec(new VoidResult() - { - public void run() - { - try - { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - Shell activeShell = Display.getCurrent().getActiveShell(); - - if (activeShell != workbenchWindow.getShell()) - { - activeShell.close(); - } - - page.closeAllEditors(false); - page.resetPerspective(); - - String defaultPerspectiveId = workbench.getPerspectiveRegistry().getDefaultPerspective(); - workbench.showPerspective(defaultPerspectiveId, workbenchWindow); - - page.resetPerspective(); - } - catch (WorkbenchException e) - { - throw new RuntimeException(e); - } - } - }); - } - - /** - * walks true the tree and selects the first element which matches the name - */ - protected void selectFolder(SWTBotTreeItem[] items, String name, boolean exactMatch) - { - for (SWTBotTreeItem item : items) - { - if (exactMatch) - { - if (item.getText().equals(name)) - { - item.select(); - return; - } - } - else - { - if (item.getText().contains(name)) - { - item.select(); - return; - } - } - item.expand(); - selectFolder(item.getItems(), name, exactMatch); - } + SWTBotPreferences.SCREENSHOTS_DIR = DawnTestPlatform.instance.getTestFolder(); + super.setUp(); } /** @@ -158,11 +79,33 @@ public class AbstractDawnUITest extends AbstractDawnTest }); } - protected void typeTextToFocusedWidget(String text, SWTBot bot) + protected boolean resourceExists(String resourcePath) + { + CDOSession session = openSession(); + CDOView view = session.openView(); + + CDOResource resource = view.getResource(resourcePath); + + return resource != null ? true : false; + } + + protected void createNode(String type, int xPosition, int yPosition, SWTGefBot bot, SWTBotGefEditor editor) + { + editor.activateTool(type); + editor.click(xPosition, yPosition); + } + + protected void createNodeWithLabel(String type, int xPosition, int yPosition, String labelText, SWTGefBot bot, + SWTBotGefEditor editor) + { + createNode(type, xPosition, yPosition, bot, editor); + typeTextToFocusedWidget(labelText, bot, true); + } + + protected void createEdge(String type, int fromXPosition, int fromYPosition, int toXPosition, int toYPosition, + SWTBotGefEditor editor) { - Keyboard keyboard = KeyboardFactory.getSWTKeyboard(); - bot.getFocusedWidget(); - keyboard.typeText(text, 100); - keyboard.pressShortcut(Keystrokes.CR); + editor.activateTool(type); + editor.drag(fromXPosition, fromYPosition, toXPosition, toYPosition); } } diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawn.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawn.java index ecabd37dbd..f980a9c018 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawn.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawn.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.cdo.dawn.tests; +import org.eclipse.emf.cdo.dawn.tests.common.DawnCodeGenGMFFragmentTest; import org.eclipse.emf.cdo.dawn.tests.common.DawnWrapperResourceTest; import org.eclipse.emf.cdo.dawn.tests.common.GMFTest; import org.eclipse.emf.cdo.dawn.tests.common.TestFrameworkTest; @@ -22,7 +23,9 @@ import junit.framework.Test; import junit.framework.TestSuite; /** - * @author Martin Fluegge This test suite should be run as plain JUnit test. + * This test suite should be executed as plain JUnit test. + * + * @author Martin Fluegge */ public class AllTestsDawn extends AllTests { @@ -37,6 +40,7 @@ public class AllTestsDawn extends AllTests testClasses.add(TestFrameworkTest.class); testClasses.add(GMFTest.class); testClasses.add(DawnWrapperResourceTest.class); + testClasses.add(DawnCodeGenGMFFragmentTest.class); } @Override diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsUI.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawnUI.java index ef256006c6..6cf174745e 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsUI.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawnUI.java @@ -21,13 +21,15 @@ import junit.framework.Test; import junit.framework.TestSuite; /** - * @author Martin Fluegge This test suite should be run as JUnit Plug-in test. + * This test suite should be executed as JUnit Plug-in test. + * + * @author Martin Fluegge */ -public class AllTestsUI extends AllTests +public class AllTestsDawnUI extends AllTests { public static Test suite() { - return new AllTestsUI().getTestSuite(AllTests.class.getName()); + return new AllTestsDawnUI().getTestSuite(AllTests.class.getName()); } @Override diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsUISWTBot.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawnUISWTBot.java index 6dd867d634..3de89051bb 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsUISWTBot.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/AllTestsDawnUISWTBot.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.cdo.dawn.tests; +import org.eclipse.emf.cdo.dawn.tests.bugzillas.Bugzilla_321024_Test; import org.eclipse.emf.cdo.dawn.tests.ui.DawnCreationWizardSWTBotTest; import org.eclipse.emf.cdo.dawn.tests.ui.MultipleResourcesTest; import org.eclipse.emf.cdo.dawn.tests.ui.SimpleDiagramTest; @@ -19,12 +20,14 @@ import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; /** - * This test suite should be run as SWTBot test. + * This test suite should be executed as SWTBot test. * * @author Martin Fluegge */ @RunWith(Suite.class) -@SuiteClasses({ DawnCreationWizardSWTBotTest.class, SimpleDiagramTest.class, MultipleResourcesTest.class }) -public class AllTestsUISWTBot +@SuiteClasses({ DawnCreationWizardSWTBotTest.class, SimpleDiagramTest.class, MultipleResourcesTest.class, + Bugzilla_321024_Test.class }) +public class AllTestsDawnUISWTBot { + } diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/DawnTestPlatform.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/DawnTestPlatform.java new file mode 100644 index 0000000000..6b2d6f14a2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/DawnTestPlatform.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.tests; + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Date; + +/** + * @author Martin Fluegge + */ +public class DawnTestPlatform +{ + public static DawnTestPlatform instance = new DawnTestPlatform(); + + private String tempTestFolder = ""; + + private String resourcesFolderName = "testdata"; + + public DawnTestPlatform() + { + tempTestFolder = System.getProperty("java.io.tmpdir") + "/dawntests/test_" + new Date().getTime(); + } + + public String getTestFolder() + { + return tempTestFolder; + } + + public File getTestResource(String path) throws URISyntaxException + { + File file = new File(getTestResourceURI(path)); + return file; + } + + public java.net.URI getTestResourceURI(String path) throws URISyntaxException + { + String testFolder = getBundlePathForClass(AbstractDawnTest.class); + + String separator = path.startsWith("/") ? "" : "/"; + + java.net.URI uri = new java.net.URI(testFolder + "/" + resourcesFolderName + separator + path); + return uri; + } + + public String getBundlePathForClass(Class<?> clazz) throws URISyntaxException + { + URL resourceURI = clazz.getResource(""); + return resourceURI.toString().substring(0, resourceURI.toString().lastIndexOf("/bin")); + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/common/DawnCodeGenGMFFragmentTest.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/common/DawnCodeGenGMFFragmentTest.java new file mode 100644 index 0000000000..cc90020521 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/common/DawnCodeGenGMFFragmentTest.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.tests.common; + +import org.eclipse.emf.cdo.dawn.codegen.creators.impl.GMFFragmentCreator; +import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.DawnAcoreDiagramEditor; +import org.eclipse.emf.cdo.dawn.tests.AbstractDawnTest; +import org.eclipse.emf.cdo.dawn.tests.DawnTestPlatform; + +import org.eclipse.emf.mwe.core.WorkflowRunner; +import org.eclipse.emf.mwe.core.monitor.NullProgressMonitor; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.net.URI; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Martin Fluegge + */ +public class DawnCodeGenGMFFragmentTest extends AbstractDawnTest +{ + public void testCodeGeneration() throws Exception + { + Map<String, ?> slotMap = new HashMap<String, Object>(); + + Map<String, String> properties = new HashMap<String, String>(); + File dawnGenFile = DawnTestPlatform.instance.getTestResource("/model/acore.dawngenmodel"); + + String ouputFolder = DawnTestPlatform.instance.getTestFolder(); + + properties.put("model", dawnGenFile.toURI().toString()); + properties.put("src-gen", ouputFolder); + + WorkflowRunner workflowRunner = new WorkflowRunner(); + String workflowPath = getWorkflowPath("workflow/gmfFragmentGenerator.oaw");// FileLocator.toFileURL(workFlowURL).getFile(); + System.out.println(workflowPath); + + workflowRunner.run(workflowPath, new NullProgressMonitor(), properties, slotMap); + + String outputFolder = DawnTestPlatform.instance.getTestFolder(); + String diagramFolder = ouputFolder + "/" + "src/org/eclipse/emf/cdo/dawn/examples/acore/diagram"; + + assertEquals(true, new File(outputFolder + "/META-INF/Manifest.MF").exists()); + assertEquals(true, new File(diagramFolder + "/edit/").exists()); + assertEquals(true, new File(diagramFolder + "/edit/parts/DawnAcoreEditPartFactory.java").exists()); + assertEquals(true, new File(diagramFolder + "/edit/parts/DawnACoreRootEditPart.java").exists()); + assertEquals(true, new File(diagramFolder + "/edit/policies/DawnACoreRootCanonicalEditPolicy.java").exists()); + + assertEquals(true, new File(diagramFolder + "/part/").exists()); + assertEquals(true, new File(diagramFolder + "/part/DawnAcoreCreationWizard.java").exists()); + assertEquals(true, new File(diagramFolder + "/part/DawnAcoreDiagramEditor.java").exists()); + assertEquals(true, new File(diagramFolder + "/part/DawnAcoreDiagramEditorUtil.java").exists()); + assertEquals(true, new File(diagramFolder + "/part/DawnAcoreDocumentProvider.java").exists()); + + assertEquals(true, new File(diagramFolder + "/providers/").exists()); + assertEquals(true, new File(diagramFolder + "/providers/DawnAcoreEditPartProvider.java").exists()); + assertEquals(true, new File(diagramFolder + "/providers/DawnAcoreEditPolicyProvider.java").exists()); + basicCompare(new File(new URI(DawnTestPlatform.instance.getBundlePathForClass(DawnAcoreDiagramEditor.class) + + ".dawn/src/")), new File(outputFolder + "/src")); + } + + /** + * check whether the generated folder contains the same files as the reference editor + * + * @throws IOException + */ + private void basicCompare(File reference, File expected) throws IOException + { + if (reference.getName().endsWith("CVS")) + { + return; + } + msg(reference + " <---> " + expected); + assertEquals(true, reference.exists()); + assertEquals(true, expected.exists()); + if (reference.isFile()) + { + // assertEquals(true, FileCompare.compare(reference, expected)); + if (!FileCompare.compare(reference, expected)) + { + fail("not equal: " + reference.getName()); + } + } + else if (reference.isDirectory()) + { + for (File child : reference.listFiles()) + { + // TODO: fix the problematic files + // if (child.getName().equals("DawnAcoreCreationWizard.java")) + // { + // continue; + // } + basicCompare(child, new File(expected + "/" + child.getName())); + } + } + } + + private String getWorkflowPath(String subPath) + { + URL resource = GMFFragmentCreator.class.getResource(""); + + String packagePath = GMFFragmentCreator.class.getPackage().getName().replace(".", "/"); + System.out.println(packagePath); + String path = resource.toString().replace(packagePath, ""); + return path + subPath; + } + + private static class FileCompare + { + public static boolean compare(File reference, File expected) throws IOException + { + String referenceContent = FileCompare.getContent(reference); + String compareContent = FileCompare.getContent(expected); + + msg("REF.) " + referenceContent); + msg("EXP.) " + compareContent); + + return referenceContent.equals(compareContent); + } + + private static String getContent(File file) throws java.io.IOException + { + StringBuffer buffer = new StringBuffer(); + BufferedReader reader = new BufferedReader(new FileReader(file)); + String line = ""; + + while ((line = reader.readLine()) != null) + { + if (isValid(line.trim())) + { + buffer.append(replaceWhiteSpace(line)); + } + } + + reader.close(); + return buffer.toString(); + } + + private static Object replaceWhiteSpace(String line) + { + return line.replace(" ", "").replace("\t", ""); + } + + private static boolean isValid(String line) + { + if (line.contains("AcoreDiagramEditorPlugin.getInstance().logInfo") || line.equals("") || line.startsWith("*") + || line.equals("import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorPlugin;") + | line.startsWith("/*") || line.startsWith("//") || line.contains("@")) + { + return false; + } + + return true; + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/DawnCreationWizardSWTBotTest.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/DawnCreationWizardSWTBotTest.java index 2957af79c4..eeb1afd700 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/DawnCreationWizardSWTBotTest.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/DawnCreationWizardSWTBotTest.java @@ -11,6 +11,7 @@ package org.eclipse.emf.cdo.dawn.tests.ui; import org.eclipse.emf.cdo.dawn.tests.AbstractDawnUITest; +import org.eclipse.emf.cdo.dawn.tests.ui.util.DawnSWTBotUtil; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.transaction.CDOTransaction; @@ -47,7 +48,7 @@ public class DawnCreationWizardSWTBotTest extends AbstractDawnUITest public static void beforeClass() throws Exception { bot = new SWTGefBot(); - bot.viewByTitle("Welcome").close(); + DawnSWTBotUtil.initTest(bot); } @Override @@ -61,7 +62,6 @@ public class DawnCreationWizardSWTBotTest extends AbstractDawnUITest @After public void tearDown() throws Exception { - closeAllEditors(); super.tearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/MultipleResourcesTest.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/MultipleResourcesTest.java index c7f4dbd4a4..e28730466f 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/MultipleResourcesTest.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/MultipleResourcesTest.java @@ -82,7 +82,7 @@ public class MultipleResourcesTest extends AbstractDawnUITest editor.activateTool(A_CLASS); editor.click(100, 100); - typeTextToFocusedWidget("A", bot); + typeTextToFocusedWidget("A", bot, true); editor.saveAndClose(); // editor.save(); @@ -112,11 +112,11 @@ public class MultipleResourcesTest extends AbstractDawnUITest editor.activateTool(A_CLASS); editor.click(100, 100); - typeTextToFocusedWidget("B", bot); + typeTextToFocusedWidget("B", bot, true); editor.activateTool(A_CLASS); editor.click(300, 300); - typeTextToFocusedWidget("C", bot); + typeTextToFocusedWidget("C", bot, true); editor.click(200, 200); editor.saveAndClose(); diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/SimpleDiagramTest.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/SimpleDiagramTest.java index a74141a13a..6a72802983 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/SimpleDiagramTest.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/SimpleDiagramTest.java @@ -10,34 +10,44 @@ */ package org.eclipse.emf.cdo.dawn.tests.ui; +import org.eclipse.emf.cdo.dawn.examples.acore.AAttribute; import org.eclipse.emf.cdo.dawn.examples.acore.AClass; import org.eclipse.emf.cdo.dawn.examples.acore.ACoreRoot; +import org.eclipse.emf.cdo.dawn.examples.acore.AInterface; +import org.eclipse.emf.cdo.dawn.examples.acore.AOperation; +import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart; import org.eclipse.emf.cdo.dawn.tests.AbstractDawnUITest; +import org.eclipse.emf.cdo.dawn.tests.ui.util.DawnAcoreTestUtil; import org.eclipse.emf.cdo.dawn.tests.ui.util.DawnSWTBotUtil; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.view.CDOView; +import org.eclipse.emf.common.util.EList; + import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart; import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; -import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; +import org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher; +import org.hamcrest.Description; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import java.util.ArrayList; +import java.util.List; + /** * @author Martin Fluegge */ @RunWith(SWTBotJunit4ClassRunner.class) public class SimpleDiagramTest extends AbstractDawnUITest { - private static final String A_CLASS = "AClass"; - private static SWTGefBot bot; @BeforeClass @@ -65,40 +75,68 @@ public class SimpleDiagramTest extends AbstractDawnUITest @Test public void createNewDawnDiagramAndAddElements() throws Exception { - bot.menu("File").menu("New").menu("Other...").click(); + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); + assertNotNull(editor); + + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 100, 100, "A", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 250, 100, "B", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 150, 250, "C", bot, editor); + + editor.saveAndClose(); + + { + CDOSession session = openSession(); + CDOView view = session.openView(); - SWTBotShell shell = bot.shell("New"); - shell.activate(); - bot.tree().expandNode("Dawn Examples").select("Dawn Acore Diagram"); - bot.button("Next >").click(); - bot.button("Finish").click(); + CDOResource diagramResource = view.getResource("/default.acore_diagram"); + // TODO: Fix this naming after BUG 321024 is solved. + CDOResource semanticResource = view.getResource("/default.acore"); + + assertNotNull(diagramResource); + assertNotNull(semanticResource); + Diagram diagram = (Diagram)diagramResource.getContents().get(0); + ACoreRoot semanticRoot = (ACoreRoot)semanticResource.getContents().get(0); + + assertEquals(3, diagram.getChildren().size()); + assertEquals(3, semanticRoot.getClasses().size()); - SWTBotGefEditor editor = bot.gefEditor("default.acore_diagram"); + Character name = 'A'; + + for (AClass aClass : semanticRoot.getClasses()) + { + assertEquals(name.toString(), aClass.getName()); + name++; + } + } + } + + @Test + public void createNewDawnDiagramAndAddElementsWithEdges() throws Exception + { + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); assertNotNull(editor); - editor.activateTool(A_CLASS); - editor.click(100, 100); - typeTextToFocusedWidget("A", bot); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 100, 100, "A", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 250, 100, "B", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 150, 250, "C", bot, editor); - editor.activateTool(A_CLASS); - // editor.drag(400, 50, 450, 100); - editor.click(250, 100); - typeTextToFocusedWidget("B", bot); + createEdge(DawnAcoreTestUtil.CONNECTION_IHERITS, 100, 100, 250, 100, editor); + createEdge(DawnAcoreTestUtil.CONNECTION_IHERITS, 100, 100, 150, 250, editor); - editor.activateTool(A_CLASS); - // editor.drag(250, 250, 100, 100); - editor.click(150, 250); - typeTextToFocusedWidget("C", bot); + List<SWTBotGefEditPart> connectionEditParts = getAllConnections(editor); - editor.saveAndClose(); + assertEquals(2, connectionEditParts.size()); + + editor.save(); { CDOSession session = openSession(); CDOView view = session.openView(); CDOResource diagramResource = view.getResource("/default.acore_diagram"); + // TODO: Fix this naming after BUG 321024 is solved. - CDOResource semanticResource = view.getResource("/default."); + CDOResource semanticResource = view.getResource("/default.acore"); assertNotNull(diagramResource); assertNotNull(semanticResource); @@ -115,6 +153,244 @@ public class SimpleDiagramTest extends AbstractDawnUITest assertEquals(name.toString(), aClass.getName()); name++; } + view.close(); + // session.close(); } + + // for (SWTBotGefEditPart ep : connectionEditParts) + // { + // ConnectionEditPart connectionEditPart = (ConnectionEditPart)ep.part(); + // Connection connection = (Connection)connectionEditPart.getFigure(); + // + // Point midpoint = connection.getPoints().getMidpoint().getCopy(); + // + // editor.click(midpoint.x, midpoint.y); + // editor.drag(midpoint.x, midpoint.y, 0, 20); + // } + // editor.save(); + // editor.close(); + } + + @Test + public void testAClassWithAttributes() throws Exception + { + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 100, 100, "A", bot, editor); + + editor.activateTool(DawnAcoreTestUtil.A_ATTRIBUTE); + editor.click(100, 100); + + typeTextToFocusedWidget("public foo:int", bot, true); + editor.save(); + + { + CDOSession session = openSession(); + CDOView view = session.openView(); + + CDOResource diagramResource = view.getResource("/default.acore_diagram"); + + // TODO: Fix this naming after BUG 321024 is solved. + CDOResource semanticResource = view.getResource("/default.acore"); + + assertNotNull(diagramResource); + assertNotNull(semanticResource); + Diagram diagram = (Diagram)diagramResource.getContents().get(0); + ACoreRoot semanticRoot = (ACoreRoot)semanticResource.getContents().get(0); + + assertEquals(1, diagram.getChildren().size()); + + AClass aClass = semanticRoot.getClasses().get(0); + + assertEquals(1, aClass.getAttributes().size()); + + AAttribute aAttribute = aClass.getAttributes().get(0); + + assertEquals("public", aAttribute.getAccessright().toString()); + assertEquals("int", aAttribute.getDataType().toString()); + assertEquals("foo", aAttribute.getName()); + } + } + + @Test + public void testAClassWithOperations() throws Exception + { + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 100, 100, "A", bot, editor); + + editor.activateTool(DawnAcoreTestUtil.A_OPERATION); + editor.click(100, 100); + + typeTextToFocusedWidget("public foo():int", bot, true); + editor.save(); + { + CDOSession session = openSession(); + CDOView view = session.openView(); + + CDOResource diagramResource = view.getResource("/default.acore_diagram"); + + // TODO: Fix this naming after BUG 321024 is solved. + CDOResource semanticResource = view.getResource("/default.acore"); + + assertNotNull(diagramResource); + assertNotNull(semanticResource); + Diagram diagram = (Diagram)diagramResource.getContents().get(0); + ACoreRoot semanticRoot = (ACoreRoot)semanticResource.getContents().get(0); + + assertEquals(1, diagram.getChildren().size()); + + AClass aClass = semanticRoot.getClasses().get(0); + + assertEquals(1, aClass.getOperations().size()); + + AOperation aOperation = aClass.getOperations().get(0); + assertEquals("foo", aOperation.getName()); + assertEquals("public", aOperation.getAccessright().toString()); + assertEquals("int", aOperation.getDataType().toString()); + } + } + + @Test + public void testAInterfaceWithOperations() throws Exception + { + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); + createNodeWithLabel(DawnAcoreTestUtil.A_INTERFACE, 100, 100, "A", bot, editor); + + editor.activateTool(DawnAcoreTestUtil.A_OPERATION); + editor.click(100, 100); + + typeTextToFocusedWidget("public foo():int", bot, true); + + editor.save(); + { + CDOSession session = openSession(); + CDOView view = session.openView(); + + CDOResource diagramResource = view.getResource("/default.acore_diagram"); + + // TODO: Fix this naming after BUG 321024 is solved. + CDOResource semanticResource = view.getResource("/default.acore"); + + assertNotNull(diagramResource); + assertNotNull(semanticResource); + Diagram diagram = (Diagram)diagramResource.getContents().get(0); + ACoreRoot semanticRoot = (ACoreRoot)semanticResource.getContents().get(0); + + assertEquals(1, diagram.getChildren().size()); + + AInterface aInterface = semanticRoot.getInterfaces().get(0); + + AOperation aOperation = aInterface.getOperations().get(0); + assertEquals("foo", aOperation.getName()); + assertEquals("public", aOperation.getAccessright().toString()); + assertEquals("int", aOperation.getDataType().toString()); + } + } + + @Test + public void testConnections() throws Exception + { + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); + assertNotNull(editor); + + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 100, 100, "A", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 300, 100, "B", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 100, 300, "C", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_CLASS, 300, 300, "D", bot, editor); + createNodeWithLabel(DawnAcoreTestUtil.A_INTERFACE, 200, 200, "Interface", bot, editor); + + createEdge(DawnAcoreTestUtil.CONNECTION_IHERITS, 100, 100, 300, 100, editor); + createEdge(DawnAcoreTestUtil.CONNECTION_ASSOCIATION, 310, 110, 310, 310, editor); + createEdge(DawnAcoreTestUtil.CONNECTION_COMPOSITION, 300, 300, 100, 300, editor); + createEdge(DawnAcoreTestUtil.CONNECTION_AGGREGATION, 100, 300, 100, 100, editor); + createEdge(DawnAcoreTestUtil.CONNECTION_IMPLEMENTS, 100, 100, 200, 200, editor); + + List<SWTBotGefEditPart> connectionEditParts = getAllConnections(editor); + + assertEquals(5, connectionEditParts.size()); + + editor.save(); + + { + CDOSession session = openSession(); + CDOView view = session.openView(); + + CDOResource diagramResource = view.getResource("/default.acore_diagram"); + + // TODO: Fix this naming after BUG 321024 is solved. + CDOResource semanticResource = view.getResource("/default.acore"); + + assertNotNull(diagramResource); + assertNotNull(semanticResource); + Diagram diagram = (Diagram)diagramResource.getContents().get(0); + ACoreRoot semanticRoot = (ACoreRoot)semanticResource.getContents().get(0); + + assertEquals(5, diagram.getChildren().size()); + assertEquals(4, semanticRoot.getClasses().size()); + assertEquals(1, semanticRoot.getInterfaces().size()); + + AClass A = semanticRoot.getClasses().get(0); + AClass B = semanticRoot.getClasses().get(1); + AClass C = semanticRoot.getClasses().get(2); + AClass D = semanticRoot.getClasses().get(3); + + // A + EList<AInterface> implementedInterfaces = A.getImplementedInterfaces(); + assertEquals(1, implementedInterfaces.size()); + assertEquals(implementedInterfaces.get(0), semanticRoot.getInterfaces().get(0)); + assertEquals(1, A.getSubClasses().size()); + assertEquals(B, A.getSubClasses().get(0)); + + // B + assertEquals(1, B.getAssociations().size()); + assertEquals(D, B.getAssociations().get(0)); + + // C + assertEquals(1, C.getAggregations().size()); + assertEquals(A, C.getAggregations().get(0)); + + // D + assertEquals(1, D.getCompositions().size()); + assertEquals(C, D.getCompositions().get(0)); + view.close(); + // session.close(); + } + + editor.close(); + } + + @Test + public void testExceptionOnClose() throws Exception + { + SWTBotGefEditor editor = DawnAcoreTestUtil.openNewAcoreEditor("default.acore_diagram", bot); + assertNotNull(editor); + editor.close(); + } + + private List<SWTBotGefEditPart> getAllConnections(final SWTBotGefEditor editor) + { + List<SWTBotGefEditPart> aClassEditParts = editor.editParts(new AbstractMatcher<AClassEditPart>() + { + @Override + protected boolean doMatch(Object item) + { + if (item instanceof AClassEditPart) + { + return true; + } + return false; + } + + public void describeTo(Description description) + { + } + }); + + List<SWTBotGefEditPart> ret = new ArrayList<SWTBotGefEditPart>(); + for (SWTBotGefEditPart editPart : aClassEditParts) + { + ret.addAll(editPart.sourceConnections()); + } + + return ret; } } diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnAcoreTestUtil.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnAcoreTestUtil.java new file mode 100644 index 0000000000..16b4edd9ca --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnAcoreTestUtil.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2010 Martin Fluegge (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.tests.ui.util; + +import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; + +/** + * @author Martin Fluegge + */ +public class DawnAcoreTestUtil +{ + public static final String A_CLASS = "AClass"; + + public static final String A_INTERFACE = "AInterface"; + + public static final String A_ATTRIBUTE = "AAttribute"; + + public static final String A_OPERATION = "AOperation"; + + public static final String CONNECTION_IHERITS = "inherits"; + + public static final String CONNECTION_IMPLEMENTS = "implements"; + + public static final String CONNECTION_ASSOCIATION = "association"; + + public static final String CONNECTION_AGGREGATION = "aggregation"; + + public static final String CONNECTION_COMPOSITION = "composition"; + + public static SWTBotGefEditor openNewAcoreEditor(String diagramResourceName, SWTGefBot bot) + { + bot.menu("File").menu("New").menu("Other...").click(); + + SWTBotShell shell = bot.shell("New"); + shell.activate(); + bot.tree().expandNode("Dawn Examples").select("Dawn Acore Diagram"); + bot.button("Next >").click(); + bot.button("Finish").click(); + + SWTBotGefEditor editor = bot.gefEditor(diagramResourceName); + return editor; + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnSWTBotUtil.java b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnSWTBotUtil.java index 7a77363b30..cab47a02dc 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnSWTBotUtil.java +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/src/org/eclipse/emf/cdo/dawn/tests/ui/util/DawnSWTBotUtil.java @@ -36,4 +36,5 @@ public class DawnSWTBotUtil // already closed the welcome screen. } } + } diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.dawngenmodel b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.dawngenmodel new file mode 100644 index 0000000000..ac80bb9dd8 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.dawngenmodel @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="ASCII"?> +<dawngenmodel:DawnGMFGenerator xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:dawngenmodel="http://www.eclipse.org/emf/cdo/dawn/2010/GenModel" fragmentName="org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn" dawnEditorClassName="DawnAcoreDiagramEditor" dawnDocumentProviderClassName="DawnAcoreDocumentProvider" dawnEditorUtilClassName="DawnAcoreDiagramEditorUtil" dawnCreationWizardClassName="DawnAcoreCreationWizard" dawnCanonicalEditingPolicyClassName="DawnACoreRootCanonicalEditPolicy" dawnDiagramEditPartClassName="DawnACoreRootEditPart" dawnEditPartFactoryClassName="DawnAcoreEditPartFactory" dawnEditPartProviderClassName="DawnAcoreEditPartProvider" dawnEditPolicyProviderClassName="DawnAcoreEditPolicyProvider"> + <GMFGenEditorGenerator href="acore.gmfgen#/"/> +</dawngenmodel:DawnGMFGenerator> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.ecore b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.ecore new file mode 100644 index 0000000000..83ba795d55 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.ecore @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="acore" + nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore" nsPrefix="acore"> + <eClassifiers xsi:type="ecore:EClass" name="AClass" eSuperTypes="#//ABasicClass"> + <eStructuralFeatures xsi:type="ecore:EReference" name="subClasses" upperBound="-1" + eType="#//AClass"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="implementedInterfaces" + upperBound="-1" eType="#//AInterface"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="associations" upperBound="-1" + eType="#//AClass"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="compositions" upperBound="-1" + eType="#//AClass"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="aggregations" upperBound="-1" + eType="#//AClass"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AInterface" eSuperTypes="#//ABasicClass"/> + <eClassifiers xsi:type="ecore:EClass" name="ACoreRoot"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="classes" upperBound="-1" + eType="#//AClass" containment="true" resolveProxies="false"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="interfaces" upperBound="-1" + eType="#//AInterface" containment="true" resolveProxies="false"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AAttribute" eSuperTypes="#//AClassChild"/> + <eClassifiers xsi:type="ecore:EClass" name="AOperation" eSuperTypes="#//AClassChild"> + <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1" + eType="#//AParameter" containment="true" resolveProxies="false"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ABasicClass"> + <eStructuralFeatures xsi:type="ecore:EReference" name="operations" upperBound="-1" + eType="#//AOperation" containment="true" resolveProxies="false"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1" + eType="#//AAttribute" containment="true" resolveProxies="false"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AParameter"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AClassChild"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" + defaultValueLiteral=""/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="accessright" unique="false" + eType="#//AccessType" defaultValueLiteral="public" unsettable="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="AccessType"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="name" value="AccessType"/> + </eAnnotations> + <eLiterals name="PUBLIC" literal="public"/> + <eLiterals name="PRIVATE" value="1" literal="private"/> + <eLiterals name="PROECTED" value="2" literal="protected"/> + <eLiterals name="PACKAGE" value="3" literal="package"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EDataType" name="AccessTypeObject" instanceClassName="org.eclipse.emf.common.util.Enumerator"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="name" value="AccessType:Object"/> + <details key="baseType" value="AccessType"/> + </eAnnotations> + </eClassifiers> +</ecore:EPackage> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.genmodel b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.genmodel new file mode 100644 index 0000000000..d9c3369e34 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.genmodel @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<genmodel:GenModel xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany).
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
 
Contributors:
 Martin Fluegge - initial API and implementation
" + modelDirectory="/org.eclipse.emf.cdo.dawn.examples.acore/src" modelPluginID="org.eclipse.emf.cdo.dawn.examples.acore" + modelName="Acore" rootExtendsInterface="org.eclipse.emf.cdo.CDOObject" rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl" + reflectiveDelegation="true" importerID="org.eclipse.emf.importer.cdo" featureDelegation="Reflective" + complianceLevel="5.0"> + <foreignModel>acore.ecore</foreignModel> + <modelPluginVariables>CDO=org.eclipse.emf.cdo</modelPluginVariables> + <genPackages prefix="Acore" basePackage="org.eclipse.emf.cdo.dawn.examples" disposableProviderFactory="true" + ecorePackage="acore.ecore#/"> + <genEnums typeSafeEnumCompatible="false" ecoreEnum="acore.ecore#//AccessType"> + <genEnumLiterals ecoreEnumLiteral="acore.ecore#//AccessType/PUBLIC"/> + <genEnumLiterals ecoreEnumLiteral="acore.ecore#//AccessType/PRIVATE"/> + <genEnumLiterals ecoreEnumLiteral="acore.ecore#//AccessType/PROECTED"/> + <genEnumLiterals ecoreEnumLiteral="acore.ecore#//AccessType/PACKAGE"/> + </genEnums> + <genDataTypes ecoreDataType="acore.ecore#//AccessTypeObject"/> + <genClasses ecoreClass="acore.ecore#//AClass"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference acore.ecore#//AClass/subClasses"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference acore.ecore#//AClass/implementedInterfaces"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference acore.ecore#//AClass/associations"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference acore.ecore#//AClass/compositions"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference acore.ecore#//AClass/aggregations"/> + </genClasses> + <genClasses ecoreClass="acore.ecore#//AInterface"/> + <genClasses ecoreClass="acore.ecore#//ACoreRoot"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//ACoreRoot/title"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acore.ecore#//ACoreRoot/classes"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acore.ecore#//ACoreRoot/interfaces"/> + </genClasses> + <genClasses ecoreClass="acore.ecore#//AAttribute"/> + <genClasses ecoreClass="acore.ecore#//AOperation"> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acore.ecore#//AOperation/parameters"/> + </genClasses> + <genClasses ecoreClass="acore.ecore#//ABasicClass"> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acore.ecore#//ABasicClass/operations"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acore.ecore#//ABasicClass/attributes"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//ABasicClass/name"/> + </genClasses> + <genClasses ecoreClass="acore.ecore#//AParameter"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//AParameter/name"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//AParameter/type"/> + </genClasses> + <genClasses ecoreClass="acore.ecore#//AClassChild"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//AClassChild/name"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//AClassChild/accessright"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute acore.ecore#//AClassChild/dataType"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfgen b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfgen new file mode 100644 index 0000000000..a871250aa5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfgen @@ -0,0 +1,740 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gmfgen:GenEditorGenerator xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel" copyrightText="Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany).
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
 
Contributors:
 Martin Fluegge - initial API and implementation
"> + <diagram + visualID="1000" + editPartClassName="ACoreRootEditPart" + itemSemanticEditPolicyClassName="ACoreRootItemSemanticEditPolicy" + canonicalEditPolicyClassName="ACoreRootCanonicalEditPolicy" + iconProviderPriority="Low" + validationProviderPriority="Low"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/> + <elementType + xsi:type="gmfgen:MetamodelType" + editHelperClassName="ACoreRootEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/> + <domainDiagramElement + href="acore.genmodel#//acore/ACoreRoot"/> + <childNodes + xsi:type="gmfgen:GenChildLabelNode" + visualID="3001" + editPartClassName="AAttributeEditPart" + itemSemanticEditPolicyClassName="AAttributeItemSemanticEditPolicy" + canonicalEditPolicyClassName="AAttributeCanonicalEditPolicy" + graphicalNodeEditPolicyClassName="AAttributeGraphicalNodeEditPolicy" + createCommandClassName="AAttributeCreateCommand" + containers="//@diagram/@compartments.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + editHelperClassName="AAttributeEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet> + <metaClass + href="acore.genmodel#//acore/AAttribute"/> + <containmentMetaFeature + href="acore.genmodel#//acore/ABasicClass/attributes"/> + <childMetaFeature + href="acore.genmodel#//acore/ABasicClass/attributes"/> + </modelFacet> + <labelModelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="//@labelParsers/@implementations.0" + viewPattern="{0} {2}:{1}" + editorPattern="" + editPattern=""> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/accessright"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/dataType"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/name"/> + </labelModelFacet> + </childNodes> + <childNodes + xsi:type="gmfgen:GenChildLabelNode" + visualID="3002" + editPartClassName="AOperationEditPart" + itemSemanticEditPolicyClassName="AOperationItemSemanticEditPolicy" + canonicalEditPolicyClassName="AOperationCanonicalEditPolicy" + graphicalNodeEditPolicyClassName="AOperationGraphicalNodeEditPolicy" + createCommandClassName="AOperationCreateCommand" + containers="//@diagram/@compartments.1"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + editHelperClassName="AOperationEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet> + <metaClass + href="acore.genmodel#//acore/AOperation"/> + <containmentMetaFeature + href="acore.genmodel#//acore/ABasicClass/operations"/> + <childMetaFeature + href="acore.genmodel#//acore/ABasicClass/operations"/> + </modelFacet> + <labelModelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="//@labelParsers/@implementations.0" + viewPattern="{0} {2}():{1}" + editorPattern="" + editPattern=""> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/accessright"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/dataType"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/name"/> + </labelModelFacet> + </childNodes> + <childNodes + xsi:type="gmfgen:GenChildLabelNode" + visualID="3003" + editPartClassName="AAttribute2EditPart" + itemSemanticEditPolicyClassName="AAttribute2ItemSemanticEditPolicy" + canonicalEditPolicyClassName="AAttribute2CanonicalEditPolicy" + graphicalNodeEditPolicyClassName="AAttribute2GraphicalNodeEditPolicy" + createCommandClassName="AAttribute2CreateCommand" + containers="//@diagram/@compartments.2"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:SpecializationType" + metamodelType="//@diagram/@childNodes.0/@elementType"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet> + <metaClass + href="acore.genmodel#//acore/AAttribute"/> + <containmentMetaFeature + href="acore.genmodel#//acore/ABasicClass/attributes"/> + <childMetaFeature + href="acore.genmodel#//acore/ABasicClass/attributes"/> + </modelFacet> + <labelModelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="//@labelParsers/@implementations.0" + viewPattern="{0} {2}:{1}" + editorPattern="" + editPattern=""> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/accessright"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/dataType"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/name"/> + </labelModelFacet> + </childNodes> + <childNodes + xsi:type="gmfgen:GenChildLabelNode" + visualID="3004" + editPartClassName="AOperation2EditPart" + itemSemanticEditPolicyClassName="AOperation2ItemSemanticEditPolicy" + canonicalEditPolicyClassName="AOperation2CanonicalEditPolicy" + graphicalNodeEditPolicyClassName="AOperation2GraphicalNodeEditPolicy" + createCommandClassName="AOperation2CreateCommand" + containers="//@diagram/@compartments.3"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:SpecializationType" + metamodelType="//@diagram/@childNodes.1/@elementType"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet> + <metaClass + href="acore.genmodel#//acore/AOperation"/> + <containmentMetaFeature + href="acore.genmodel#//acore/ABasicClass/operations"/> + <childMetaFeature + href="acore.genmodel#//acore/ABasicClass/operations"/> + </modelFacet> + <labelModelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="//@labelParsers/@implementations.0" + viewPattern="{0} {2}():{1}" + editorPattern="" + editPattern=""> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/accessright"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/dataType"/> + <metaFeatures + href="acore.genmodel#//acore/AClassChild/name"/> + </labelModelFacet> + </childNodes> + <topLevelNodes + visualID="2001" + editPartClassName="AInterfaceEditPart" + itemSemanticEditPolicyClassName="AInterfaceItemSemanticEditPolicy" + canonicalEditPolicyClassName="AInterfaceCanonicalEditPolicy" + compartments="//@diagram/@compartments.0 //@diagram/@compartments.1" + graphicalNodeEditPolicyClassName="AInterfaceGraphicalNodeEditPolicy" + createCommandClassName="AInterfaceCreateCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + editHelperClassName="AInterfaceEditHelper"/> + <viewmap + xsi:type="gmfgen:InnerClassViewmap" + layoutType="TOOLBAR_LAYOUT" + className="AInterfaceFigure" + classBody="
/**
 * @generated
 */
public class AInterfaceFigure extends org.eclipse.draw2d.RoundedRectangle {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureAInterfaceNameFigure; 
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureInterfaceAttributes; 
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureInterfaceOperations; 


	/**
	 * @generated
	 */
	public AInterfaceFigure() {
		
	org.eclipse.draw2d.ToolbarLayout layoutThis = new org.eclipse.draw2d.ToolbarLayout();
	layoutThis.setStretchMinorAxis(true);
	layoutThis.setMinorAlignment(org.eclipse.draw2d.ToolbarLayout.ALIGN_CENTER
);

	layoutThis.setSpacing(0);
	layoutThis.setVertical(true);

	this.setLayoutManager(layoutThis);

		this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(12)
, getMapMode().DPtoLP(12)
));
this.setLineWidth(1);
	this.setBackgroundColor(THIS_BACK
);
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel aInterfaceTypeLabelFigure0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
aInterfaceTypeLabelFigure0.setText("«Interface»");

this.add(aInterfaceTypeLabelFigure0);



fFigureAInterfaceNameFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureAInterfaceNameFigure.setText("<...>");

this.add(fFigureAInterfaceNameFigure);



fFigureInterfaceAttributes = new org.eclipse.draw2d.RectangleFigure();
fFigureInterfaceAttributes.setLineWidth(1);

this.add(fFigureInterfaceAttributes);
fFigureInterfaceAttributes.setLayoutManager(new org.eclipse.draw2d.StackLayout());



fFigureInterfaceOperations = new org.eclipse.draw2d.RectangleFigure();
fFigureInterfaceOperations.setLineWidth(1);

this.add(fFigureInterfaceOperations);
fFigureInterfaceOperations.setLayoutManager(new org.eclipse.draw2d.StackLayout());


	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureAInterfaceNameFigure() {
		return fFigureAInterfaceNameFigure;
	}
	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureInterfaceAttributes() {
		return fFigureInterfaceAttributes;
	}
	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureInterfaceOperations() {
		return fFigureInterfaceOperations;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 250, 250, 190);

"> + <attributes + xsi:type="gmfgen:StyleAttributes" + fixedBackground="true"/> + </viewmap> + <modelFacet> + <metaClass + href="acore.genmodel#//acore/AInterface"/> + <containmentMetaFeature + href="acore.genmodel#//acore/ACoreRoot/interfaces"/> + <childMetaFeature + href="acore.genmodel#//acore/ACoreRoot/interfaces"/> + </modelFacet> + <labels + visualID="5001" + editPartClassName="AInterfaceNameEditPart" + itemSemanticEditPolicyClassName="AInterfaceNameItemSemanticEditPolicy" + elementIcon="true"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureAInterfaceNameFigure" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="//@labelParsers/@implementations.0"> + <metaFeatures + href="acore.genmodel#//acore/ABasicClass/name"/> + </modelFacet> + </labels> + </topLevelNodes> + <topLevelNodes + visualID="2002" + editPartClassName="AClassEditPart" + itemSemanticEditPolicyClassName="AClassItemSemanticEditPolicy" + canonicalEditPolicyClassName="AClassCanonicalEditPolicy" + compartments="//@diagram/@compartments.2 //@diagram/@compartments.3" + graphicalNodeEditPolicyClassName="AClassGraphicalNodeEditPolicy" + createCommandClassName="AClassCreateCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + editHelperClassName="AClassEditHelper"/> + <viewmap + xsi:type="gmfgen:InnerClassViewmap" + layoutType="TOOLBAR_LAYOUT" + className="AClassFigure" + classBody="
/**
 * @generated
 */
public class AClassFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureClassAttributes; 
	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureAClassNameFigure; 
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureClassOperations; 


	/**
	 * @generated
	 */
	public AClassFigure() {
		
	org.eclipse.draw2d.ToolbarLayout layoutThis = new org.eclipse.draw2d.ToolbarLayout();
	layoutThis.setStretchMinorAxis(true);
	layoutThis.setMinorAlignment(org.eclipse.draw2d.ToolbarLayout.ALIGN_CENTER
);

	layoutThis.setSpacing(0);
	layoutThis.setVertical(true);

	this.setLayoutManager(layoutThis);

		this.setLineWidth(1);
	this.setBackgroundColor(THIS_BACK
);
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


fFigureAClassNameFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureAClassNameFigure.setText("<...>");

this.add(fFigureAClassNameFigure);



fFigureClassAttributes = new org.eclipse.draw2d.RectangleFigure();
fFigureClassAttributes.setLineWidth(1);

this.add(fFigureClassAttributes);
fFigureClassAttributes.setLayoutManager(new org.eclipse.draw2d.StackLayout());



fFigureClassOperations = new org.eclipse.draw2d.RectangleFigure();
fFigureClassOperations.setLineWidth(1);

this.add(fFigureClassOperations);
fFigureClassOperations.setLayoutManager(new org.eclipse.draw2d.StackLayout());


	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureClassAttributes() {
		return fFigureClassAttributes;
	}
	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureAClassNameFigure() {
		return fFigureAClassNameFigure;
	}
	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureClassOperations() {
		return fFigureClassOperations;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 230, 230, 255);

"> + <attributes + xsi:type="gmfgen:StyleAttributes" + fixedBackground="true"/> + </viewmap> + <modelFacet> + <metaClass + href="acore.genmodel#//acore/AClass"/> + <containmentMetaFeature + href="acore.genmodel#//acore/ACoreRoot/classes"/> + <childMetaFeature + href="acore.genmodel#//acore/ACoreRoot/classes"/> + </modelFacet> + <labels + visualID="5002" + editPartClassName="AClassNameEditPart" + itemSemanticEditPolicyClassName="AClassNameItemSemanticEditPolicy" + elementIcon="true"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureAClassNameFigure" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="//@labelParsers/@implementations.0"> + <metaFeatures + href="acore.genmodel#//acore/ABasicClass/name"/> + </modelFacet> + </labels> + </topLevelNodes> + <links + visualID="4001" + editPartClassName="AClassSubClassesEditPart" + itemSemanticEditPolicyClassName="AClassSubClassesItemSemanticEditPolicy" + createCommandClassName="AClassSubClassesCreateCommand" + reorientCommandClassName="AClassSubClassesReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType"/> + <viewmap + xsi:type="gmfgen:InnerClassViewmap" + className="AClassSubClassesFigure" + classBody="
/**
 * @generated
 */
public class AClassSubClassesFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {




	/**
	 * @generated
	 */
	public AClassSubClassesFigure() {
		this.setLineWidth(1);

		setTargetDecoration(createTargetDecoration());
	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration();
df.setFill(true);
df.setLineWidth(1);
	df.setBackgroundColor(DF_BACK
);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}




}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color DF_BACK = new org.eclipse.swt.graphics.Color(null, 255, 255, 255);

"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="acore.genmodel#//acore/AClass/subClasses"/> + </modelFacet> + </links> + <links + visualID="4002" + editPartClassName="AClassImplementedInterfacesEditPart" + itemSemanticEditPolicyClassName="AClassImplementedInterfacesItemSemanticEditPolicy" + createCommandClassName="AClassImplementedInterfacesCreateCommand" + reorientCommandClassName="AClassImplementedInterfacesReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType"/> + <viewmap + xsi:type="gmfgen:InnerClassViewmap" + className="AClassImplementedInterfacesFigure" + classBody="
/**
 * @generated
 */
public class AClassImplementedInterfacesFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {




	/**
	 * @generated
	 */
	public AClassImplementedInterfacesFigure() {
		this.setLineWidth(1);
this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);

		setTargetDecoration(createTargetDecoration());
	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
df.setLineWidth(1);
		return df;
	}




}

"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="acore.genmodel#//acore/AClass/implementedInterfaces"/> + </modelFacet> + </links> + <links + visualID="4003" + editPartClassName="AClassAssociationsEditPart" + itemSemanticEditPolicyClassName="AClassAssociationsItemSemanticEditPolicy" + createCommandClassName="AClassAssociationsCreateCommand" + reorientCommandClassName="AClassAssociationsReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="acore.genmodel#//acore/AClass/associations"/> + </modelFacet> + </links> + <links + visualID="4004" + editPartClassName="AClassAggregationsEditPart" + itemSemanticEditPolicyClassName="AClassAggregationsItemSemanticEditPolicy" + createCommandClassName="AClassAggregationsCreateCommand" + reorientCommandClassName="AClassAggregationsReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType"/> + <viewmap + xsi:type="gmfgen:InnerClassViewmap" + className="AClassAggregationClassesFigure" + classBody="
/**
 * @generated
 */
public class AClassAggregationClassesFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {




	/**
	 * @generated
	 */
	public AClassAggregationClassesFigure() {
		this.setLineWidth(1);

		setTargetDecoration(createTargetDecoration());
	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration();
df.setFill(true);
df.setLineWidth(1);
	df.setBackgroundColor(DF_BACK
);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
pl.addPoint(getMapMode().DPtoLP(-4)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}




}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color DF_BACK = new org.eclipse.swt.graphics.Color(null, 255, 255, 255);

"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="acore.genmodel#//acore/AClass/aggregations"/> + </modelFacet> + </links> + <links + visualID="4005" + editPartClassName="AClassCompositionsEditPart" + itemSemanticEditPolicyClassName="AClassCompositionsItemSemanticEditPolicy" + createCommandClassName="AClassCompositionsCreateCommand" + reorientCommandClassName="AClassCompositionsReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType"/> + <viewmap + xsi:type="gmfgen:InnerClassViewmap" + className="AClassCompositionClassesFigure" + classBody="
/**
 * @generated
 */
public class AClassCompositionClassesFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {




	/**
	 * @generated
	 */
	public AClassCompositionClassesFigure() {
		this.setLineWidth(1);

		setTargetDecoration(createTargetDecoration());
	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration();
df.setFill(true);
df.setLineWidth(1);
	df.setBackgroundColor(DF_BACK
);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
pl.addPoint(getMapMode().DPtoLP(-4)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}




}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color DF_BACK = new org.eclipse.swt.graphics.Color(null, 0, 0, 0);

"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="acore.genmodel#//acore/AClass/compositions"/> + </modelFacet> + </links> + <compartments + visualID="7001" + editPartClassName="AInterfaceAAttributeInterfaceCompartmentEditPart" + itemSemanticEditPolicyClassName="AInterfaceAAttributeInterfaceCompartmentItemSemanticEditPolicy" + canonicalEditPolicyClassName="AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy" + childNodes="//@diagram/@childNodes.0" + title="AAttributeInterfaceCompartment" + canCollapse="false" + needsTitle="false" + node="//@diagram/@topLevelNodes.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureInterfaceAttributes" + figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/> + </compartments> + <compartments + visualID="7002" + editPartClassName="AInterfaceAOperationInterfaceCompartmentEditPart" + itemSemanticEditPolicyClassName="AInterfaceAOperationInterfaceCompartmentItemSemanticEditPolicy" + canonicalEditPolicyClassName="AInterfaceAOperationInterfaceCompartmentCanonicalEditPolicy" + childNodes="//@diagram/@childNodes.1" + title="AOperationInterfaceCompartment" + canCollapse="false" + needsTitle="false" + node="//@diagram/@topLevelNodes.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureInterfaceOperations" + figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/> + </compartments> + <compartments + visualID="7003" + editPartClassName="AClassAAttributeCompartmentEditPart" + itemSemanticEditPolicyClassName="AClassAAttributeCompartmentItemSemanticEditPolicy" + canonicalEditPolicyClassName="AClassAAttributeCompartmentCanonicalEditPolicy" + childNodes="//@diagram/@childNodes.2" + title="AAttributeCompartment" + canCollapse="false" + needsTitle="false" + node="//@diagram/@topLevelNodes.1"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureClassAttributes" + figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/> + </compartments> + <compartments + visualID="7004" + editPartClassName="AClassAOperationClassCompartmentEditPart" + itemSemanticEditPolicyClassName="AClassAOperationClassCompartmentItemSemanticEditPolicy" + canonicalEditPolicyClassName="AClassAOperationClassCompartmentCanonicalEditPolicy" + childNodes="//@diagram/@childNodes.3" + title="AOperationClassCompartment" + canCollapse="false" + needsTitle="false" + node="//@diagram/@topLevelNodes.1"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureClassOperations" + figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/> + </compartments> + <palette> + <groups + title="Node" + collapse="true"> + <entries + xsi:type="gmfgen:ToolEntry" + title="AClass" + description="Create new AClass" + genNodes="//@diagram/@topLevelNodes.1"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="AInterface" + description="Create new AInterface" + genNodes="//@diagram/@topLevelNodes.0"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="AAttribute" + description="Create an Attribute" + genNodes="//@diagram/@childNodes.0 //@diagram/@childNodes.2"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="AOperation" + description="Create an Operation" + genNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.3"/> + </groups> + <groups + title="Connections" + collapse="true"> + <entries + xsi:type="gmfgen:ToolEntry" + title="inherits" + description="Create new AClassSubClasses" + largeIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/inherits.png" + smallIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/inherits.png" + genLinks="//@diagram/@links.0"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="implements" + description="Create new AClassImplementedInterfaces" + largeIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/implements.png" + smallIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/implements.png" + genLinks="//@diagram/@links.1"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="association" + description="Create new AClassSubClasses" + largeIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/association.png" + smallIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/association.png" + genLinks="//@diagram/@links.2"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="aggregation" + description="Create new AClassSubClasses" + largeIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/aggregation.png" + smallIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/aggregation.png" + genLinks="//@diagram/@links.3"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="composition" + description="Create new AClassSubClasses" + largeIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/composition.png" + smallIconPath="/org.eclipse.emf.cdo.dawn.examples.acore.edit/icons/full/obj16/composition.png" + genLinks="//@diagram/@links.4"/> + </groups> + </palette> + <preferencePages + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general" + name="Acore Diagram"> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.emf.cdo.dawn.examples.acore.diagram.appearance" + name="Appearance" + kind="Appearance"/> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.emf.cdo.dawn.examples.acore.diagram.connections" + name="Connections" + kind="Connections"/> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.emf.cdo.dawn.examples.acore.diagram.printing" + name="Printing" + kind="Printing"/> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.emf.cdo.dawn.examples.acore.diagram.rulersAndGrid" + name="Rulers And Grid" + kind="RulersAndGrid"/> + </preferencePages> + </diagram> + <plugin> + <requiredPlugins>org.eclipse.draw2d</requiredPlugins> + <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins> + </plugin> + <editor/> + <navigator> + <childReferences + child="//@diagram"/> + <childReferences + parent="//@diagram/@topLevelNodes.0" + child="//@diagram/@childNodes.0"/> + <childReferences + parent="//@diagram/@topLevelNodes.0" + child="//@diagram/@childNodes.1"/> + <childReferences + parent="//@diagram" + child="//@diagram/@topLevelNodes.0"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@childNodes.2"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@childNodes.3"/> + <childReferences + parent="//@diagram" + child="//@diagram/@topLevelNodes.1"/> + <childReferences + parent="//@diagram" + child="//@diagram/@links.0" + groupName="links" + groupIcon="icons/linksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.0" + child="//@diagram/@topLevelNodes.1" + referenceType="out_target" + groupName="target" + groupIcon="icons/linkTargetNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.0" + referenceType="in_source" + groupName="incoming links" + groupIcon="icons/incomingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.0" + child="//@diagram/@topLevelNodes.1" + referenceType="in_source" + groupName="source" + groupIcon="icons/linkSourceNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.0" + referenceType="out_target" + groupName="outgoing links" + groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram" + child="//@diagram/@links.1" + groupName="links" + groupIcon="icons/linksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.1" + child="//@diagram/@topLevelNodes.0" + referenceType="out_target" + groupName="target" + groupIcon="icons/linkTargetNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.0" + child="//@diagram/@links.1" + referenceType="in_source" + groupName="incoming links" + groupIcon="icons/incomingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.1" + child="//@diagram/@topLevelNodes.1" + referenceType="in_source" + groupName="source" + groupIcon="icons/linkSourceNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.1" + referenceType="out_target" + groupName="outgoing links" + groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram" + child="//@diagram/@links.2" + groupName="links" + groupIcon="icons/linksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.2" + child="//@diagram/@topLevelNodes.1" + referenceType="out_target" + groupName="target" + groupIcon="icons/linkTargetNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.2" + referenceType="in_source" + groupName="incoming links" + groupIcon="icons/incomingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.2" + child="//@diagram/@topLevelNodes.1" + referenceType="in_source" + groupName="source" + groupIcon="icons/linkSourceNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.2" + referenceType="out_target" + groupName="outgoing links" + groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram" + child="//@diagram/@links.3" + groupName="links" + groupIcon="icons/linksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.3" + child="//@diagram/@topLevelNodes.1" + referenceType="out_target" + groupName="target" + groupIcon="icons/linkTargetNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.3" + referenceType="in_source" + groupName="incoming links" + groupIcon="icons/incomingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.3" + child="//@diagram/@topLevelNodes.1" + referenceType="in_source" + groupName="source" + groupIcon="icons/linkSourceNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.3" + referenceType="out_target" + groupName="outgoing links" + groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram" + child="//@diagram/@links.4" + groupName="links" + groupIcon="icons/linksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.4" + child="//@diagram/@topLevelNodes.1" + referenceType="out_target" + groupName="target" + groupIcon="icons/linkTargetNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.4" + referenceType="in_source" + groupName="incoming links" + groupIcon="icons/incomingLinksNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@links.4" + child="//@diagram/@topLevelNodes.1" + referenceType="in_source" + groupName="source" + groupIcon="icons/linkSourceNavigatorGroup.gif"/> + <childReferences + parent="//@diagram/@topLevelNodes.1" + child="//@diagram/@links.4" + referenceType="out_target" + groupName="outgoing links" + groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> + </navigator> + <diagramUpdater/> + <propertySheet> + <tabs + xsi:type="gmfgen:GenStandardPropertyTab" + iD="appearance"/> + <tabs + xsi:type="gmfgen:GenStandardPropertyTab" + iD="diagram"/> + <tabs + xsi:type="gmfgen:GenCustomPropertyTab" + iD="domain" + label="Core"> + <filter + xsi:type="gmfgen:TypeTabFilter"> + <types>org.eclipse.gmf.runtime.notation.View</types> + <types>org.eclipse.gef.EditPart</types> + <generatedTypes>abstractNavigatorItem</generatedTypes> + </filter> + </tabs> + </propertySheet> + <domainGenModel + href="acore.genmodel#/"/> + <labelParsers + extensibleViaService="true"> + <implementations + xsi:type="gmfgen:PredefinedParser" + uses="//@diagram/@childNodes.0/@labelModelFacet //@diagram/@childNodes.1/@labelModelFacet //@diagram/@topLevelNodes.0/@labels.0/@modelFacet //@diagram/@childNodes.2/@labelModelFacet //@diagram/@childNodes.3/@labelModelFacet //@diagram/@topLevelNodes.1/@labels.0/@modelFacet"/> + </labelParsers> + <contextMenus + context="//@diagram"> + <items + xsi:type="gmfgen:LoadResourceAction"/> + </contextMenus> +</gmfgen:GenEditorGenerator> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfgraph b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfgraph new file mode 100644 index 0000000000..f2621f9ccd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfgraph @@ -0,0 +1,292 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gmfgraph:Canvas xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="classdiagram"> + <figures + name="Default"> + <figures + xsi:type="gmfgraph:PolylineDecoration" + name="AClassSubClassesTargetDecoration"> + <foregroundColor + xsi:type="gmfgraph:RGBColor" + green="255"/> + <backgroundColor + xsi:type="gmfgraph:RGBColor" + green="255"/> + <template + x="-2" + y="2"/> + <template/> + <template + x="-2" + y="-2"/> + <template + x="-2" + y="2"/> + </figures> + <figures + xsi:type="gmfgraph:PolylineDecoration" + name="AClassImplementedInterfacesTargetDecoration"/> + <figures + xsi:type="gmfgraph:PolygonDecoration" + name="ClassArrow"> + <backgroundColor + xsi:type="gmfgraph:RGBColor" + red="255" + green="255" + blue="255"/> + <template + x="-2" + y="2"/> + <template/> + <template + x="-2" + y="-2"/> + <template + x="-2" + y="2"/> + </figures> + <figures + xsi:type="gmfgraph:PolygonDecoration" + name="BlackDiamond"> + <backgroundColor + xsi:type="gmfgraph:RGBColor"/> + <template + x="-2" + y="2"/> + <template/> + <template + x="-2" + y="-2"/> + <template + x="-4"/> + <template + x="-2" + y="2"/> + </figures> + <figures + xsi:type="gmfgraph:PolygonDecoration" + name="WhiteDiamond"> + <backgroundColor + xsi:type="gmfgraph:RGBColor" + red="255" + green="255" + blue="255"/> + <template + x="-2" + y="2"/> + <template/> + <template + x="-2" + y="-2"/> + <template + x="-4"/> + <template + x="-2" + y="2"/> + </figures> + <descriptors + name="AClassFigure"> + <actualFigure + xsi:type="gmfgraph:Rectangle" + name="AClassFigure"> + <layout + xsi:type="gmfgraph:FlowLayout" + vertical="true" + matchMinorSize="true" + forceSingleLine="true" + minorAlignment="CENTER" + majorSpacing="0" + minorSpacing="0"/> + <backgroundColor + xsi:type="gmfgraph:RGBColor" + red="230" + green="230" + blue="255"/> + <children + xsi:type="gmfgraph:Label" + name="AClassNameFigure" + text="<...>"/> + <children + xsi:type="gmfgraph:Rectangle" + name="ClassAttributes"> + <layout + xsi:type="gmfgraph:StackLayout"/> + </children> + <children + xsi:type="gmfgraph:Rectangle" + name="ClassOperations"> + <layout + xsi:type="gmfgraph:StackLayout"/> + </children> + </actualFigure> + <accessors + figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/> + <accessors + figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/> + <accessors + figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/> + </descriptors> + <descriptors + name="AClassSubClassesFigure"> + <actualFigure + xsi:type="gmfgraph:PolylineConnection" + name="AClassSubClassesFigure" + targetDecoration="//@figures.0/@figures.2"/> + </descriptors> + <descriptors + name="AClassImplementedInterfacesFigure"> + <actualFigure + xsi:type="gmfgraph:PolylineConnection" + name="AClassImplementedInterfacesFigure" + lineKind="LINE_DASH" + targetDecoration="//@figures.0/@figures.1"/> + </descriptors> + <descriptors + name="AInterfaceFigure"> + <actualFigure + xsi:type="gmfgraph:RoundedRectangle" + name="AInterfaceFigure" + cornerWidth="12" + cornerHeight="12"> + <layout + xsi:type="gmfgraph:FlowLayout" + vertical="true" + matchMinorSize="true" + forceSingleLine="true" + minorAlignment="CENTER" + majorSpacing="0" + minorSpacing="0"/> + <backgroundColor + xsi:type="gmfgraph:RGBColor" + red="250" + green="250" + blue="190"/> + <children + xsi:type="gmfgraph:Label" + name="AInterfaceTypeLabelFigure" + text="«Interface»"/> + <children + xsi:type="gmfgraph:Label" + name="AInterfaceNameFigure" + text="<...>"/> + <children + xsi:type="gmfgraph:Rectangle" + name="InterfaceAttributes"> + <layout + xsi:type="gmfgraph:StackLayout"/> + </children> + <children + xsi:type="gmfgraph:Rectangle" + name="InterfaceOperations"> + <layout + xsi:type="gmfgraph:StackLayout"/> + </children> + </actualFigure> + <accessors + figure="//@figures.0/@descriptors.3/@actualFigure/@children.1"/> + <accessors + figure="//@figures.0/@descriptors.3/@actualFigure/@children.2"/> + <accessors + figure="//@figures.0/@descriptors.3/@actualFigure/@children.3"/> + </descriptors> + <descriptors + name="AnAttributeFigure"> + <actualFigure + xsi:type="gmfgraph:Rectangle" + name="AnAttributeFigure"> + <children + xsi:type="gmfgraph:Label" + name="AnAttributeNameFigure"/> + </actualFigure> + <accessors + figure="//@figures.0/@descriptors.4/@actualFigure/@children.0"/> + </descriptors> + <descriptors + name="AnAttributeLabelFigure"> + <actualFigure + xsi:type="gmfgraph:Label" + name="AnAttributeLabelFigure"/> + </descriptors> + <descriptors + name="AnOperationLabelFigure"> + <actualFigure + xsi:type="gmfgraph:Label" + name="AnMethodLabelFigure"/> + </descriptors> + <descriptors + name="AClassAssociationClassesFigure"> + <actualFigure + xsi:type="gmfgraph:PolylineConnection" + name="AClassAssociationFigure"/> + </descriptors> + <descriptors + name="AClassAggregationClassesFigure"> + <actualFigure + xsi:type="gmfgraph:PolylineConnection" + name="AClassAggregationFigure" + targetDecoration="//@figures.0/@figures.4"/> + </descriptors> + <descriptors + name="AClassCompositionClassesFigure"> + <actualFigure + xsi:type="gmfgraph:PolylineConnection" + name="AClassCompositionFigure" + targetDecoration="//@figures.0/@figures.3"/> + </descriptors> + </figures> + <nodes + name="AClass" + figure="AClassFigure"/> + <nodes + name="AInterface" + figure="AInterfaceFigure"/> + <connections + name="AClassSubClasses" + figure="AClassSubClassesFigure"/> + <connections + name="AClassImplementedInterfaces" + figure="AClassImplementedInterfacesFigure"/> + <connections + name="AClassAssociationClasses" + figure="AClassAssociationClassesFigure"/> + <connections + name="AClassAggregationClasses" + figure="AClassAggregationClassesFigure"/> + <connections + name="AClassCompositionClasses" + figure="AClassCompositionClassesFigure"/> + <compartments + name="AAttributeCompartment" + figure="AClassFigure" + accessor="//@figures.0/@descriptors.0/@accessors.0"/> + <compartments + name="AAttributeInterfaceCompartment" + figure="AInterfaceFigure" + accessor="//@figures.0/@descriptors.3/@accessors.1"/> + <compartments + name="AOperationClassCompartment" + figure="AClassFigure" + accessor="//@figures.0/@descriptors.0/@accessors.2"/> + <compartments + name="AOperationInterfaceCompartment" + figure="AInterfaceFigure" + accessor="//@figures.0/@descriptors.3/@accessors.2"/> + <labels + name="AClassName" + figure="AClassFigure" + accessor="//@figures.0/@descriptors.0/@accessors.1"/> + <labels + name="AInterfaceName" + figure="AInterfaceFigure" + accessor="//@figures.0/@descriptors.3/@accessors.0"/> + <labels + name="AAttributeLabel" + figure="AnAttributeLabelFigure" + elementIcon="false"/> + <labels + name="AOperationLabel" + figure="AnOperationLabelFigure" + elementIcon="false"/> +</gmfgraph:Canvas> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfmap b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfmap new file mode 100644 index 0000000000..f1e0d03246 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmfmap @@ -0,0 +1,240 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gmfmap:Mapping xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings" + xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition"> + <nodes> + <containmentFeature + href="acore.ecore#//ACoreRoot/interfaces"/> + <ownedChild> + <domainMetaElement + href="acore.ecore#//AInterface"/> + <labelMappings + xsi:type="gmfmap:FeatureLabelMapping"> + <diagramLabel + href="acore.gmfgraph#AInterfaceName"/> + <features + href="acore.ecore#//ABasicClass/name"/> + </labelMappings> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.0/@tools.1"/> + <diagramNode + href="acore.gmfgraph#AInterface"/> + <children + compartment="//@nodes.0/@ownedChild/@compartments.0"> + <containmentFeature + href="acore.ecore#//ABasicClass/attributes"/> + <ownedChild> + <domainMetaElement + href="acore.ecore#//AAttribute"/> + <labelMappings + xsi:type="gmfmap:FeatureLabelMapping" + viewPattern="{0} {2}:{1}" + editorPattern="" + editPattern=""> + <diagramLabel + href="acore.gmfgraph#AAttributeLabel"/> + <features + href="acore.ecore#//AClassChild/accessright"/> + <features + href="acore.ecore#//AClassChild/dataType"/> + <features + href="acore.ecore#//AClassChild/name"/> + </labelMappings> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.0/@tools.2"/> + <diagramNode + href="acore.gmfgraph#AAttributeLabel"/> + </ownedChild> + </children> + <children + compartment="//@nodes.0/@ownedChild/@compartments.1"> + <containmentFeature + href="acore.ecore#//ABasicClass/operations"/> + <ownedChild> + <domainMetaElement + href="acore.ecore#//AOperation"/> + <labelMappings + xsi:type="gmfmap:FeatureLabelMapping" + viewPattern="{0} {2}():{1}" + editorPattern="" + editPattern=""> + <diagramLabel + href="acore.gmfgraph#AOperationLabel"/> + <features + href="acore.ecore#//AClassChild/accessright"/> + <features + href="acore.ecore#//AClassChild/dataType"/> + <features + href="acore.ecore#//AClassChild/name"/> + </labelMappings> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.0/@tools.3"/> + <diagramNode + href="acore.gmfgraph#AOperationLabel"/> + </ownedChild> + </children> + <compartments + children="//@nodes.0/@ownedChild/@children.0"> + <compartment + href="acore.gmfgraph#AAttributeInterfaceCompartment"/> + </compartments> + <compartments + children="//@nodes.0/@ownedChild/@children.1"> + <compartment + href="acore.gmfgraph#AOperationInterfaceCompartment"/> + </compartments> + </ownedChild> + </nodes> + <nodes> + <containmentFeature + href="acore.ecore#//ACoreRoot/classes"/> + <ownedChild> + <domainMetaElement + href="acore.ecore#//AClass"/> + <labelMappings + xsi:type="gmfmap:FeatureLabelMapping"> + <diagramLabel + href="acore.gmfgraph#AClassName"/> + <features + href="acore.ecore#//ABasicClass/name"/> + </labelMappings> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.0/@tools.0"/> + <diagramNode + href="acore.gmfgraph#AClass"/> + <children + compartment="//@nodes.1/@ownedChild/@compartments.0"> + <containmentFeature + href="acore.ecore#//ABasicClass/attributes"/> + <ownedChild> + <domainMetaElement + href="acore.ecore#//AAttribute"/> + <labelMappings + xsi:type="gmfmap:FeatureLabelMapping" + viewPattern="{0} {2}:{1}" + editorPattern="" + editPattern=""> + <diagramLabel + href="acore.gmfgraph#AAttributeLabel"/> + <features + href="acore.ecore#//AClassChild/accessright"/> + <features + href="acore.ecore#//AClassChild/dataType"/> + <features + href="acore.ecore#//AClassChild/name"/> + </labelMappings> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.0/@tools.2"/> + <diagramNode + href="acore.gmfgraph#AAttributeLabel"/> + </ownedChild> + </children> + <children + compartment="//@nodes.1/@ownedChild/@compartments.1"> + <containmentFeature + href="acore.ecore#//ABasicClass/operations"/> + <ownedChild> + <domainMetaElement + href="acore.ecore#//AOperation"/> + <labelMappings + xsi:type="gmfmap:FeatureLabelMapping" + viewPattern="{0} {2}():{1}" + editorPattern="" + editPattern=""> + <diagramLabel + href="acore.gmfgraph#AOperationLabel"/> + <features + href="acore.ecore#//AClassChild/accessright"/> + <features + href="acore.ecore#//AClassChild/dataType"/> + <features + href="acore.ecore#//AClassChild/name"/> + </labelMappings> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.0/@tools.3"/> + <diagramNode + href="acore.gmfgraph#AOperationLabel"/> + </ownedChild> + </children> + <compartments + children="//@nodes.1/@ownedChild/@children.0"> + <compartment + href="acore.gmfgraph#AAttributeCompartment"/> + </compartments> + <compartments + children="//@nodes.1/@ownedChild/@children.1"> + <compartment + href="acore.gmfgraph#AOperationClassCompartment"/> + </compartments> + </ownedChild> + </nodes> + <links> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.1/@tools.0"/> + <diagramLink + href="acore.gmfgraph#AClassSubClasses"/> + <linkMetaFeature + xsi:type="ecore:EReference" + href="acore.ecore#//AClass/subClasses"/> + </links> + <links> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.1/@tools.1"/> + <diagramLink + href="acore.gmfgraph#AClassImplementedInterfaces"/> + <linkMetaFeature + xsi:type="ecore:EReference" + href="acore.ecore#//AClass/implementedInterfaces"/> + </links> + <links> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.1/@tools.2"/> + <diagramLink + href="acore.gmfgraph#AClassAssociationClasses"/> + <linkMetaFeature + xsi:type="ecore:EReference" + href="acore.ecore#//AClass/associations"/> + </links> + <links> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.1/@tools.3"/> + <diagramLink + href="acore.gmfgraph#AClassAggregationClasses"/> + <linkMetaFeature + xsi:type="ecore:EReference" + href="acore.ecore#//AClass/aggregations"/> + </links> + <links> + <tool + xsi:type="gmftool:CreationTool" + href="acore.gmftool#//@palette/@tools.1/@tools.4"/> + <diagramLink + href="acore.gmfgraph#AClassCompositionClasses"/> + <linkMetaFeature + xsi:type="ecore:EReference" + href="acore.ecore#//AClass/compositions"/> + </links> + <diagram> + <diagramCanvas + href="acore.gmfgraph#classdiagram"/> + <domainModel + href="acore.ecore#/"/> + <domainMetaElement + href="acore.ecore#//ACoreRoot"/> + <palette + href="acore.gmftool#//@palette"/> + </diagram> +</gmfmap:Mapping> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmftool b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmftool new file mode 100644 index 0000000000..56f2feea8b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.gmftool @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gmftool:ToolRegistry xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition"> + <palette + title="classdiagramPalette"> + <tools + xsi:type="gmftool:ToolGroup" + title="Node" + collapsible="true"> + <tools + xsi:type="gmftool:CreationTool" + title="AClass" + description="Create new AClass"> + <smallIcon + xsi:type="gmftool:DefaultImage"/> + <largeIcon + xsi:type="gmftool:DefaultImage"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="AInterface" + description="Create new AInterface"> + <smallIcon + xsi:type="gmftool:DefaultImage"/> + <largeIcon + xsi:type="gmftool:DefaultImage"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="AAttribute" + description="Create an Attribute"> + <smallIcon + xsi:type="gmftool:DefaultImage"/> + <largeIcon + xsi:type="gmftool:DefaultImage"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="AOperation" + description="Create an Operation"> + <smallIcon + xsi:type="gmftool:DefaultImage"/> + <largeIcon + xsi:type="gmftool:DefaultImage"/> + </tools> + </tools> + <tools + xsi:type="gmftool:ToolGroup" + title="Connections" + collapsible="true"> + <tools + xsi:type="gmftool:CreationTool" + title="inherits" + description="Create new AClassSubClasses"> + <smallIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/inherits.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + <largeIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/inherits.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="implements" + description="Create new AClassImplementedInterfaces"> + <smallIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/implements.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + <largeIcon + xsi:type="gmftool:BundleImage" + path="icons/full/obj16/implements.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="association" + description="Create new AClassSubClasses"> + <smallIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/association.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + <largeIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/association.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="aggregation" + description="Create new AClassSubClasses"> + <smallIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/aggregation.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + <largeIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/aggregation.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + </tools> + <tools + xsi:type="gmftool:CreationTool" + title="composition" + description="Create new AClassSubClasses"> + <smallIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/composition.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + <largeIcon + xsi:type="gmftool:BundleImage" + path="/icons/full/obj16/composition.png" + bundle="org.eclipse.emf.cdo.dawn.examples.acore.edit"/> + </tools> + </tools> + </palette> +</gmftool:ToolRegistry> diff --git a/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.trace b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.trace new file mode 100644 index 0000000000..b3dd37501d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.dawn.tests/testdata/model/acore.trace @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<trace:TraceModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:trace="http://www.eclipse.org/gmf/2006/Trace"> + <nodeTraces visualID="2001" queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AInterface') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'ACoreRoot') and _containmentMF_.name = 'interfaces')"> + <nodeLabelTraces visualID="5001" queryText="true"/> + <compartmentTraces visualID="7001" queryText="true"/> + <compartmentTraces visualID="7002" queryText="true"/> + </nodeTraces> + <nodeTraces visualID="2002" queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AClass') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'ACoreRoot') and _containmentMF_.name = 'classes')"> + <nodeLabelTraces visualID="5002" queryText="true"/> + <compartmentTraces visualID="7003" queryText="true"/> + <compartmentTraces visualID="7004" queryText="true"/> + </nodeTraces> + <childNodeTraces visualID="3001" queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AAttribute') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'ABasicClass') and _containmentMF_.name = 'attributes')"/> + <childNodeTraces visualID="3002" queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AOperation') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'ABasicClass') and _containmentMF_.name = 'operations')"/> + <childNodeTraces visualID="3003" queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AAttribute') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'ABasicClass') and _containmentMF_.name = 'attributes')"/> + <childNodeTraces visualID="3004" queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AOperation') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'ABasicClass') and _containmentMF_.name = 'operations')"/> + <linkTraces visualID="4001" queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AClass') and _feature_.name = 'subClasses')"/> + <linkTraces visualID="4002" queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AClass') and _feature_.name = 'implementedInterfaces')"/> + <linkTraces visualID="4003" queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AClass') and _feature_.name = 'associations')"/> + <linkTraces visualID="4004" queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AClass') and _feature_.name = 'aggregations')"/> + <linkTraces visualID="4005" queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore' and _eClass_.name = 'AClass') and _feature_.name = 'compositions')"/> +</trace:TraceModel> diff --git a/plugins/org.eclipse.emf.cdo.tests.ui/src/org/eclipse/emf/cdo/tests/ui/AbstractCDOUITest.java b/plugins/org.eclipse.emf.cdo.tests.ui/src/org/eclipse/emf/cdo/tests/ui/AbstractCDOUITest.java index 322ac72b9a..ac6e666cc3 100644 --- a/plugins/org.eclipse.emf.cdo.tests.ui/src/org/eclipse/emf/cdo/tests/ui/AbstractCDOUITest.java +++ b/plugins/org.eclipse.emf.cdo.tests.ui/src/org/eclipse/emf/cdo/tests/ui/AbstractCDOUITest.java @@ -37,9 +37,9 @@ public abstract class AbstractCDOUITest extends AbstractCDOTest @Override public void setUp() throws Exception { - super.setUp(); SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; SWTBotPreferences.SCREENSHOTS_DIR = System.getProperty("java.io.tmpdir") + "/cdotests"; + super.setUp(); } protected void closeAllEditors() @@ -119,7 +119,8 @@ public abstract class AbstractCDOUITest extends AbstractCDOTest { Keyboard keyboard = KeyboardFactory.getSWTKeyboard(); bot.getFocusedWidget(); - keyboard.typeText(text, 100); + keyboard.typeText(text, 50); + if (hitCR) { keyboard.pressShortcut(Keystrokes.CR); |