Bug 561236 - Update EMF Graphical Viewer
Change-Id: I7bc36a72ad6214e0c1aface3e6888c0a88d7bfef
Signed-off-by: Dirk Fauth <dirk.fauth@de.bosch.com>
diff --git a/eclipse-tools/emf-graphical-viewer/.gitignore b/eclipse-tools/emf-graphical-viewer/.gitignore
new file mode 100644
index 0000000..f1c734e
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/.gitignore
@@ -0,0 +1,5 @@
+.metadata/
+
+# Eclipse target directories
+bin/
+target/
diff --git a/eclipse-tools/emf-graphical-viewer/.mvn/extensions.xml b/eclipse-tools/emf-graphical-viewer/.mvn/extensions.xml
new file mode 100644
index 0000000..710a9ec
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/.mvn/extensions.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extensions>
+ <extension>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-pomless</artifactId>
+ <version>1.6.0</version>
+ </extension>
+</extensions>
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/META-INF/MANIFEST.MF b/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/META-INF/MANIFEST.MF
deleted file mode 100644
index 621d74b..0000000
--- a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: EMF Content Extractor Build
-Bundle-SymbolicName: org.eclipse.app4mc.emf.viewers.build;singleton:=true
-Bundle-Version: 1.2.0
-Bundle-Activator: org.eclipse.app4mc.emf.viewer.plantuml.Activator
-Require-Bundle: org.eclipse.ui
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .,
- lib/plantuml.8041.jar
-Bundle-Vendor: Eclipse APP4MC
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/pom.xml b/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/pom.xml
deleted file mode 100644
index 0d9e790..0000000
--- a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/pom.xml
+++ /dev/null
@@ -1,189 +0,0 @@
-<project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.eclipse.app4mc.emf.viewers</groupId>
- <artifactId>org.eclipse.app4mc.emf.viewers.build</artifactId>
- <version>0.9.0</version>
- <packaging>pom</packaging>
- <name>Eclipse APP4MC EMF Viewers</name>
-
- <properties>
- <tycho.version>0.22.0</tycho.version>
- <jacoco.version>0.7.4.201502262128</jacoco.version>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <luna-repo.url>http://download.eclipse.org/releases/luna</luna-repo.url>
- <amalthea-repo.url>http://download.eclipse.org/app4mc/updatesites/releases/0.9.7/</amalthea-repo.url>
-
- <orbit-repo.url>http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/</orbit-repo.url>
- <ease-repo-url>http://download.eclipse.org/ease/update/release</ease-repo-url>
- <sphinx-repo-url>http://download.eclipse.org/sphinx/updates/interim</sphinx-repo-url>
- </properties>
- <repositories>
-<repository>
- <id>amalthea</id>
- <url>${amalthea-repo.url}</url>
- <layout>p2</layout>
- </repository>
- <repository>
- <id>luna</id>
- <url>${luna-repo.url}</url>
- <layout>p2</layout>
- </repository>
- <repository>
- <id>orbit</id>
- <url>${orbit-repo.url}</url>
- <layout>p2</layout>
- </repository>
- <repository>
- <id>ease</id>
- <url>${ease-repo-url}</url>
- <layout>p2</layout>
- </repository>
- <repository>
- <id>sphinx</id>
- <url>${sphinx-repo-url}</url>
- <layout>p2</layout>
- </repository>
- </repositories>
-
-
- <modules>
- <!-- Plugins -->
- <module>../../plugins/org.eclipse.app4mc.emf.viewer.plantuml</module>
- <module>../../plugins/org.eclipse.app4mc.emf.metamodelviewer</module>
-
- <module>../../plugins/net.sourceforge.plantuml</module>
-
- <!-- Tests -->
-
- <!-- Features -->
- <module>../../features/org.eclipse.app4mc.emf.viewers.graphical</module>
- <module>../../features/org.eclipse.app4mc.emf.metamodelviewers</module>
-
- <!-- P2Repo -->
- <module>../org.eclipse.app4mc.emf.viewers.p2repo</module>
-
- </modules>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-maven-plugin</artifactId>
- <version>${tycho.version}</version>
- <extensions>true</extensions>
- <configuration>
-
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-compiler-plugin</artifactId>
- <version>${tycho.version}</version>
- <configuration>
- <verbose>true</verbose>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tycho.version}</version>
- <configuration>
- <dependency-resolution>
- <extraRequirements>
- <requirement>
- <type>eclipse-plugin</type>
- <id>org.hamcrest</id>
- <versionRange>0.0.0</versionRange>
- </requirement>
- </extraRequirements>
- </dependency-resolution>
- <environments>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho.version}</version>
- <configuration>
- <!-- argLine>${tycho.testArgLine}</argLine> -->
- <forkMode>never</forkMode>
- <includes>
- <include>**/*Test.*</include>
- </includes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.4.201502262128</version>
- <configuration>
- <excludes>
-
- </excludes>
- </configuration>
- <executions>
- <!-- Prepares the property pointing to the JaCoCo runtime agent which
- is passed as VM argument when Maven the Surefire plugin is executed. -->
- <execution>
- <id>pre-unit-test</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <configuration>
- <!-- Sets the path to the file which contains the execution data. -->
- <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
- </configuration>
- </execution>
- <!-- Ensures that the code coverage report for unit tests is created
- after unit tests have been run. -->
- <execution>
- <id>post-unit-test</id>
- <phase>verify</phase>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <!-- Sets the path to the file which contains the execution data. -->
- <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
- <!-- Sets the output directory for the code coverage report. -->
- <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/pom.xml b/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/pom.xml
deleted file mode 100644
index 8293e1b..0000000
--- a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../build/org.eclipse.app4mc.emf.viewers.build</relativePath>
- <groupId>org.eclipse.app4mc.emf.viewers</groupId>
- <artifactId>org.eclipse.app4mc.emf.viewers.build</artifactId>
- <version>0.9.0</version>
- </parent>
-
- <artifactId>org.eclipse.app4mc.emf.viewers.p2repo</artifactId>
- <packaging>eclipse-repository</packaging>
-
- <properties>
- <org.jboss.tools.tycho-plugins.version>0.22.0</org.jboss.tools.tycho-plugins.version>
- </properties>
-
- <pluginRepositories>
- <pluginRepository>
- <id>jboss-public-repository-group</id>
- <name>JBoss Public Repository Group</name>
- <url>http://repository.jboss.org/nexus/content/groups/public/</url>
- </pluginRepository>
-
- <pluginRepository>
- <id>jboss-snapshots-repository</id>
- <name>JBoss Snapshots Repository</name>
- <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
- </pluginRepository>
- </pluginRepositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-p2-repository-plugin</artifactId>
- <version>${tycho.version}</version>
-
- <configuration>
- <compress/>
- </configuration>
- </plugin>
-
-
- <plugin>
- <groupId>org.jboss.tools.tycho-plugins</groupId>
- <artifactId>repository-utils</artifactId>
- <version>${org.jboss.tools.tycho-plugins.version}</version>
-
- <executions>
- <execution>
- <id>generate-facade</id>
- <phase>package</phase>
-
- <goals>
- <goal>generate-repository-facade</goal>
- </goals>
-
- <configuration>
- <siteTemplateFolder>siteTemplate</siteTemplateFolder>
-
- <!-- Symbols are used while expanding index.html template -->
- <symbols>
- <update.site.name>${project.parent.name}</update.site.name>
- <target.eclipse.version>4.3.2</target.eclipse.version>
- </symbols>
-
- <associateSites>
- <!-- site>http://hudson.eclipse.org/hudson/job/damos-master/lastSuccessfulBuild/artifact/update-site</site>
- <site>http://download.eclipse.org/modeling/emf/emf/updates/releases</site>
- <site>http://download.eclipse.org/modeling/emf/compare/updates/releases</site>
- <site>http://download.eclipse.org/rmf/updates</site>
- <site>http://download.eclipse.org/sphinx/updates/interim</site>
- <site>http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases</site>
- <site>http://franca.github.io/franca/update_site/releases</site>
- <site>http://updates.yakindu.org/sct/kepler/releases</site>
-
- <site>http://download.eclipse.org/sphinx/updates/interim</site-->
- </associateSites>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/site.xml b/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/site.xml
deleted file mode 100644
index df94b97..0000000
--- a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/site.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <feature url="features/org.eclipse.app4mc.emf.metamodelviewers_0.9.0.qualifier.jar" id="org.eclipse.app4mc.emf.metamodelviewers" version="0.9.0.qualifier">
- <category name="Ecore Tools"/>
- </feature>
- <feature url="features/org.eclipse.app4mc.emf.viewers.graphical_0.9.0.qualifier.jar" id="org.eclipse.app4mc.emf.viewers.graphical" version="0.9.0.qualifier">
- <category name="Ecore Tools"/>
- </feature>
- <category-def name="Ecore Tools" label="Ecore Tools"/>
-</site>
diff --git a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/feature.xml b/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/feature.xml
index bfed304..d4d985d 100644
--- a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/feature.xml
+++ b/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.app4mc.emf.metamodelviewers"
label="APP4MC EMF MetaModel Viewers"
- version="0.9.0.qualifier"
+ version="0.9.8.qualifier"
provider-name="Eclipse APP4MC"
license-feature="org.eclipse.license"
license-feature-version="2.0.2.qualifier">
diff --git a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/pom.xml b/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/pom.xml
deleted file mode 100644
index 9e4e757..0000000
--- a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.metamodelviewers/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../build/org.eclipse.app4mc.emf.viewers.build</relativePath>
- <groupId>org.eclipse.app4mc.emf.viewers</groupId>
- <artifactId>org.eclipse.app4mc.emf.viewers.build</artifactId>
- <version>0.9.0</version>
- </parent>
-
- <artifactId>org.eclipse.app4mc.emf.metamodelviewers</artifactId>
- <packaging>eclipse-feature</packaging>
-
-</project>
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/feature.xml b/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/feature.xml
index c401235..f9d3655 100644
--- a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/feature.xml
+++ b/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.app4mc.emf.viewers.graphical"
label="APP4MC EMF Graphical Viewers"
- version="0.9.0.qualifier"
+ version="0.9.8.qualifier"
provider-name="Eclipse APP4MC"
license-feature="org.eclipse.license"
license-feature-version="2.0.2.qualifier">
@@ -29,15 +29,12 @@
<import plugin="org.eclipse.sphinx.emf.editors.forms"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.ui.browser"/>
+ <import feature="net.sourceforge.plantuml.ecore.feature" version="1.1.24"/>
+ <import feature="net.sourceforge.plantuml.feature" version="1.1.24"/>
+ <import feature="net.sourceforge.plantuml.lib.feature" version="1.2019.11"/>
</requires>
<plugin
- id="net.sourceforge.plantuml"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.eclipse.app4mc.emf.viewer.plantuml"
download-size="0"
install-size="0"
diff --git a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/pom.xml b/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/pom.xml
deleted file mode 100644
index 79c8ba6..0000000
--- a/eclipse-tools/emf-graphical-viewer/features/org.eclipse.app4mc.emf.viewers.graphical/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../build/org.eclipse.app4mc.emf.viewers.build</relativePath>
- <groupId>org.eclipse.app4mc.emf.viewers</groupId>
- <artifactId>org.eclipse.app4mc.emf.viewers.build</artifactId>
- <version>0.9.0</version>
- </parent>
-
- <artifactId>org.eclipse.app4mc.emf.viewers.graphical</artifactId>
- <packaging>eclipse-feature</packaging>
-
-</project>
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.classpath b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.classpath
deleted file mode 100644
index 3cd64d4..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/plantuml-2018.8.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.gitignore b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.gitignore
deleted file mode 100644
index 09e3bc9..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/bin/
-/target/
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.project b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.project
deleted file mode 100644
index 7614bd0..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>net.sourceforge.plantuml</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.settings/org.eclipse.jdt.core.prefs b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a698e59..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/META-INF/MANIFEST.MF b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/META-INF/MANIFEST.MF
deleted file mode 100644
index 19c6390..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,152 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Plantuml
-Bundle-SymbolicName: net.sourceforge.plantuml
-Bundle-Version: 8000.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Bundle-ClassPath: lib/plantuml-2018.8.jar
-Export-Package: gen.lib.cdt,
- gen.lib.cgraph,
- gen.lib.circogen,
- gen.lib.common,
- gen.lib.dotgen,
- gen.lib.fdpgen,
- gen.lib.gvc,
- gen.lib.label,
- gen.lib.ortho,
- gen.lib.pack,
- gen.lib.pathplan,
- gen.lib.xdot,
- gen.plugin.core,
- gen.plugin.dot_layout,
- h,
- net.sourceforge.plantuml,
- net.sourceforge.plantuml.activitydiagram,
- net.sourceforge.plantuml.activitydiagram.command,
- net.sourceforge.plantuml.activitydiagram3,
- net.sourceforge.plantuml.activitydiagram3.command,
- net.sourceforge.plantuml.activitydiagram3.ftile,
- net.sourceforge.plantuml.activitydiagram3.ftile.vcompact,
- net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond,
- net.sourceforge.plantuml.activitydiagram3.ftile.vertical,
- net.sourceforge.plantuml.anim,
- net.sourceforge.plantuml.ant,
- net.sourceforge.plantuml.api,
- net.sourceforge.plantuml.api.mda.option2,
- net.sourceforge.plantuml.api.mda.option3,
- net.sourceforge.plantuml.asciiart,
- net.sourceforge.plantuml.bpm,
- net.sourceforge.plantuml.braille,
- net.sourceforge.plantuml.brotli,
- net.sourceforge.plantuml.classdiagram,
- net.sourceforge.plantuml.classdiagram.command,
- net.sourceforge.plantuml.code,
- net.sourceforge.plantuml.command,
- net.sourceforge.plantuml.command.note,
- net.sourceforge.plantuml.command.note.sequence,
- net.sourceforge.plantuml.command.regex,
- net.sourceforge.plantuml.compositediagram,
- net.sourceforge.plantuml.compositediagram.command,
- net.sourceforge.plantuml.core,
- net.sourceforge.plantuml.creole,
- net.sourceforge.plantuml.cucadiagram,
- net.sourceforge.plantuml.cucadiagram.dot,
- net.sourceforge.plantuml.cucadiagram.entity,
- net.sourceforge.plantuml.cute,
- net.sourceforge.plantuml.dedication,
- net.sourceforge.plantuml.definition,
- net.sourceforge.plantuml.descdiagram,
- net.sourceforge.plantuml.descdiagram.command,
- net.sourceforge.plantuml.directdot,
- net.sourceforge.plantuml.donors,
- net.sourceforge.plantuml.eggs,
- net.sourceforge.plantuml.eps,
- net.sourceforge.plantuml.flashcode,
- net.sourceforge.plantuml.flowdiagram,
- net.sourceforge.plantuml.font,
- net.sourceforge.plantuml.ftp,
- net.sourceforge.plantuml.fun,
- net.sourceforge.plantuml.geom,
- net.sourceforge.plantuml.geom.kinetic,
- net.sourceforge.plantuml.golem,
- net.sourceforge.plantuml.graph,
- net.sourceforge.plantuml.graph2,
- net.sourceforge.plantuml.graphic,
- net.sourceforge.plantuml.graphic.color,
- net.sourceforge.plantuml.hector,
- net.sourceforge.plantuml.hector2,
- net.sourceforge.plantuml.hector2.continuity,
- net.sourceforge.plantuml.hector2.graphic,
- net.sourceforge.plantuml.hector2.layering,
- net.sourceforge.plantuml.hector2.mpos,
- net.sourceforge.plantuml.html,
- net.sourceforge.plantuml.jdot,
- net.sourceforge.plantuml.jungle,
- net.sourceforge.plantuml.math,
- net.sourceforge.plantuml.mda,
- net.sourceforge.plantuml.mjpeg,
- net.sourceforge.plantuml.objectdiagram,
- net.sourceforge.plantuml.objectdiagram.command,
- net.sourceforge.plantuml.openiconic,
- net.sourceforge.plantuml.openiconic.data,
- net.sourceforge.plantuml.oregon,
- net.sourceforge.plantuml.pdf,
- net.sourceforge.plantuml.png,
- net.sourceforge.plantuml.posimo,
- net.sourceforge.plantuml.postit,
- net.sourceforge.plantuml.preproc,
- net.sourceforge.plantuml.printskin,
- net.sourceforge.plantuml.project,
- net.sourceforge.plantuml.project.command,
- net.sourceforge.plantuml.project.graphic,
- net.sourceforge.plantuml.project2,
- net.sourceforge.plantuml.project2.command,
- net.sourceforge.plantuml.project3,
- net.sourceforge.plantuml.real,
- net.sourceforge.plantuml.salt,
- net.sourceforge.plantuml.salt.element,
- net.sourceforge.plantuml.salt.factory,
- net.sourceforge.plantuml.sequencediagram,
- net.sourceforge.plantuml.sequencediagram.command,
- net.sourceforge.plantuml.sequencediagram.graphic,
- net.sourceforge.plantuml.sequencediagram.puma,
- net.sourceforge.plantuml.sequencediagram.teoz,
- net.sourceforge.plantuml.skin,
- net.sourceforge.plantuml.skin.bluemodern,
- net.sourceforge.plantuml.skin.rose,
- net.sourceforge.plantuml.statediagram,
- net.sourceforge.plantuml.statediagram.command,
- net.sourceforge.plantuml.stats,
- net.sourceforge.plantuml.stats.api,
- net.sourceforge.plantuml.suggest,
- net.sourceforge.plantuml.svek,
- net.sourceforge.plantuml.svek.extremity,
- net.sourceforge.plantuml.svek.image,
- net.sourceforge.plantuml.svg,
- net.sourceforge.plantuml.swing,
- net.sourceforge.plantuml.syntax,
- net.sourceforge.plantuml.telnet,
- net.sourceforge.plantuml.tikz,
- net.sourceforge.plantuml.timingdiagram,
- net.sourceforge.plantuml.ugraphic,
- net.sourceforge.plantuml.ugraphic.arc,
- net.sourceforge.plantuml.ugraphic.crossing,
- net.sourceforge.plantuml.ugraphic.eps,
- net.sourceforge.plantuml.ugraphic.g2d,
- net.sourceforge.plantuml.ugraphic.hand,
- net.sourceforge.plantuml.ugraphic.html5,
- net.sourceforge.plantuml.ugraphic.sprite,
- net.sourceforge.plantuml.ugraphic.svg,
- net.sourceforge.plantuml.ugraphic.tikz,
- net.sourceforge.plantuml.ugraphic.txt,
- net.sourceforge.plantuml.ugraphic.visio,
- net.sourceforge.plantuml.utils,
- net.sourceforge.plantuml.version,
- net.sourceforge.plantuml.vizjs,
- net.sourceforge.plantuml.xmi,
- net.sourceforge.plantuml.xmlsc,
- net.sourceforge.plantuml.zopfli,
- smetana.core,
- smetana.core.amiga,
- smetana.core.debug
-Automatic-Module-Name: net.sourceforge.plantuml
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/build.properties b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/build.properties
deleted file mode 100644
index dc20abe..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# *******************************************************************************
-# Copyright (c) 2017 - 2018 Robert Bosch GmbH and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 2.0
-# which accompanies this distribution, and is available at
-# https://www.eclipse.org/legal/epl-2.0/
-#
-# Contributors:
-# Robert Bosch GmbH - initial API and implementation
-#
-# *******************************************************************************
-bin.includes = META-INF/,\
- lib-src/,\
- lib/plantuml-2018.8.jar
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib-src/README.txt b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib-src/README.txt
deleted file mode 100644
index 6416959..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib-src/README.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Goto http://plantuml.sourceforge.net/ for product info
-
-CQ clearance as a part of eclipse IPZilla (CQ 8178): https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8178
-
-Downloaded jar from : http://sourceforge.net/projects/plantuml/files/plantuml-jar-epl-8000.zip/download
-
-Downloaded sources from : https://dev.eclipse.org/ipzilla/attachment.cgi?id=11627
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib-src/plantuml-sources-epl-8000.zip b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib-src/plantuml-sources-epl-8000.zip
deleted file mode 100644
index 69db480..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib-src/plantuml-sources-epl-8000.zip
+++ /dev/null
Binary files differ
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib/plantuml-2018.8.jar b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib/plantuml-2018.8.jar
deleted file mode 100644
index 7f4bde6..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/lib/plantuml-2018.8.jar
+++ /dev/null
Binary files differ
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/license/license.txt b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/license/license.txt
deleted file mode 100644
index 47adaf9..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/license/license.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-========================================================================
-PlantUML : a free UML diagram generator
-========================================================================
-
-(C) Copyright 2009-2014, Arnaud Roques
-
-Project Info: http://plantuml.sourceforge.net
-
-PlantUML is free software; you can redistribute it and/or modify it
-under the terms of the Eclipse Public License.
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
-LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
-
-ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
-RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-You may obtain a copy of the License at
-
-http://www.eclipse.org/legal/epl-v10.html
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Note that images (whatever their format : PNG, SVG...) generated by running PlantUML
-are owned by the author of their corresponding sources code (that is, their
-textual description in PlantUML language). Those images are not covered by
-the Eclipse Public License.
-
-The generated images can then be used without any reference to the Eclipse Public License.
-It is not even necessary to stipulate that they have been generated with PlantUML,
-also this will be appreciate by PlantUML team.
-
-There is an exception : if the textual description in PlantUML language is also covered
-by a license (like the EPL), then the generated images are logically covered
-by the very same license.
-
-Icon provided by OpenIconic : https://useiconic.com/open/
-
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/pom.xml b/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/pom.xml
deleted file mode 100644
index f489eaa..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/net.sourceforge.plantuml/pom.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
-<parent>
- <relativePath>../../build/org.eclipse.app4mc.emfutils.extractor.build</relativePath>
- <groupId>org.eclipse.app4mc.emfutils.content.extractor</groupId>
- <artifactId>org.eclipse.app4mc.emfutils.extractor.build</artifactId>
- <version>0.8.3</version>
- </parent>
-
- <artifactId>net.sourceforge.plantuml</artifactId>
- <packaging>eclipse-plugin</packaging>
- <version>8000.0.0-SNAPSHOT</version>
-
-</project>
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/META-INF/MANIFEST.MF b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/META-INF/MANIFEST.MF
index 630841f..b54e4f2 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/META-INF/MANIFEST.MF
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/META-INF/MANIFEST.MF
@@ -2,11 +2,12 @@
Bundle-ManifestVersion: 2
Bundle-Name: APP4MC EMF Metamodel Viewer
Bundle-SymbolicName: org.eclipse.app4mc.emf.metamodelviewer;singleton:=true
-Bundle-Version: 0.9.0
+Bundle-Version: 0.9.8.qualifier
Bundle-Vendor: Eclipse APP4MC
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.ui,
- org.eclipse.sphinx.emf
+ org.eclipse.sphinx.emf,
+ org.eclipse.jface;bundle-version="3.14.0",
+ org.eclipse.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Activator: org.eclipse.app4mc.emf.metamodelviewer.base.Activator
Bundle-ActivationPolicy: lazy
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/pom.xml b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/pom.xml
deleted file mode 100644
index cb2c3c5..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.metamodelviewer/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../build/org.eclipse.app4mc.emf.viewers.build</relativePath>
- <groupId>org.eclipse.app4mc.emf.viewers</groupId>
- <artifactId>org.eclipse.app4mc.emf.viewers.build</artifactId>
- <version>0.9.0</version>
- </parent>
-
- <artifactId>org.eclipse.app4mc.emf.metamodelviewer</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <build>
- <sourceDirectory>src</sourceDirectory>
- <resources>
- <resource>
- <directory>xtend-gen</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.4.1</version>
- <configuration>
- <filesets>
- <fileset>
- <directory>xtend-gen</directory>
- <includes>
- <include>**</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>xtend-gen</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>xtend-maven-plugin</artifactId>
- <version>2.14.0</version>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>org.eclipse.jdt.core</artifactId>
- <version>3.13.102</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>org.eclipse.jdt.compiler.apt</artifactId>
- <version>1.3.110</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>org.eclipse.jdt.compiler.tool</artifactId>
- <version>1.2.101</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>org.eclipse.emf.codegen</artifactId>
- <version>2.11.0</version>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- <goal>xtend-install-debug-info</goal>
- <goal>testCompile</goal>
- <goal>xtend-test-install-debug-info</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <outputDirectory>xtend-gen</outputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/META-INF/MANIFEST.MF b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/META-INF/MANIFEST.MF
index 298ee04..63a221b 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/META-INF/MANIFEST.MF
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/META-INF/MANIFEST.MF
@@ -2,8 +2,10 @@
Bundle-ManifestVersion: 2
Bundle-Name: APP4MC EMF Viewer (PlantUML)
Bundle-SymbolicName: org.eclipse.app4mc.emf.viewer.plantuml;singleton:=true
-Bundle-Version: 0.9.0
+Bundle-Version: 0.9.8.qualifier
+Bundle-ClassPath: .
Bundle-Activator: org.eclipse.app4mc.emf.viewer.plantuml.Activator
+Bundle-Vendor: Eclipse APP4MC
Require-Bundle: com.google.guava,
org.eclipse.core.runtime,
org.eclipse.emf.ecore,
@@ -15,12 +17,21 @@
org.eclipse.ui.browser,
org.eclipse.sphinx.emf,
org.eclipse.sphinx.emf.editors,
- org.eclipse.sphinx.emf.editors.forms
+ org.eclipse.sphinx.emf.editors.forms,
+ org.eclipse.e4.ui.model.workbench,
+ org.eclipse.e4.core.di,
+ org.eclipse.e4.core.contexts,
+ org.eclipse.e4.core.di.extensions,
+ org.eclipse.e4.ui.di,
+ org.eclipse.e4.ui.services,
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.core.services
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
-Import-Package: net.sourceforge.plantuml;version="1.2019.0",
- net.sourceforge.plantuml.core;version="1.2019.0"
-Bundle-ClassPath: .
-Bundle-Vendor: Eclipse APP4MC
+Import-Package: javax.annotation;version="1.2.0",
+ javax.inject;version="1.0.0",
+ net.sourceforge.plantuml;version="1.2019.0",
+ net.sourceforge.plantuml.core;version="1.2019.0",
+ net.sourceforge.plantuml.eclipse.utils,
+ org.slf4j;version="1.7.2"
Automatic-Module-Name: org.eclipse.app4mc.emf.viewer.plantuml
-
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/build.properties b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/build.properties
index 3e871de..4f03bd5 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/build.properties
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/build.properties
@@ -1,21 +1,11 @@
-# *******************************************************************************
-# Copyright (c) 2017 - 2020 Robert Bosch GmbH and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 2.0
-# which accompanies this distribution, and is available at
-# https://www.eclipse.org/legal/epl-2.0/
-#
-# Contributors:
-# Robert Bosch GmbH - initial API and implementation
-#
-# *******************************************************************************
-source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
icons/,\
epl-2.0.html,\
- about.html
+ about.html,\
+ fragment.e4xmi
src.includes = about.html,\
epl-2.0.html
+source.. = src/
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/fragment.e4xmi b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/fragment.e4xmi
new file mode 100644
index 0000000..c271538
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/fragment.e4xmi
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_24JxkGmpEeqly_jY3FLnyw">
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_4M1skGmpEeqly_jY3FLnyw" featurename="descriptors" parentElementId="xpath:/">
+ <elements xsi:type="basic:PartDescriptor" xmi:id="_7EwU4GmpEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView" label="Diagram View" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/sample.gif" category="APP4MC" closeable="true" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView">
+ <toolbar xmi:id="_DIC14GmqEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.toolbar.0">
+ <children xsi:type="menu:DirectToolItem" xmi:id="_jgBp0GmqEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.directtoolitem.select" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/targetinternal_obj.png" tooltip="Link the selection in the editor with the current diagram type" type="Check" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.LinkWithEditorHandler"/>
+ </toolbar>
+ </elements>
+ </fragments>
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_gMvh4GmvEeqly_jY3FLnyw" featurename="commands" parentElementId="xpath:/">
+ <elements xsi:type="commands:Command" xmi:id="_hnm9YGmvEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.extracteclasshierarchy" commandName="Extract EClass Hierarchy" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Command" xmi:id="_1iuA8GmvEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.extracteobjectreferences" commandName="Extract EObject References" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Command" xmi:id="_P8RuoGmwEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.extracteclassallreferences" commandName="Extract EClass All References" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Command" xmi:id="_SVoLoGmwEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.extracteclasshierarchyandtheircontents" commandName="Extract EClass Hierarchy And Their Contents" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Command" xmi:id="_W4xmsGmwEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.extracteclassumlcontents" commandName="Extract EClass UML Contents" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Command" xmi:id="_Zw9UwGmwEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.fromreference-extracteclassumlcontents" commandName="From reference -> Extract EClass UML Contents" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Command" xmi:id="_dIkJwGmwEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.command.copycontentsandgeneratecsv" commandName="Copy Contents and Generate CSV" category="_qKzGcGmvEeqly_jY3FLnyw"/>
+ </fragments>
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_nfvOYGmvEeqly_jY3FLnyw" featurename="categories" parentElementId="xpath:/">
+ <elements xsi:type="commands:Category" xmi:id="_qKzGcGmvEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.category" name="Extract Eclass References"/>
+ </fragments>
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_bQFvwGmxEeqly_jY3FLnyw" featurename="handlers" parentElementId="xpath:/">
+ <elements xsi:type="commands:Handler" xmi:id="_ceh40GmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.0" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassHierarchyHandler" command="_hnm9YGmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Handler" xmi:id="_kV_kUGmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.1" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.EObjectRefsHandler" command="_1iuA8GmvEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Handler" xmi:id="_qg0H0GmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.2" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassAllReferencesHandler" command="_P8RuoGmwEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Handler" xmi:id="_uBWPUGmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.3" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsAndHierarchyHandler" command="_SVoLoGmwEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Handler" xmi:id="_ylP4UGmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.4" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsHandler" command="_W4xmsGmwEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Handler" xmi:id="_17314GmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.5" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsFromReferenceHandler" command="_Zw9UwGmwEeqly_jY3FLnyw"/>
+ <elements xsi:type="commands:Handler" xmi:id="_43st0GmxEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handler.6" contributionURI="bundleclass://org.eclipse.app4mc.emf.viewer.plantuml/org.eclipse.app4mc.emf.viewer.plantuml.handlers.CopyContentsHandler" command="_dIkJwGmwEeqly_jY3FLnyw"/>
+ </fragments>
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_U-pKYGmyEeqly_jY3FLnyw" featurename="menuContributions" parentElementId="xpath:/">
+ <elements xsi:type="menu:MenuContribution" xmi:id="_WQga4GmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.menucontribution.0" positionInParent="after=additions" parentId="popup">
+ <children xsi:type="menu:Menu" xmi:id="_ddrMMGmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.menu" label="APP4MC EMF Utils" mnemonics="">
+ <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_n6-cEGmzEeqly_jY3FLnyw" coreExpressionId="org.eclipse.app4mc.emf.viewer.plantuml.definition.ecore"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_hJ60cGmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.eclasshierarchy" label="EClass Hierarchy" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/keygroups_obj.gif" mnemonics="" command="_hnm9YGmvEeqly_jY3FLnyw"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_n74QcGmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.eobjectrefs" label="EObject Refs" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/sample.gif" command="_1iuA8GmvEeqly_jY3FLnyw"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_tYaKkGmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.eclassallreferences" label="EClass All References" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/tag_blue_add.png" command="_P8RuoGmwEeqly_jY3FLnyw"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_0rNCwGmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.eclasscontentshierarchy" label="EClass Contents + Hierarchy" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/elements_obj.gif" command="_SVoLoGmwEeqly_jY3FLnyw"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_8Xoi8GmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.eclasscontents" label="EClass Contents" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/prop_ps.gif" command="_W4xmsGmwEeqly_jY3FLnyw"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="__g6BAGmyEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.eclasscontentsfromreference" label="EClass Contents from Reference" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/drive_go.png" command="_Zw9UwGmwEeqly_jY3FLnyw"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_HvDuMGmzEeqly_jY3FLnyw" elementId="org.eclipse.app4mc.emf.viewer.plantuml.handledmenuitem.copycontentscommand" label="Copy Contents Command" iconURI="platform:/plugin/org.eclipse.app4mc.emf.viewer.plantuml/icons/keygroups_obj.gif" command="_dIkJwGmwEeqly_jY3FLnyw"/>
+ </children>
+ </elements>
+ </fragments>
+</fragment:ModelFragments>
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/icons/targetinternal_obj.png b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/icons/targetinternal_obj.png
new file mode 100644
index 0000000..9c483c1
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/icons/targetinternal_obj.png
Binary files differ
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/plugin.xml b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/plugin.xml
index faee1ce..4c28402 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/plugin.xml
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/plugin.xml
@@ -1,330 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
<plugin>
- <extension
- point="org.eclipse.ui.commands">
- <category
- id="org.eclipse.app4mc.emf.viewer.plantuml.category"
- name="Extract Eclass References Category">
- </category>
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.eClassHierarchy.command"
- name="Extract Eclass Hierarchy">
- </command>
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.eObjectReferences.command"
- name="Extract Eobject References">
- </command>
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.eClassAllReferences.command"
- name="Extract Eclass All References">
- </command>
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.eClassContentsAndHierarchy.command"
- name="Extract Eclass Hierarchy And Their Contents">
- </command>
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.eClassContents.command"
- name="Extract Eclass UML Contents">
- </command>
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.eClassContentsFromReference.command"
- name="From reference -> Extract Eclass UML Contents">
- </command>
-
- <command
- categoryId="org.eclipse.app4mc.emf.viewer.plantuml.category"
- id="org.eclipse.app4mc.emf.viewer.plantuml.copyContents.command"
- name="Copy Contents and Generate CSV">
- </command>
-
-
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassHierarchyHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassHierarchy.command">
- </handler>
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.EObjectRefsHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eObjectReferences.command">
- </handler>
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassAllReferencesHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassAllReferences.command">
- </handler>
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsAndHierarchyHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassContentsAndHierarchy.command">
- </handler>
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassContents.command">
- </handler>
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsFromReferenceHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassContentsFromReference.command">
- </handler>
- <handler
- class="org.eclipse.app4mc.emf.viewer.plantuml.handlers.CopyContentsHandler"
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.copyContents.command">
- </handler>
- </extension>
-
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
- <menu
- id="org.eclipse.app4mc.emf.viewer.plantuml.menu"
- label="APP4MC-EMF Utils"
- mnemonic="M">
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassHierarchy.command"
- icon="icons/keygroups_obj.gif"
- id="com.test.menus.sampleCommand"
- label="EClass Hierarchy"
- mnemonic="S">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate
- operator="or">
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EDataType">
- </instanceof>
- </not>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </not>
- </or>
- </iterate>
-
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eObjectReferences.command"
- icon="icons/sample.gif"
- id="com.test.menus.sampleCommand1"
- label="Eobject Refs">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EClass">
- </instanceof>
- </not>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </not>
- </or>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EDataType">
- </instanceof>
- </not>
- </or>
- </iterate>
-
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassAllReferences.command"
- icon="icons/tag_blue_add.png"
- id="com.test.menus.sampleCommand4"
- label="EClass All References"
- mnemonic="S">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EDataType">
- </instanceof>
- </not>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </not>
- </or>
- </iterate>
-
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassContentsAndHierarchy.command"
- icon="icons/elements_obj.gif"
- id="com.test.menus.sampleCommand"
- label="EClass Contents + Hierarchy"
- mnemonic="S">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EDataType">
- </instanceof>
- </not>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </not>
- </or>
- </iterate>
-
- </with>
-
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassContents.command"
- icon="icons/prop_ps.gif"
- id="com.test.menus.sampleCommand"
- label="EClass Contents"
- mnemonic="S">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EDataType">
- </instanceof>
- </not>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </not>
- </or>
- </iterate>
-
- </with>
-
- </visibleWhen>
- </command>
-
-
-
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.eClassContentsFromReference.command"
- icon="icons/drive_go.png"
- id="com.test.menus.sampleCommand"
- label="EClass Contents from Reference"
- mnemonic="S">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </iterate>
-
- </with>
- </visibleWhen>
- </command>
-
- <command
- commandId="org.eclipse.app4mc.emf.viewer.plantuml.copyContents.command"
- icon="icons/keygroups_obj.gif"
- id="com.test.menus.sampleCommand.copy"
- label="Copy Contents Command"
- mnemonic="S">
- <visibleWhen
- checkEnabled="true">
-
- <with
- variable="activeMenuSelection">
-
- <iterate
- operator="or">
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EDataType">
- </instanceof>
- </not>
- <or>
- <not>
- <instanceof
- value="org.eclipse.emf.ecore.EStructuralFeature">
- </instanceof>
- </not>
- </or>
- </iterate>
-
- </with>
- </visibleWhen>
- </command>
-
-
-
-
- <visibleWhen
- checkEnabled="true">
- <with
- variable="activeMenuSelection">
- <iterate>
- <instanceof
- value="org.eclipse.emf.ecore.EObject">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </menu>
- </menuContribution>
- </extension>
+
<extension
point="org.eclipse.ui.preferencePages">
<page
class="org.eclipse.app4mc.emf.viewer.plantuml.preferences.AmaltheaGraphicalRepresentationPreferencePage"
id="org.eclipse.app4mc.emf.viewer.plantuml.preferences.AmaltheaPreferencePage"
- name="AMALTHEA-Graphical-Representation">
+ name="AMALTHEA Graphical Representation">
</page>
</extension>
<extension
@@ -334,20 +16,6 @@
</initializer>
</extension>
<extension
- point="org.eclipse.ui.views">
- <category
- id="org.eclipse.app4mc.emf.viewer.plantuml"
- name="AMALTHEA Graphical Representation">
- </category>
- <view
- category="org.eclipse.app4mc.emf.viewer.plantuml"
- class="org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView"
- icon="icons/sample.gif"
- id="org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView"
- name="Diagram View">
- </view>
- </extension>
- <extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
@@ -359,5 +27,27 @@
</view>
</perspectiveExtension>
</extension>
+ <extension
+ id="org.eclipse.app4mc.emf.viewer.plantuml.fragment"
+ point="org.eclipse.e4.workbench.model">
+ <fragment
+ uri="fragment.e4xmi"
+ apply="always">
+ </fragment>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.definitions">
+ <definition
+ id="org.eclipse.app4mc.emf.viewer.plantuml.definition.ecore">
+ <with
+ variable="activeMenuSelection">
+ <iterate>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ </iterate>
+ </with>
+ </definition>
+ </extension>
</plugin>
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/pom.xml b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/pom.xml
deleted file mode 100644
index bed4071..0000000
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../build/org.eclipse.app4mc.emf.viewers.build</relativePath>
- <groupId>org.eclipse.app4mc.emf.viewers</groupId>
- <artifactId>org.eclipse.app4mc.emf.viewers.build</artifactId>
- <version>0.9.0</version>
- </parent>
-
- <artifactId>org.eclipse.app4mc.emf.viewer.plantuml</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <build>
- <sourceDirectory>src</sourceDirectory>
- <resources>
- <resource>
- <directory>xtend-gen</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.4.1</version>
- <configuration>
- <filesets>
- <fileset>
- <directory>xtend-gen</directory>
- <includes>
- <include>**</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>xtend-gen</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>xtend-maven-plugin</artifactId>
- <version>2.14.0</version>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>org.eclipse.jdt.core</artifactId>
- <version>3.13.102</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>org.eclipse.jdt.compiler.apt</artifactId>
- <version>1.3.110</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>org.eclipse.jdt.compiler.tool</artifactId>
- <version>1.2.101</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>org.eclipse.emf.codegen</artifactId>
- <version>2.11.0</version>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- <goal>xtend-install-debug-info</goal>
- <goal>testCompile</goal>
- <goal>xtend-test-install-debug-info</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <outputDirectory>xtend-gen</outputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/AbstractPlantUMLBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/AbstractPlantUMLBuilder.java
index 3dcddd4..b62902e 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/AbstractPlantUMLBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/AbstractPlantUMLBuilder.java
@@ -41,6 +41,15 @@
private Set<Object> nodes;
private Set<String> connections;
+ public BuilderResult generatePlantUML(Object selectedObject) {
+ if (selectedObject instanceof EClass) {
+ return generatePlantUML((EClass) selectedObject);
+ }
+ return null;
+ }
+
+ public abstract BuilderResult generatePlantUML(EClass selectedObjClass);
+
protected void resetCaches() {
id2ObjectMap = null;
object2IdMap = null;
@@ -128,7 +137,7 @@
protected void appendAsContainment(final StringBuilder plantuml, final EStructuralFeature feature) {
final EClass source = feature.getEContainingClass();
- final EClassifier target = (EClassifier) feature.getEType();
+ final EClassifier target = feature.getEType();
appendAsContainment(plantuml, feature, source, target);
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/BuilderResult.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/BuilderResult.java
index 0c92df3..a5e0975 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/BuilderResult.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/BuilderResult.java
@@ -19,6 +19,9 @@
import java.util.Map;
public class BuilderResult {
+
+ private Map<String, Object> id2Object;
+ private String plantUML;
public BuilderResult(Map<String, Object> id2ObjectMap, String plantUMLText) {
this.id2Object = new HashMap<String, Object>();
@@ -28,9 +31,6 @@
this.plantUML = plantUMLText;
}
- private Map<String, Object> id2Object;
- private String plantUML;
-
public Map<String, Object> getId2ObjectMap() {
return id2Object;
}
@@ -38,5 +38,4 @@
public String getPlantUMLText() {
return plantUML;
}
-
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassAllReferencesBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassAllReferencesBuilder.java
index bccc3ef..157be29 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassAllReferencesBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassAllReferencesBuilder.java
@@ -31,6 +31,7 @@
public class EClassAllReferencesBuilder extends AbstractPlantUMLBuilder {
+ @Override
public BuilderResult generatePlantUML(final EClass selectedObjClass) {
resetCaches();
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsAndHierarchyBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsAndHierarchyBuilder.java
index 5ca278a..513fd80 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsAndHierarchyBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsAndHierarchyBuilder.java
@@ -22,6 +22,7 @@
public class EClassContentsAndHierarchyBuilder extends AbstractPlantUMLBuilder {
+ @Override
public BuilderResult generatePlantUML(final EClass selectedObjClass) {
this.resetCaches();
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsFromReferenceBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsFromReferenceBuilder.java
index b81df3e..ecf17f4 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsFromReferenceBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassContentsFromReferenceBuilder.java
@@ -22,6 +22,7 @@
public class EClassContentsFromReferenceBuilder extends AbstractPlantUMLBuilder {
+ @Override
public BuilderResult generatePlantUML(final EClass selectedObjClass) {
this.resetCaches();
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassHierarchyBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassHierarchyBuilder.java
index 1735c00..01e8518 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassHierarchyBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EClassHierarchyBuilder.java
@@ -21,7 +21,8 @@
public class EClassHierarchyBuilder extends AbstractPlantUMLBuilder {
- public BuilderResult generatePlantUML(final EClass selectedObjClass) {
+ @Override
+ public BuilderResult generatePlantUML(EClass selectedObjClass) {
resetCaches();
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EObjectRefsBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EObjectRefsBuilder.java
index d2767d1..ac0a308 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EObjectRefsBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/EObjectRefsBuilder.java
@@ -21,17 +21,28 @@
import java.util.List;
import java.util.regex.Pattern;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.widgets.Display;
public class EObjectRefsBuilder extends AbstractPlantUMLBuilder {
- public BuilderResult generatePlantUML(final EObject eObject) {
+ UISynchronize sync;
+
+ public EObjectRefsBuilder(UISynchronize sync) {
+ this.sync = sync;
+ }
+
+ @Override
+ public BuilderResult generatePlantUML(final EClass eObject) {
resetCaches();
@@ -58,57 +69,59 @@
final List<EObject> result = new ArrayList<EObject>();
- /*- getting all the elements from the selected objects EClass --> by supplying the EResource of the corresponding EClass (i.e. ecore or Xcore) */
+ /* getting all the elements from the selected objects EClass --> by supplying the EResource of the corresponding EClass (i.e. ecore or Xcore) */
- Collection<Setting> allRefSettings = null;
-
- final Resource eResource = selectedEObj.eResource();
-
- if (eResource == null) {
- allRefSettings = EcoreUtil.UsageCrossReferencer.find(selectedEObj, EcoreUtil.getRootContainer(selectedEObj));
- } else if (eResource.getResourceSet() == null) {
- allRefSettings = EcoreUtil.UsageCrossReferencer.find(selectedEObj, eResource);
- } else {
- allRefSettings = EcoreUtil.UsageCrossReferencer.find(selectedEObj, eResource.getResourceSet());
- }
-
- /*-
+ final Collection<Setting> allRefSettings = getAllRefSettings(selectedEObj);
+
+ /*
* In case of many elements it is difficult to visualize the contents in the diagram.
*
* Below code provides the possibility to specify the range
*/
- if (allRefSettings.size() > 100) {
+ if (allRefSettings.size() > 10) {
- final InputDialog inputDialog = new InputDialog(
- org.eclipse.swt.widgets.Display.getDefault().getActiveShell(), "Element selection dialog",
- "There are " + allRefSettings.size()
- + " references. specify the range for which contents should be represented graphically",
- "0-" + (allRefSettings.size() - 1), new IInputValidator() {
+ if (sync != null) {
+ sync.syncExec(() -> {
+ InputDialog inputDialog = new InputDialog(
+ Display.getDefault().getActiveShell(),
+ "Element selection dialog",
+ "There are " + allRefSettings.size() + " references. Specify the range for which contents should be represented graphically",
+ "0-" + (allRefSettings.size() - 1), new IInputValidator() {
- @Override
- public String isValid(final String newText) {
- if (Pattern.matches("(\\d)+\\-(\\d)+", newText) == false) {
- return "Specify the range in the following way int-int eg. 10-20 ";
- }
- return null;
- }
- });
+ @Override
+ public String isValid(final String newText) {
+ if (!Pattern.matches("(\\d)+\\-(\\d)+", newText)) {
+ return "Specify the range in the following way int-int eg. 10-20 ";
+ }
+ return null;
+ }
+ });
- final int status = inputDialog.open();
+ int status = inputDialog.open();
- if (status == 0) {
- final String value = inputDialog.getValue();
+ List<Setting> subList = null;
+ if (status == Dialog.OK) {
+ String value = inputDialog.getValue();
+ String[] split = value.split("-");
- final String[] split = value.split("-");
+ subList = new ArrayList<>(allRefSettings).subList(Integer.parseInt(split[0]),
+ Integer.parseInt(split[1]) < allRefSettings.size()
+ ? Integer.parseInt(split[1])
+ : (allRefSettings.size() - 1));
- allRefSettings = new ArrayList<Setting>(allRefSettings).subList(Integer.parseInt(split[0]),
- Integer.parseInt(split[1]) < allRefSettings.size() ? Integer.parseInt(split[1])
- : (allRefSettings.size() - 1));
-
+ } else {
+ subList = new ArrayList<Setting>(allRefSettings).subList(0, 99);
+ }
+
+ allRefSettings.clear();
+ allRefSettings.addAll(subList);
+ });
+
} else {
- allRefSettings = new ArrayList<Setting>(allRefSettings).subList(0, 99);
+ List<Setting> subList = new ArrayList<>(allRefSettings).subList(0, 99);
+ allRefSettings.clear();
+ allRefSettings.addAll(subList);
}
-
}
/*- if refs of the EClass are found, then fill the plantUMLBuffer with the appropriate contents */
@@ -150,6 +163,16 @@
}
}
+ private Collection<Setting> getAllRefSettings(EObject selectedEObj) {
+ Resource eResource = selectedEObj.eResource();
+ if (eResource == null) {
+ return EcoreUtil.UsageCrossReferencer.find(selectedEObj, EcoreUtil.getRootContainer(selectedEObj));
+ } else if (eResource.getResourceSet() == null) {
+ return EcoreUtil.UsageCrossReferencer.find(selectedEObj, eResource);
+ }
+ return EcoreUtil.UsageCrossReferencer.find(selectedEObj, eResource.getResourceSet());
+ }
+
private void createClass(final StringBuilder plantuml, final EObject selectedEObj) {
if (!getNodes().contains(selectedEObj)) {
addNode(selectedEObj); // mark as created
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/ObjectContentBuilder.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/ObjectContentBuilder.java
index f885ac0..c07a8fc 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/ObjectContentBuilder.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/builders/ObjectContentBuilder.java
@@ -19,17 +19,36 @@
import java.util.List;
import java.util.regex.Pattern;
+import org.eclipse.e4.ui.di.UISynchronize;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.widgets.Display;
public class ObjectContentBuilder extends AbstractPlantUMLBuilder {
- public BuilderResult generatePlantUML(final EObject eObject) {
+ UISynchronize sync;
+
+ public ObjectContentBuilder(UISynchronize sync) {
+ this.sync = sync;
+ }
+
+ @Override
+ public BuilderResult generatePlantUML(Object selectedObject) {
+ if (selectedObject instanceof EList) {
+ return generatePlantUMLForCollection((EList<?>) selectedObject);
+ }
+ return super.generatePlantUML(selectedObject);
+ }
+
+ @Override
+ public BuilderResult generatePlantUML(final EClass eObject) {
resetCaches();
@@ -194,45 +213,53 @@
return eObject.eClass().getName() + "__" + eObject.hashCode();
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
private List<?> getElementsBasedOnRange(final EList<?> eList) {
if (eList.size() > 100) {
- List<?> subList = new ArrayList();
-
- final InputDialog inputDialog = new InputDialog(
- org.eclipse.swt.widgets.Display.getDefault().getActiveShell(), "Element selection dialog",
- "There are " + eList.size()
- + " references. specify the range for which contents should be represented graphically",
- "0-" + (eList.size() - 1), new IInputValidator() {
-
- @Override
- public String isValid(final String newText) {
- if (Pattern.matches("(\\d)+\\-(\\d)+", newText) == false) {
- return "Specify the range in the following way int-int eg. 10-20 ";
- }
- return null;
- }
- });
-
- final int status = inputDialog.open();
-
- if (status == 0) {
- final String value = inputDialog.getValue();
-
- final String[] split = value.split("-");
-
- subList = new ArrayList(eList).subList(Integer.parseInt(split[0]),
- Integer.parseInt(split[1]) < eList.size() ? Integer.parseInt(split[1]) : (eList.size() - 1));
-
- } else {
- subList = new ArrayList(eList).subList(0, 99);
+ if (sync != null) {
+ sync.syncExec(() -> {
+
+ List subList = new ArrayList();
+
+ InputDialog inputDialog = new InputDialog(
+ Display.getDefault().getActiveShell(),
+ "Element selection dialog",
+ "There are " + eList.size() + " references. Specify the range for which contents should be represented graphically",
+ "0-" + (eList.size() - 1), new IInputValidator() {
+
+ @Override
+ public String isValid(final String newText) {
+ if (!Pattern.matches("(\\d)+\\-(\\d)+", newText)) {
+ return "Specify the range in the following way int-int eg. 10-20 ";
+ }
+ return null;
+ }
+ });
+
+ int status = inputDialog.open();
+
+ if (status == Dialog.OK) {
+ String value = inputDialog.getValue();
+
+ String[] split = value.split("-");
+
+ subList = new ArrayList<>(eList).subList(
+ Integer.parseInt(split[0]),
+ Integer.parseInt(split[1]) < eList.size()
+ ? Integer.parseInt(split[1])
+ : (eList.size() - 1));
+ } else {
+ subList = new ArrayList<>(eList).subList(0, 99);
+ }
+
+ eList.clear();
+ eList.addAll(subList);
+ });
}
-
- return subList;
-
}
+
return eList;
}
-
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/AbstractPlantUMLHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/AbstractPlantUMLHandler.java
index 816f683..ef2f034 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/AbstractPlantUMLHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/AbstractPlantUMLHandler.java
@@ -15,370 +15,139 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Map;
-import org.eclipse.app4mc.emf.viewer.plantuml.Activator;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
-import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
+import org.eclipse.app4mc.emf.viewer.plantuml.utils.DiagramCreator;
+import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
+import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
import org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView;
-import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import net.sourceforge.plantuml.FileFormat;
-import net.sourceforge.plantuml.FileFormatOption;
-import net.sourceforge.plantuml.SourceStringReader;
+public abstract class AbstractPlantUMLHandler {
-public abstract class AbstractPlantUMLHandler extends AbstractHandler {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPlantUMLHandler.class);
+
+ protected abstract AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync);
+
+ protected abstract ExecutionCategory getExecutionCategory();
- protected void openEReferencesView(final EClass activeEClass) {
-
- if (activeEClass != null) {
- try {
-
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .findView("org.eclipse.emf.ecoretools.internal.views.EReferencesView") == null) {
-
- return;
- }
- final IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .showView("org.eclipse.emf.ecoretools.internal.views.EReferencesView");
-
- if (view != null) {
- final Class<?> eClassReferencesViewClass = Class
- .forName("org.eclipse.emf.ecoretools.internal.views.EReferencesView");
-
- if (eClassReferencesViewClass != null) {
- final Method setAnalyzedObjectMethod = eClassReferencesViewClass.getMethod("setAnalyzedObject",
- EObject.class);
-
- if (setAnalyzedObjectMethod != null) {
- setAnalyzedObjectMethod.setAccessible(true);
- setAnalyzedObjectMethod.invoke(view, activeEClass);
- }
- }
- }
-
- } catch (final PartInitException exception) {
- exception.printStackTrace();
- } catch (final ClassNotFoundException e) {
- e.printStackTrace();
- } catch (final NoSuchMethodException e) {
- e.printStackTrace();
- } catch (final SecurityException e) {
- e.printStackTrace();
- } catch (final IllegalAccessException e) {
- e.printStackTrace();
- } catch (final IllegalArgumentException e) {
- e.printStackTrace();
- } catch (final InvocationTargetException e) {
- e.printStackTrace();
+ public abstract String getFileNamePrefix(Object eObject);
+
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ String dotPath,
+ String genFolderPath,
+ IStructuredSelection selection,
+ EPartService partService) {
+
+ EClass selectedObjClass = null;
+
+ Object element = selection.getFirstElement();
+ if (element instanceof EObject) {
+ if (element instanceof EClass) {
+ selectedObjClass = (EClass) element;
+ } else {
+ selectedObjClass = ((EObject) element).eClass();
}
- }
- }
-
- protected void openHierarchyView(final EClass activeEClass) {
-
- if (activeEClass != null) {
- try {
-
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .findView("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView") == null) {
- return;
- }
-
- final IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .showView("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView");
-
- if (view != null) {
- final Class<?> eClassHierarchyViewClass = Class
- .forName("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView");
-
- if (eClassHierarchyViewClass != null) {
- final Method setAnalyzedObjectMethod = eClassHierarchyViewClass.getMethod("setAnalyzedObject",
- EObject.class);
-
- if (setAnalyzedObjectMethod != null) {
- setAnalyzedObjectMethod.setAccessible(true);
- setAnalyzedObjectMethod.invoke(view, activeEClass);
- }
- }
- }
- } catch (final PartInitException exception) {
- exception.printStackTrace();
- } catch (final ClassNotFoundException e) {
- e.printStackTrace();
- } catch (final NoSuchMethodException e) {
- e.printStackTrace();
- } catch (final SecurityException e) {
- e.printStackTrace();
- } catch (final IllegalAccessException e) {
- e.printStackTrace();
- } catch (final IllegalArgumentException e) {
- e.printStackTrace();
- } catch (final InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- }
-
- protected void openErrorDialog() {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- final Shell shell = new Shell(Display.getDefault());
- MessageDialog.openError(shell, "EMF content extractor dialog", "Selected object is not a EMF object");
- }
- });
- }
-
- protected static void openErrorDialog(final String msg) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- final Shell shell = new Shell(Display.getDefault());
- MessageDialog.openError(shell, "EMF content extractor dialog", msg);
- }
- });
- }
-
- /**
- * This method returns the value for a supplied key from the Preference Store
- *
- * @param key
- * @return
- */
- protected static String getValueFromPreferenceStore(final String key) {
-
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-
- return store.getString(key);
- }
-
- public static void generateSVGAndDisplayDiagram(final BuilderResult result, final String fileNamePrefix, final Map<String, String> properties) throws IOException {
-
- final String dot_exe_location = getValueFromPreferenceStore(PreferenceConstants.P_DOT_PATH);
-
- if (dot_exe_location == null) {
-
- openErrorDialog("DOT file exe path is not set in the Preferences");
-
- return;
- } else if (!new File(dot_exe_location).exists()) {
- openErrorDialog(
- "DOT file exe is not existing in the specified path. Update the valid path in Preferences -> AMALTHEA-Grpahical-Representation node");
-
+ } else {
+ openErrorDialog(shell);
return;
}
-
- System.setProperty("GRAPHVIZ_DOT", dot_exe_location);
-
- final SourceStringReader reader = new SourceStringReader(result.getPlantUMLText());
-
- final String genFileLocation = getValueFromPreferenceStore(PreferenceConstants.P_FOLDER_PATH)
- + "\\amalthea_element_" + fileNamePrefix;
-
- try (final FileOutputStream fileOutputStream = new FileOutputStream(
-
- new File(genFileLocation + ".svg"));) {
-
- reader.outputImage(fileOutputStream, new FileFormatOption(FileFormat.SVG));
-
- fileOutputStream.close();
+
+ execute(
+ shell,
+ sync,
+ dotPath,
+ genFolderPath,
+ partService,
+ selectedObjClass,
+ (EObject)element);
+ }
+
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ String dotPath,
+ String genFolderPath,
+ EPartService partService,
+ Object eClass,
+ EObject eObject) {
+
+ // check if there is a valid dot path
+ if (verifyDotPath(shell, dotPath)) {
+
+ // generate UML
+ if (eClass != null) {
+
+ String genFolder = DiagramCreator.getGenFolder(genFolderPath, eObject != null ? eObject.eResource() : null);
+ if (genFolder == null || genFolder.length() == 0) {
+ openErrorDialog(shell, "Folder for diagram generation is not set. Configure a folder in Preferences -> AMALTHEA Graphical Representation");
+ return;
+ }
+
+ // generate UML and SVG
+ Job job = Job.create("Generate diagram", monitor -> {
+ AbstractPlantUMLBuilder builder = createPlantUMLBuilder(sync);
+ BuilderResult result = builder.generatePlantUML(eClass);
+
+ LOGGER.info(result.getPlantUMLText());
+
+ ExecutionUtil.setExecutionCategory(getExecutionCategory());
+ String fileNamePrefix = getFileNamePrefix(eObject != null ? eObject : eClass);
+ String svgFilePath = DiagramCreator.generateSVG(result, genFolder, fileNamePrefix, eObject);
+
+ sync.asyncExec(() -> {
+ // display view
+ MPart diagramPart = partService.findPart(DiagramView.ID);
+ if (diagramPart == null) {
+ diagramPart = partService.createPart(DiagramView.ID);
+ }
+ if (diagramPart != null) {
+ partService.showPart(diagramPart, PartState.VISIBLE);
+ DiagramView diagramView = (DiagramView) diagramPart.getObject();
+ diagramView.showDiagram(fileNamePrefix, eObject, svgFilePath, result.getId2ObjectMap());
+ }
+ });
+ });
+ job.schedule();
+ }
+ }
+ }
+
+ protected boolean verifyDotPath(Shell shell, String dotPath) {
+ if (dotPath == null) {
+ openErrorDialog(shell, "DOT file exe path is not set in the Preferences");
+ return false;
+ } else if (!new File(dotPath).exists()) {
+ openErrorDialog(shell, "DOT file exe is not existing in the specified path. Update the valid path in Preferences -> AMALTHEA Graphical Representation node");
+ return false;
}
- Display.getDefault().asyncExec(new Runnable() {
+ System.setProperty("GRAPHVIZ_DOT", dotPath);
- @Override
- public void run() {
-
- try (final FileOutputStream fileOutputStream = new FileOutputStream(
-
- new File(genFileLocation + ".plantuml"));
-
- final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fileOutputStream));) {
-
- bw.write(result.getPlantUMLText());
-
- } catch (final FileNotFoundException e) {
- e.printStackTrace();
- } catch (final IOException e) {
- e.printStackTrace();
- }
- }
-
- });
-
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- final String diagramViewID = "org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView";
-
- IViewPart diagramView = activePage.findView(diagramViewID);
-
- final IViewReference findViewReference = activePage.findViewReference(diagramViewID);
-
- if (diagramView == null) {
- try {
- diagramView = activePage.showView(diagramViewID);
-
- // updateBooleanProps(properties, diagramView);
-
- ((DiagramView) diagramView).getIdObjectsMap().putAll(result.getId2ObjectMap());
- ((DiagramView) diagramView).getBrowser()
- .setUrl(("file:\\" + getValueFromPreferenceStore(PreferenceConstants.P_FOLDER_PATH)
- + "\\amalthea_element_" + fileNamePrefix + ".svg"));
- } catch (final PartInitException e) {
- e.printStackTrace();
- }
-
- } else {
-
- // updateBooleanProps(properties, diagramView);
-
- ((DiagramView) diagramView).getIdObjectsMap().putAll(result.getId2ObjectMap());
-
- ((DiagramView) diagramView).getBrowser()
- .setUrl(("file:/" + getValueFromPreferenceStore(PreferenceConstants.P_FOLDER_PATH)
- + "\\amalthea_element_" + fileNamePrefix + ".svg"));
- }
- }
-
- /*-private void updateBooleanProps(final Map<String, String> properties, final IViewPart diagramView) {
- if (properties.get(ExecutionCategory.isClassHierarchyGeneration.toString()) != null
- && properties.get(ExecutionCategory.isClassHierarchyGeneration.toString()).equals("true")) {
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy(true);
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy_And_corresponding_Relation_Contents(false);
-
- ((DiagramView) diagramView).setDisplayingClassReference_Hierarchy_subclass_info_generation(false);
- ((DiagramView) diagramView).setClassContents_UML_Generation(false);
- }
- else if (properties.get(ExecutionCategory.isClassHierarchy_Contents_Generation.toString()) != null
- && properties.get(ExecutionCategory.isClassHierarchy_Contents_Generation.toString())
- .equals("true")) {
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy(false);
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy_And_corresponding_Relation_Contents(true);
-
- ((DiagramView) diagramView).setDisplayingClassReference_Hierarchy_subclass_info_generation(false);
- ((DiagramView) diagramView).setClassContents_UML_Generation(false);
- }
- else if (properties
- .get(ExecutionCategory.isClassReference_Hierarchy_subclass_info_generation.toString()) != null
- && properties
- .get(ExecutionCategory.isClassReference_Hierarchy_subclass_info_generation.toString())
- .equals("true")) {
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy(false);
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy_And_corresponding_Relation_Contents(false);
-
- ((DiagramView) diagramView).setDisplayingClassReference_Hierarchy_subclass_info_generation(true);
- ((DiagramView) diagramView).setClassContents_UML_Generation(false);
- }
- else if (properties.get(ExecutionCategory.isClassContents_UML_Generation.toString()) != null
- && properties.get(ExecutionCategory.isClassContents_UML_Generation.toString()).equals("true")) {
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy(false);
-
- ((DiagramView) diagramView).setDisplayingClassHierarchy_And_corresponding_Relation_Contents(false);
-
- ((DiagramView) diagramView).setDisplayingClassReference_Hierarchy_subclass_info_generation(false);
- ((DiagramView) diagramView).setClassContents_UML_Generation(true);
-
- }
- else {
- ((DiagramView) diagramView).setDisplayingClassHierarchy(false);
- ((DiagramView) diagramView).setClassContents_UML_Generation(false);
- ((DiagramView) diagramView).setDisplayingClassHierarchy_And_corresponding_Relation_Contents(false);
- ((DiagramView) diagramView).setDisplayingClassReference_Hierarchy_subclass_info_generation(false);
- }
- }*/
- });
-
+ return true;
+ }
+
+ protected void openErrorDialog(Shell shell) {
+ openErrorDialog(shell, "Selected object is not a EMF object");
}
- public static String generateSVGFile(final BuilderResult result, final String fileNamePrefix) throws IOException {
-
- final String dot_exe_location = Activator.getDefault().getPreferenceStore()
- .getString(PreferenceConstants.P_DOT_PATH);
-
- if (dot_exe_location == null) {
-
- openErrorDialog("DOT file exe path is not set in the Preferences");
- return null;
- } else if (!new File(dot_exe_location).exists()) {
- openErrorDialog(
- "DOT file exe is not existing in the specified path. Update the valid path in Preferences -> AMALTHEA-Grpahical-Representation node");
-
- return null;
- }
-
- System.setProperty("GRAPHVIZ_DOT", dot_exe_location);
-
- final SourceStringReader reader = new SourceStringReader(result.getPlantUMLText());
-
- final String genFileLocation = Activator.getDefault().getPreferenceStore()
- .getString(PreferenceConstants.P_FOLDER_PATH) + "\\amalthea_element_" + fileNamePrefix;
-
- try (final FileOutputStream svgFileOutputStream = new FileOutputStream(new File(genFileLocation + ".svg"));
-
- ) {
-
- reader.outputImage(svgFileOutputStream, new FileFormatOption(FileFormat.SVG));
-
- }
-
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
-
- try (final FileOutputStream fileOutputStream = new FileOutputStream(
-
- new File(genFileLocation + ".plantuml"));
-
- final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fileOutputStream));) {
-
- bw.write(result.getPlantUMLText());
-
- } catch (final FileNotFoundException e) {
- e.printStackTrace();
- } catch (final IOException e) {
- e.printStackTrace();
- }
- }
-
- });
-
- return ("file:/" + Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_FOLDER_PATH)
- + "\\amalthea_element_" + fileNamePrefix + ".svg");
-
+ protected void openErrorDialog(Shell shell, String msg) {
+ MessageDialog.openError(shell, "EMF content extractor dialog", msg);
}
-}
+}
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/CopyContentsHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/CopyContentsHandler.java
index 3dbbfa1..35c6ac1 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/CopyContentsHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/CopyContentsHandler.java
@@ -20,47 +20,34 @@
import java.awt.datatransfer.StringSelection;
import java.util.Iterator;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-public class CopyContentsHandler extends AbstractPlantUMLHandler {
+public class CopyContentsHandler {
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
- }
+ @Execute
+ public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection) {
StringBuilder sb = new StringBuilder();
- if (selection instanceof IStructuredSelection) {
- Iterator<?> iterator = ((IStructuredSelection) selection).iterator();
+ Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object next = iterator.next();
- System.out.println(next);
+ while (iterator.hasNext()) {
+ Object next = iterator.next();
+ System.out.println(next);
- if (next instanceof ENamedElement) {
- String name = ((ENamedElement) next).getName();
- sb.append(name);
- sb.append("\n");
- }
+ if (next instanceof ENamedElement) {
+ String name = ((ENamedElement) next).getName();
+ sb.append(name);
+ sb.append("\n");
}
- StringSelection selection1 = new StringSelection(sb.toString());
- Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
- clipboard.setContents(selection1, selection1);
}
-
- return null;
+ StringSelection selection1 = new StringSelection(sb.toString());
+ Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+ clipboard.setContents(selection1, selection1);
}
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassAllReferencesHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassAllReferencesHandler.java
index 7e5068a..35d16ad 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassAllReferencesHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassAllReferencesHandler.java
@@ -15,91 +15,63 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import javax.inject.Named;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassAllReferencesBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
-import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EClass;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.swt.widgets.Shell;
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
public class EClassAllReferencesHandler extends AbstractPlantUMLHandler {
-
- /**
- * the command has been executed, so extract extract the needed information from the application context.
- */
+
@Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
-
- final EClassAllReferencesBuilder builder = new EClassAllReferencesBuilder();
-
- BuilderResult result = null;
-
- final String eClassName = "";
-
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new EClassAllReferencesBuilder();
+ }
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.eClassAllReferences;
+ }
+
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EObject) {
+ return ((EObject)eObject).eClass().getName() + "_SuperTypes_References";
}
- if (selection != null & selection instanceof IStructuredSelection) {
-
- final IStructuredSelection strucSelection = (IStructuredSelection) selection;
-
- for (final Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
-
- final Object element = iterator.next();
-
- if (element instanceof EObject) {
-
- EClass eClass = null;
-
- if (element instanceof EClass) {
- eClass = (EClass) element;
- } else {
- eClass = ((EObject) element).eClass();
- }
-
- result = builder.generatePlantUML(eClass);
-
- } else {
- openErrorDialog();
- return null;
- }
- }
- } else {
- openErrorDialog();
- return null;
- }
-
- System.out.println(result.getPlantUMLText());
-
- try {
- final Map<String, String> propsMap = new HashMap<String, String>();
-
- // propsMap.put(ExecutionCategory.isClassReference_Hierarchy_subclass_info_generation.toString(), "true");
-
- ExecutionUtil.setExecutionCategory(ExecutionCategory.eClassAllReferences);
-
- generateSVGAndDisplayDiagram(result, eClassName + "_SuperTypes_References", propsMap);
- } catch (final IOException e) {
- e.printStackTrace();
- }
-
- return null;
+ return eObject.getClass().getName() + "_SuperTypes_References";
}
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsAndHierarchyHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsAndHierarchyHandler.java
index 7c81f35..9a3dcbb 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsAndHierarchyHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsAndHierarchyHandler.java
@@ -15,100 +15,63 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import javax.inject.Named;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassContentsAndHierarchyBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
-import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EClass;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.swt.widgets.Shell;
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
public class EClassContentsAndHierarchyHandler extends AbstractPlantUMLHandler {
-
- /**
- * the command has been executed, so extract extract the needed information from the application context.
- */
+
@Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
-
- final EClassContentsAndHierarchyBuilder builder = new EClassContentsAndHierarchyBuilder();
-
- BuilderResult result = null;
-
- String eClassName = "";
-
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
- }
- if (selection != null & selection instanceof IStructuredSelection) {
-
- final IStructuredSelection strucSelection = (IStructuredSelection) selection;
-
- for (final Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
-
- final Object element = iterator.next();
-
- if (element instanceof EObject) {
-
- EClass selectedObjClass = null;
-
- if (element instanceof EClass) {
- selectedObjClass = (EClass) element;
- } else {
- selectedObjClass = ((EObject) element).eClass();
- }
-
- // final EClass selectedObjClass = ((EObject) element).eClass();
-
- /* ==================== Opening Contents and Hierarchy View ===================== */
-
- openHierarchyView(selectedObjClass);
-
- eClassName = selectedObjClass.getName();
-
- result = builder.generatePlantUML(selectedObjClass);
-
- } else {
- openErrorDialog();
- return null;
- }
- }
- } else {
- openErrorDialog();
- return null;
- }
-
- System.out.println(result.getPlantUMLText());
-
- try {
- final Map<String, String> propsMap = new HashMap<String, String>();
-
- // propsMap.put(ExecutionCategory.isClassHierarchy_Contents_Generation.toString(), "true");
-
- ExecutionUtil.setExecutionCategory(ExecutionCategory.eClassContentsAndHierarchy);
-
- generateSVGAndDisplayDiagram(result, eClassName + "__contents_deep_Hierarchy", propsMap);
- } catch (final IOException e) {
- // TODO Zmeer Auto-generated catch block
- e.printStackTrace();
- }
-
- return null;
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new EClassContentsAndHierarchyBuilder();
}
-
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.eClassContentsAndHierarchy;
+ }
+
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EObject) {
+ return ((EObject)eObject).eClass().getName() + "__contents_deep_Hierarchy";
+ }
+ return eObject.getClass().getName() + "__contents_deep_Hierarchy";
+ }
+
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsFromReferenceHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsFromReferenceHandler.java
index 2b188e4..2153391 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsFromReferenceHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsFromReferenceHandler.java
@@ -15,119 +15,63 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import javax.inject.Named;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassContentsFromReferenceBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
-import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.swt.widgets.Shell;
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
public class EClassContentsFromReferenceHandler extends AbstractPlantUMLHandler {
-
- /**
- * the command has been executed, so extract extract the needed information from
- * the application context.
- */
+
@Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
-
- final EClassContentsFromReferenceBuilder builder = new EClassContentsFromReferenceBuilder();
-
- BuilderResult result = null;
-
- String eClassName = "";
-
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
- }
- if (selection != null & selection instanceof IStructuredSelection) {
-
- final IStructuredSelection strucSelection = (IStructuredSelection) selection;
-
- if (strucSelection == null) {
- return null;
- }
-
- for (final Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
-
- final Object element = iterator.next();
-
- if (element instanceof EObject) {
-
- EClass selectedObjClass = null;
-
- if (element instanceof EStructuralFeature && element instanceof EReference) {
-
- final EClassifier eType = ((EReference) element).getEType();
-
- if (eType instanceof EClass) {
-
- selectedObjClass = (EClass) eType;
- } else {
- selectedObjClass = ((EObject) element).eClass();
- }
-
- } else if (element instanceof EClass) {
- selectedObjClass = ((EClass) element);
- } else {
- selectedObjClass = ((EObject) element).eClass();
- }
-
- // final EClass selectedObjClass = ((EObject) element).eClass();
-
- /* ==================== Opening Contents and Hierarchy View ===================== */
-
- openHierarchyView(selectedObjClass);
-
- eClassName = selectedObjClass.getName();
-
- result = builder.generatePlantUML(selectedObjClass);
-
- } else {
- openErrorDialog();
- return null;
- }
- }
- } else {
- openErrorDialog();
- return null;
- }
-
- System.out.println(result.getPlantUMLText());
-
- try {
- final Map<String, String> propsMap = new HashMap<String, String>();
-
- // propsMap.put(ExecutionCategory.isClassContents_UML_Generation.toString(), "true");
-
- ExecutionUtil.setExecutionCategory(ExecutionCategory.eClassContentsFromReference);
-
- generateSVGAndDisplayDiagram(result, eClassName + "__reference_type_Hierarchy", propsMap);
- } catch (final IOException e) {
- // TODO Zmeer Auto-generated catch block
- e.printStackTrace();
- }
-
- return null;
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new EClassContentsFromReferenceBuilder();
}
-
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.eClassContentsFromReference;
+ }
+
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EObject) {
+ return ((EObject)eObject).eClass().getName() + "__reference_type_Hierarchy";
+ }
+ return eObject.getClass().getName() + "__reference_type_Hierarchy";
+ }
+
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsHandler.java
index de41d01..28c262f 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassContentsHandler.java
@@ -15,99 +15,63 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import javax.inject.Named;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassContentsFromReferenceBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
-import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EClass;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.swt.widgets.Shell;
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
public class EClassContentsHandler extends AbstractPlantUMLHandler {
-
- /**
- * the command has been executed, so extract extract the needed information from the application context.
- */
+
@Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
-
- final EClassContentsFromReferenceBuilder builder = new EClassContentsFromReferenceBuilder();
-
- BuilderResult result = null;
-
- String eClassName = "";
-
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
- }
- if (selection != null & selection instanceof IStructuredSelection) {
-
- final IStructuredSelection strucSelection = (IStructuredSelection) selection;
-
- for (final Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
-
- final Object element = iterator.next();
-
- if (element instanceof EObject) {
-
- EClass selectedObjClass = null;
-
- if (element instanceof EClass) {
- selectedObjClass = (EClass) element;
- } else {
- selectedObjClass = ((EObject) element).eClass();
- }
-
- // final EClass selectedObjClass = ((EObject) element).eClass();
-
- /* ==================== Opening Hierarchy View ===================== */
-
- openHierarchyView(selectedObjClass);
-
- eClassName = selectedObjClass.getName();
-
- result = builder.generatePlantUML(selectedObjClass);
-
- } else {
- openErrorDialog();
- return null;
- }
- }
- } else {
- openErrorDialog();
- return null;
- }
-
- System.out.println(result.getPlantUMLText());
-
- try {
- final Map<String, String> propsMap = new HashMap<String, String>();
-
- // propsMap.put(ExecutionCategory.isClassContents_UML_Generation.toString(), "true");
- ExecutionUtil.setExecutionCategory(ExecutionCategory.eClassContents);
-
- generateSVGAndDisplayDiagram(result, eClassName + "__precise_Hierarchy", propsMap);
- } catch (final IOException e) {
- // TODO Zmeer Auto-generated catch block
- e.printStackTrace();
- }
-
- return null;
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new EClassContentsFromReferenceBuilder();
}
-
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.eClassContents;
+ }
+
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EObject) {
+ return ((EObject)eObject).eClass().getName() + "__precise_Hierarchy";
+ }
+ return eObject.getClass().getName() + "__precise_Hierarchy";
+ }
+
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassHierarchyHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassHierarchyHandler.java
index 25c1e34..b493ebb 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassHierarchyHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EClassHierarchyHandler.java
@@ -15,97 +15,67 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import javax.inject.Named;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassHierarchyBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
-import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EClass;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.swt.widgets.Shell;
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
public class EClassHierarchyHandler extends AbstractPlantUMLHandler {
-
- /**
- * the command has been executed, so extract extract the needed information from the application context.
- */
+
+ EPartService partService;
+
@Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
-
- final EClassHierarchyBuilder builder = new EClassHierarchyBuilder();
-
- BuilderResult result = null;
-
- String eClassName = "";
-
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
- }
- if (selection != null & selection instanceof IStructuredSelection) {
-
- final IStructuredSelection strucSelection = (IStructuredSelection) selection;
-
- for (final Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
-
- final Object element = iterator.next();
-
- if (element instanceof EObject) {
-
- EClass selectedObjClass = null;
-
- if (element instanceof EClass) {
- selectedObjClass = (EClass) element;
- } else {
- selectedObjClass = ((EObject) element).eClass();
- }
-
- // final EClass selectedObjClass = ((EObject) element).eClass();
-
- /* ====================Opening Hierarchy View ===================== */
-
- openHierarchyView(selectedObjClass);
-
- eClassName = selectedObjClass.getName();
-
- result = builder.generatePlantUML(selectedObjClass);
-
- } else {
- openErrorDialog();
- return null;
- }
- }
- } else {
- openErrorDialog();
- return null;
- }
-
- System.out.println(result.getPlantUMLText());
-
- try {
- final Map<String, String> propsMap = new HashMap<String, String>();
-
- ExecutionUtil.setExecutionCategory(ExecutionCategory.eClassHierarchy);
-
- generateSVGAndDisplayDiagram(result, eClassName + "__eclass_Hierarchy", propsMap);
- } catch (final IOException e) {
- e.printStackTrace();
- }
-
- return null;
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new EClassHierarchyBuilder();
}
-
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.eClassHierarchy;
+ }
+
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EObject) {
+ return ((EObject)eObject).eClass().getName() + "__eclass_Hierarchy";
+ }
+ return eObject.getClass().getName() + "__eclass_Hierarchy";
+ }
+
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ this.partService = partService;
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EObjectRefsHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EObjectRefsHandler.java
index 6e96f79..846ae6b 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EObjectRefsHandler.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/EObjectRefsHandler.java
@@ -15,119 +15,71 @@
package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import javax.inject.Named;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
import org.eclipse.app4mc.emf.viewer.plantuml.builders.EObjectRefsBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
-import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EClass;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.swt.widgets.Shell;
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
public class EObjectRefsHandler extends AbstractPlantUMLHandler {
- /**
- * the command has been executed, so extract extract the needed information from the application context.
- */
@Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
-
- final EObjectRefsBuilder builder = new EObjectRefsBuilder();
-
- BuilderResult result = null;
-
- String eClassName = "";
-
- String elementName = "";
-
- ISelection selection = null;
-
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection == null) {
-
- selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
- }
-
- if (selection != null & selection instanceof IStructuredSelection) {
-
- final IStructuredSelection strucSelection = (IStructuredSelection) selection;
-
- for (final Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
-
- final Object element = iterator.next();
-
- if (element instanceof EObject) {
-
- EClass selectedObjClass = null;
-
- if (element instanceof EClass) {
- selectedObjClass = (EClass) element;
- } else {
- selectedObjClass = ((EObject) element).eClass();
- }
-
- // final EClass selectedObjClass = ((EObject) element).eClass();
-
- eClassName = selectedObjClass.getName();
-
- elementName = (String) getName((EObject) element);
-
- result = builder.generatePlantUML(selectedObjClass);
-
- /* ====================Opening References View ===================== */
-
- openEReferencesView(selectedObjClass);
-
- /* ====================Opening Hierarchy View ===================== */
- openHierarchyView(selectedObjClass);
- } else {
- openErrorDialog();
- return null;
- }
- }
- } else {
- openErrorDialog();
- return null;
- }
-
- System.out.println(result.getPlantUMLText());
-
- try {
-
- final Map<String, String> propsMap = new HashMap<String, String>();
-
- ExecutionUtil.setExecutionCategory(ExecutionCategory.eObjectRefs);
-
- generateSVGAndDisplayDiagram(result, eClassName + "_" + elementName + "_References", propsMap);
- } catch (final IOException e) {
- e.printStackTrace();
- }
-
- return null;
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new EObjectRefsBuilder(sync);
+ }
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.eObjectRefs;
}
- private Object getName(final EObject eObject) {
- final EStructuralFeature eStructuralFeature = eObject.eClass().getEStructuralFeature("name");
-
- if (eStructuralFeature != null) {
-
- final Object originalName = eObject.eGet(eStructuralFeature);
-
- return originalName;
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EObject) {
+ EObject e = (EObject)eObject;
+ EStructuralFeature eStructuralFeature = e.eClass().getEStructuralFeature("name");
+
+ String name = (eStructuralFeature != null)
+ ? (String) e.eGet(eStructuralFeature)
+ : e.eClass().getName() + "__" + eObject.hashCode();
+
+ return e.eClass().getName() + "__" + name + "_References";
}
-
- return eObject.eClass().getName() + "__" + eObject.hashCode();
+ return eObject.getClass().getName() + "__" + "_References";
}
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/LinkWithEditorHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/LinkWithEditorHandler.java
new file mode 100644
index 0000000..64ca72f
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/LinkWithEditorHandler.java
@@ -0,0 +1,42 @@
+/*********************************************************************************
+ * Copyright (c) 2020 Robert Bosch GmbH and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Robert Bosch GmbH - initial API and implementation
+ ********************************************************************************
+ */
+package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
+
+import org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView;
+import org.eclipse.e4.core.contexts.Active;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MDirectToolItem;
+import org.eclipse.e4.ui.model.application.ui.menu.MToolBarElement;
+
+public class LinkWithEditorHandler {
+
+ @Execute
+ public void execute(@Active MPart activePart) {
+
+ if (activePart.getObject() instanceof DiagramView) {
+ for (MToolBarElement element : activePart.getToolbar().getChildren()) {
+ if (element.getElementId().equals("org.eclipse.app4mc.emf.viewer.plantuml.directtoolitem.select")) {
+ MDirectToolItem toolItem = (MDirectToolItem) element;
+
+ DiagramView diagramView = (DiagramView) activePart.getObject();
+
+ boolean isLinked = diagramView.isLinkedWithEditor();
+ diagramView.setLinkedWithEditor(!isLinked);
+ toolItem.setSelected(!isLinked);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/ObjectContentHandler.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/ObjectContentHandler.java
new file mode 100644
index 0000000..dc078e4
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/handlers/ObjectContentHandler.java
@@ -0,0 +1,86 @@
+/**
+ ********************************************************************************
+ * Copyright (c) 2017-2020 Robert Bosch GmbH.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Robert Bosch GmbH - initial API and implementation
+ ********************************************************************************
+ */
+
+package org.eclipse.app4mc.emf.viewer.plantuml.handlers;
+
+import java.lang.reflect.Type;
+
+import javax.inject.Named;
+
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.AbstractPlantUMLBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.ObjectContentBuilder;
+import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
+import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+
+@SuppressWarnings("restriction")
+public class ObjectContentHandler extends AbstractPlantUMLHandler {
+
+ @Override
+ protected AbstractPlantUMLBuilder createPlantUMLBuilder(UISynchronize sync) {
+ return new ObjectContentBuilder(sync);
+ }
+
+ @Override
+ protected ExecutionCategory getExecutionCategory() {
+ return ExecutionCategory.dummy;
+ }
+
+ @Override
+ public String getFileNamePrefix(Object eObject) {
+ if (eObject instanceof EList) {
+ EList<?> eList = (EList<?>) eObject;
+ String typeString = "";
+ if (!eList.isEmpty()) {
+ Type[] genericInterfaces = eList.getClass().getGenericInterfaces();
+
+ typeString = genericInterfaces.length > 0 ? genericInterfaces[0].getTypeName() : "";
+ }
+ return "Collection" + "_" + typeString + "__object_Content";
+ }
+ return eObject.getClass().getName() + "__object_Content";
+ }
+
+ @Override
+ @Execute
+ public void execute(
+ Shell shell,
+ UISynchronize sync,
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath,
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath,
+ @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+ EPartService partService) {
+
+ super.execute(shell, sync, dotPath, genFolderPath, selection, partService);
+ }
+}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/AmaltheaGraphicalRepresentationPreferencePage.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/AmaltheaGraphicalRepresentationPreferencePage.java
index eabb082..fc30077 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/AmaltheaGraphicalRepresentationPreferencePage.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/AmaltheaGraphicalRepresentationPreferencePage.java
@@ -18,10 +18,8 @@
import java.io.IOException;
import org.eclipse.app4mc.emf.viewer.plantuml.Activator;
-import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IWorkbench;
@@ -42,8 +40,7 @@
public AmaltheaGraphicalRepresentationPreferencePage() {
super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
- setDescription(
- "Preference page to specify the Graphviz (dot executable) location & the folder (with RW access) to generate SVG files");
+ setDescription("Preference page to specify the directory in which the diagrams should be generated.");
}
/**
@@ -53,33 +50,13 @@
@Override
public void createFieldEditors() {
- addField(new FileFieldEditor(PreferenceConstants.P_DOT_PATH, "&Path to the dot executable of Graphviz:",
- getFieldEditorParent()));
-
addField(new DirectoryFieldEditor(PreferenceConstants.P_FOLDER_PATH,
"&Path to the directory where SVG files shall be generated:", getFieldEditorParent()));
- addField(new BooleanFieldEditor(PreferenceConstants.P_DRILL_DOWN,
- "&Show the details of selected element (Contents)", getFieldEditorParent()));
-
- addField(new BooleanFieldEditor(PreferenceConstants.P_REDRAW_TREE_ON_SELECTION,
- "&Collapse other elements and make the selection (by enabling this -> selected element will be focused more precisely in the tree )",
- getFieldEditorParent()));
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(final IWorkbench workbench) {
}
@Override
- public boolean performOk() {
- // TODO Auto-generated method stub
- return super.performOk();
+ public void init(final IWorkbench workbench) {
}
@Override
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceConstants.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceConstants.java
index 55ac765..363153e 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceConstants.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceConstants.java
@@ -20,11 +20,6 @@
*/
public class PreferenceConstants {
- public static final String P_DOT_PATH = "P_DOT_PATH";
-
public static final String P_FOLDER_PATH = "P_FOLDER_PATH";
- public static final String P_DRILL_DOWN = "P_DRILL_DOWN";
-
- public static final String P_REDRAW_TREE_ON_SELECTION = "P_REDRAW_TREE_ON_SELECTION";
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceInitializer.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceInitializer.java
index 59daafc..15a13c1 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceInitializer.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/preferences/PreferenceInitializer.java
@@ -24,30 +24,14 @@
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
@Override
public void initializeDefaultPreferences() {
final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- store.setDefault(PreferenceConstants.P_DOT_PATH,
- store.getString(PreferenceConstants.P_DOT_PATH) != null
- ? store.getString(PreferenceConstants.P_DOT_PATH)
- : "");
store.setDefault(PreferenceConstants.P_FOLDER_PATH,
store.getString(PreferenceConstants.P_FOLDER_PATH) != null
? store.getString(PreferenceConstants.P_FOLDER_PATH)
: "");
-
- store.setDefault(PreferenceConstants.P_DRILL_DOWN, store.getBoolean(PreferenceConstants.P_DRILL_DOWN));
-
- store.setDefault(PreferenceConstants.P_REDRAW_TREE_ON_SELECTION,
- store.contains(PreferenceConstants.P_REDRAW_TREE_ON_SELECTION)
- ? store.getBoolean(PreferenceConstants.P_REDRAW_TREE_ON_SELECTION)
- : false);
}
}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/utils/DiagramCreator.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/utils/DiagramCreator.java
new file mode 100644
index 0000000..119f753
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/utils/DiagramCreator.java
@@ -0,0 +1,126 @@
+/**
+ ********************************************************************************
+ * Copyright (c) 2020 Robert Bosch GmbH.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Robert Bosch GmbH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.app4mc.emf.viewer.plantuml.utils;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.SourceStringReader;
+
+public final class DiagramCreator {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(DiagramCreator.class);
+
+ private DiagramCreator() {
+ // empty default constructor for static helper class
+ }
+
+ public static String generateSVG(
+ BuilderResult result,
+ String genFolder,
+ String fileNamePrefix,
+ EObject selectedElement) {
+
+ SourceStringReader reader = new SourceStringReader(result.getPlantUMLText());
+
+ String genFileLocation = genFolder + "\\" + fileNamePrefix;
+
+ // write plantuml file
+ try (FileOutputStream fileOutputStream = new FileOutputStream(new File(genFileLocation + ".plantuml"));
+ BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fileOutputStream));) {
+ bw.write(result.getPlantUMLText());
+ } catch (IOException e) {
+ LOGGER.error("Error on PlantUML persistence", e);
+ }
+
+ // write SVG file
+ File svgFile = new File(genFileLocation + ".svg");
+ try (FileOutputStream fileOutputStream = new FileOutputStream(svgFile);) {
+ reader.outputImage(fileOutputStream, new FileFormatOption(FileFormat.SVG));
+ } catch (IOException e) {
+ LOGGER.error("Error on SVG persistence", e);
+ }
+
+ if (selectedElement != null) {
+ URI uri = selectedElement.eResource().getURI();
+ String platformString = uri.toPlatformString(true);
+ if (platformString != null) {
+ IPath path = new Path(platformString);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+
+ try {
+ file.getParent().refreshLocal(2, new NullProgressMonitor());
+ } catch (CoreException e) {
+ LOGGER.error("Error on refreshing workspace folder", e);
+ }
+ }
+ }
+
+ return svgFile.getAbsolutePath();
+ }
+
+ public static String getGenFolder(String genFolder, Resource resource) {
+ // extract the gen folder from the BuilderResult if no preference value is set
+ if ((genFolder == null || genFolder.length() == 0) && resource != null) {
+ URI uri = resource.getURI();
+ String platformString = uri.toPlatformString(true);
+ if (platformString != null) {
+ IPath path = new Path(platformString);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+
+ IContainer parentFolder = file.getParent();
+ if (parentFolder != null) {
+ // **** Find visualization folder (create if necessary)
+
+ IFolder folder = parentFolder.getFolder(new Path(".emf_viewer_diagrams"));
+
+ if (!folder.exists()) {
+ try {
+ folder.create(IResource.NONE, true, null);
+ } catch (CoreException e) {
+ LOGGER.error("Error on creating folder for generated diagrams.", e);
+ }
+ }
+
+ genFolder = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()
+ + folder.getFullPath().toString();
+ }
+ }
+ }
+
+ return genFolder;
+ }
+
+}
diff --git a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/views/DiagramView.java b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/views/DiagramView.java
index 389d733..aac859c 100644
--- a/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/views/DiagramView.java
+++ b/eclipse-tools/emf-graphical-viewer/plugins/org.eclipse.app4mc.emf.viewer.plantuml/src/org/eclipse/app4mc/emf/viewer/plantuml/views/DiagramView.java
@@ -15,466 +15,251 @@
package org.eclipse.app4mc.emf.viewer.plantuml.views;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collections;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
-import org.eclipse.app4mc.emf.viewer.plantuml.Activator;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.BuilderResult;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassAllReferencesBuilder;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassContentsAndHierarchyBuilder;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassContentsFromReferenceBuilder;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.EClassHierarchyBuilder;
-import org.eclipse.app4mc.emf.viewer.plantuml.builders.ObjectContentBuilder;
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+
import org.eclipse.app4mc.emf.viewer.plantuml.handlers.AbstractPlantUMLHandler;
+import org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassAllReferencesHandler;
+import org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsAndHierarchyHandler;
+import org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassContentsFromReferenceHandler;
+import org.eclipse.app4mc.emf.viewer.plantuml.handlers.EClassHierarchyHandler;
+import org.eclipse.app4mc.emf.viewer.plantuml.handlers.ObjectContentHandler;
import org.eclipse.app4mc.emf.viewer.plantuml.preferences.PreferenceConstants;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionCategory;
import org.eclipse.app4mc.emf.viewer.plantuml.utils.ExecutionUtil;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.di.PersistState;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MDirectToolItem;
+import org.eclipse.e4.ui.model.application.ui.menu.MToolBarElement;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.sphinx.emf.editors.forms.BasicTransactionalFormEditor;
-import org.eclipse.sphinx.emf.ui.util.EcoreUIUtil;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.LocationAdapter;
import org.eclipse.swt.browser.LocationEvent;
-import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.ViewPart;
+import org.eclipse.swt.widgets.Shell;
-public class DiagramView extends ViewPart {
+import net.sourceforge.plantuml.eclipse.utils.PlantumlConstants;
+@SuppressWarnings("restriction")
+public class DiagramView {
+
/**
- * The ID of the view as specified by the extension.
+ * The ID of the view.
*/
public static final String ID = "org.eclipse.app4mc.emf.viewer.plantuml.views.DiagramView";
- /** counter for the generated files (which are associated to the collections ) **/
- private int i = 0;
+ private static final String LINKED_KEY = "LINKED_WITH_EDITOR";
+
+ private boolean linkedWithEditor = false;
private Browser browser;
- final Map<String, Object> idObjectsMap;
+ final HashMap<String, Object> idObjectsMap = new HashMap<>();
- /**
- * The constructor.
- */
- public DiagramView() {
+ @Inject
+ Shell shell;
+
+ @Inject
+ UISynchronize sync;
- this.idObjectsMap = new HashMap<String, Object>();
- }
-
- @Override
- public void init(final IViewSite site) throws PartInitException {
- super.init(site);
- addActions();
- }
-
+ @Inject
+ EPartService partService;
+
+ @Inject
+ IEventBroker broker;
+
+ @Inject
+ @Optional
+ @Preference(
+ nodePath = "net.sourceforge.plantuml.eclipse",
+ value = PlantumlConstants.GRAPHVIZ_PATH)
+ String dotPath;
+
+ @Inject
+ @Optional
+ @Preference(
+ nodePath = "org.eclipse.app4mc.emf.viewer.plantuml",
+ value = PreferenceConstants.P_FOLDER_PATH)
+ String genFolderPath;
+
+ private Stack<String> history = new Stack<>();
+
/**
* This is a callback that will allow us to create the viewer and initialize it.
*/
- @Override
- public void createPartControl(final Composite parent) {
+ @PostConstruct
+ public void createPartControl(Composite parent, MPart part) {
+ Map<String, String> state = part.getPersistedState();
+ String value = state.get(LINKED_KEY);
+ this.linkedWithEditor = value != null ? Boolean.valueOf(value) : false;
+
this.browser = new Browser(parent, SWT.None);
-
this.browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- CustomBrowserListener listener = new CustomBrowserListener();
- this.browser.addKeyListener(listener);
+ this.browser.addKeyListener(new KeyAdapter() {
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (e.character == '\b' && !history.isEmpty()) {
+ String previous = history.pop();
+ if (previous != null) {
+
+ // extract ID from URL
+ int lastIndexOf = previous.lastIndexOf("/");
- this.browser.addLocationListener(listener);
+ String id = "";
+ if (lastIndexOf != -1) {
+ id = previous.substring(lastIndexOf + 1, previous.lastIndexOf("."));
+ }
+ // get object of the previous view
+ Object eObject = idObjectsMap.get(id);
+ if (eObject != null && isLinkedWithEditor()) {
+ if (eObject instanceof EClass) {
+ updateDiagram((eObject), null);
+ } else if (eObject instanceof EObject) {
+ updateDiagram(((EObject) eObject).eClass(), (EObject) eObject);
+ }
+ selectInEditor(eObject);
+
+ e.doit = false;
+ }
+ }
+ }
+ }
+ });
+
+ this.browser.addLocationListener(new LocationAdapter() {
+
+ @Override
+ public void changing(LocationEvent event) {
+ String location = event.location;
+ if (!location.endsWith(".svg")) {
+ int lastIndexOf = location.lastIndexOf("/");
+
+ String id = "";
+ if (lastIndexOf != -1) {
+ id = location.substring(lastIndexOf + 1, location.length());
+ }
+
+ Object eObject = idObjectsMap.get(id);
+ if (eObject != null) {
+ if (eObject instanceof EClass) {
+ updateDiagram((eObject), null);
+ } else if (eObject instanceof EObject) {
+ updateDiagram(((EObject) eObject).eClass(), (EObject) eObject);
+ } else if (eObject instanceof EList<?>) {
+ // we pass the eObject which is a EList so the ObjectContentHandler can handle the EList special case
+ updateDiagram(eObject, null);
+ }
+ if (isLinkedWithEditor()) {
+ selectInEditor(eObject);
+ }
+ }
+
+ event.doit = false;
+ }
+ }
+ });
}
-
- class CustomBrowserListener implements LocationListener, KeyListener {
-
- String lastSource = "";
-
- public Stack<String> urls = new Stack<>();;
-
- boolean isBackButtonPressed = false;
-
- @Override
- public void changing(final LocationEvent event) {
-
- if (isBackButtonPressed) {
- isBackButtonPressed = false;
- return;
- }
-
- final String location = event.location;
-//TODO: found this
- if (!location.endsWith(".svg")) {
- final int lastIndexOf = location.lastIndexOf("/");
-
- String id = "";
- if (lastIndexOf != -1) {
- id = location.substring(lastIndexOf + 1, location.length());
- }
- final Object source = event.getSource();
-
- if (source instanceof Browser) {
-
- try {
-// ((Browser) source).setUrl(this.lastSource);
- } catch (final Exception e) {
- // skipping exception logging, as here goal is to still retain the same image
- }
- }
-
- final Object eObject = DiagramView.this.idObjectsMap.get(id);
-
- if (eObject != null) {
-
- if (eObject instanceof EObject) {
- if (Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_DRILL_DOWN)) {
-
- /*- ======================================== Regeneration of SVG Buffer for populating content specific to the selection =====================*/
-
- BuilderResult result = null;
-
- if (ExecutionUtil.isExecuting(ExecutionCategory.eClassHierarchy)
- && (eObject instanceof EClass)) {
-
- final EClassHierarchyBuilder plantUMLBuilder = new EClassHierarchyBuilder();
- result = plantUMLBuilder.generatePlantUML((EClass) eObject);
-
- } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassContentsAndHierarchy)
- && (eObject instanceof EClass)) {
-
- final EClassContentsAndHierarchyBuilder plantUMLBuilder = new EClassContentsAndHierarchyBuilder();
- result = plantUMLBuilder.generatePlantUML((EClass) eObject);
-
- } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassAllReferences)
- && (eObject instanceof EClass)) {
-
- final EClassAllReferencesBuilder plantUMLBuilder = new EClassAllReferencesBuilder();
- result = plantUMLBuilder.generatePlantUML((EClass) eObject);
-
- } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassContentsFromReference)
- && (eObject instanceof EClass)) {
-
- final EClassContentsFromReferenceBuilder plantUMLBuilder = new EClassContentsFromReferenceBuilder();
- result = plantUMLBuilder.generatePlantUML((EClass) eObject);
-
- } else {
-
- /*- EClassContents and EObjectRefs behaviour is included in ObjectContentBufferBuilder java class */
- final ObjectContentBuilder plantUMLBuilder = new ObjectContentBuilder();
- result = plantUMLBuilder.generatePlantUML((EObject) eObject);
-
- }
-
- getIdObjectsMap().putAll(result.getId2ObjectMap());
-
- System.out.println(result.getPlantUMLText());
-
-
- try {
-
- final String svgFile = AbstractPlantUMLHandler.generateSVGFile(result, ((EObject) eObject).eClass().getName() + DiagramView.this.i++);
- ((Browser) source).setUrl(svgFile);
- } catch (final IOException e) {
- e.printStackTrace();
- }
-
- } else {
-
- if (ExecutionUtil.isExecuting(ExecutionCategory.eClassHierarchy)
- && (eObject instanceof EClass)) {
- // do nothing
- }
-
- else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassContentsAndHierarchy)
- && (eObject instanceof EClass)) {
- // do nothing
- } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassAllReferences)
- && (eObject instanceof EClass)) {
- // do nothing
- } else {
- selectElement((EObject) eObject);
-
- }
-
-// ((Browser)source).stop();
-
- event.doit = false;
- }
-
- } else if (eObject instanceof EList<?>) {
-
- if (Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_DRILL_DOWN)) {
-
- /*- ======================================== Regeneration of SVG Buffer for populating content specific to the selection =====================*/
-
- final ObjectContentBuilder builder = new ObjectContentBuilder();
-
- final BuilderResult result = builder.generatePlantUMLForCollection((EList<?>) eObject);
-
- System.out.println(result.getPlantUMLText());
-
- try {
-
- getIdObjectsMap().putAll(result.getId2ObjectMap());
-
- final String svgFile = AbstractPlantUMLHandler.generateSVGFile(result, "Collection" + DiagramView.this.i++);
- ((Browser) source).setUrl(svgFile);
- } catch (final IOException e) {
- e.printStackTrace();
- }
-
- } else {
- MessageDialog.openError(Display.getDefault().getActiveShell(), "Element Selection",
- "Selection of list is not possible for AMALTHEA model");
-
- try {
- ((Browser) source).setUrl(this.lastSource);
-
- } catch (final Exception e) {
- throw e;
- }
- }
- }
- }
+
+ @Inject
+ @Optional
+ void handleSelection(@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection) {
+ if (isLinkedWithEditor() && selection != null && !selection.isEmpty()) {
+ Object firstElement = selection.getFirstElement();
+ if (firstElement instanceof EObject) {
+ updateDiagram(((EObject)firstElement).eClass(), (EObject)firstElement);
}
}
+ }
+
+ private void updateDiagram(Object eClass, EObject eObject) {
- @Override
- public void changed(final LocationEvent event) {
- this.lastSource = event.location;
- urls.push(this.lastSource);
- }
-
- /**
- * This method is used to select specified AMALTHEA element in the Sphinx editor
- *
- * @param element
+ /*
+ * Regeneration of SVG Buffer for populating content specific to the selection
*/
- private void selectElement(final EObject element) {
- final URIEditorInput input = EcoreUIUtil.createURIEditorInput(element.eResource());
- if (null != input) {
-
- final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null
- ? PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- : PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage();
-
- Display.getDefault().asyncExec(new java.lang.Runnable() {
-
- @Override
- public void run() {
- final IEditorReference[] editorReferences = page.getEditorReferences();
-
- for (final IEditorReference iEditorReference : editorReferences) {
-
- if (iEditorReference.getId().equals("org.eclipse.app4mc.amalthea.sphinx.ui.editor")
- || iEditorReference.getId().equals("org.itea2.amalthea.sphinx.ui.editor")
- || iEditorReference.getId()
- .equals("com.inchron.realtime.root.presentation.RootEditorID")) {
- try {
- final FileEditorInput editorInput = (FileEditorInput) iEditorReference
- .getEditorInput();
-
- final IFile fileFromEditor = editorInput.getFile();
-
- final Resource eResource = element.eResource();
-
- final URI uri = eResource.getURI();
-
- final IFile fileFromResource = ResourcesPlugin.getWorkspace().getRoot()
- .getFile(new Path(uri.toPlatformString(true)));
-
- if ((fileFromEditor != null && fileFromResource != null)
- && fileFromEditor.toString().equals(fileFromResource.toString())) {
-
- final IEditorPart activeEditor = iEditorReference.getEditor(false);
-
- if (activeEditor instanceof MultiPageEditorPart) {
-
- IDE.openEditor(page, editorInput, iEditorReference.getId());
-
- if (canCollapseTreeElements()) {
-
- Method method = activeEditor.getClass().getMethod("getViewer");
-
- final Viewer viewer = (Viewer) method.invoke(activeEditor);
-
- if (viewer instanceof TreeViewer) {
- ((TreeViewer) viewer).collapseAll();
-
- }
- }
-
- if (activeEditor instanceof BasicTransactionalFormEditor) {
- ((BasicTransactionalFormEditor) activeEditor)
- .setSelectionToViewer(Collections.singleton(element));
-
- } else {
-
- Method method = activeEditor.getClass().getMethod("getViewer");
-
- final Viewer viewer = (Viewer) method.invoke(activeEditor);
-
- if (viewer instanceof TreeViewer) {
- ((TreeViewer) viewer).setSelection(new StructuredSelection(element),
- true);
-
- }
- }
- }
-
- }
- } catch (final PartInitException | NoSuchMethodException | SecurityException
- | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- }
-
- }
-
- private boolean canCollapseTreeElements() {
- return Activator.getDefault().getPreferenceStore()
- .getBoolean(PreferenceConstants.P_REDRAW_TREE_ON_SELECTION);
- }
- });
-
- }
-
+ AbstractPlantUMLHandler handler = null;
+ if (ExecutionUtil.isExecuting(ExecutionCategory.eClassHierarchy)) {
+ handler = new EClassHierarchyHandler();
+ } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassContentsAndHierarchy)) {
+ handler = new EClassContentsAndHierarchyHandler();
+ } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassAllReferences)) {
+ handler = new EClassAllReferencesHandler();
+ } else if (ExecutionUtil.isExecuting(ExecutionCategory.eClassContentsFromReference)) {
+ handler = new EClassContentsFromReferenceHandler();
+ } else {
+ /*- EClassContents and EObjectRefs behaviour is included in ObjectContentBuilder java class */
+ handler = new ObjectContentHandler();
}
-
- @Override
- public void keyPressed(KeyEvent e) {
-
- if (e.character == '\b') {
- isBackButtonPressed = true;
- Object source = e.getSource();
- if (source instanceof Browser) {
-
- try {
- if (urls.isEmpty() == false) {
- String pop = urls.pop();
-
- if (urls.isEmpty() == false) {
- pop = urls.pop();
- ((Browser) source).setUrl(pop);
- }
- }
- } catch (final Exception exception) {
- // skipping exception logging, as here goal is to still retain the same image
- }
- }
-
- }
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
-
- }
- };
-
- private void addActions() {
- final String P_DRILL_DOWN = Activator.getDefault().getPreferenceStore()
- .getString(PreferenceConstants.P_DRILL_DOWN);
-
- boolean state = false;
- if (P_DRILL_DOWN == null) {
- state = true;
- } else if (P_DRILL_DOWN.equals("false")) {
- state = true;
- } else if (P_DRILL_DOWN.equals("true")) {
- state = false;
- }
-
- final IActionBars actionBars = getViewSite().getActionBars();
-
- final IToolBarManager toolBar = actionBars.getToolBarManager();
- final Action action = new Action("Select in Editor", IAction.AS_CHECK_BOX) {
- @Override
- public void setText(final String text) {
- super.setText(text);
- }
-
- @Override
- public void run() {
-
- if (isChecked() == false) {
-
- try {
-
- Activator.getDefault().getPreferenceStore().setValue(PreferenceConstants.P_DRILL_DOWN, true);
- } catch (final Exception e) {
-
- throw e;
- }
- } else if (isChecked() == true) {
-
- try {
- Activator.getDefault().getPreferenceStore().setValue(PreferenceConstants.P_DRILL_DOWN, false);
-
- } catch (final Exception e) {
- throw e;
- }
- }
-
- }
-
- };
-
- action.setChecked(state);
-
- toolBar.add(action);
-
+
+ handler.execute(shell, sync, dotPath, genFolderPath, partService, eClass, eObject);
}
-
+
/**
- * Passing the focus request to the viewer's control.
+ * This method is used to select specified AMALTHEA element in the Sphinx editor
+ *
+ * @param element
*/
- @Override
- public void setFocus() {
- getViewSite().getActionBars().updateActionBars();
-
+ private void selectInEditor(Object element) {
+ HashMap<String, Object> data = new HashMap<>();
+ data.put("modelElements", Arrays.asList(element));
+ broker.send("org/eclipse/app4mc/amalthea/editor/SELECT", data);
+ }
+
+ @Focus
+ public void setFocus(MPart activePart) {
+ for (MToolBarElement element : activePart.getToolbar().getChildren()) {
+ if (element.getElementId().equals("org.eclipse.app4mc.emf.viewer.plantuml.directtoolitem.select")) {
+ MDirectToolItem toolItem = (MDirectToolItem) element;
+ toolItem.setSelected(linkedWithEditor);
+ }
+ }
}
- public Browser getBrowser() {
- return this.browser;
+ @PersistState
+ public void persistState(MPart part) {
+ Map<String, String> state = part.getPersistedState();
+ state.put(LINKED_KEY, Boolean.valueOf(linkedWithEditor).toString());
}
-
- public Map<String, Object> getIdObjectsMap() {
- return this.idObjectsMap;
+
+ public boolean isLinkedWithEditor() {
+ return this.linkedWithEditor;
}
-
+
+ public void setLinkedWithEditor(boolean linked) {
+ this.linkedWithEditor = linked;
+ }
+
+ public void showDiagram(String fileNamePrefix, Object element, String svgPath, Map<String, Object> id2ObjectsMap) {
+ if (this.browser != null && !this.browser.isDisposed()) {
+ if (element != null) {
+ this.idObjectsMap.put(fileNamePrefix, element);
+ }
+ this.idObjectsMap.putAll(id2ObjectsMap);
+ this.history.add(browser.getUrl());
+ this.browser.setUrl(svgPath);
+ }
+ }
}
diff --git a/eclipse-tools/emf-graphical-viewer/pom.xml b/eclipse-tools/emf-graphical-viewer/pom.xml
new file mode 100644
index 0000000..1335b56
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/pom.xml
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.app4mc.emf.viewers</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.9.8-SNAPSHOT</version>
+
+ <packaging>pom</packaging>
+
+ <name>Eclipse APP4MC EMF Viewers</name>
+
+ <properties>
+ <tycho.version>1.6.0</tycho.version>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>cbi</id>
+ <url>https://repo.eclipse.org/content/repositories/cbi-releases/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <modules>
+ <module>plugins</module>
+ <module>features</module>
+ <module>releng</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <verbose>true</verbose>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+
+ <target>
+ <artifact>
+ <groupId>org.eclipse.app4mc.emf.viewers</groupId>
+ <artifactId>org.eclipse.app4mc.emf.viewers.target</artifactId>
+ <version>0.9.8-SNAPSHOT</version>
+ </artifact>
+ </target>
+ <targetDefinitionIncludeSource>honor</targetDefinitionIncludeSource>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <!-- argLine>${tycho.testArgLine}</argLine> -->
+ <forkMode>never</forkMode>
+ <includes>
+ <include>**/*Test.*</include>
+ </includes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho.version}</version>
+
+ <executions>
+ <execution>
+ <id>plugin-source</id>
+ <goals>
+ <goal>plugin-source</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>sign</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.cbi.maven.plugins</groupId>
+ <artifactId>eclipse-jarsigner-plugin</artifactId>
+ <version>1.1.3</version>
+ <executions>
+ <execution>
+ <id>sign</id>
+ <phase>package</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/.gitignore b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/.gitignore
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/.gitignore
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/.gitignore
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/.project b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/.project
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/.project
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/.project
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/about.html b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/about.html
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/about.html
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/about.html
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/category.xml b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/category.xml
similarity index 76%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/category.xml
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/category.xml
index 2f21da7..ad129e6 100644
--- a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/category.xml
+++ b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/category.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
- <feature id="org.eclipse.app4mc.emf.metamodelviewers">
- <category name="Ecore Tools"/>
- </feature>
<feature id="org.eclipse.app4mc.emf.viewers.graphical">
- <category name="Ecore Tools"/>
+ <category name="APP4MC EMF Viewers"/>
+ </feature>
+ <feature id="org.eclipse.app4mc.emf.metamodelviewers">
+ <category name="APP4MC EMF Viewers"/>
</feature>
<category-def name="APP4MC EMF Viewers" label="org.eclipse.app4mc.emf.viewers"/>
</site>
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/epl-2.0.html b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/epl-2.0.html
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/epl-2.0.html
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/epl-2.0.html
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/siteTemplate/index.html b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/siteTemplate/index.html
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.p2repo/siteTemplate/index.html
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.p2repo/siteTemplate/index.html
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/.project b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/.project
similarity index 77%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/.project
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/.project
index 453263b..bbe8c68 100644
--- a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/.project
+++ b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.app4mc.emf.viewers.build</name>
+ <name>org.eclipse.app4mc.emf.viewers.target</name>
<comment></comment>
<projects>
</projects>
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/about.html b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/about.html
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/about.html
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/about.html
diff --git a/eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/epl-2.0.html b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/epl-2.0.html
similarity index 100%
rename from eclipse-tools/emf-graphical-viewer/build/org.eclipse.app4mc.emf.viewers.build/epl-2.0.html
rename to eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/epl-2.0.html
diff --git a/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/org.eclipse.app4mc.emf.viewers.target.target b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/org.eclipse.app4mc.emf.viewers.target.target
new file mode 100644
index 0000000..4324aa8
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/org.eclipse.app4mc.emf.viewers.target.target
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde?>
+<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
+<target name="EMF Graphical Viewer Target" sequenceNumber="1584966333">
+ <locations>
+ <location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.sdk.ide" version="4.8.0.I20180611-0500"/>
+ <unit id="org.eclipse.emf.ecore.xcore.lib.feature.group" version="1.3.0.v20180125-1130"/>
+ <unit id="org.eclipse.emf.sdk.feature.group" version="2.14.0.v20180529-1157"/>
+ <unit id="org.eclipse.emf.transaction.feature.group" version="1.12.0.201805140824"/>
+ <unit id="org.eclipse.emf.validation.feature.group" version="1.12.0.201805030717"/>
+ <unit id="org.eclipse.emf.workspace.feature.group" version="1.12.0.201805140824"/>
+ <unit id="org.eclipse.xtext.runtime.feature.group" version="2.14.0.v20180523-0937"/>
+ <unit id="org.eclipse.xtext.sdk.feature.group" version="2.14.0.v20180523-0937"/>
+ <unit id="org.eclipse.xtext.xbase.feature.group" version="2.14.0.v20180523-0937"/>
+ <unit id="org.eclipse.xtext.xbase.lib.feature.group" version="2.14.0.v20180522-1631"/>
+ <unit id="org.eclipse.xtend.sdk.feature.group" version="2.14.0.v20180523-0937"/>
+ <unit id="org.eclipse.xpand.sdk.feature.group" version="2.2.0.v201605260315"/>
+ <unit id="org.apache.commons.cli" version="1.2.0.v201404270220"/>
+ <unit id="org.apache.commons.lang" version="2.6.0.v201404270220"/>
+ <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
+ <unit id="org.apache.xerces" version="2.9.0.v201101211617"/>
+ <unit id="org.apache.xalan" version="2.7.1.v201005080400"/>
+ <unit id="org.apache.xml.resolver" version="1.2.0.v201005080400"/>
+ <unit id="org.apache.xml.serializer" version="2.7.1.v201005080400"/>
+ <unit id="javax.xml" version="1.3.4.v201005080400"/>
+ <unit id="org.jdom" version="1.1.1.v201101151400"/>
+ <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
+ <unit id="org.slf4j.api" version="1.7.2.v20121108-1250"/>
+ <repository location="http://download.eclipse.org/releases/photon"/>
+ </location>
+ <location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.sphinx.sdk.feature.group" version="0.11.2.201802230805"/>
+ <repository location="http://download.eclipse.org/sphinx/updates/0.11.x"/>
+ </location>
+ <location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="net.sourceforge.plantuml.lib.feature.feature.group" version="1.2019.11"/>
+ <unit id="net.sourceforge.plantuml.feature.feature.group" version="1.1.24"/>
+ <unit id="net.sourceforge.plantuml.ecore.feature.feature.group" version="1.1.24"/>
+ <repository location="http://hallvard.github.io/plantuml"/>
+ </location>
+ <location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.license.feature.group" version="2.0.2.v20181016-2210"/>
+ <repository location="http://download.eclipse.org/cbi/updates/license"/>
+ </location>
+ </locations>
+</target>
diff --git a/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/org.eclipse.app4mc.emf.viewers.target.tpd b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/org.eclipse.app4mc.emf.viewers.target.tpd
new file mode 100644
index 0000000..2c4327d
--- /dev/null
+++ b/eclipse-tools/emf-graphical-viewer/releng/org.eclipse.app4mc.emf.viewers.target/org.eclipse.app4mc.emf.viewers.target.tpd
@@ -0,0 +1,43 @@
+target "EMF Graphical Viewer Target"
+
+with source allEnvironments
+
+location "http://download.eclipse.org/releases/photon" {
+ org.eclipse.sdk.ide
+ org.eclipse.emf.ecore.xcore.lib.feature.group
+ org.eclipse.emf.sdk.feature.group
+ org.eclipse.emf.transaction.feature.group
+ org.eclipse.emf.validation.feature.group
+ org.eclipse.emf.workspace.feature.group
+ org.eclipse.xtext.runtime.feature.group
+ org.eclipse.xtext.sdk.feature.group
+ org.eclipse.xtext.xbase.feature.group
+ org.eclipse.xtext.xbase.lib.feature.group
+ org.eclipse.xtend.sdk.feature.group
+ org.eclipse.xpand.sdk.feature.group
+ org.apache.commons.cli
+ org.apache.commons.lang
+ org.apache.log4j
+ org.apache.xerces
+ org.apache.xalan
+ org.apache.xml.resolver
+ org.apache.xml.serializer
+ javax.xml
+ org.jdom
+ com.google.guava
+ org.slf4j.api
+}
+
+location "http://download.eclipse.org/sphinx/updates/0.11.x" {
+ org.eclipse.sphinx.sdk.feature.group
+}
+
+location "http://hallvard.github.io/plantuml" {
+ net.sourceforge.plantuml.lib.feature.feature.group [1.2019.11,1.2019.11]
+ net.sourceforge.plantuml.feature.feature.group [1.1.24,1.1.24]
+ net.sourceforge.plantuml.ecore.feature.feature.group [1.1.24,1.1.24]
+}
+
+location "http://download.eclipse.org/cbi/updates/license" {
+ org.eclipse.license.feature.group
+}
\ No newline at end of file