Merge branch 'develop' into X-multipage
diff --git a/.gitignore b/.gitignore
index c757597..47ebe3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,25 +1,25 @@
-target/
-local/
-.git/
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
-
-# Repository wide ignore mac DS_Store files
-.DS_Store
-
-# additional stuff
-.metadata/
-bin/
-.settings/
-*.swp
-.scala_dependencies
-*.class
-bin/
-
-/lib/specs_2.8.1-1.6.6.jar
+target/
+local/
+.git/
+
+# Eclipse, Netbeans and IntelliJ files
+/.*
+!.gitignore
+/nbproject
+/*.ipr
+/*.iws
+/*.iml
+
+# Repository wide ignore mac DS_Store files
+.DS_Store
+
+# additional stuff
+.metadata/
+bin/
+.settings/
+*.swp
+.scala_dependencies
+*.class
+bin/
+
+/lib/specs_2.8.1-1.6.6.jar
diff --git a/org.eclipse.bpmn2.modeler.core/.classpath b/org.eclipse.bpmn2.modeler.core/.classpath
index 8a8f166..ad32c83 100644
--- a/org.eclipse.bpmn2.modeler.core/.classpath
+++ b/org.eclipse.bpmn2.modeler.core/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.bpmn2.modeler.core/.gitignore b/org.eclipse.bpmn2.modeler.core/.gitignore
index 47568e5..e934adf 100644
--- a/org.eclipse.bpmn2.modeler.core/.gitignore
+++ b/org.eclipse.bpmn2.modeler.core/.gitignore
@@ -1 +1 @@
-cache/
+cache/
diff --git a/org.eclipse.bpmn2.modeler.core/.project b/org.eclipse.bpmn2.modeler.core/.project
index 03204ee..7cf94ed 100644
--- a/org.eclipse.bpmn2.modeler.core/.project
+++ b/org.eclipse.bpmn2.modeler.core/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.core</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>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.core</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/org.eclipse.bpmn2.modeler.core/about.html b/org.eclipse.bpmn2.modeler.core/about.html
index dd1a159..3408ea2 100644
--- a/org.eclipse.bpmn2.modeler.core/about.html
+++ b/org.eclipse.bpmn2.modeler.core/about.html
@@ -1,26 +1,26 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/build.properties b/org.eclipse.bpmn2.modeler.core/build.properties
index 8bde1b1..052e46b 100644
--- a/org.eclipse.bpmn2.modeler.core/build.properties
+++ b/org.eclipse.bpmn2.modeler.core/build.properties
@@ -1,8 +1,8 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/,\
- schema/,\
- about.html
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ schema/,\
+ about.html
diff --git a/org.eclipse.bpmn2.modeler.core/pom.xml b/org.eclipse.bpmn2.modeler.core/pom.xml
index 67be119..b072cb5 100644
--- a/org.eclipse.bpmn2.modeler.core/pom.xml
+++ b/org.eclipse.bpmn2.modeler.core/pom.xml
@@ -1,16 +1,16 @@
-<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>
- <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <artifactId>org.eclipse.bpmn2.modeler.core</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
- <name>BPMN2 Modeler Core</name>
- <description>Common Core functionality for BPMN2 Modeler</description>
+<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>
+ <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <artifactId>org.eclipse.bpmn2.modeler.core</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>BPMN2 Modeler Core</name>
+ <description>Common Core functionality for BPMN2 Modeler</description>
</project>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/schema/org.eclipse.bpmn2.modeler.runtime.exsd b/org.eclipse.bpmn2.modeler.core/schema/org.eclipse.bpmn2.modeler.runtime.exsd
index 8923c54..98c585a 100644
--- a/org.eclipse.bpmn2.modeler.core/schema/org.eclipse.bpmn2.modeler.runtime.exsd
+++ b/org.eclipse.bpmn2.modeler.core/schema/org.eclipse.bpmn2.modeler.runtime.exsd
@@ -1,670 +1,670 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.bpmn2.modeler.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.bpmn2.modeler.core" id="org.eclipse.bpmn2.modeler.runtime" name="Runtime Specialization"/>
- </appinfo>
- <documentation>
- Provides customization of the BPMN2 Modeler for third-party runtimes.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <choice minOccurs="1" maxOccurs="unbounded">
- <element ref="runtime"/>
- <element ref="model"/>
- <element ref="propertyTab"/>
- <element ref="customTask"/>
- <element ref="modelExtension"/>
- <element ref="modelEnablement"/>
- <element ref="propertyExtension"/>
- <element ref="featureContainer"/>
- <element ref="style" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtime">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- Descriptive name for this Runtime implementation. This will be displayed in the BPMN2 Modeler Preference Page under "Runtimes".
- </documentation>
- </annotation>
- </attribute>
- <attribute name="versions" type="string">
- <annotation>
- <documentation>
- Versions of the runtime that are supported by this extension point's contributions.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique ID for the Runtime.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Tooltip text displayed for this runtime name.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="model">
- <annotation>
- <documentation>
- Custom EMF Resource Factory based on the org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl class. This provides runtime-specific hooks for model serialization, proxy resolution, object customization, etc.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="runtimeId" type="string" use="required">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements for which this ResourceFactory will be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="uri" type="string">
- <annotation>
- <documentation>
- The namespace URI of the registered model EPackage.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="resourceFactory" type="string" use="required">
- <annotation>
- <documentation>
- ResourceFactory class for this model.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertyTab">
- <annotation>
- <documentation>
- Describes a list of tabs that will be contributed to the tabbed property sheet page.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique ID for the tab.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeId" type="string">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements for which this propertyTab will be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A label to be displayed on the tab.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="category" type="string">
- <annotation>
- <documentation>
- The category used to group tabs.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="afterTab" type="string">
- <annotation>
- <documentation>
- When there is more than one tab in a category, tabs are sorted by the afterTab attribute.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="indented" type="boolean">
- <annotation>
- <documentation>
- If true, then this tab is indented. This is meant to indicate subtabs or categories of the parent tab.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="image" type="string">
- <annotation>
- <documentation>
- If an image is provided, the icon image is displayed on the tab when the tab is active.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="replaceTab" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements the section, i.e. extends org.eclipse.graphiti.ui.platform.GFPropertySection
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.graphiti.ui.platform.GFPropertySection:"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="type" type="string">
- <annotation>
- <documentation>
- The selected class or interface that will enable the display of the section in the tab. This must be a fully qualified class name, e.g. "org.eclipse.bpmn2.SequenceFlow".
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="popup" type="boolean">
- <annotation>
- <documentation>
- Exclude this Property Tab from popup dialogs if "false". The default value is "true". This allows miscellaneous property tabs, such as the Description to be hidden from configuration dialogs.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="customTask">
- <annotation>
- <documentation>
- Defines a Custom Task contributed by a third party runtime vendor. A Custom Task is typically backed by a business object model (e.g. EMF), identified by "type".
- </documentation>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="property"/>
- </choice>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique ID used to identify the Custom Task.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeId" type="string" use="required">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements in which this Custom Task is defined.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- Descriptive name for this Custom Task. This will be displayed in the Tool Palette.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Description used in dialogs and tooltips.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="type" type="string">
- <annotation>
- <documentation>
- Identifies the business object model type. If the business object model is persisted as an EMF resource, this corresponds to the EMF EClass of the object representing this Custom Task.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="featureContainer" type="string" use="required">
- <annotation>
- <documentation>
- The Graphiti Feature Container that provides create, add and update functionality in the editor for this Custom Task.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomTaskFeatureContainer:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="property">
- <annotation>
- <documentation>
- Describes some property of the Custom Task. This may be either
- </documentation>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="value"/>
- </choice>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- The property name. If the property is mapped to an EMF model, this should correspond to an attribute name of the Custom Task type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="value" type="string">
- <annotation>
- <documentation>
- Default value for the property.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Description used in dialogs and tooltips.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="ref" type="string">
- <annotation>
- <documentation>
- Identifies a reference to a previously created property (no forward references supported at this time). The reference string is a slash-separated name of a property followed by an optional #<number> used to index list objects; for example:
-
-rootFeature/childFeature_1/childFeature_2#0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string">
- <annotation>
- <documentation>
- If the EMF attribute is created dynamically (i.e. not defined in a model) then this is used as the attribute's data type.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="value">
- <annotation>
- <documentation>
- If a property type is complex then this will contain a list of the complex type's values. If multiple values are given the property is assumed to be a list of complex types.
- </documentation>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="property"/>
- </choice>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="modelExtension">
- <complexType>
- <choice minOccurs="1" maxOccurs="unbounded">
- <element ref="property"/>
- </choice>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeId" type="string" use="required">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements in which this Model Extension is defined.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- Descriptive name for this Custom Task. This will be displayed in the Tool Palette.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Description used in dialogs and tooltips.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- Identifies the business object model type. If the business object model is persisted as an EMF resource, this corresponds to the EMF EClass of the object representing this extensible element.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="modelEnablement">
- <complexType>
- <choice>
- <element ref="enable" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="disable" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- <attribute name="runtimeId" type="string" use="required">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements in which this Model Enablement is defined.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type">
- <annotation>
- <documentation>
- Optional diagram type name: either Process, Collaboration or Choreography.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="Process">
- </enumeration>
- <enumeration value="Collaboration">
- </enumeration>
- <enumeration value="Choreography">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="profile" type="string">
- <annotation>
- <documentation>
- An optional profile name that can be used to define different levels of enablment within each diagram type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="override" type="boolean">
- <annotation>
- <documentation>
- Controls the processing of the modelEnablement. By default the model enablements will be effective instantly on opening a diagram with the corresponding type and runtime.
-
-If set to "false", the model enablement will not be effective by default.
-If not set, this value will be treated as "true".
-
-DEPRECATED: I have no idea what I was thinking here...
- </documentation>
- <appinfo>
- <meta.attribute deprecated="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="enable">
- <complexType>
- <attribute name="object" type="string" use="required">
- <annotation>
- <documentation>
- Name of the BPMN2 element to enable. All references made by this element to other BPMN2 elements are enabled also (note: if needed, the referenced element types can subsequently be disabled).
-
-This may also be a Custom Task ID to show it on the tool palette.
-
-The special object name "all" is used to refer to all BPMN2 elements.
-
-The value "default" is used by contributing plugins to refer to enablements in the Default Target Runtime defined in the editor core plugins.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="feature" type="string">
- <annotation>
- <documentation>
- The name of a structural feature defined by the BPMN2 element named in "object".
-
-If "object" has the value "default", then this refers to a diagram type in the modelEnablement section.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="disable">
- <complexType>
- <attribute name="object" type="string" use="required">
- <annotation>
- <documentation>
- Name of the BPMN2 element to disable. All references made by this element to other BPMN2 elements are also disabled (note: if needed, the referenced element types can subsequently be re-enabled).
-
-This may also be a Custom Task ID to hide it on the tool palette.
-
-The special object name "all" is used to refer to all BPMN2 elements.
-
-The value "default" is used by contributing plugins to refer to enablements in the Default Target Runtime defined in the editor core plugins.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="feature" type="string">
- <annotation>
- <documentation>
- The name of a structural feature defined by the BPMN2 element named in "object".
-
-If "object" has the value "default", then this refers to a diagram type in the modelEnablement section.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertyExtension">
- <annotation>
- <documentation>
- Provider classes for model objects and features.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique ID for the propertyExtension extension.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeId" type="string" use="required">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements for which this propertyExtension will be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements the property extension adapter, i.e. extends the org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter class.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.graphiti.ui.platform.GFPropertySection:"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The BPMN2 element EClass to which this propertyExtension applies. This must be a fully qualified class name, e.g. "org.eclipse.bpmn2.SequenceFlow".
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="featureContainer">
- <complexType>
- <attribute name="runtimeId" type="string" use="required">
- <annotation>
- <documentation>
- Identifies one of the previously defined runtime elements for which this featureContainer will be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements the Graphiti Feature Container class. The class must implement the BPMN2 Code Feature Container interface.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.bpmn2.modeler.core.features.FeatureContainer"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The BPMN2 element EClass to which this featureContainer applies. This must be a fully qualified class name, e.g. "org.eclipse.bpmn2.SequenceFlow".
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="style">
- <complexType>
- <attribute name="object" type="string" use="required">
- <annotation>
- <documentation>
- Name of the BPMN2 element to enable. All references made by this element to other BPMN2 elements are enabled also (note: if needed, the referenced element types can subsequently be disabled).
-
-This may also be a Custom Task ID to show it on the tool palette.
-
-The special object name "all" is used to refer to all BPMN2 elements.
-
-The value "default" is used by contributing plugins to refer to enablements in the Default Target Runtime defined in the editor core plugins.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="foreground" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="background" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="font" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="textColor" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.bpmn2.modeler.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.bpmn2.modeler.core" id="org.eclipse.bpmn2.modeler.runtime" name="Runtime Specialization"/>
+ </appinfo>
+ <documentation>
+ Provides customization of the BPMN2 Modeler for third-party runtimes.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <choice minOccurs="1" maxOccurs="unbounded">
+ <element ref="runtime"/>
+ <element ref="model"/>
+ <element ref="propertyTab"/>
+ <element ref="customTask"/>
+ <element ref="modelExtension"/>
+ <element ref="modelEnablement"/>
+ <element ref="propertyExtension"/>
+ <element ref="featureContainer"/>
+ <element ref="style" minOccurs="0" maxOccurs="unbounded"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="runtime">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Descriptive name for this Runtime implementation. This will be displayed in the BPMN2 Modeler Preference Page under "Runtimes".
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="versions" type="string">
+ <annotation>
+ <documentation>
+ Versions of the runtime that are supported by this extension point's contributions.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique ID for the Runtime.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ Tooltip text displayed for this runtime name.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="model">
+ <annotation>
+ <documentation>
+ Custom EMF Resource Factory based on the org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl class. This provides runtime-specific hooks for model serialization, proxy resolution, object customization, etc.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="runtimeId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements for which this ResourceFactory will be used.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="uri" type="string">
+ <annotation>
+ <documentation>
+ The namespace URI of the registered model EPackage.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="resourceFactory" type="string" use="required">
+ <annotation>
+ <documentation>
+ ResourceFactory class for this model.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="propertyTab">
+ <annotation>
+ <documentation>
+ Describes a list of tabs that will be contributed to the tabbed property sheet page.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique ID for the tab.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="runtimeId" type="string">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements for which this propertyTab will be used.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ A label to be displayed on the tab.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="category" type="string">
+ <annotation>
+ <documentation>
+ The category used to group tabs.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="afterTab" type="string">
+ <annotation>
+ <documentation>
+ When there is more than one tab in a category, tabs are sorted by the afterTab attribute.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="indented" type="boolean">
+ <annotation>
+ <documentation>
+ If true, then this tab is indented. This is meant to indicate subtabs or categories of the parent tab.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="image" type="string">
+ <annotation>
+ <documentation>
+ If an image is provided, the icon image is displayed on the tab when the tab is active.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="replaceTab" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class that implements the section, i.e. extends org.eclipse.graphiti.ui.platform.GFPropertySection
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.graphiti.ui.platform.GFPropertySection:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string">
+ <annotation>
+ <documentation>
+ The selected class or interface that will enable the display of the section in the tab. This must be a fully qualified class name, e.g. "org.eclipse.bpmn2.SequenceFlow".
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="popup" type="boolean">
+ <annotation>
+ <documentation>
+ Exclude this Property Tab from popup dialogs if "false". The default value is "true". This allows miscellaneous property tabs, such as the Description to be hidden from configuration dialogs.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="customTask">
+ <annotation>
+ <documentation>
+ Defines a Custom Task contributed by a third party runtime vendor. A Custom Task is typically backed by a business object model (e.g. EMF), identified by "type".
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="property"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique ID used to identify the Custom Task.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="runtimeId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements in which this Custom Task is defined.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Descriptive name for this Custom Task. This will be displayed in the Tool Palette.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ Description used in dialogs and tooltips.
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string">
+ <annotation>
+ <documentation>
+ Identifies the business object model type. If the business object model is persisted as an EMF resource, this corresponds to the EMF EClass of the object representing this Custom Task.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="featureContainer" type="string" use="required">
+ <annotation>
+ <documentation>
+ The Graphiti Feature Container that provides create, add and update functionality in the editor for this Custom Task.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomTaskFeatureContainer:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="property">
+ <annotation>
+ <documentation>
+ Describes some property of the Custom Task. This may be either
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="value"/>
+ </choice>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ The property name. If the property is mapped to an EMF model, this should correspond to an attribute name of the Custom Task type.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string">
+ <annotation>
+ <documentation>
+ Default value for the property.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ Description used in dialogs and tooltips.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="ref" type="string">
+ <annotation>
+ <documentation>
+ Identifies a reference to a previously created property (no forward references supported at this time). The reference string is a slash-separated name of a property followed by an optional #<number> used to index list objects; for example:
+
+rootFeature/childFeature_1/childFeature_2#0
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string">
+ <annotation>
+ <documentation>
+ If the EMF attribute is created dynamically (i.e. not defined in a model) then this is used as the attribute's data type.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="value">
+ <annotation>
+ <documentation>
+ If a property type is complex then this will contain a list of the complex type's values. If multiple values are given the property is assumed to be a list of complex types.
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="property"/>
+ </choice>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="modelExtension">
+ <complexType>
+ <choice minOccurs="1" maxOccurs="unbounded">
+ <element ref="property"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="runtimeId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements in which this Model Extension is defined.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ Descriptive name for this Custom Task. This will be displayed in the Tool Palette.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ Description used in dialogs and tooltips.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies the business object model type. If the business object model is persisted as an EMF resource, this corresponds to the EMF EClass of the object representing this extensible element.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="modelEnablement">
+ <complexType>
+ <choice>
+ <element ref="enable" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="disable" minOccurs="0" maxOccurs="unbounded"/>
+ </choice>
+ <attribute name="runtimeId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements in which this Model Enablement is defined.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type">
+ <annotation>
+ <documentation>
+ Optional diagram type name: either Process, Collaboration or Choreography.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="Process">
+ </enumeration>
+ <enumeration value="Collaboration">
+ </enumeration>
+ <enumeration value="Choreography">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="profile" type="string">
+ <annotation>
+ <documentation>
+ An optional profile name that can be used to define different levels of enablment within each diagram type.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="override" type="boolean">
+ <annotation>
+ <documentation>
+ Controls the processing of the modelEnablement. By default the model enablements will be effective instantly on opening a diagram with the corresponding type and runtime.
+
+If set to "false", the model enablement will not be effective by default.
+If not set, this value will be treated as "true".
+
+DEPRECATED: I have no idea what I was thinking here...
+ </documentation>
+ <appinfo>
+ <meta.attribute deprecated="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="enable">
+ <complexType>
+ <attribute name="object" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of the BPMN2 element to enable. All references made by this element to other BPMN2 elements are enabled also (note: if needed, the referenced element types can subsequently be disabled).
+
+This may also be a Custom Task ID to show it on the tool palette.
+
+The special object name "all" is used to refer to all BPMN2 elements.
+
+The value "default" is used by contributing plugins to refer to enablements in the Default Target Runtime defined in the editor core plugins.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="feature" type="string">
+ <annotation>
+ <documentation>
+ The name of a structural feature defined by the BPMN2 element named in "object".
+
+If "object" has the value "default", then this refers to a diagram type in the modelEnablement section.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="disable">
+ <complexType>
+ <attribute name="object" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of the BPMN2 element to disable. All references made by this element to other BPMN2 elements are also disabled (note: if needed, the referenced element types can subsequently be re-enabled).
+
+This may also be a Custom Task ID to hide it on the tool palette.
+
+The special object name "all" is used to refer to all BPMN2 elements.
+
+The value "default" is used by contributing plugins to refer to enablements in the Default Target Runtime defined in the editor core plugins.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="feature" type="string">
+ <annotation>
+ <documentation>
+ The name of a structural feature defined by the BPMN2 element named in "object".
+
+If "object" has the value "default", then this refers to a diagram type in the modelEnablement section.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="propertyExtension">
+ <annotation>
+ <documentation>
+ Provider classes for model objects and features.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique ID for the propertyExtension extension.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="runtimeId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements for which this propertyExtension will be used.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class that implements the property extension adapter, i.e. extends the org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter class.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.graphiti.ui.platform.GFPropertySection:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The BPMN2 element EClass to which this propertyExtension applies. This must be a fully qualified class name, e.g. "org.eclipse.bpmn2.SequenceFlow".
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="featureContainer">
+ <complexType>
+ <attribute name="runtimeId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Identifies one of the previously defined runtime elements for which this featureContainer will be used.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class that implements the Graphiti Feature Container class. The class must implement the BPMN2 Code Feature Container interface.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.bpmn2.modeler.core.features.FeatureContainer"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The BPMN2 element EClass to which this featureContainer applies. This must be a fully qualified class name, e.g. "org.eclipse.bpmn2.SequenceFlow".
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="style">
+ <complexType>
+ <attribute name="object" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of the BPMN2 element to enable. All references made by this element to other BPMN2 elements are enabled also (note: if needed, the referenced element types can subsequently be disabled).
+
+This may also be a Custom Task ID to show it on the tool palette.
+
+The special object name "all" is used to refer to all BPMN2 elements.
+
+The value "default" is used by contributing plugins to refer to enablements in the Default Target Runtime defined in the editor core plugins.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="foreground" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="background" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="font" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="textColor" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/AbstractPropertyChangeListenerProvider.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/AbstractPropertyChangeListenerProvider.java
index 5a089cb..5260de3 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/AbstractPropertyChangeListenerProvider.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/AbstractPropertyChangeListenerProvider.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-
-public abstract class AbstractPropertyChangeListenerProvider {
-
- ArrayList<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
-
- public void removePropertyChangeListener(PropertyChangeListener pcl) {
- listeners.remove(pcl);
- }
-
- public void removePropertyChangeListener(String s, PropertyChangeListener pcl) {
- listeners.remove(pcl);
- }
-
- public void addPropertyChangeListener(PropertyChangeListener pcl) {
- listeners.add(pcl);
- }
-
- public void addPropertyChangeListener(String s, PropertyChangeListener pcl) {
- listeners.add(pcl);
- }
-
- protected void fireChangeEvent(PropertyChangeEvent propertyChangeEvent) {
- for (PropertyChangeListener l : listeners) {
- l.propertyChange(propertyChangeEvent);
- }
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+
+public abstract class AbstractPropertyChangeListenerProvider {
+
+ ArrayList<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
+
+ public void removePropertyChangeListener(PropertyChangeListener pcl) {
+ listeners.remove(pcl);
+ }
+
+ public void removePropertyChangeListener(String s, PropertyChangeListener pcl) {
+ listeners.remove(pcl);
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener pcl) {
+ listeners.add(pcl);
+ }
+
+ public void addPropertyChangeListener(String s, PropertyChangeListener pcl) {
+ listeners.add(pcl);
+ }
+
+ protected void fireChangeEvent(PropertyChangeEvent propertyChangeEvent) {
+ for (PropertyChangeListener l : listeners) {
+ l.propertyChange(propertyChangeEvent);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Activator.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Activator.java
index 775725f..0e5a091 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Activator.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Activator.java
@@ -1,134 +1,134 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core;
-
-import java.lang.reflect.Field;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.bpmn2.modeler.core"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- IPreferenceStore store = getPreferenceStore();
- Bpmn2Preferences.getInstance().load();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- public static void logStatus(IStatus status) {
- Platform.getLog(plugin.getBundle()).log(status);
- }
-
- public static void logError(Exception e) {
- logStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
- }
-
- /**
- * Initializes the table of images used in this plugin.
- */
- @Override
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = super.createImageRegistry();
- URL baseURL = getBundle().getEntry("/"); //$NON-NLS-1$
-
- // A little reflection magic ... so that we don't
- // have to add the createImageDescriptor every time
- // we add it to the IConstants ..
- Field fields[] = IConstants.class.getFields();
- for(int i=0; i < fields.length; i++) {
- Field f = fields[i];
- if (f.getType() != String.class) {
- continue;
- }
- String name = f.getName();
- if (name.startsWith("ICON_") || name.startsWith("CURSOR_") || name.startsWith("IMAGE_")) { //$NON-NLS-1$ //$NON-NLS-2$
- try {
- String value = (String) f.get(null);
- createImageDescriptor(registry, value, baseURL);
- } catch (Exception e) {
- logError(e);
- }
- }
- }
- return registry;
- }
-
- /**
- * Creates an image descriptor and places it in the image registry.
- */
- private void createImageDescriptor(ImageRegistry registry, String id, URL baseURL) {
- URL url = null;
- try {
- url = new URL(baseURL, IConstants.ICON_PATH + id);
- } catch (MalformedURLException e) {
- logError(e);
- }
- ImageDescriptor desc = ImageDescriptor.createFromURL(url);
- registry.put(id, desc);
- }
-
- public Image getImage(String id) {
- return getImageRegistry().get(id);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core;
+
+import java.lang.reflect.Field;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.bpmn2.modeler.core"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ IPreferenceStore store = getPreferenceStore();
+ Bpmn2Preferences.getInstance().load();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static void logStatus(IStatus status) {
+ Platform.getLog(plugin.getBundle()).log(status);
+ }
+
+ public static void logError(Exception e) {
+ logStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
+ }
+
+ /**
+ * Initializes the table of images used in this plugin.
+ */
+ @Override
+ protected ImageRegistry createImageRegistry() {
+ ImageRegistry registry = super.createImageRegistry();
+ URL baseURL = getBundle().getEntry("/"); //$NON-NLS-1$
+
+ // A little reflection magic ... so that we don't
+ // have to add the createImageDescriptor every time
+ // we add it to the IConstants ..
+ Field fields[] = IConstants.class.getFields();
+ for(int i=0; i < fields.length; i++) {
+ Field f = fields[i];
+ if (f.getType() != String.class) {
+ continue;
+ }
+ String name = f.getName();
+ if (name.startsWith("ICON_") || name.startsWith("CURSOR_") || name.startsWith("IMAGE_")) { //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ String value = (String) f.get(null);
+ createImageDescriptor(registry, value, baseURL);
+ } catch (Exception e) {
+ logError(e);
+ }
+ }
+ }
+ return registry;
+ }
+
+ /**
+ * Creates an image descriptor and places it in the image registry.
+ */
+ private void createImageDescriptor(ImageRegistry registry, String id, URL baseURL) {
+ URL url = null;
+ try {
+ url = new URL(baseURL, IConstants.ICON_PATH + id);
+ } catch (MalformedURLException e) {
+ logError(e);
+ }
+ ImageDescriptor desc = ImageDescriptor.createFromURL(url);
+ registry.put(id, desc);
+ }
+
+ public Image getImage(String id) {
+ return getImageRegistry().get(id);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Bpmn2TabbedPropertySheetPage.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Bpmn2TabbedPropertySheetPage.java
index e5cf27c..a3bbf1a 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Bpmn2TabbedPropertySheetPage.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/Bpmn2TabbedPropertySheetPage.java
@@ -1,20 +1,20 @@
-package org.eclipse.bpmn2.modeler.core;
-
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-public class Bpmn2TabbedPropertySheetPage extends TabbedPropertySheetPage {
-
- DiagramEditor diagramEditor;
-
- public Bpmn2TabbedPropertySheetPage(
- ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) {
- super(tabbedPropertySheetPageContributor);
- diagramEditor = (DiagramEditor)tabbedPropertySheetPageContributor;
- }
-
- public DiagramEditor getDiagramEditor() {
- return diagramEditor;
- }
-}
+package org.eclipse.bpmn2.modeler.core;
+
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+public class Bpmn2TabbedPropertySheetPage extends TabbedPropertySheetPage {
+
+ DiagramEditor diagramEditor;
+
+ public Bpmn2TabbedPropertySheetPage(
+ ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) {
+ super(tabbedPropertySheetPageContributor);
+ diagramEditor = (DiagramEditor)tabbedPropertySheetPageContributor;
+ }
+
+ public DiagramEditor getDiagramEditor() {
+ return diagramEditor;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/DIZorderComparator.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/DIZorderComparator.java
index 8736720..154b7fb 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/DIZorderComparator.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/DIZorderComparator.java
@@ -1,128 +1,128 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core;
-
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.FlowNode;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.SubChoreography;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.dd.di.DiagramElement;
-
-final class DIZorderComparator implements Comparator<DiagramElement> {
- @Override
- public int compare(DiagramElement a, DiagramElement b) {
- boolean aShape = a instanceof BPMNShape;
- boolean bShape = b instanceof BPMNShape;
-
- boolean aEdge = a instanceof BPMNEdge;
- boolean bEdge = b instanceof BPMNEdge;
-
- if (aShape && bEdge) {
- return -1;
-
- } else if (aEdge && bShape) {
- return 1;
- }
- if (aShape && bShape) {
- return compareShape((BPMNShape) a, (BPMNShape) b);
- }
- return 0;
- }
-
- private int compareShape(BPMNShape a, BPMNShape b) {
- boolean aIsPool = isPool(a);
- boolean bIsPool = isPool(b);
-
- // Pools must be the first DI elements as pools can only be placed on diagrams.
- if (aIsPool && bIsPool) {
- return 0;
- } else if (aIsPool && !bIsPool) {
- return -1;
- } else if (!aIsPool && bIsPool) {
- return 1;
- }
-
- BaseElement aElem = a.getBpmnElement();
- BaseElement bElem = b.getBpmnElement();
- boolean aIsSecondTier = aElem instanceof Lane || aElem instanceof SubProcess
- || aElem instanceof SubChoreography;
- boolean bIsSecondTier = bElem instanceof Lane || bElem instanceof SubProcess
- || bElem instanceof SubChoreography;
-
- if (aIsSecondTier && bIsSecondTier) {
- if (isParent(aElem, bElem)) {
- return -1;
- } else if (isParent(bElem, aElem)) {
- return 1;
- }
- return 0;
- } else if (aIsSecondTier && !bIsSecondTier) {
- return -1;
- } else if (!aIsSecondTier && bIsSecondTier) {
- return 1;
- }
-
- return 0;
- }
-
- private boolean isPool(BPMNShape a) {
- return a.getBpmnElement() instanceof Participant && a.getChoreographyActivityShape() == null;
- }
-
- private boolean isParent(BaseElement parent, BaseElement child) {
- if (child instanceof FlowNode) {
- if (((FlowNode) child).getLanes().contains(parent)) {
- return true;
- } else if (parent instanceof Lane) {
- return isChildParent(parent, child);
- }
- } else if (parent instanceof Lane) {
- if (child instanceof Lane) {
- LaneSet childLaneSet = ((Lane) parent).getChildLaneSet();
- if (childLaneSet == null) {
- return false;
- }
- if (((Lane) parent).getChildLaneSet().getLanes().contains(child)) {
- return true;
- }
- return isChildParent(parent, child);
- }
- }
-
- return false;
- }
-
- private boolean isChildParent(BaseElement parent, BaseElement child) {
- LaneSet childLaneSet = ((Lane) parent).getChildLaneSet();
- if (childLaneSet == null) {
- return false;
- }
-
- List<Lane> lanes = childLaneSet.getLanes();
- for (Lane lane : lanes) {
- if (isParent(lane, child)) {
- return true;
- }
- }
- return false;
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.FlowNode;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.SubChoreography;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.dd.di.DiagramElement;
+
+final class DIZorderComparator implements Comparator<DiagramElement> {
+ @Override
+ public int compare(DiagramElement a, DiagramElement b) {
+ boolean aShape = a instanceof BPMNShape;
+ boolean bShape = b instanceof BPMNShape;
+
+ boolean aEdge = a instanceof BPMNEdge;
+ boolean bEdge = b instanceof BPMNEdge;
+
+ if (aShape && bEdge) {
+ return -1;
+
+ } else if (aEdge && bShape) {
+ return 1;
+ }
+ if (aShape && bShape) {
+ return compareShape((BPMNShape) a, (BPMNShape) b);
+ }
+ return 0;
+ }
+
+ private int compareShape(BPMNShape a, BPMNShape b) {
+ boolean aIsPool = isPool(a);
+ boolean bIsPool = isPool(b);
+
+ // Pools must be the first DI elements as pools can only be placed on diagrams.
+ if (aIsPool && bIsPool) {
+ return 0;
+ } else if (aIsPool && !bIsPool) {
+ return -1;
+ } else if (!aIsPool && bIsPool) {
+ return 1;
+ }
+
+ BaseElement aElem = a.getBpmnElement();
+ BaseElement bElem = b.getBpmnElement();
+ boolean aIsSecondTier = aElem instanceof Lane || aElem instanceof SubProcess
+ || aElem instanceof SubChoreography;
+ boolean bIsSecondTier = bElem instanceof Lane || bElem instanceof SubProcess
+ || bElem instanceof SubChoreography;
+
+ if (aIsSecondTier && bIsSecondTier) {
+ if (isParent(aElem, bElem)) {
+ return -1;
+ } else if (isParent(bElem, aElem)) {
+ return 1;
+ }
+ return 0;
+ } else if (aIsSecondTier && !bIsSecondTier) {
+ return -1;
+ } else if (!aIsSecondTier && bIsSecondTier) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ private boolean isPool(BPMNShape a) {
+ return a.getBpmnElement() instanceof Participant && a.getChoreographyActivityShape() == null;
+ }
+
+ private boolean isParent(BaseElement parent, BaseElement child) {
+ if (child instanceof FlowNode) {
+ if (((FlowNode) child).getLanes().contains(parent)) {
+ return true;
+ } else if (parent instanceof Lane) {
+ return isChildParent(parent, child);
+ }
+ } else if (parent instanceof Lane) {
+ if (child instanceof Lane) {
+ LaneSet childLaneSet = ((Lane) parent).getChildLaneSet();
+ if (childLaneSet == null) {
+ return false;
+ }
+ if (((Lane) parent).getChildLaneSet().getLanes().contains(child)) {
+ return true;
+ }
+ return isChildParent(parent, child);
+ }
+ }
+
+ return false;
+ }
+
+ private boolean isChildParent(BaseElement parent, BaseElement child) {
+ LaneSet childLaneSet = ((Lane) parent).getChildLaneSet();
+ if (childLaneSet == null) {
+ return false;
+ }
+
+ List<Lane> lanes = childLaneSet.getLanes();
+ for (Lane lane : lanes) {
+ if (isParent(lane, child)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IBpmn2RuntimeExtension.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IBpmn2RuntimeExtension.java
index 4a8b031..8b57a4f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IBpmn2RuntimeExtension.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IBpmn2RuntimeExtension.java
@@ -1,35 +1,35 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core;
-
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swt.widgets.Composite;
-
-public interface IBpmn2RuntimeExtension {
-
- /**
- * Check if the given input file is specific to the runtime environment.
- * The implementation should check for specific extensions and namespaces that identify
- * the file for this runtime.
- *
- * @param file
- * @return true if the file is targeted for this runtime, false if the file is generic BPMN 2.0
- */
- public boolean isContentForRuntime(IFile file);
- public String getTargetNamespace(Bpmn2DiagramType diagramType);
- public void initialize();
-
- public Composite getPreferencesComposite(Composite parent, Bpmn2Preferences preferences);
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core;
+
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.widgets.Composite;
+
+public interface IBpmn2RuntimeExtension {
+
+ /**
+ * Check if the given input file is specific to the runtime environment.
+ * The implementation should check for specific extensions and namespaces that identify
+ * the file for this runtime.
+ *
+ * @param file
+ * @return true if the file is targeted for this runtime, false if the file is generic BPMN 2.0
+ */
+ public boolean isContentForRuntime(IFile file);
+ public String getTargetNamespace(Bpmn2DiagramType diagramType);
+ public void initialize();
+
+ public Composite getPreferencesComposite(Composite parent, Bpmn2Preferences preferences);
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IConstants.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IConstants.java
index a5469b2..cc52cbc 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IConstants.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/IConstants.java
@@ -1,14 +1,14 @@
-package org.eclipse.bpmn2.modeler.core;
-
-public interface IConstants {
- public final String ICON_PATH = "icons/";
-
- public final String ICON_ADD_20 = "20/add.png"; //$NON-NLS-1$
- public final String ICON_CLOSE_20 = "20/close.png"; //$NON-NLS-1$
- public final String ICON_DELETE_20 = "20/delete.png"; //$NON-NLS-1$
- public final String ICON_DOWN_20= "20/down.png"; //$NON-NLS-1$
- public final String ICON_EDIT_20 = "20/edit.png"; //$NON-NLS-1$
- public final String ICON_REMOVE_20 = "20/remove.png"; //$NON-NLS-1$
- public final String ICON_UP_20 = "20/up.png"; //$NON-NLS-1$
- public final String ICON_PROPERTIES_16 = "org.eclipse.bpmn2.modeler.icons." + "properties" + ".16"; //$NON-NLS-1$
-}
+package org.eclipse.bpmn2.modeler.core;
+
+public interface IConstants {
+ public final String ICON_PATH = "icons/";
+
+ public final String ICON_ADD_20 = "20/add.png"; //$NON-NLS-1$
+ public final String ICON_CLOSE_20 = "20/close.png"; //$NON-NLS-1$
+ public final String ICON_DELETE_20 = "20/delete.png"; //$NON-NLS-1$
+ public final String ICON_DOWN_20= "20/down.png"; //$NON-NLS-1$
+ public final String ICON_EDIT_20 = "20/edit.png"; //$NON-NLS-1$
+ public final String ICON_REMOVE_20 = "20/remove.png"; //$NON-NLS-1$
+ public final String ICON_UP_20 = "20/up.png"; //$NON-NLS-1$
+ public final String ICON_PROPERTIES_16 = "org.eclipse.bpmn2.modeler.icons." + "properties" + ".16"; //$NON-NLS-1$
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandlerLocator.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandlerLocator.java
index e3e0721..e97fad8 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandlerLocator.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandlerLocator.java
@@ -1,91 +1,91 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core;
-
-import java.io.IOException;
-import java.util.HashMap;
-
-import org.eclipse.bpmn2.util.Bpmn2ResourceImpl;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-
-public class ModelHandlerLocator {
-
- private static HashMap<URI, ModelHandler> map = new HashMap<URI, ModelHandler>();
- private static HashMap<URI, ModelHandler> diagramMap = new HashMap<URI, ModelHandler>();
-
- public static ModelHandler getModelHandler(Resource eResource) throws IOException {
- if (eResource==null)
- return null;
- URI uri = eResource.getURI();
-
- return getModelHandler(uri);
- }
-
- public static ModelHandler getModelHandler(URI path) throws IOException {
- ModelHandler modelHandler = map.get(path);
- if (modelHandler == null) {
- return diagramMap.get(path);
- }
- return modelHandler;
- }
-
- public static void put(URI diagramPath, ModelHandler mh) {
- diagramMap.put(diagramPath, mh);
- }
-
- public static void remove(URI path) {
- if (map.remove(path)==null) {
- diagramMap.remove(path);
- }
- }
-
- public static ModelHandler createModelHandler(URI path, final Bpmn2ResourceImpl resource) {
- if (map.containsKey(path)) {
- return map.get(path);
- }
- return createNewModelHandler(path, resource);
- }
-
- private static ModelHandler createNewModelHandler(URI path, final Bpmn2ResourceImpl resource) {
- ModelHandler handler = new ModelHandler();
- map.put(path, handler);
- handler.resource = resource;
-
- URI uri = resource.getURI();
-
- try {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- String platformString = uri.toPlatformString(true);
-
- // platformString is null if file is outside of workspace
- if ((platformString == null || workspace.getRoot().getFile(new Path(platformString)).exists())
- && !resource.isLoaded()) {
- handler.loadResource();
- }
- } catch (IllegalStateException e) {
-
- // Workspace is not initialized so we must be running tests!
- if (!resource.isLoaded()) {
- handler.loadResource();
- }
- }
-
- handler.createDefinitionsIfMissing();
- return handler;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import org.eclipse.bpmn2.util.Bpmn2ResourceImpl;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+
+public class ModelHandlerLocator {
+
+ private static HashMap<URI, ModelHandler> map = new HashMap<URI, ModelHandler>();
+ private static HashMap<URI, ModelHandler> diagramMap = new HashMap<URI, ModelHandler>();
+
+ public static ModelHandler getModelHandler(Resource eResource) throws IOException {
+ if (eResource==null)
+ return null;
+ URI uri = eResource.getURI();
+
+ return getModelHandler(uri);
+ }
+
+ public static ModelHandler getModelHandler(URI path) throws IOException {
+ ModelHandler modelHandler = map.get(path);
+ if (modelHandler == null) {
+ return diagramMap.get(path);
+ }
+ return modelHandler;
+ }
+
+ public static void put(URI diagramPath, ModelHandler mh) {
+ diagramMap.put(diagramPath, mh);
+ }
+
+ public static void remove(URI path) {
+ if (map.remove(path)==null) {
+ diagramMap.remove(path);
+ }
+ }
+
+ public static ModelHandler createModelHandler(URI path, final Bpmn2ResourceImpl resource) {
+ if (map.containsKey(path)) {
+ return map.get(path);
+ }
+ return createNewModelHandler(path, resource);
+ }
+
+ private static ModelHandler createNewModelHandler(URI path, final Bpmn2ResourceImpl resource) {
+ ModelHandler handler = new ModelHandler();
+ map.put(path, handler);
+ handler.resource = resource;
+
+ URI uri = resource.getURI();
+
+ try {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ String platformString = uri.toPlatformString(true);
+
+ // platformString is null if file is outside of workspace
+ if ((platformString == null || workspace.getRoot().getFile(new Path(platformString)).exists())
+ && !resource.isLoaded()) {
+ handler.loadResource();
+ }
+ } catch (IllegalStateException e) {
+
+ // Workspace is not initialized so we must be running tests!
+ if (!resource.isLoaded()) {
+ handler.loadResource();
+ }
+ }
+
+ handler.createDefinitionsIfMissing();
+ return handler;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ProxyURIConverterImplExtension.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ProxyURIConverterImplExtension.java
index bb4e4b7..774fec2 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ProxyURIConverterImplExtension.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ProxyURIConverterImplExtension.java
@@ -1,79 +1,79 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
-
-public final class ProxyURIConverterImplExtension extends ExtensibleURIConverterImpl {
- private static final String DIR_NAME = "cache/";
-
- /**
- * We provide local copies for some files from the web. Local copy names are requested url without starting
- * "http://" and all '/' are replaced with '_'
- *
- * @see org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl#createInputStream(org.eclipse.emf.common.util.URI)
- */
- @Override
- public InputStream createInputStream(URI uri) throws IOException {
- InputStream stream = getInputStreamForUri(uri);
- if (stream != null) {
- return stream;
- }
-
- InputStream createInputStream = super.createInputStream(uri);
-
- return createInputStream;
- }
-
- /**
- * We provide local copies for some files from the web. Local copy names are requested url without starting
- * "http://" and all '/' are replaced with '_'
- *
- * @see org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl#createInputStream(org.eclipse.emf.common.util.URI,
- * java.util.Map)
- */
- @Override
- public InputStream createInputStream(URI uri, java.util.Map<?, ?> options) throws IOException {
- InputStream stream = getInputStreamForUri(uri);
- if (stream != null) {
- return stream;
- }
-
- InputStream createInputStream = super.createInputStream(uri, options);
-
- return createInputStream;
- }
-
- private InputStream getInputStreamForUri(URI uri) throws IOException {
- if (uri.toString().startsWith("http://")) {
- return checkForLocalCopy(uri);
- }
- return null;
- }
-
- private InputStream checkForLocalCopy(URI uri) throws IOException {
- String fileName = uri.toString().substring(7).replace("/", "_");
- URL entry = Activator.getDefault().getBundle().getEntry(DIR_NAME + fileName);
-
- if (entry != null) {
- return entry.openStream();
- }
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
+
+public final class ProxyURIConverterImplExtension extends ExtensibleURIConverterImpl {
+ private static final String DIR_NAME = "cache/";
+
+ /**
+ * We provide local copies for some files from the web. Local copy names are requested url without starting
+ * "http://" and all '/' are replaced with '_'
+ *
+ * @see org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl#createInputStream(org.eclipse.emf.common.util.URI)
+ */
+ @Override
+ public InputStream createInputStream(URI uri) throws IOException {
+ InputStream stream = getInputStreamForUri(uri);
+ if (stream != null) {
+ return stream;
+ }
+
+ InputStream createInputStream = super.createInputStream(uri);
+
+ return createInputStream;
+ }
+
+ /**
+ * We provide local copies for some files from the web. Local copy names are requested url without starting
+ * "http://" and all '/' are replaced with '_'
+ *
+ * @see org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl#createInputStream(org.eclipse.emf.common.util.URI,
+ * java.util.Map)
+ */
+ @Override
+ public InputStream createInputStream(URI uri, java.util.Map<?, ?> options) throws IOException {
+ InputStream stream = getInputStreamForUri(uri);
+ if (stream != null) {
+ return stream;
+ }
+
+ InputStream createInputStream = super.createInputStream(uri, options);
+
+ return createInputStream;
+ }
+
+ private InputStream getInputStreamForUri(URI uri) throws IOException {
+ if (uri.toString().startsWith("http://")) {
+ return checkForLocalCopy(uri);
+ }
+ return null;
+ }
+
+ private InputStream checkForLocalCopy(URI uri) throws IOException {
+ String fileName = uri.toString().substring(7).replace("/", "_");
+ URL entry = Activator.getDefault().getBundle().getEntry(DIR_NAME + fileName);
+
+ if (entry != null) {
+ return entry.openStream();
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractAdapter.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractAdapter.java
index fbd48c0..1d3a33a 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractAdapter.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractAdapter.java
@@ -1,171 +1,171 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-
-/**
-* Abstract adapter has basic adapter functionality and it has some
-* logic to decide whether adapters are stateful or stateless.
-*
-* @author Michal Chmielewski (michal.chmielewski@oracle.com)
-* @date Sep 15, 2006
-*
-*/
-
-public class AbstractAdapter implements Adapter {
-
- /** The event type that we will consume that indicates a context update */
- static public final int CONTEXT_UPDATE_EVENT_TYPE = 101;
-
- /** Makes sense only when adapters are statefull */
- // Bugzilla 330519
- // need access to this in MarkerDelegateAdapter
- protected Object target = null;
-
- /** additional context that is needed by the adapter to wrap the object */
- private Object context = null;
-
-
- /**
- * Allow the adapter to store new context information. This
- * only works if the adapter is stateful.
- *
- *
- * @param notification the notification to process.
- */
- public void notifyChanged (Notification notification) {
-
- if (notification.getEventType() == CONTEXT_UPDATE_EVENT_TYPE && isStatefull() ) {
- context = notification.getNewValue();
- }
- }
-
-
- /**
- * Return the target. This will always be null in case the
- * adapter is stateless.
- *
- * @return the target
- */
-
- public Notifier getTarget() {
- return getTarget(target,Notifier.class);
- }
-
- /**
- * Set the target element, only if the adapter is stateless.
- *
- * @param newTarget the target to set
- */
-
- public void setTarget(Notifier newTarget) {
- if ( isStatefull() ) {
- target = newTarget;
- }
- }
-
-
- /**
- *
- * @param newTarget
- */
-
- public void setTarget (Object newTarget) {
- if (isStatefull()) {
- target = newTarget;
- }
- }
-
-
- /**
- * Answer true if we are an adapter for the type given
- * @param type the object type to check.
- * @return true if so, false if not
- */
-
- public boolean isAdapterForType (Object type) {
- Class<?> clazz = null;
- // what is type ? (an interface)
- if (type instanceof Class) {
- clazz = (Class) type;
- return clazz.isInstance(this);
- }
- // what else could it be ?
- return false;
- }
-
- /**
- * Return any context object that the adapter is holding.
- * @return the context object
- */
-
- public Object getContext () {
- return context;
- }
-
- /**
- * Answer if we are a stateful adapter or not.
- *
- * @return true if stateful, false if stateless.
- */
-
- public boolean isStatefull () {
- return IStatefullAdapter.class.isInstance(this);
- }
-
-
- /**
- * Some adapters rely on interfaces that are stateless, where the target
- * is passed as an argument to the adapter. This is not necessarily true for
- * some interfaces we cannot control (like IContentProposal).
- *
- * @param <T> The type class
- * @param obj the object which might be the adapted target
- * @param clazz the class that the target must be an instance of.
- * @return the target object
- */
-
- @SuppressWarnings("unchecked")
- public <T extends Object> T getTarget ( Object obj , Class<T> clazz ) {
-
- if (obj != null) {
- if (clazz.isInstance(obj)) {
- return (T) obj;
- }
- if (target != null) {
- if (clazz.isInstance(target)) {
- return (T) target;
- }
- }
- // problem !
- throw new RuntimeException("Object is not of type " + clazz.getName()); //$NON-NLS-1$
- }
-
- /** Target is never set unless the object is statefull. */
-
- if (target != null) {
- if (clazz.isInstance(target)) {
- return (T) target;
- }
- // problem !
- throw new RuntimeException("Target is not of type " + clazz.getName()); //$NON-NLS-1$
- }
-
- return null;
-
-
-
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+/**
+* Abstract adapter has basic adapter functionality and it has some
+* logic to decide whether adapters are stateful or stateless.
+*
+* @author Michal Chmielewski (michal.chmielewski@oracle.com)
+* @date Sep 15, 2006
+*
+*/
+
+public class AbstractAdapter implements Adapter {
+
+ /** The event type that we will consume that indicates a context update */
+ static public final int CONTEXT_UPDATE_EVENT_TYPE = 101;
+
+ /** Makes sense only when adapters are statefull */
+ // Bugzilla 330519
+ // need access to this in MarkerDelegateAdapter
+ protected Object target = null;
+
+ /** additional context that is needed by the adapter to wrap the object */
+ private Object context = null;
+
+
+ /**
+ * Allow the adapter to store new context information. This
+ * only works if the adapter is stateful.
+ *
+ *
+ * @param notification the notification to process.
+ */
+ public void notifyChanged (Notification notification) {
+
+ if (notification.getEventType() == CONTEXT_UPDATE_EVENT_TYPE && isStatefull() ) {
+ context = notification.getNewValue();
+ }
+ }
+
+
+ /**
+ * Return the target. This will always be null in case the
+ * adapter is stateless.
+ *
+ * @return the target
+ */
+
+ public Notifier getTarget() {
+ return getTarget(target,Notifier.class);
+ }
+
+ /**
+ * Set the target element, only if the adapter is stateless.
+ *
+ * @param newTarget the target to set
+ */
+
+ public void setTarget(Notifier newTarget) {
+ if ( isStatefull() ) {
+ target = newTarget;
+ }
+ }
+
+
+ /**
+ *
+ * @param newTarget
+ */
+
+ public void setTarget (Object newTarget) {
+ if (isStatefull()) {
+ target = newTarget;
+ }
+ }
+
+
+ /**
+ * Answer true if we are an adapter for the type given
+ * @param type the object type to check.
+ * @return true if so, false if not
+ */
+
+ public boolean isAdapterForType (Object type) {
+ Class<?> clazz = null;
+ // what is type ? (an interface)
+ if (type instanceof Class) {
+ clazz = (Class) type;
+ return clazz.isInstance(this);
+ }
+ // what else could it be ?
+ return false;
+ }
+
+ /**
+ * Return any context object that the adapter is holding.
+ * @return the context object
+ */
+
+ public Object getContext () {
+ return context;
+ }
+
+ /**
+ * Answer if we are a stateful adapter or not.
+ *
+ * @return true if stateful, false if stateless.
+ */
+
+ public boolean isStatefull () {
+ return IStatefullAdapter.class.isInstance(this);
+ }
+
+
+ /**
+ * Some adapters rely on interfaces that are stateless, where the target
+ * is passed as an argument to the adapter. This is not necessarily true for
+ * some interfaces we cannot control (like IContentProposal).
+ *
+ * @param <T> The type class
+ * @param obj the object which might be the adapted target
+ * @param clazz the class that the target must be an instance of.
+ * @return the target object
+ */
+
+ @SuppressWarnings("unchecked")
+ public <T extends Object> T getTarget ( Object obj , Class<T> clazz ) {
+
+ if (obj != null) {
+ if (clazz.isInstance(obj)) {
+ return (T) obj;
+ }
+ if (target != null) {
+ if (clazz.isInstance(target)) {
+ return (T) target;
+ }
+ }
+ // problem !
+ throw new RuntimeException("Object is not of type " + clazz.getName()); //$NON-NLS-1$
+ }
+
+ /** Target is never set unless the object is statefull. */
+
+ if (target != null) {
+ if (clazz.isInstance(target)) {
+ return (T) target;
+ }
+ // problem !
+ throw new RuntimeException("Target is not of type " + clazz.getName()); //$NON-NLS-1$
+ }
+
+ return null;
+
+
+
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractStatefulAdapter.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractStatefulAdapter.java
index 0d75b79..5a91f55 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractStatefulAdapter.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AbstractStatefulAdapter.java
@@ -1,30 +1,30 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Sep 18, 2006
- *
- */
-public class AbstractStatefulAdapter extends AbstractAdapter implements
- IStatefullAdapter {
-
- /**
- * @see org.eclipse.bpel.model.adapters.IStatefullAdapter#setTarget(java.lang.Object)
- */
-
- @Override
- public void setTarget (Object newTarget) {
- super.setTarget(newTarget);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Sep 18, 2006
+ *
+ */
+public class AbstractStatefulAdapter extends AbstractAdapter implements
+ IStatefullAdapter {
+
+ /**
+ * @see org.eclipse.bpel.model.adapters.IStatefullAdapter#setTarget(java.lang.Object)
+ */
+
+ @Override
+ public void setTarget (Object newTarget) {
+ super.setTarget(newTarget);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterProvider.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterProvider.java
index c0d136d..d5d8697 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterProvider.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterProvider.java
@@ -1,169 +1,169 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-import java.util.HashMap;
-
-import org.eclipse.emf.common.notify.Adapter;
-
-/**
- * The primary motivation for this class is to delegate the decision
- * of whether an adapter is stateless or statefull.
- *
- * In the case of a stateless adapter, the singleton instance is
- * always returned.
- *
- * The factory classes simply call
- * <pre>
- * adapter.getAdatper ( Class )
- * </pre>
- *
- * An adapter is considered stateful if it implements IStatefullAdapter
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Jul 21, 2006
- *
- */
-
-public final class AdapterProvider {
-
- /**
- * The list of adapter singletons that we have created.
- */
- final HashMap<Class<? extends Adapter>,Adapter> map = new HashMap<Class<? extends Adapter>,Adapter>();
-
- /**
- * The package list that we search for adapters.
- */
- String [] packageList = {};
-
- /**
- * Return a brand new shiny adapter provider.
- *
- */
- public AdapterProvider () {
-
- }
-
- /**
- * Return a brand new shiny adapter provider which searches for
- * adapters in the packages specified.
- * @param args
- */
-
- public AdapterProvider (String ... args) {
- packageList = args;
- }
-
- /**
- * Return an adapter for the given class
- *
- * @param name the name of the adapter (class name)
- * @return the Adapter, or null, if the adapter cannot be found.
- */
-
-
- @SuppressWarnings("nls")
- public Adapter getAdapter ( String name ) {
-
- int absNameIdx = name.indexOf('.');
- if (absNameIdx > 0) {
- // absolute specification
- return getAdapter ( classFor(name) );
- }
-
- for(String packageName : packageList) {
- Class<? extends Adapter> adapterClazz = classFor( packageName + "." + name );
- if (adapterClazz != null) {
- return getAdapter(adapterClazz);
- }
- }
-
- return null;
- }
-
-
-
- /**
- * Get an adapter of the class passed.
- *
- *
- * @param adapterClass
- * @return the appropriate adapter
- */
-
- public Adapter getAdapter ( Class<? extends Adapter> adapterClass ) {
-
- Adapter instance = map.get(adapterClass);
- if (instance == null) {
- instance = newAdapter( adapterClass );
- map.put(adapterClass,instance);
- }
-
- if (instance instanceof IStatefullAdapter) {
- return newAdapter(adapterClass);
- }
-
- return instance;
- }
-
-
- /**
- * Get an adapter of the class passed.
- *
- *
- * @param adapterClass
- * @param target the target object
- * @return the appropriate adapter
- */
-
- public Adapter getAdapter ( Class<? extends Adapter> adapterClass , Object target ) {
-
- Adapter adapter = getAdapter(adapterClass);
-
- if (adapter == null) {
- return null;
- }
-
- if (adapter instanceof IStatefullAdapter) {
- IStatefullAdapter statefullAdapter = (IStatefullAdapter) adapter;
- statefullAdapter.setTarget(target);
- }
-
- return adapter;
- }
-
-
- @SuppressWarnings("unchecked")
- Class<? extends Adapter> classFor ( String name ) {
- Class<?> clazz = null;
- try {
- clazz = Class.forName(name);
- return (Class<? extends Adapter>) clazz;
- } catch (ClassNotFoundException e) {
- return null;
- } catch (ClassCastException cce) {
- return null;
- }
- }
-
-
- Adapter newAdapter ( Class<? extends Adapter> clazz ) {
- try {
- return clazz.newInstance();
- } catch (Exception ex) {
- throw new RuntimeException( ex );
- }
- }
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+import java.util.HashMap;
+
+import org.eclipse.emf.common.notify.Adapter;
+
+/**
+ * The primary motivation for this class is to delegate the decision
+ * of whether an adapter is stateless or statefull.
+ *
+ * In the case of a stateless adapter, the singleton instance is
+ * always returned.
+ *
+ * The factory classes simply call
+ * <pre>
+ * adapter.getAdatper ( Class )
+ * </pre>
+ *
+ * An adapter is considered stateful if it implements IStatefullAdapter
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Jul 21, 2006
+ *
+ */
+
+public final class AdapterProvider {
+
+ /**
+ * The list of adapter singletons that we have created.
+ */
+ final HashMap<Class<? extends Adapter>,Adapter> map = new HashMap<Class<? extends Adapter>,Adapter>();
+
+ /**
+ * The package list that we search for adapters.
+ */
+ String [] packageList = {};
+
+ /**
+ * Return a brand new shiny adapter provider.
+ *
+ */
+ public AdapterProvider () {
+
+ }
+
+ /**
+ * Return a brand new shiny adapter provider which searches for
+ * adapters in the packages specified.
+ * @param args
+ */
+
+ public AdapterProvider (String ... args) {
+ packageList = args;
+ }
+
+ /**
+ * Return an adapter for the given class
+ *
+ * @param name the name of the adapter (class name)
+ * @return the Adapter, or null, if the adapter cannot be found.
+ */
+
+
+ @SuppressWarnings("nls")
+ public Adapter getAdapter ( String name ) {
+
+ int absNameIdx = name.indexOf('.');
+ if (absNameIdx > 0) {
+ // absolute specification
+ return getAdapter ( classFor(name) );
+ }
+
+ for(String packageName : packageList) {
+ Class<? extends Adapter> adapterClazz = classFor( packageName + "." + name );
+ if (adapterClazz != null) {
+ return getAdapter(adapterClazz);
+ }
+ }
+
+ return null;
+ }
+
+
+
+ /**
+ * Get an adapter of the class passed.
+ *
+ *
+ * @param adapterClass
+ * @return the appropriate adapter
+ */
+
+ public Adapter getAdapter ( Class<? extends Adapter> adapterClass ) {
+
+ Adapter instance = map.get(adapterClass);
+ if (instance == null) {
+ instance = newAdapter( adapterClass );
+ map.put(adapterClass,instance);
+ }
+
+ if (instance instanceof IStatefullAdapter) {
+ return newAdapter(adapterClass);
+ }
+
+ return instance;
+ }
+
+
+ /**
+ * Get an adapter of the class passed.
+ *
+ *
+ * @param adapterClass
+ * @param target the target object
+ * @return the appropriate adapter
+ */
+
+ public Adapter getAdapter ( Class<? extends Adapter> adapterClass , Object target ) {
+
+ Adapter adapter = getAdapter(adapterClass);
+
+ if (adapter == null) {
+ return null;
+ }
+
+ if (adapter instanceof IStatefullAdapter) {
+ IStatefullAdapter statefullAdapter = (IStatefullAdapter) adapter;
+ statefullAdapter.setTarget(target);
+ }
+
+ return adapter;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ Class<? extends Adapter> classFor ( String name ) {
+ Class<?> clazz = null;
+ try {
+ clazz = Class.forName(name);
+ return (Class<? extends Adapter>) clazz;
+ } catch (ClassNotFoundException e) {
+ return null;
+ } catch (ClassCastException cce) {
+ return null;
+ }
+ }
+
+
+ Adapter newAdapter ( Class<? extends Adapter> clazz ) {
+ try {
+ return clazz.newInstance();
+ } catch (Exception ex) {
+ throw new RuntimeException( ex );
+ }
+ }
+
+
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterRegistry.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterRegistry.java
index 92a994f..4b85759 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterRegistry.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterRegistry.java
@@ -1,369 +1,369 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl;
-import org.eclipse.bpmn2.di.provider.BpmnDiItemProviderAdapterFactory;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.dd.dc.impl.DcPackageImpl;
-import org.eclipse.dd.dc.provider.DcItemProviderAdapterFactory;
-import org.eclipse.dd.di.impl.DiPackageImpl;
-import org.eclipse.dd.di.provider.DiItemProviderAdapterFactory;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-
-/**
- * This is the one place where EMF object adapters can be registered.
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Jul 23, 2007
- *
- */
-
-public class AdapterRegistry {
-
- public static ComposedAdapterFactory BPMN2_ADAPTER_FACTORIES = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);;
- static AdapterFactoryLabelProvider LABEL_PROVIDER;
-
- /**
- * The singleton instance of this registry.
- */
-
- static final public AdapterRegistry INSTANCE = new AdapterRegistry();
-
- static {
- BPMN2_ADAPTER_FACTORIES.addAdapterFactory(new ResourceItemProviderAdapterFactory());
-// BPMN2_ADAPTER_FACTORIES.addAdapterFactory(
-// INSTANCE.registerFactory(BpmnDiPackageImpl.eINSTANCE, new BpmnDiItemProviderAdapterFactory()));
- BPMN2_ADAPTER_FACTORIES.addAdapterFactory(
- INSTANCE.registerFactory(DcPackageImpl.eINSTANCE, new DcItemProviderAdapterFactory()));
- BPMN2_ADAPTER_FACTORIES.addAdapterFactory(
- INSTANCE.registerFactory(DiPackageImpl.eINSTANCE, new DiItemProviderAdapterFactory()));
-
- BPMN2_ADAPTER_FACTORIES.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
- }
-
- /** For every type of EClass or EPackage, register an Adapter Factory
- * This means that a particular EClass or EPackage may have N
- *
- * Adapter Factories.
- */
-
- HashMap<Object,List<AdapterFactory>> fKeyToAdapterFactory ;
-
- /** The current adapter manager */
- IAdapterManager fAdapterManager;
-
- /**
- * Private constructor.
- */
-
- AdapterRegistry () {
- fKeyToAdapterFactory = new HashMap<Object,List<AdapterFactory>>();
-
- if (Platform.isRunning()) {
- fAdapterManager = Platform.getAdapterManager();
- } else {
- fAdapterManager = org.eclipse.core.internal.runtime.AdapterManager.getDefault();
- }
- }
-
- /**
- * Register adapter factory for the given EClass.
- *
- * @param key
- * @param factory
- */
-
- public void registerAdapterFactory (EClass key, AdapterFactory factory) {
- registerFactory (key,factory);
- }
-
- /**
- * Register adapter factory for the given EPackage.
- *
- * @param key
- * @param factory
- */
-
- public void registerAdapterFactory (EPackage key, AdapterFactory factory) {
- registerFactory (key,factory);
- }
-
-
-
- /**
- * Unregister adapter factory for the given object (EClass)
- * @param key
- * @param factory
- */
-
- public void unregisterAdapterFactory (EClass key, AdapterFactory factory) {
- unregisterFactory (key,factory);
- }
-
- /**
- * Unregister adapter factory for the given object (EPackage)
- * @param key
- * @param factory
- */
-
- public void unregisterAdapterFactory (EPackage key, AdapterFactory factory) {
- unregisterFactory (key,factory);
- }
-
-
- /**
- * Register the factory (internal method, synchronized).
- * @param key
- * @param factory
- */
- public synchronized AdapterFactory registerFactory ( Object key, AdapterFactory factory) {
- List<AdapterFactory> list = fKeyToAdapterFactory.get(key);
-
- if (list == null) {
- list = new ArrayList<AdapterFactory>( );
- fKeyToAdapterFactory.put( key, list );
- list.add (factory);
- } else {
- if (list.contains(factory) == false) {
- list.add (factory);
- }
- }
-
- return factory;
- }
-
- synchronized void unregisterFactory (Object key, AdapterFactory factory) {
- List<AdapterFactory> list = fKeyToAdapterFactory.get(key);
-
- if (list == null) {
- return ;
- }
- list.remove(factory);
- }
-
-
- Class<?> adapterInterface ( Object type ) {
-
- if (type instanceof Class) {
- return (Class<?>) type;
- }
-
- if (type instanceof String) {
- try {
- return Class.forName((String)type);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
-
- throw new RuntimeException("Adapter type " + type + " is not understood."); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @param <T>
- * @param target
- * @param clazz
- * @return the adapted interface or object
- */
-
-
- public <T extends Object> T adapt ( Object target, Class<T> clazz) {
- return adapt (target,clazz,true);
- }
-
-
- /**
- *
- * @param <T>
- * @param target
- * @param clazz
- * @param checkWSAdapters Check the Workspace adapters as well.
- *
- * @return the adapted interface or object
- */
-
- public <T extends Object> T adapt ( Object target, Class<T> clazz, boolean checkWSAdapters ) {
-
- if (target == null) {
- return null;
- }
-
- if (clazz.isInstance(target)) {
- return clazz.cast(target);
- }
-
- Object adapter = null;
-
- if (target instanceof EObject) {
-
- EObject eObj = (EObject) target;
- EClass effectiveClass = eObj instanceof EClass ? (EClass)eObj : eObj.eClass();
- for (Adapter a : eObj.eAdapters()) {
- if (a != null && clazz.isInstance(a)) {
- return clazz.cast(a);
- }
- }
-
- List<AdapterFactory> list = fKeyToAdapterFactory.get( effectiveClass );
- if (list != null) {
- for(AdapterFactory factory : list) {
- adapter = factory.adapt(target, clazz);
- if (adapter != null && clazz.isInstance(adapter)) {
- return clazz.cast(adapter);
- }
- }
-
- // adaptNew() maybe?
- for(AdapterFactory factory : list ) {
- adapter = factory.adaptNew((Notifier)target, clazz);
- if (adapter != null && clazz.isInstance(adapter)) {
- return clazz.cast(adapter);
- }
- }
- }
-
- if (effectiveClass!=null) {
- list = fKeyToAdapterFactory.get( effectiveClass.getEPackage() );
- if (list != null) {
- for(AdapterFactory factory : list ) {
- adapter = factory.adapt(target, clazz);
- if (adapter != null && clazz.isInstance(adapter)) {
- return clazz.cast(adapter);
- }
- }
-
- // adaptNew() maybe?
- for(AdapterFactory factory : list ) {
- if (factory instanceof ComposedAdapterFactory) {
- ComposedAdapterFactory cf = (ComposedAdapterFactory)factory;
- cf.adaptAllNew((Notifier) target);
- }
-
- adapter = factory.adaptNew((Notifier)target, clazz);
- if (adapter != null && clazz.isInstance(adapter)) {
- return clazz.cast(adapter);
- }
- }
- }
-
- // last chance: check instance class of an EClass
- list = fKeyToAdapterFactory.get( effectiveClass.getInstanceClass() );
- if (list != null) {
- for(AdapterFactory factory : list ) {
- adapter = factory.adaptNew((Notifier)target, clazz);
- if (adapter != null && clazz.isInstance(adapter)) {
- return clazz.cast(adapter);
- }
- }
- }
- }
- }
-
- if ( checkWSAdapters && fAdapterManager != null ) {
- // otherwise, the object we are adapting is not an EObject, try any other adapters.
- adapter = fAdapterManager.getAdapter(target, clazz);
- if (adapter != null && clazz.isInstance(adapter)) {
- return clazz.cast(adapter);
- }
- }
-
- return null;
- }
-
-
-
- /**
- * This method tries the registered adapter factories one by one, returning
- * the first non-null result it gets. If none of the factories can adapt
- * the result, it returns null.
- * @param target target object
- * @param type type of the adapter to find
- * @return the adapter for the target.
- */
-
- public Object adapt (Object target, Object type) {
-
- if (target == null) {
- return null;
- }
- return adapt ( target, adapterInterface(type) );
- }
-
-
- /**
- * Create an adapter for the given target of the given type.
- * In addition, pass a context object to the adapter(s) of the target.
- *
- * The idea is that some adapters can be stateful and depend not only
- * on the objects that they wrap, but also on some other context that is needed
- * to completely and correctly implement the interface for which the adaptor is
- * needed.
- *
- * Adapters that are stateless, should ignore any notifications sent to them.
- *
- * @param target the target object
- * @param type the type it wants to adapt to
- * @param context the context object
- *
- * @return the adapter
- */
- public Object adapt (Object target, Object type, Object context) {
-
- Object adapter = adapt (target,type);
- if (adapter == null) {
- return adapter;
- }
-
- if (target instanceof EObject) {
- EObject eObject = (EObject) target;
- Notification n = new NotificationImpl(AbstractAdapter.CONTEXT_UPDATE_EVENT_TYPE, null, context);
- eObject.eNotify(n);
- }
-
- return adapter;
- }
-
- public void registerAdapterFactory (IAdapterFactory factory) {
- registerAdapterFactory(factory, Object.class);
- }
-
- /**
- * @param factory
- * @param class1
- */
- public void registerAdapterFactory(IAdapterFactory factory, Class<?> clazz) {
- fAdapterManager.registerAdapters(factory, clazz);
- }
-
- public static AdapterFactoryLabelProvider getLabelProvider() {
- if (LABEL_PROVIDER==null)
- LABEL_PROVIDER = new AdapterFactoryLabelProvider(BPMN2_ADAPTER_FACTORIES);
- return LABEL_PROVIDER;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl;
+import org.eclipse.bpmn2.di.provider.BpmnDiItemProviderAdapterFactory;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.dd.dc.impl.DcPackageImpl;
+import org.eclipse.dd.dc.provider.DcItemProviderAdapterFactory;
+import org.eclipse.dd.di.impl.DiPackageImpl;
+import org.eclipse.dd.di.provider.DiItemProviderAdapterFactory;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.NotificationImpl;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+
+/**
+ * This is the one place where EMF object adapters can be registered.
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Jul 23, 2007
+ *
+ */
+
+public class AdapterRegistry {
+
+ public static ComposedAdapterFactory BPMN2_ADAPTER_FACTORIES = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);;
+ static AdapterFactoryLabelProvider LABEL_PROVIDER;
+
+ /**
+ * The singleton instance of this registry.
+ */
+
+ static final public AdapterRegistry INSTANCE = new AdapterRegistry();
+
+ static {
+ BPMN2_ADAPTER_FACTORIES.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+// BPMN2_ADAPTER_FACTORIES.addAdapterFactory(
+// INSTANCE.registerFactory(BpmnDiPackageImpl.eINSTANCE, new BpmnDiItemProviderAdapterFactory()));
+ BPMN2_ADAPTER_FACTORIES.addAdapterFactory(
+ INSTANCE.registerFactory(DcPackageImpl.eINSTANCE, new DcItemProviderAdapterFactory()));
+ BPMN2_ADAPTER_FACTORIES.addAdapterFactory(
+ INSTANCE.registerFactory(DiPackageImpl.eINSTANCE, new DiItemProviderAdapterFactory()));
+
+ BPMN2_ADAPTER_FACTORIES.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ }
+
+ /** For every type of EClass or EPackage, register an Adapter Factory
+ * This means that a particular EClass or EPackage may have N
+ *
+ * Adapter Factories.
+ */
+
+ HashMap<Object,List<AdapterFactory>> fKeyToAdapterFactory ;
+
+ /** The current adapter manager */
+ IAdapterManager fAdapterManager;
+
+ /**
+ * Private constructor.
+ */
+
+ AdapterRegistry () {
+ fKeyToAdapterFactory = new HashMap<Object,List<AdapterFactory>>();
+
+ if (Platform.isRunning()) {
+ fAdapterManager = Platform.getAdapterManager();
+ } else {
+ fAdapterManager = org.eclipse.core.internal.runtime.AdapterManager.getDefault();
+ }
+ }
+
+ /**
+ * Register adapter factory for the given EClass.
+ *
+ * @param key
+ * @param factory
+ */
+
+ public void registerAdapterFactory (EClass key, AdapterFactory factory) {
+ registerFactory (key,factory);
+ }
+
+ /**
+ * Register adapter factory for the given EPackage.
+ *
+ * @param key
+ * @param factory
+ */
+
+ public void registerAdapterFactory (EPackage key, AdapterFactory factory) {
+ registerFactory (key,factory);
+ }
+
+
+
+ /**
+ * Unregister adapter factory for the given object (EClass)
+ * @param key
+ * @param factory
+ */
+
+ public void unregisterAdapterFactory (EClass key, AdapterFactory factory) {
+ unregisterFactory (key,factory);
+ }
+
+ /**
+ * Unregister adapter factory for the given object (EPackage)
+ * @param key
+ * @param factory
+ */
+
+ public void unregisterAdapterFactory (EPackage key, AdapterFactory factory) {
+ unregisterFactory (key,factory);
+ }
+
+
+ /**
+ * Register the factory (internal method, synchronized).
+ * @param key
+ * @param factory
+ */
+ public synchronized AdapterFactory registerFactory ( Object key, AdapterFactory factory) {
+ List<AdapterFactory> list = fKeyToAdapterFactory.get(key);
+
+ if (list == null) {
+ list = new ArrayList<AdapterFactory>( );
+ fKeyToAdapterFactory.put( key, list );
+ list.add (factory);
+ } else {
+ if (list.contains(factory) == false) {
+ list.add (factory);
+ }
+ }
+
+ return factory;
+ }
+
+ synchronized void unregisterFactory (Object key, AdapterFactory factory) {
+ List<AdapterFactory> list = fKeyToAdapterFactory.get(key);
+
+ if (list == null) {
+ return ;
+ }
+ list.remove(factory);
+ }
+
+
+ Class<?> adapterInterface ( Object type ) {
+
+ if (type instanceof Class) {
+ return (Class<?>) type;
+ }
+
+ if (type instanceof String) {
+ try {
+ return Class.forName((String)type);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ throw new RuntimeException("Adapter type " + type + " is not understood."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * @param <T>
+ * @param target
+ * @param clazz
+ * @return the adapted interface or object
+ */
+
+
+ public <T extends Object> T adapt ( Object target, Class<T> clazz) {
+ return adapt (target,clazz,true);
+ }
+
+
+ /**
+ *
+ * @param <T>
+ * @param target
+ * @param clazz
+ * @param checkWSAdapters Check the Workspace adapters as well.
+ *
+ * @return the adapted interface or object
+ */
+
+ public <T extends Object> T adapt ( Object target, Class<T> clazz, boolean checkWSAdapters ) {
+
+ if (target == null) {
+ return null;
+ }
+
+ if (clazz.isInstance(target)) {
+ return clazz.cast(target);
+ }
+
+ Object adapter = null;
+
+ if (target instanceof EObject) {
+
+ EObject eObj = (EObject) target;
+ EClass effectiveClass = eObj instanceof EClass ? (EClass)eObj : eObj.eClass();
+ for (Adapter a : eObj.eAdapters()) {
+ if (a != null && clazz.isInstance(a)) {
+ return clazz.cast(a);
+ }
+ }
+
+ List<AdapterFactory> list = fKeyToAdapterFactory.get( effectiveClass );
+ if (list != null) {
+ for(AdapterFactory factory : list) {
+ adapter = factory.adapt(target, clazz);
+ if (adapter != null && clazz.isInstance(adapter)) {
+ return clazz.cast(adapter);
+ }
+ }
+
+ // adaptNew() maybe?
+ for(AdapterFactory factory : list ) {
+ adapter = factory.adaptNew((Notifier)target, clazz);
+ if (adapter != null && clazz.isInstance(adapter)) {
+ return clazz.cast(adapter);
+ }
+ }
+ }
+
+ if (effectiveClass!=null) {
+ list = fKeyToAdapterFactory.get( effectiveClass.getEPackage() );
+ if (list != null) {
+ for(AdapterFactory factory : list ) {
+ adapter = factory.adapt(target, clazz);
+ if (adapter != null && clazz.isInstance(adapter)) {
+ return clazz.cast(adapter);
+ }
+ }
+
+ // adaptNew() maybe?
+ for(AdapterFactory factory : list ) {
+ if (factory instanceof ComposedAdapterFactory) {
+ ComposedAdapterFactory cf = (ComposedAdapterFactory)factory;
+ cf.adaptAllNew((Notifier) target);
+ }
+
+ adapter = factory.adaptNew((Notifier)target, clazz);
+ if (adapter != null && clazz.isInstance(adapter)) {
+ return clazz.cast(adapter);
+ }
+ }
+ }
+
+ // last chance: check instance class of an EClass
+ list = fKeyToAdapterFactory.get( effectiveClass.getInstanceClass() );
+ if (list != null) {
+ for(AdapterFactory factory : list ) {
+ adapter = factory.adaptNew((Notifier)target, clazz);
+ if (adapter != null && clazz.isInstance(adapter)) {
+ return clazz.cast(adapter);
+ }
+ }
+ }
+ }
+ }
+
+ if ( checkWSAdapters && fAdapterManager != null ) {
+ // otherwise, the object we are adapting is not an EObject, try any other adapters.
+ adapter = fAdapterManager.getAdapter(target, clazz);
+ if (adapter != null && clazz.isInstance(adapter)) {
+ return clazz.cast(adapter);
+ }
+ }
+
+ return null;
+ }
+
+
+
+ /**
+ * This method tries the registered adapter factories one by one, returning
+ * the first non-null result it gets. If none of the factories can adapt
+ * the result, it returns null.
+ * @param target target object
+ * @param type type of the adapter to find
+ * @return the adapter for the target.
+ */
+
+ public Object adapt (Object target, Object type) {
+
+ if (target == null) {
+ return null;
+ }
+ return adapt ( target, adapterInterface(type) );
+ }
+
+
+ /**
+ * Create an adapter for the given target of the given type.
+ * In addition, pass a context object to the adapter(s) of the target.
+ *
+ * The idea is that some adapters can be stateful and depend not only
+ * on the objects that they wrap, but also on some other context that is needed
+ * to completely and correctly implement the interface for which the adaptor is
+ * needed.
+ *
+ * Adapters that are stateless, should ignore any notifications sent to them.
+ *
+ * @param target the target object
+ * @param type the type it wants to adapt to
+ * @param context the context object
+ *
+ * @return the adapter
+ */
+ public Object adapt (Object target, Object type, Object context) {
+
+ Object adapter = adapt (target,type);
+ if (adapter == null) {
+ return adapter;
+ }
+
+ if (target instanceof EObject) {
+ EObject eObject = (EObject) target;
+ Notification n = new NotificationImpl(AbstractAdapter.CONTEXT_UPDATE_EVENT_TYPE, null, context);
+ eObject.eNotify(n);
+ }
+
+ return adapter;
+ }
+
+ public void registerAdapterFactory (IAdapterFactory factory) {
+ registerAdapterFactory(factory, Object.class);
+ }
+
+ /**
+ * @param factory
+ * @param class1
+ */
+ public void registerAdapterFactory(IAdapterFactory factory, Class<?> clazz) {
+ fAdapterManager.registerAdapters(factory, clazz);
+ }
+
+ public static AdapterFactoryLabelProvider getLabelProvider() {
+ if (LABEL_PROVIDER==null)
+ LABEL_PROVIDER = new AdapterFactoryLabelProvider(BPMN2_ADAPTER_FACTORIES);
+ return LABEL_PROVIDER;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterUtil.java
index a97bb20..6b2e6b0 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/AdapterUtil.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-
-/**
- * @author Bob Brodt
- *
- */
-public class AdapterUtil {
-
- /**
- * @param <T>
- * @param target
- * @param clazz
- * @return the adapted interface or object
- */
- @SuppressWarnings("unchecked")
- public static <T extends Object> T adapt ( Object target, Class<T> clazz) {
- return AdapterRegistry.INSTANCE.adapt(target, clazz);
- }
-
- /**
- * This method tries the registered adapter factories one by one, returning
- * the first non-null result it gets. If none of the factories can adapt
- * the result, it returns null.
- * @param target target object
- * @param type type of the adapter to find
- * @return the adapter for the target.
- */
-
- public static Object adapt (Object target, Object type) {
- return AdapterRegistry.INSTANCE.adapt(target, type);
- }
-
- /**
- * Create an adapter for the given target of the given type.
- * In addition, pass a context object to the adapter(s) of the target.
- *
- * The idea is that some adapters can be stateful and depend not only
- * on the objects that they wrap, button also on some other context that is needed
- * to completely and correctly implement the interface for which the adaptor is
- * needed.
- *
- * Adapters that are stateless, should ignore any notifications sent to them.
- *
- * @param target the target object
- * @param type the type it wants to adapt to
- * @param context the context object
- *
- * @return the adapter
- */
- public static Object adapt (Object target, Object type, Object context) {
- return AdapterRegistry.INSTANCE.adapt(target, type,context);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class AdapterUtil {
+
+ /**
+ * @param <T>
+ * @param target
+ * @param clazz
+ * @return the adapted interface or object
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends Object> T adapt ( Object target, Class<T> clazz) {
+ return AdapterRegistry.INSTANCE.adapt(target, clazz);
+ }
+
+ /**
+ * This method tries the registered adapter factories one by one, returning
+ * the first non-null result it gets. If none of the factories can adapt
+ * the result, it returns null.
+ * @param target target object
+ * @param type type of the adapter to find
+ * @return the adapter for the target.
+ */
+
+ public static Object adapt (Object target, Object type) {
+ return AdapterRegistry.INSTANCE.adapt(target, type);
+ }
+
+ /**
+ * Create an adapter for the given target of the given type.
+ * In addition, pass a context object to the adapter(s) of the target.
+ *
+ * The idea is that some adapters can be stateful and depend not only
+ * on the objects that they wrap, button also on some other context that is needed
+ * to completely and correctly implement the interface for which the adaptor is
+ * needed.
+ *
+ * Adapters that are stateless, should ignore any notifications sent to them.
+ *
+ * @param target the target object
+ * @param type the type it wants to adapt to
+ * @param context the context object
+ *
+ * @return the adapter
+ */
+ public static Object adapt (Object target, Object type, Object context) {
+ return AdapterRegistry.INSTANCE.adapt(target, type,context);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/BasicEObjectAdapter.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/BasicEObjectAdapter.java
index c86774c..ab430b2 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/BasicEObjectAdapter.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/BasicEObjectAdapter.java
@@ -1,258 +1,258 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Jul 23, 2007
- *
- */
-public class BasicEObjectAdapter extends AbstractStatefulAdapter
-
-implements IProperty<String, Object>, INamespaceMap<String, String> {
-
- /**
- * For generic properties associated with an EObject; this are transient and
- * not saved
- */
- Map<String, Object> fProperties = null;
-
- /** Forward, prefix to namespace map. */
- Map<String, String> fPrefix2Namespace = null;
-
- /** Reverse, Namespace to list of prefixes */
- Map<String, List<String>> fNamespace2Prefix = null;
-
- /**
- * @param key
- * the key
- * @return the value
- * @see org.eclipse.bpel.model.adapters.IProperty#getProperty(java.lang.Object)
- */
-
- public Object getProperty(String key) {
- return fProperties == null ? null : fProperties.get(key);
- }
-
- /**
- * Set the value under the key key. Previous value is returned.
- *
- * @param key
- * the key
- * @param value
- * the new value
- * @return the previous value, if set.
- * @see org.eclipse.bpel.model.adapters.IProperty#setProperty(java.lang.Object,
- * java.lang.Object)
- */
-
- public Object setProperty(String key, Object value) {
- if (fProperties == null) {
- fProperties = new HashMap<String, Object>(5);
- }
- return fProperties.put(key, value);
- }
-
- /**
- *
- * @param key
- * the namespace to get the reverse mapping for
- * @return The reverse mapping of the Namespace to namespace prefixes.
- * @see org.eclipse.bpel.model.adapters.INamespaceMap#getReverse(java.lang.Object)
- */
-
- public List<String> getReverse(String key) {
- return getReverse4(key);
- }
-
- /**
- * @see java.util.Map#clear()
- */
- public void clear() {
- if (fNamespace2Prefix != null) {
- fNamespace2Prefix.clear();
- }
- if (fPrefix2Namespace != null) {
- fPrefix2Namespace.clear();
- }
- }
-
- /**
- * @see java.util.Map#containsKey(java.lang.Object)
- */
- public boolean containsKey(Object key) {
- return fPrefix2Namespace != null ? fPrefix2Namespace.containsKey(key)
- : false;
- }
-
- /**
- * @see java.util.Map#containsValue(java.lang.Object)
- */
- public boolean containsValue(Object value) {
- return fPrefix2Namespace != null ? fPrefix2Namespace
- .containsValue(value) : false;
- }
-
- /**
- * @see java.util.Map#entrySet()
- */
- public Set<java.util.Map.Entry<String, String>> entrySet() {
- if (fPrefix2Namespace == null) {
- return Collections.emptySet();
- }
- return fPrefix2Namespace.entrySet();
- }
-
- /**
- * @see java.util.Map#get(java.lang.Object)
- */
- public String get(Object key) {
- return fPrefix2Namespace != null ? fPrefix2Namespace.get(key) : null;
- }
-
- /**
- * @see java.util.Map#isEmpty()
- */
- public boolean isEmpty() {
- return fPrefix2Namespace != null ? fPrefix2Namespace.isEmpty() : true;
- }
-
- /**
- * @see java.util.Map#keySet()
- */
- public Set<String> keySet() {
- if (fPrefix2Namespace == null) {
- return Collections.emptySet();
- }
- return fPrefix2Namespace.keySet();
- }
-
- /**
- * @param key
- * the key to set
- * @param value
- * the value to set.
- * @return the old value, if set
- * @see java.util.Map#put(java.lang.Object, java.lang.Object)
- */
- public String put(String key, String value) {
- fPrefix2Namespace = getPrefix2NamespaceMap();
- String oldValue = fPrefix2Namespace.put(key, value);
-
- // when we put something, the reverse value may not yet exist.
- List<String> ns2pfx = getReverse4(value);
- if (ns2pfx.contains(key) == false) {
- ns2pfx.add(key);
- }
- //
- if (getTarget() instanceof WSDLElement) {
- Element element = ((WSDLElement) getTarget()).getElement();
- // Element could be null (for instance, on load)
- if (element != null) {
- String attr = key.equals("") ? "xmlns" : "xmlns:" + key;
- // We only need to update attribute if something really has been changed
- // because it causes hard reconcile process
- if ((oldValue == null && value != null) || (oldValue != null && !oldValue.equals(value))) {
- String attribute = element.getAttribute(attr);
- if ((attribute == null && value != null) || (attribute != null && !attribute.equals(value))) {
- element.setAttribute(attr, value);
- }
- }
- }
- }
- return oldValue;
- }
-
- /**
- * @see java.util.Map#putAll(java.util.Map)
- */
- public void putAll(Map<? extends String, ? extends String> t) {
- fPrefix2Namespace.putAll(t);
- }
-
- /**
- * @see java.util.Map#remove(java.lang.Object)
- */
- public String remove(Object key) {
- if (fPrefix2Namespace == null) {
- return null;
- }
-
- String value = fPrefix2Namespace.remove(key);
-
- // the key did not exist.
- if (value == null) {
- return value;
- }
- // the key did exist, remove it from the reverse mapping as well.
- // the reverse mapping must exist in this case.
- fNamespace2Prefix.get(value).remove(key);
-
- if (getTarget() instanceof WSDLElement) {
- Element element = ((WSDLElement) getTarget()).getElement();
- // Element could be null (for instance, on load)
- if (element != null) {
- element.removeAttributeNS(XSDConstants.XMLNS_URI_2000, key.toString());
- }
- }
-
- return value;
- }
-
- /**
- * @see java.util.Map#size()
- */
- public int size() {
- return fPrefix2Namespace != null ? fPrefix2Namespace.size() : 0;
- }
-
- /**
- * @see java.util.Map#values()
- */
- public Collection<String> values() {
- if (fPrefix2Namespace == null) {
- return Collections.emptyList();
- }
- return fPrefix2Namespace.values();
- }
-
- Map<String, String> getPrefix2NamespaceMap() {
- if (fPrefix2Namespace == null) {
- fPrefix2Namespace = new HashMap<String, String>(5);
- }
- return fPrefix2Namespace;
- }
-
- List<String> getReverse4(String key) {
- if (fNamespace2Prefix == null) {
- fNamespace2Prefix = new HashMap<String, List<String>>(5);
- }
- List<String> prefixes = fNamespace2Prefix.get(key);
- if (prefixes == null) {
- prefixes = new ArrayList<String>();
- fNamespace2Prefix.put(key, prefixes);
- }
- return prefixes;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.wst.wsdl.WSDLElement;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Jul 23, 2007
+ *
+ */
+public class BasicEObjectAdapter extends AbstractStatefulAdapter
+
+implements IProperty<String, Object>, INamespaceMap<String, String> {
+
+ /**
+ * For generic properties associated with an EObject; this are transient and
+ * not saved
+ */
+ Map<String, Object> fProperties = null;
+
+ /** Forward, prefix to namespace map. */
+ Map<String, String> fPrefix2Namespace = null;
+
+ /** Reverse, Namespace to list of prefixes */
+ Map<String, List<String>> fNamespace2Prefix = null;
+
+ /**
+ * @param key
+ * the key
+ * @return the value
+ * @see org.eclipse.bpel.model.adapters.IProperty#getProperty(java.lang.Object)
+ */
+
+ public Object getProperty(String key) {
+ return fProperties == null ? null : fProperties.get(key);
+ }
+
+ /**
+ * Set the value under the key key. Previous value is returned.
+ *
+ * @param key
+ * the key
+ * @param value
+ * the new value
+ * @return the previous value, if set.
+ * @see org.eclipse.bpel.model.adapters.IProperty#setProperty(java.lang.Object,
+ * java.lang.Object)
+ */
+
+ public Object setProperty(String key, Object value) {
+ if (fProperties == null) {
+ fProperties = new HashMap<String, Object>(5);
+ }
+ return fProperties.put(key, value);
+ }
+
+ /**
+ *
+ * @param key
+ * the namespace to get the reverse mapping for
+ * @return The reverse mapping of the Namespace to namespace prefixes.
+ * @see org.eclipse.bpel.model.adapters.INamespaceMap#getReverse(java.lang.Object)
+ */
+
+ public List<String> getReverse(String key) {
+ return getReverse4(key);
+ }
+
+ /**
+ * @see java.util.Map#clear()
+ */
+ public void clear() {
+ if (fNamespace2Prefix != null) {
+ fNamespace2Prefix.clear();
+ }
+ if (fPrefix2Namespace != null) {
+ fPrefix2Namespace.clear();
+ }
+ }
+
+ /**
+ * @see java.util.Map#containsKey(java.lang.Object)
+ */
+ public boolean containsKey(Object key) {
+ return fPrefix2Namespace != null ? fPrefix2Namespace.containsKey(key)
+ : false;
+ }
+
+ /**
+ * @see java.util.Map#containsValue(java.lang.Object)
+ */
+ public boolean containsValue(Object value) {
+ return fPrefix2Namespace != null ? fPrefix2Namespace
+ .containsValue(value) : false;
+ }
+
+ /**
+ * @see java.util.Map#entrySet()
+ */
+ public Set<java.util.Map.Entry<String, String>> entrySet() {
+ if (fPrefix2Namespace == null) {
+ return Collections.emptySet();
+ }
+ return fPrefix2Namespace.entrySet();
+ }
+
+ /**
+ * @see java.util.Map#get(java.lang.Object)
+ */
+ public String get(Object key) {
+ return fPrefix2Namespace != null ? fPrefix2Namespace.get(key) : null;
+ }
+
+ /**
+ * @see java.util.Map#isEmpty()
+ */
+ public boolean isEmpty() {
+ return fPrefix2Namespace != null ? fPrefix2Namespace.isEmpty() : true;
+ }
+
+ /**
+ * @see java.util.Map#keySet()
+ */
+ public Set<String> keySet() {
+ if (fPrefix2Namespace == null) {
+ return Collections.emptySet();
+ }
+ return fPrefix2Namespace.keySet();
+ }
+
+ /**
+ * @param key
+ * the key to set
+ * @param value
+ * the value to set.
+ * @return the old value, if set
+ * @see java.util.Map#put(java.lang.Object, java.lang.Object)
+ */
+ public String put(String key, String value) {
+ fPrefix2Namespace = getPrefix2NamespaceMap();
+ String oldValue = fPrefix2Namespace.put(key, value);
+
+ // when we put something, the reverse value may not yet exist.
+ List<String> ns2pfx = getReverse4(value);
+ if (ns2pfx.contains(key) == false) {
+ ns2pfx.add(key);
+ }
+ //
+ if (getTarget() instanceof WSDLElement) {
+ Element element = ((WSDLElement) getTarget()).getElement();
+ // Element could be null (for instance, on load)
+ if (element != null) {
+ String attr = key.equals("") ? "xmlns" : "xmlns:" + key;
+ // We only need to update attribute if something really has been changed
+ // because it causes hard reconcile process
+ if ((oldValue == null && value != null) || (oldValue != null && !oldValue.equals(value))) {
+ String attribute = element.getAttribute(attr);
+ if ((attribute == null && value != null) || (attribute != null && !attribute.equals(value))) {
+ element.setAttribute(attr, value);
+ }
+ }
+ }
+ }
+ return oldValue;
+ }
+
+ /**
+ * @see java.util.Map#putAll(java.util.Map)
+ */
+ public void putAll(Map<? extends String, ? extends String> t) {
+ fPrefix2Namespace.putAll(t);
+ }
+
+ /**
+ * @see java.util.Map#remove(java.lang.Object)
+ */
+ public String remove(Object key) {
+ if (fPrefix2Namespace == null) {
+ return null;
+ }
+
+ String value = fPrefix2Namespace.remove(key);
+
+ // the key did not exist.
+ if (value == null) {
+ return value;
+ }
+ // the key did exist, remove it from the reverse mapping as well.
+ // the reverse mapping must exist in this case.
+ fNamespace2Prefix.get(value).remove(key);
+
+ if (getTarget() instanceof WSDLElement) {
+ Element element = ((WSDLElement) getTarget()).getElement();
+ // Element could be null (for instance, on load)
+ if (element != null) {
+ element.removeAttributeNS(XSDConstants.XMLNS_URI_2000, key.toString());
+ }
+ }
+
+ return value;
+ }
+
+ /**
+ * @see java.util.Map#size()
+ */
+ public int size() {
+ return fPrefix2Namespace != null ? fPrefix2Namespace.size() : 0;
+ }
+
+ /**
+ * @see java.util.Map#values()
+ */
+ public Collection<String> values() {
+ if (fPrefix2Namespace == null) {
+ return Collections.emptyList();
+ }
+ return fPrefix2Namespace.values();
+ }
+
+ Map<String, String> getPrefix2NamespaceMap() {
+ if (fPrefix2Namespace == null) {
+ fPrefix2Namespace = new HashMap<String, String>(5);
+ }
+ return fPrefix2Namespace;
+ }
+
+ List<String> getReverse4(String key) {
+ if (fNamespace2Prefix == null) {
+ fNamespace2Prefix = new HashMap<String, List<String>>(5);
+ }
+ List<String> prefixes = fNamespace2Prefix.get(key);
+ if (prefixes == null) {
+ prefixes = new ArrayList<String>();
+ fNamespace2Prefix.put(key, prefixes);
+ }
+ return prefixes;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/ExtendedPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/ExtendedPropertiesAdapter.java
index dceaf5d..6eac99f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/ExtendedPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/ExtendedPropertiesAdapter.java
@@ -1,167 +1,167 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-import java.lang.reflect.Field;
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.modeler.core.utils.JavaReflectionUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ExtendedPropertiesAdapter<T extends EObject> extends AdapterImpl {
-
- // common property keys
- public final static String LONG_DESCRIPTION = "long.description";
- public final static String UI_CAN_EDIT = "ui.can.edit";
- // Any adapter that uses this must override setValue() which understands
- // how to convert a String to the required type.
- // This is used in ComboObjectEditor (maybe others in the future)
- public final static String UI_CAN_EDIT_INLINE = "ui.can.edit.inline";
- public final static String UI_CAN_CREATE_NEW = "ui.can.create.new";
- public final static String UI_CAN_SET_NULL = "ui.can.set.null";
- public final static String UI_IS_MULTI_CHOICE = "ui.is.multi.choice";
- public static final String PROPERTY_DESCRIPTOR = "property.descriptor";
-
- protected Hashtable<
- EStructuralFeature, // feature ID
- Hashtable<String,Object>> // property key and value
- featureProperties = new Hashtable<EStructuralFeature, Hashtable<String,Object>>();
- protected Hashtable <
- String, // property key
- Object> // value
- objectProperties = new Hashtable <String,Object>();
-
- protected AdapterFactory adapterFactory;
-
- public ExtendedPropertiesAdapter(AdapterFactory adapterFactory, T object) {
- super();
- this.adapterFactory = adapterFactory;
- setTarget(object);
-
- String name = "";
- if (object instanceof BPMNDiagram) {
- switch(ModelUtil.getDiagramType(object)) {
- case NONE:
- name = "UnknownDiagram";
- break;
- case PROCESS:
- name = "ProcessDiagram";
- break;
- case CHOREOGRAPHY:
- name = "ChoreographyDiagram";
- break;
- case COLLABORATION:
- name = "CollaborationDiagram";
- break;
- }
- }
- else {
- name = object.eClass().getName().replaceAll("Impl$", "");
- }
- // Set the model element's long description from the Messages class.
- // The field in Messages that contains the description will have the
- // form: "UI_<BPMN2ElementName>_long_description".
- // The Messages class must be contained somewhere in the package hierarchy
- // that contains the adapter factory class; by default, this will be the
- // BPMN2 modeler UI plugin hierarchy, starting with org.eclipse.bpmn2.modeler.ui.adapters
- try {
- String fieldName = "UI_" + name + "_long_description";
- Class messages = JavaReflectionUtil.findClass(adapterFactory, "Messages");
- Field field = messages.getField(fieldName);
- String text = (String)field.get(null);
- setProperty(LONG_DESCRIPTION, text);
- } catch (Exception e) {
- }
- }
-
- public void setObjectDescriptor(ObjectDescriptor<T> pd) {
- setProperty(PROPERTY_DESCRIPTOR,pd);
- }
-
- public ObjectDescriptor<T> getObjectDescriptor() {
- ObjectDescriptor<T> pd = (ObjectDescriptor<T>) getProperty(PROPERTY_DESCRIPTOR);
- if (pd==null) {
- pd = new ObjectDescriptor<T>(adapterFactory, (T)getTarget());
- setProperty(PROPERTY_DESCRIPTOR,pd);
- }
- return pd;
- }
-
- public FeatureDescriptor<T> getFeatureDescriptor(EStructuralFeature feature) {
- FeatureDescriptor<T> pd = (FeatureDescriptor<T>) getProperty(feature,PROPERTY_DESCRIPTOR);
- if (pd==null) {
- pd = new FeatureDescriptor<T>(adapterFactory, (T)getTarget(), feature);
- setProperty(feature,PROPERTY_DESCRIPTOR,pd);
- }
- return pd;
- }
-
- public void setFeatureDescriptor(EStructuralFeature feature, FeatureDescriptor<T> pd) {
- Hashtable<String,Object> props = featureProperties.get(feature);
- if (props==null) {
- props = new Hashtable<String,Object>();
- featureProperties.put(feature,props);
- }
- props.put(PROPERTY_DESCRIPTOR, pd);
- }
-
- public Object getProperty(String key) {
- return objectProperties.get(key);
- }
-
- public boolean getBooleanProperty(String key) {
- Object result = getProperty(key);
- if (result instanceof Boolean)
- return ((Boolean)result);
- return false;
- }
-
- public void setProperty(String key, Object value) {
- objectProperties.put(key, value);
- }
-
- public Object getProperty(EStructuralFeature feature, String key) {
- Hashtable<String,Object> props = featureProperties.get(feature);
- if (props==null) {
- props = new Hashtable<String,Object>();
- featureProperties.put(feature,props);
- }
- return props.get(key);
- }
-
- public boolean getBooleanProperty(EStructuralFeature feature, String key) {
- Object result = getProperty(feature, key);
- if (result instanceof Boolean)
- return ((Boolean)result);
- return false;
- }
-
- public void setProperty(EStructuralFeature feature, String key, Object value) {
- Hashtable<String,Object> props = featureProperties.get(feature);
- if (props==null) {
- props = new Hashtable<String,Object>();
- featureProperties.put(feature,props);
- }
- props.put(key, value);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+import java.lang.reflect.Field;
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.utils.JavaReflectionUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ExtendedPropertiesAdapter<T extends EObject> extends AdapterImpl {
+
+ // common property keys
+ public final static String LONG_DESCRIPTION = "long.description";
+ public final static String UI_CAN_EDIT = "ui.can.edit";
+ // Any adapter that uses this must override setValue() which understands
+ // how to convert a String to the required type.
+ // This is used in ComboObjectEditor (maybe others in the future)
+ public final static String UI_CAN_EDIT_INLINE = "ui.can.edit.inline";
+ public final static String UI_CAN_CREATE_NEW = "ui.can.create.new";
+ public final static String UI_CAN_SET_NULL = "ui.can.set.null";
+ public final static String UI_IS_MULTI_CHOICE = "ui.is.multi.choice";
+ public static final String PROPERTY_DESCRIPTOR = "property.descriptor";
+
+ protected Hashtable<
+ EStructuralFeature, // feature ID
+ Hashtable<String,Object>> // property key and value
+ featureProperties = new Hashtable<EStructuralFeature, Hashtable<String,Object>>();
+ protected Hashtable <
+ String, // property key
+ Object> // value
+ objectProperties = new Hashtable <String,Object>();
+
+ protected AdapterFactory adapterFactory;
+
+ public ExtendedPropertiesAdapter(AdapterFactory adapterFactory, T object) {
+ super();
+ this.adapterFactory = adapterFactory;
+ setTarget(object);
+
+ String name = "";
+ if (object instanceof BPMNDiagram) {
+ switch(ModelUtil.getDiagramType(object)) {
+ case NONE:
+ name = "UnknownDiagram";
+ break;
+ case PROCESS:
+ name = "ProcessDiagram";
+ break;
+ case CHOREOGRAPHY:
+ name = "ChoreographyDiagram";
+ break;
+ case COLLABORATION:
+ name = "CollaborationDiagram";
+ break;
+ }
+ }
+ else {
+ name = object.eClass().getName().replaceAll("Impl$", "");
+ }
+ // Set the model element's long description from the Messages class.
+ // The field in Messages that contains the description will have the
+ // form: "UI_<BPMN2ElementName>_long_description".
+ // The Messages class must be contained somewhere in the package hierarchy
+ // that contains the adapter factory class; by default, this will be the
+ // BPMN2 modeler UI plugin hierarchy, starting with org.eclipse.bpmn2.modeler.ui.adapters
+ try {
+ String fieldName = "UI_" + name + "_long_description";
+ Class messages = JavaReflectionUtil.findClass(adapterFactory, "Messages");
+ Field field = messages.getField(fieldName);
+ String text = (String)field.get(null);
+ setProperty(LONG_DESCRIPTION, text);
+ } catch (Exception e) {
+ }
+ }
+
+ public void setObjectDescriptor(ObjectDescriptor<T> pd) {
+ setProperty(PROPERTY_DESCRIPTOR,pd);
+ }
+
+ public ObjectDescriptor<T> getObjectDescriptor() {
+ ObjectDescriptor<T> pd = (ObjectDescriptor<T>) getProperty(PROPERTY_DESCRIPTOR);
+ if (pd==null) {
+ pd = new ObjectDescriptor<T>(adapterFactory, (T)getTarget());
+ setProperty(PROPERTY_DESCRIPTOR,pd);
+ }
+ return pd;
+ }
+
+ public FeatureDescriptor<T> getFeatureDescriptor(EStructuralFeature feature) {
+ FeatureDescriptor<T> pd = (FeatureDescriptor<T>) getProperty(feature,PROPERTY_DESCRIPTOR);
+ if (pd==null) {
+ pd = new FeatureDescriptor<T>(adapterFactory, (T)getTarget(), feature);
+ setProperty(feature,PROPERTY_DESCRIPTOR,pd);
+ }
+ return pd;
+ }
+
+ public void setFeatureDescriptor(EStructuralFeature feature, FeatureDescriptor<T> pd) {
+ Hashtable<String,Object> props = featureProperties.get(feature);
+ if (props==null) {
+ props = new Hashtable<String,Object>();
+ featureProperties.put(feature,props);
+ }
+ props.put(PROPERTY_DESCRIPTOR, pd);
+ }
+
+ public Object getProperty(String key) {
+ return objectProperties.get(key);
+ }
+
+ public boolean getBooleanProperty(String key) {
+ Object result = getProperty(key);
+ if (result instanceof Boolean)
+ return ((Boolean)result);
+ return false;
+ }
+
+ public void setProperty(String key, Object value) {
+ objectProperties.put(key, value);
+ }
+
+ public Object getProperty(EStructuralFeature feature, String key) {
+ Hashtable<String,Object> props = featureProperties.get(feature);
+ if (props==null) {
+ props = new Hashtable<String,Object>();
+ featureProperties.put(feature,props);
+ }
+ return props.get(key);
+ }
+
+ public boolean getBooleanProperty(EStructuralFeature feature, String key) {
+ Object result = getProperty(feature, key);
+ if (result instanceof Boolean)
+ return ((Boolean)result);
+ return false;
+ }
+
+ public void setProperty(EStructuralFeature feature, String key, Object value) {
+ Hashtable<String,Object> props = featureProperties.get(feature);
+ if (props==null) {
+ props = new Hashtable<String,Object>();
+ featureProperties.put(feature,props);
+ }
+ props.put(key, value);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/INamespaceMap.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/INamespaceMap.java
index 3ecbcad..9cb3b29 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/INamespaceMap.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/INamespaceMap.java
@@ -1,24 +1,24 @@
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Namespace map of K,V which also holds the reverse map of V,K
- *
- * @param <K>
- * @param <V>
- */
-
-public interface INamespaceMap <K,V> extends Map<K,V> {
-
- /**
- * Get the entry under key V (which is the value).
- *
- * @param key the value key
- * @return the list of prefix names
- */
- public List<K> getReverse ( V key );
-
-
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Namespace map of K,V which also holds the reverse map of V,K
+ *
+ * @param <K>
+ * @param <V>
+ */
+
+public interface INamespaceMap <K,V> extends Map<K,V> {
+
+ /**
+ * Get the entry under key V (which is the value).
+ *
+ * @param key the value key
+ * @return the list of prefix names
+ */
+ public List<K> getReverse ( V key );
+
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IProperty.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IProperty.java
index 9cec17e..2478974 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IProperty.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IProperty.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @param <K>
- * @param <V>
- * @date Jul 23, 2007
- *
- */
-public interface IProperty<K,V> {
-
- /**
- * Get the property.
- *
- * @param key the
- * @return the property under the key key.
- */
- public V getProperty ( K key );
-
- /**
- * Set the property.
- * @param key the key
- * @param value the value
- * @return the old value of the property, if set, null otherwise.
- */
-
- public V setProperty (K key, V value);
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @param <K>
+ * @param <V>
+ * @date Jul 23, 2007
+ *
+ */
+public interface IProperty<K,V> {
+
+ /**
+ * Get the property.
+ *
+ * @param key the
+ * @return the property under the key key.
+ */
+ public V getProperty ( K key );
+
+ /**
+ * Set the property.
+ * @param key the key
+ * @param value the value
+ * @return the old value of the property, if set, null otherwise.
+ */
+
+ public V setProperty (K key, V value);
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IStatefullAdapter.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IStatefullAdapter.java
index 31eadd2..5accf67 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IStatefullAdapter.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IStatefullAdapter.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.adapters;
-
-/**
- * If an adapter implements this interface, it is assumed to be statefull.
- * The AdapterProvider helper class will always return new instances of
- * such adapter classes.
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Jul 28, 2006
- *
- */
-
-public interface IStatefullAdapter {
-
- /**
- * Set the target object.
- *
- * @param target the target object
- */
- public void setTarget (Object target);
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.adapters;
+
+/**
+ * If an adapter implements this interface, it is assumed to be statefull.
+ * The AdapterProvider helper class will always return new instances of
+ * such adapter classes.
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Jul 28, 2006
+ *
+ */
+
+public interface IStatefullAdapter {
+
+ /**
+ * Set the target object.
+ *
+ * @param target the target object
+ */
+ public void setTarget (Object target);
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateConnectionFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateConnectionFeature.java
index ec2f0be..047aba0 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateConnectionFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateConnectionFeature.java
@@ -1,130 +1,130 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICreateConnectionContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.context.IReconnectionContext;
-import org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-
-/**
- * @author Bob Brodt
- *
- */
-public abstract class AbstractBpmn2CreateConnectionFeature<T extends BaseElement>
- extends AbstractCreateConnectionFeature
- implements IBpmn2CreateFeature<T, ICreateConnectionContext> {
-
- /**
- * @param fp
- * @param name
- * @param description
- */
- public AbstractBpmn2CreateConnectionFeature(IFeatureProvider fp,
- String name, String description) {
- super(fp, name, description);
- // TODO Auto-generated constructor stub
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.ICreateConnection#canCreate(org.eclipse.graphiti.features.context.ICreateConnectionContext)
- */
- @Override
- public boolean canCreate(ICreateConnectionContext context) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.ICreateConnection#create(org.eclipse.graphiti.features.context.ICreateConnectionContext)
- */
- @Override
- public Connection create(ICreateConnectionContext context) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.ICreateConnection#canStartConnection(org.eclipse.graphiti.features.context.ICreateConnectionContext)
- */
- @Override
- public boolean canStartConnection(ICreateConnectionContext context) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.impl.AbstractFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public boolean isAvailable(IContext context) {
- Object o = null;
- if (context instanceof ICreateConnectionContext) {
- ICreateConnectionContext ccc = (ICreateConnectionContext)context;
- if (ccc.getTargetPictogramElement()!=null) {
- o = BusinessObjectUtil.getFirstElementOfType(
- ccc.getTargetPictogramElement(), BaseElement.class);
- }
- else if (ccc.getSourcePictogramElement()!=null) {
- o = BusinessObjectUtil.getFirstElementOfType(
- ccc.getSourcePictogramElement(), BaseElement.class);
- }
- }
- else if (context instanceof IReconnectionContext) {
- IReconnectionContext rc = (IReconnectionContext)context;
- if (rc.getTargetPictogramElement()!=null) {
- o = BusinessObjectUtil.getFirstElementOfType(
- rc.getTargetPictogramElement(), BaseElement.class);
- }
- }
-
- if (o instanceof EndEvent)
- return false;
-
- if (o instanceof EObject) {
- ModelEnablementDescriptor e = TargetRuntime.getCurrentRuntime().getModelEnablements((EObject)o);
- return e.isEnabled(getBusinessObjectClass());
- }
- return false;
- }
-
- @Override
- public String getCreateDescription() {
- return "Create " + ModelUtil.toDisplayName( getBusinessObjectClass().getName());
- }
-
- @SuppressWarnings("unchecked")
- public T getBusinessObject(ICreateConnectionContext context) {
- return (T) context.getProperty(ContextConstants.BUSINESS_OBJECT);
- }
-
- public void putBusinessObject(ICreateConnectionContext context, T businessObject) {
- context.putProperty(ContextConstants.BUSINESS_OBJECT, businessObject);
- }
-
- public void postExecute(IExecutionInfo executionInfo) {
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICreateConnectionContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.context.IReconnectionContext;
+import org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public abstract class AbstractBpmn2CreateConnectionFeature<T extends BaseElement>
+ extends AbstractCreateConnectionFeature
+ implements IBpmn2CreateFeature<T, ICreateConnectionContext> {
+
+ /**
+ * @param fp
+ * @param name
+ * @param description
+ */
+ public AbstractBpmn2CreateConnectionFeature(IFeatureProvider fp,
+ String name, String description) {
+ super(fp, name, description);
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.ICreateConnection#canCreate(org.eclipse.graphiti.features.context.ICreateConnectionContext)
+ */
+ @Override
+ public boolean canCreate(ICreateConnectionContext context) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.ICreateConnection#create(org.eclipse.graphiti.features.context.ICreateConnectionContext)
+ */
+ @Override
+ public Connection create(ICreateConnectionContext context) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.ICreateConnection#canStartConnection(org.eclipse.graphiti.features.context.ICreateConnectionContext)
+ */
+ @Override
+ public boolean canStartConnection(ICreateConnectionContext context) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.impl.AbstractFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean isAvailable(IContext context) {
+ Object o = null;
+ if (context instanceof ICreateConnectionContext) {
+ ICreateConnectionContext ccc = (ICreateConnectionContext)context;
+ if (ccc.getTargetPictogramElement()!=null) {
+ o = BusinessObjectUtil.getFirstElementOfType(
+ ccc.getTargetPictogramElement(), BaseElement.class);
+ }
+ else if (ccc.getSourcePictogramElement()!=null) {
+ o = BusinessObjectUtil.getFirstElementOfType(
+ ccc.getSourcePictogramElement(), BaseElement.class);
+ }
+ }
+ else if (context instanceof IReconnectionContext) {
+ IReconnectionContext rc = (IReconnectionContext)context;
+ if (rc.getTargetPictogramElement()!=null) {
+ o = BusinessObjectUtil.getFirstElementOfType(
+ rc.getTargetPictogramElement(), BaseElement.class);
+ }
+ }
+
+ if (o instanceof EndEvent)
+ return false;
+
+ if (o instanceof EObject) {
+ ModelEnablementDescriptor e = TargetRuntime.getCurrentRuntime().getModelEnablements((EObject)o);
+ return e.isEnabled(getBusinessObjectClass());
+ }
+ return false;
+ }
+
+ @Override
+ public String getCreateDescription() {
+ return "Create " + ModelUtil.toDisplayName( getBusinessObjectClass().getName());
+ }
+
+ @SuppressWarnings("unchecked")
+ public T getBusinessObject(ICreateConnectionContext context) {
+ return (T) context.getProperty(ContextConstants.BUSINESS_OBJECT);
+ }
+
+ public void putBusinessObject(ICreateConnectionContext context, T businessObject) {
+ context.putProperty(ContextConstants.BUSINESS_OBJECT, businessObject);
+ }
+
+ public void postExecute(IExecutionInfo executionInfo) {
+
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateFeature.java
index 2f4a13f..fe60a72 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2CreateFeature.java
@@ -1,131 +1,131 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.IFeature;
-import org.eclipse.graphiti.features.IFeatureAndContext;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-
-/**
- * @author Bob Brodt
- *
- */
-public abstract class AbstractBpmn2CreateFeature<T extends BaseElement>
- extends AbstractCreateFeature
- implements IBpmn2CreateFeature<T, ICreateContext> {
-
- /**
- * @param fp
- * @param name
- * @param description
- */
- public AbstractBpmn2CreateFeature(IFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.ICreate#canCreate(org.eclipse.graphiti.features.context.ICreateContext)
- */
- @Override
- public boolean canCreate(ICreateContext context) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.ICreate#create(org.eclipse.graphiti.features.context.ICreateContext)
- */
- @Override
- public Object[] create(ICreateContext context) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.impl.AbstractFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public boolean isAvailable(IContext context) {
- List<ModelEnablementDescriptor> enablements = TargetRuntime.getCurrentRuntime().getModelEnablements();
- for (ModelEnablementDescriptor e : enablements) {
- if (e.isEnabled(getBusinessObjectClass()))
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.impl.AbstractCreateFeature#getCreateDescription()
- */
- @Override
- public String getCreateDescription() {
- return "Create " + ModelUtil.toDisplayName( getBusinessObjectClass().getName());
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public T createBusinessObject(ICreateContext context) {
- Shape shape = context.getTargetContainer();
- EObject container = BusinessObjectUtil.getBusinessObjectForPictogramElement(shape);
- Resource resource = container.eResource();
- EClass eclass = getBusinessObjectClass();
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(eclass, ExtendedPropertiesAdapter.class);
- T businessObject = (T)adapter.getObjectDescriptor().createObject(resource,eclass);
- putBusinessObject(context, businessObject);
- return businessObject;
- }
-
- @SuppressWarnings("unchecked")
- public T getBusinessObject(ICreateContext context) {
- return (T) context.getProperty(ContextConstants.BUSINESS_OBJECT);
- }
-
- public void putBusinessObject(ICreateContext context, T businessObject) {
- context.putProperty(ContextConstants.BUSINESS_OBJECT, businessObject);
- }
-
- public void postExecute(IExecutionInfo executionInfo) {
- for (IFeatureAndContext fc : executionInfo.getExecutionList()) {
- IContext context = fc.getContext();
- if (context instanceof ICreateContext) {
- ICreateContext cc = (ICreateContext)context;
- T businessObject = getBusinessObject(cc);
- Bpmn2Preferences prefs = (Bpmn2Preferences) ((DiagramEditor) getDiagramEditor()).getAdapter(Bpmn2Preferences.class);
- if (prefs!=null && prefs.getShowPopupConfigDialog(businessObject)) {
- ObjectEditingDialog dialog =
- new ObjectEditingDialog((DiagramEditor)getDiagramEditor(), businessObject);
- dialog.open();
- }
- }
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.IFeature;
+import org.eclipse.graphiti.features.IFeatureAndContext;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public abstract class AbstractBpmn2CreateFeature<T extends BaseElement>
+ extends AbstractCreateFeature
+ implements IBpmn2CreateFeature<T, ICreateContext> {
+
+ /**
+ * @param fp
+ * @param name
+ * @param description
+ */
+ public AbstractBpmn2CreateFeature(IFeatureProvider fp, String name, String description) {
+ super(fp, name, description);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.ICreate#canCreate(org.eclipse.graphiti.features.context.ICreateContext)
+ */
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.ICreate#create(org.eclipse.graphiti.features.context.ICreateContext)
+ */
+ @Override
+ public Object[] create(ICreateContext context) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.impl.AbstractFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean isAvailable(IContext context) {
+ List<ModelEnablementDescriptor> enablements = TargetRuntime.getCurrentRuntime().getModelEnablements();
+ for (ModelEnablementDescriptor e : enablements) {
+ if (e.isEnabled(getBusinessObjectClass()))
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.impl.AbstractCreateFeature#getCreateDescription()
+ */
+ @Override
+ public String getCreateDescription() {
+ return "Create " + ModelUtil.toDisplayName( getBusinessObjectClass().getName());
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public T createBusinessObject(ICreateContext context) {
+ Shape shape = context.getTargetContainer();
+ EObject container = BusinessObjectUtil.getBusinessObjectForPictogramElement(shape);
+ Resource resource = container.eResource();
+ EClass eclass = getBusinessObjectClass();
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(eclass, ExtendedPropertiesAdapter.class);
+ T businessObject = (T)adapter.getObjectDescriptor().createObject(resource,eclass);
+ putBusinessObject(context, businessObject);
+ return businessObject;
+ }
+
+ @SuppressWarnings("unchecked")
+ public T getBusinessObject(ICreateContext context) {
+ return (T) context.getProperty(ContextConstants.BUSINESS_OBJECT);
+ }
+
+ public void putBusinessObject(ICreateContext context, T businessObject) {
+ context.putProperty(ContextConstants.BUSINESS_OBJECT, businessObject);
+ }
+
+ public void postExecute(IExecutionInfo executionInfo) {
+ for (IFeatureAndContext fc : executionInfo.getExecutionList()) {
+ IContext context = fc.getContext();
+ if (context instanceof ICreateContext) {
+ ICreateContext cc = (ICreateContext)context;
+ T businessObject = getBusinessObject(cc);
+ Bpmn2Preferences prefs = (Bpmn2Preferences) ((DiagramEditor) getDiagramEditor()).getAdapter(Bpmn2Preferences.class);
+ if (prefs!=null && prefs.getShowPopupConfigDialog(businessObject)) {
+ ObjectEditingDialog dialog =
+ new ObjectEditingDialog((DiagramEditor)getDiagramEditor(), businessObject);
+ dialog.open();
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractUpdateBaseElementFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractUpdateBaseElementFeature.java
index 31f4508..4fc75c7 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractUpdateBaseElementFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractUpdateBaseElementFeature.java
@@ -1,75 +1,75 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.AbstractText;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public abstract class AbstractUpdateBaseElementFeature extends AbstractUpdateFeature {
-
- public AbstractUpdateBaseElementFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- PictogramElement pe = context.getPictogramElement();
- if (pe instanceof ContainerShape) {
- String shapeValue = FeatureSupport.getShapeValue(context);
- if (shapeValue==null)
- shapeValue = "";
- String businessValue = FeatureSupport.getBusinessValue(context);
- if (businessValue==null)
- businessValue = "";
-
- boolean updateNeeded = !shapeValue.equals(businessValue);
-
- if (updateNeeded) {
- return Reason.createTrueReason("Name out of date");
- }
- }
-
- return Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- // TODO here it should get an updated picture from the element controller
-
- PictogramElement pe = context.getPictogramElement();
- if (pe instanceof ContainerShape) {
- ContainerShape cs = (ContainerShape) pe;
- for (Shape shape : cs.getChildren()) {
- if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
- AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
- String value = FeatureSupport.getBusinessValue(context);
- if (value == null) {
- value = "";
- }
- text.setValue(value);
- return true;
- }
- }
- }
- return false;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.AbstractText;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public abstract class AbstractUpdateBaseElementFeature extends AbstractUpdateFeature {
+
+ public AbstractUpdateBaseElementFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ if (pe instanceof ContainerShape) {
+ String shapeValue = FeatureSupport.getShapeValue(context);
+ if (shapeValue==null)
+ shapeValue = "";
+ String businessValue = FeatureSupport.getBusinessValue(context);
+ if (businessValue==null)
+ businessValue = "";
+
+ boolean updateNeeded = !shapeValue.equals(businessValue);
+
+ if (updateNeeded) {
+ return Reason.createTrueReason("Name out of date");
+ }
+ }
+
+ return Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ // TODO here it should get an updated picture from the element controller
+
+ PictogramElement pe = context.getPictogramElement();
+ if (pe instanceof ContainerShape) {
+ ContainerShape cs = (ContainerShape) pe;
+ for (Shape shape : cs.getChildren()) {
+ if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
+ AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
+ String value = FeatureSupport.getBusinessValue(context);
+ if (value == null) {
+ value = "";
+ }
+ text.setValue(value);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementConnectionFeatureContainer.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementConnectionFeatureContainer.java
index 8e4d5d5..4fd2c8f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementConnectionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementConnectionFeatureContainer.java
@@ -1,55 +1,55 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReconnectionFeature;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.context.IReconnectionContext;
-
-public abstract class BaseElementConnectionFeatureContainer extends ConnectionFeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context instanceof IAddContext) {
- return ((IAddContext) context).getNewObject();
- } else if (context instanceof IPictogramElementContext) {
- return BusinessObjectUtil.getFirstElementOfType(
- (((IPictogramElementContext) context).getPictogramElement()), BaseElement.class);
- } else if (context instanceof IReconnectionContext) {
- IReconnectionContext rc = (IReconnectionContext)context;
- return BusinessObjectUtil.getFirstElementOfType(rc.getConnection(), BaseElement.class);
- }
- return null;
- }
-
- @Override
- public boolean canApplyTo(Object o) {
- return o instanceof BaseElement;
- }
-
- @Override
- public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
- return new ReconnectBaseElementFeature(fp);
- }
-
- @Override
- public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReconnectionFeature;
+import org.eclipse.graphiti.features.IRemoveFeature;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.context.IReconnectionContext;
+
+public abstract class BaseElementConnectionFeatureContainer extends ConnectionFeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context instanceof IAddContext) {
+ return ((IAddContext) context).getNewObject();
+ } else if (context instanceof IPictogramElementContext) {
+ return BusinessObjectUtil.getFirstElementOfType(
+ (((IPictogramElementContext) context).getPictogramElement()), BaseElement.class);
+ } else if (context instanceof IReconnectionContext) {
+ IReconnectionContext rc = (IReconnectionContext)context;
+ return BusinessObjectUtil.getFirstElementOfType(rc.getConnection(), BaseElement.class);
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return o instanceof BaseElement;
+ }
+
+ @Override
+ public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
+ return new ReconnectBaseElementFeature(fp);
+ }
+
+ @Override
+ public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementFeatureContainer.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementFeatureContainer.java
index 232ee45..999e7d0 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BaseElementFeatureContainer.java
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public abstract class BaseElementFeatureContainer implements FeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context instanceof IAddContext) {
- return ((IAddContext) context).getNewObject();
-// TODO: why is this here? we have already expanded LabelFeatureContainer to handle all of the
-// BPMN elements that have label figures and this test is done there - I believe this was an
-// interim hack before LabelFeatureContainer was added...
-// } else if (context instanceof IUpdateContext) {
-// IUpdateContext updateContext = (IUpdateContext) context;
-// BaseElement o = BusinessObjectUtil.getFirstElementOfType(updateContext.getPictogramElement(), BaseElement.class);
-// if (o instanceof Gateway || o instanceof Event) {
-// if (updateContext.getPictogramElement() instanceof ContainerShape) {
-// ContainerShape container = (ContainerShape) updateContext.getPictogramElement();
-// if (container.getChildren().size() == 1) {
-// Shape shape = container.getChildren().get(0);
-// if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
-// return null;
-// }
-// }
-// }
-// }
- }
- if (context instanceof IPictogramElementContext) {
- return BusinessObjectUtil.getFirstElementOfType(
- (((IPictogramElementContext) context).getPictogramElement()), BaseElement.class);
- }
- if (context instanceof ICustomContext) {
- PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
- if (pes.length==1)
- return BusinessObjectUtil.getFirstElementOfType(pes[0], BaseElement.class);
- }
- return null;
- }
-
- @Override
- public boolean canApplyTo(Object o) {
- return o instanceof BaseElement;
- }
-
- @Override
- public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- return new ICustomFeature[] {
- new ShowPropertiesFeature(fp)
- };
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IRemoveFeature;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public abstract class BaseElementFeatureContainer implements FeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context instanceof IAddContext) {
+ return ((IAddContext) context).getNewObject();
+// TODO: why is this here? we have already expanded LabelFeatureContainer to handle all of the
+// BPMN elements that have label figures and this test is done there - I believe this was an
+// interim hack before LabelFeatureContainer was added...
+// } else if (context instanceof IUpdateContext) {
+// IUpdateContext updateContext = (IUpdateContext) context;
+// BaseElement o = BusinessObjectUtil.getFirstElementOfType(updateContext.getPictogramElement(), BaseElement.class);
+// if (o instanceof Gateway || o instanceof Event) {
+// if (updateContext.getPictogramElement() instanceof ContainerShape) {
+// ContainerShape container = (ContainerShape) updateContext.getPictogramElement();
+// if (container.getChildren().size() == 1) {
+// Shape shape = container.getChildren().get(0);
+// if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
+// return null;
+// }
+// }
+// }
+// }
+ }
+ if (context instanceof IPictogramElementContext) {
+ return BusinessObjectUtil.getFirstElementOfType(
+ (((IPictogramElementContext) context).getPictogramElement()), BaseElement.class);
+ }
+ if (context instanceof ICustomContext) {
+ PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
+ if (pes.length==1)
+ return BusinessObjectUtil.getFirstElementOfType(pes[0], BaseElement.class);
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return o instanceof BaseElement;
+ }
+
+ @Override
+ public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ return new ICustomFeature[] {
+ new ShowPropertiesFeature(fp)
+ };
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionFeatureContainer.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionFeatureContainer.java
index 055ccde..b00403f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionFeatureContainer.java
@@ -1,74 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IReconnectionFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-
-public abstract class ConnectionFeatureContainer implements FeatureContainer {
-
- public abstract ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp);
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new DefaultLayoutBPMNShapeFeature(fp);
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider context) {
- return null;
- }
-
- public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IReconnectionFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+
+public abstract class ConnectionFeatureContainer implements FeatureContainer {
+
+ public abstract ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp);
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new DefaultLayoutBPMNShapeFeature(fp);
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider context) {
+ return null;
+ }
+
+ public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ContextConstants.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ContextConstants.java
index df9de4b..77ca29b 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ContextConstants.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ContextConstants.java
@@ -1,10 +1,10 @@
-package org.eclipse.bpmn2.modeler.core.features;
-
-public interface ContextConstants {
-
- public static final String LABEL_CONTEXT = "labelContext";
- public static final String WIDTH = "width";
- public static final String HEIGHT = "height";
- public static final String BUSINESS_OBJECT = "businessObject";
-
-}
+package org.eclipse.bpmn2.modeler.core.features;
+
+public interface ContextConstants {
+
+ public static final String LABEL_CONTEXT = "labelContext";
+ public static final String WIDTH = "width";
+ public static final String HEIGHT = "height";
+ public static final String BUSINESS_OBJECT = "businessObject";
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultDeleteBPMNShapeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultDeleteBPMNShapeFeature.java
index cc560b5..956e319 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultDeleteBPMNShapeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultDeleteBPMNShapeFeature.java
@@ -1,88 +1,88 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.impl.DeleteContext;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;
-
-public class DefaultDeleteBPMNShapeFeature extends DefaultDeleteFeature {
-
- public DefaultDeleteBPMNShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected boolean getUserDecision(IDeleteContext context) {
- return true;
- }
-
- public boolean canDelete(IDeleteContext context) {
- return true;
- }
-
- @Override
- protected void deleteBusinessObject(Object bo) {
- List<PictogramElement> pictElements = Graphiti.getLinkService().getPictogramElements(getDiagram(), (EObject) bo);
- for (Iterator<PictogramElement> iterator = pictElements.iterator(); iterator.hasNext();) {
- PictogramElement pe = iterator.next();
- deletePeEnvironment(pe);
- Graphiti.getPeService().deletePictogramElement(pe);
- }
- super.deleteBusinessObject(bo);
- }
-
- protected void deletePeEnvironment(PictogramElement pictogramElement){
- if (pictogramElement instanceof ContainerShape) {
- ContainerShape cShape = (ContainerShape) pictogramElement;
- EList<Anchor> anchors = cShape.getAnchors();
- for (Anchor anchor : anchors) {
- deleteConnections(getFeatureProvider(), anchor.getIncomingConnections());
- deleteConnections(getFeatureProvider(), anchor.getOutgoingConnections());
- }
- deleteContainer(getFeatureProvider(), cShape);
- }
- }
-
- protected void deleteContainer(IFeatureProvider fp, ContainerShape cShape) {
- Object[] children = cShape.getChildren().toArray();
- for (Object shape : children) {
- if (shape instanceof ContainerShape) {
- DeleteContext context = new DeleteContext((PictogramElement) shape);
- fp.getDeleteFeature(context).delete(context);
- }
- }
- }
-
- protected void deleteConnections(IFeatureProvider fp, EList<Connection> connections) {
- List<Connection> con = new ArrayList<Connection>();
- con.addAll(connections);
- for (Connection connection : con) {
- IDeleteContext conDelete = new DeleteContext(connection);
- fp.getDeleteFeature(conDelete).delete(conDelete);
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDeleteContext;
+import org.eclipse.graphiti.features.context.impl.DeleteContext;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;
+
+public class DefaultDeleteBPMNShapeFeature extends DefaultDeleteFeature {
+
+ public DefaultDeleteBPMNShapeFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected boolean getUserDecision(IDeleteContext context) {
+ return true;
+ }
+
+ public boolean canDelete(IDeleteContext context) {
+ return true;
+ }
+
+ @Override
+ protected void deleteBusinessObject(Object bo) {
+ List<PictogramElement> pictElements = Graphiti.getLinkService().getPictogramElements(getDiagram(), (EObject) bo);
+ for (Iterator<PictogramElement> iterator = pictElements.iterator(); iterator.hasNext();) {
+ PictogramElement pe = iterator.next();
+ deletePeEnvironment(pe);
+ Graphiti.getPeService().deletePictogramElement(pe);
+ }
+ super.deleteBusinessObject(bo);
+ }
+
+ protected void deletePeEnvironment(PictogramElement pictogramElement){
+ if (pictogramElement instanceof ContainerShape) {
+ ContainerShape cShape = (ContainerShape) pictogramElement;
+ EList<Anchor> anchors = cShape.getAnchors();
+ for (Anchor anchor : anchors) {
+ deleteConnections(getFeatureProvider(), anchor.getIncomingConnections());
+ deleteConnections(getFeatureProvider(), anchor.getOutgoingConnections());
+ }
+ deleteContainer(getFeatureProvider(), cShape);
+ }
+ }
+
+ protected void deleteContainer(IFeatureProvider fp, ContainerShape cShape) {
+ Object[] children = cShape.getChildren().toArray();
+ for (Object shape : children) {
+ if (shape instanceof ContainerShape) {
+ DeleteContext context = new DeleteContext((PictogramElement) shape);
+ fp.getDeleteFeature(context).delete(context);
+ }
+ }
+ }
+
+ protected void deleteConnections(IFeatureProvider fp, EList<Connection> connections) {
+ List<Connection> con = new ArrayList<Connection>();
+ con.addAll(connections);
+ for (Connection connection : con) {
+ IDeleteContext conDelete = new DeleteContext(connection);
+ fp.getDeleteFeature(conDelete).delete(conDelete);
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNShapeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNShapeFeature.java
index f969133..de369c0 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNShapeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNShapeFeature.java
@@ -1,56 +1,56 @@
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public class DefaultLayoutBPMNShapeFeature extends AbstractLayoutFeature {
-
- public DefaultLayoutBPMNShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- return true;
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- layoutConnections(context.getPictogramElement());
- return true;
- }
-
- public void layoutConnections(PictogramElement shape) {
- Diagram diagram = getDiagram();
- if (diagram!=null) {
- if (shape.getLink()!=null) {
- for (Object object : shape.getLink().getBusinessObjects()) {
- if (object instanceof BPMNShape || object instanceof BPMNEdge) {
- AnchorUtil.reConnect((DiagramElement) object, diagram);
- }
- }
- }
-
- if (shape instanceof ContainerShape) {
- for (PictogramElement pe : FeatureSupport.getContainerChildren((ContainerShape)shape)) {
- if (pe.getLink()!=null) {
- for (Object object : pe.getLink().getBusinessObjects()) {
- if (object instanceof BPMNShape || object instanceof BPMNEdge) {
- AnchorUtil.reConnect((DiagramElement) object, diagram);
- }
- }
- }
- }
- }
- }
- }
-}
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public class DefaultLayoutBPMNShapeFeature extends AbstractLayoutFeature {
+
+ public DefaultLayoutBPMNShapeFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ return true;
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ layoutConnections(context.getPictogramElement());
+ return true;
+ }
+
+ public void layoutConnections(PictogramElement shape) {
+ Diagram diagram = getDiagram();
+ if (diagram!=null) {
+ if (shape.getLink()!=null) {
+ for (Object object : shape.getLink().getBusinessObjects()) {
+ if (object instanceof BPMNShape || object instanceof BPMNEdge) {
+ AnchorUtil.reConnect((DiagramElement) object, diagram);
+ }
+ }
+ }
+
+ if (shape instanceof ContainerShape) {
+ for (PictogramElement pe : FeatureSupport.getContainerChildren((ContainerShape)shape)) {
+ if (pe.getLink()!=null) {
+ for (Object object : pe.getLink().getBusinessObjects()) {
+ if (object instanceof BPMNShape || object instanceof BPMNEdge) {
+ AnchorUtil.reConnect((DiagramElement) object, diagram);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java
index 6ff2d62..b7a8efa 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java
@@ -1,95 +1,95 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.AbstractText;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class DefaultMoveBPMNShapeFeature extends DefaultMoveShapeFeature {
-
- int preShapeX;
- int preShapeY;
-
- public DefaultMoveBPMNShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected void preMoveShape(IMoveShapeContext context) {
- super.preMoveShape(context);
- preShapeX = 0;
- preShapeX = 0;
-
- if (context.getShape().getGraphicsAlgorithm() != null){
- preShapeX = context.getShape().getGraphicsAlgorithm().getX();
- preShapeY = context.getShape().getGraphicsAlgorithm().getY();
- }
- }
-
- @Override
- protected void postMoveShape(IMoveShapeContext context) {
- DIUtils.updateDIShape(context.getPictogramElement());
-
- Shape shape = context.getShape();
- Object[] node = getAllBusinessObjectsForPictogramElement(shape);
-
- for (Object object : node) {
- List<PictogramElement> picElements = Graphiti.getLinkService().getPictogramElements(getDiagram(), (EObject) object);
- for (PictogramElement element : picElements){
- if (element!=shape &&
- Graphiti.getPeService().getPropertyValue(element, GraphicsUtil.LABEL_PROPERTY) != null){
- try{
- ContainerShape container = (ContainerShape) element;
- // only align when not selected, the move feature of the label will do the job when selected
- if (!ModelUtil.isElementSelected(getDiagramEditor().getSelectedPictogramElements(), element)) {
- GraphicsUtil.alignWithShape(
- (AbstractText) container.getChildren().get(0).getGraphicsAlgorithm(),
- container,
- shape.getGraphicsAlgorithm().getWidth(),
- shape.getGraphicsAlgorithm().getHeight(),
- shape.getGraphicsAlgorithm().getX(),
- shape.getGraphicsAlgorithm().getY(),
- preShapeX,
- preShapeY
- );
- }
- }
- catch(Exception e){
- new RuntimeException("Composition of label container is not as expected");
- }
- }
- }
-
- if (object instanceof BPMNShape || object instanceof BPMNEdge) {
- AnchorUtil.reConnect((DiagramElement) object, getDiagram());
- }
- }
-
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
+import org.eclipse.graphiti.mm.algorithms.AbstractText;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class DefaultMoveBPMNShapeFeature extends DefaultMoveShapeFeature {
+
+ int preShapeX;
+ int preShapeY;
+
+ public DefaultMoveBPMNShapeFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected void preMoveShape(IMoveShapeContext context) {
+ super.preMoveShape(context);
+ preShapeX = 0;
+ preShapeX = 0;
+
+ if (context.getShape().getGraphicsAlgorithm() != null){
+ preShapeX = context.getShape().getGraphicsAlgorithm().getX();
+ preShapeY = context.getShape().getGraphicsAlgorithm().getY();
+ }
+ }
+
+ @Override
+ protected void postMoveShape(IMoveShapeContext context) {
+ DIUtils.updateDIShape(context.getPictogramElement());
+
+ Shape shape = context.getShape();
+ Object[] node = getAllBusinessObjectsForPictogramElement(shape);
+
+ for (Object object : node) {
+ List<PictogramElement> picElements = Graphiti.getLinkService().getPictogramElements(getDiagram(), (EObject) object);
+ for (PictogramElement element : picElements){
+ if (element!=shape &&
+ Graphiti.getPeService().getPropertyValue(element, GraphicsUtil.LABEL_PROPERTY) != null){
+ try{
+ ContainerShape container = (ContainerShape) element;
+ // only align when not selected, the move feature of the label will do the job when selected
+ if (!ModelUtil.isElementSelected(getDiagramEditor().getSelectedPictogramElements(), element)) {
+ GraphicsUtil.alignWithShape(
+ (AbstractText) container.getChildren().get(0).getGraphicsAlgorithm(),
+ container,
+ shape.getGraphicsAlgorithm().getWidth(),
+ shape.getGraphicsAlgorithm().getHeight(),
+ shape.getGraphicsAlgorithm().getX(),
+ shape.getGraphicsAlgorithm().getY(),
+ preShapeX,
+ preShapeY
+ );
+ }
+ }
+ catch(Exception e){
+ new RuntimeException("Composition of label container is not as expected");
+ }
+ }
+ }
+
+ if (object instanceof BPMNShape || object instanceof BPMNEdge) {
+ AnchorUtil.reConnect((DiagramElement) object, getDiagram());
+ }
+ }
+
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultRemoveBPMNShapeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultRemoveBPMNShapeFeature.java
index dfa9d60..fba1353 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultRemoveBPMNShapeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultRemoveBPMNShapeFeature.java
@@ -1,38 +1,38 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DefaultRemoveBPMNShapeFeature extends DefaultRemoveFeature {
-
- /**
- * @param fp
- */
- public DefaultRemoveBPMNShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canRemove(IRemoveContext context) {
- return false;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IRemoveContext;
+import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DefaultRemoveBPMNShapeFeature extends DefaultRemoveFeature {
+
+ /**
+ * @param fp
+ */
+ public DefaultRemoveBPMNShapeFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canRemove(IRemoveContext context) {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultResizeBPMNShapeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultResizeBPMNShapeFeature.java
index 66596c2..a3be140 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultResizeBPMNShapeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultResizeBPMNShapeFeature.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class DefaultResizeBPMNShapeFeature extends DefaultResizeShapeFeature {
-
- public DefaultResizeBPMNShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public void resizeShape(IResizeShapeContext context) {
- super.resizeShape(context);
- if (context.getPictogramElement() instanceof Shape) {
- Shape shape = (Shape) context.getPictogramElement();
- AnchorUtil.relocateFixPointAnchors(shape, context.getWidth(), context.getHeight());
- Object[] node = getAllBusinessObjectsForPictogramElement(context.getShape());
- for (Object object : node) {
- if (object instanceof BPMNShape || object instanceof BPMNEdge) {
- AnchorUtil.reConnect((DiagramElement)object, getDiagram());
- }
- }
- }
- DIUtils.updateDIShape(context.getPictogramElement());
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class DefaultResizeBPMNShapeFeature extends DefaultResizeShapeFeature {
+
+ public DefaultResizeBPMNShapeFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public void resizeShape(IResizeShapeContext context) {
+ super.resizeShape(context);
+ if (context.getPictogramElement() instanceof Shape) {
+ Shape shape = (Shape) context.getPictogramElement();
+ AnchorUtil.relocateFixPointAnchors(shape, context.getWidth(), context.getHeight());
+ Object[] node = getAllBusinessObjectsForPictogramElement(context.getShape());
+ for (Object object : node) {
+ if (object instanceof BPMNShape || object instanceof BPMNEdge) {
+ AnchorUtil.reConnect((DiagramElement)object, getDiagram());
+ }
+ }
+ }
+ DIUtils.updateDIShape(context.getPictogramElement());
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DirectEditFlowElementFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DirectEditFlowElementFeature.java
index 8550c35..70334c9 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DirectEditFlowElementFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DirectEditFlowElementFeature.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class DirectEditFlowElementFeature extends AbstractDirectEditingFeature {
-
- public DirectEditFlowElementFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public String getInitialValue(IDirectEditingContext context) {
- return getBusinessObject(context).getName();
- }
-
- @Override
- public void setValue(String value, IDirectEditingContext context) {
- getBusinessObject(context).setName(value);
- PictogramElement e = context.getPictogramElement();
- updatePictogramElement(((Shape) e).getContainer());
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- return bo != null && bo instanceof FlowElement && context.getGraphicsAlgorithm() instanceof Text;
- }
-
- private FlowElement getBusinessObject(IDirectEditingContext context) {
- return (FlowElement) getBusinessObjectForPictogramElement(context.getPictogramElement());
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class DirectEditFlowElementFeature extends AbstractDirectEditingFeature {
+
+ public DirectEditFlowElementFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public int getEditingType() {
+ return TYPE_TEXT;
+ }
+
+ @Override
+ public String getInitialValue(IDirectEditingContext context) {
+ return getBusinessObject(context).getName();
+ }
+
+ @Override
+ public void setValue(String value, IDirectEditingContext context) {
+ getBusinessObject(context).setName(value);
+ PictogramElement e = context.getPictogramElement();
+ updatePictogramElement(((Shape) e).getContainer());
+ }
+
+ @Override
+ public boolean canDirectEdit(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ return bo != null && bo instanceof FlowElement && context.getGraphicsAlgorithm() instanceof Text;
+ }
+
+ private FlowElement getBusinessObject(IDirectEditingContext context) {
+ return (FlowElement) getBusinessObjectForPictogramElement(context.getPictogramElement());
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureContainer.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureContainer.java
index f12000d..76197f5 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureContainer.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-
-public interface FeatureContainer {
-
- Object getApplyObject(IContext context);
-
- boolean canApplyTo(Object o);
-
- ICreateFeature getCreateFeature(IFeatureProvider fp);
-
- IAddFeature getAddFeature(IFeatureProvider fp);
-
- IUpdateFeature getUpdateFeature(IFeatureProvider fp);
-
- IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp);
-
- ILayoutFeature getLayoutFeature(IFeatureProvider fp);
-
- IRemoveFeature getRemoveFeature(IFeatureProvider fp);
-
- IMoveShapeFeature getMoveFeature(IFeatureProvider fp);
-
- IResizeShapeFeature getResizeFeature(IFeatureProvider fp);
-
- IDeleteFeature getDeleteFeature(IFeatureProvider fp);
-
- ICustomFeature[] getCustomFeatures(IFeatureProvider fp);
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IRemoveFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+
+public interface FeatureContainer {
+
+ Object getApplyObject(IContext context);
+
+ boolean canApplyTo(Object o);
+
+ ICreateFeature getCreateFeature(IFeatureProvider fp);
+
+ IAddFeature getAddFeature(IFeatureProvider fp);
+
+ IUpdateFeature getUpdateFeature(IFeatureProvider fp);
+
+ IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp);
+
+ ILayoutFeature getLayoutFeature(IFeatureProvider fp);
+
+ IRemoveFeature getRemoveFeature(IFeatureProvider fp);
+
+ IMoveShapeFeature getMoveFeature(IFeatureProvider fp);
+
+ IResizeShapeFeature getResizeFeature(IFeatureProvider fp);
+
+ IDeleteFeature getDeleteFeature(IFeatureProvider fp);
+
+ ICustomFeature[] getCustomFeatures(IFeatureProvider fp);
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureResolver.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureResolver.java
index 2274fa5..d63b596 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureResolver.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/FeatureResolver.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-
-public interface FeatureResolver {
-
- List<ICreateConnectionFeature> getCreateConnectionFeatures(IFeatureProvider fp);
-
- List<ICreateFeature> getCreateFeatures(IFeatureProvider fp);
-
- IAddFeature getAddFeature(IFeatureProvider fp, BaseElement e);
-
- IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp, BaseElement e);
-
- ILayoutFeature getLayoutFeature(IFeatureProvider fp, BaseElement e);
-
- IUpdateFeature getUpdateFeature(IFeatureProvider fp, BaseElement e);
-
- IMoveShapeFeature getMoveFeature(IFeatureProvider fp, BaseElement e);
-
- IResizeShapeFeature getResizeFeature(IFeatureProvider fp, BaseElement e);
-
- IDeleteFeature getDeleteFeature(IFeatureProvider fp, BaseElement e);
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+
+public interface FeatureResolver {
+
+ List<ICreateConnectionFeature> getCreateConnectionFeatures(IFeatureProvider fp);
+
+ List<ICreateFeature> getCreateFeatures(IFeatureProvider fp);
+
+ IAddFeature getAddFeature(IFeatureProvider fp, BaseElement e);
+
+ IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp, BaseElement e);
+
+ ILayoutFeature getLayoutFeature(IFeatureProvider fp, BaseElement e);
+
+ IUpdateFeature getUpdateFeature(IFeatureProvider fp, BaseElement e);
+
+ IMoveShapeFeature getMoveFeature(IFeatureProvider fp, BaseElement e);
+
+ IResizeShapeFeature getResizeFeature(IFeatureProvider fp, BaseElement e);
+
+ IDeleteFeature getDeleteFeature(IFeatureProvider fp, BaseElement e);
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2AddFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2AddFeature.java
index ca7862f..b945b46 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2AddFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2AddFeature.java
@@ -1,12 +1,12 @@
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.context.IAddContext;
-
-public interface IBpmn2AddFeature<T extends EObject> {
-
- public T getBusinessObject(IAddContext context);
- public void putBusinessObject(IAddContext context, T businessObject);
- public void postExecute(IExecutionInfo executionInfo);
-}
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.context.IAddContext;
+
+public interface IBpmn2AddFeature<T extends EObject> {
+
+ public T getBusinessObject(IAddContext context);
+ public void putBusinessObject(IAddContext context, T businessObject);
+ public void postExecute(IExecutionInfo executionInfo);
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2CreateFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2CreateFeature.java
index a98872f..44e95d7 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2CreateFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/IBpmn2CreateFeature.java
@@ -1,15 +1,15 @@
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.context.IContext;
-
-public interface IBpmn2CreateFeature<T extends EObject, C extends IContext> {
-
- public T createBusinessObject(C context);
- public T getBusinessObject(C context);
- public void putBusinessObject(C context, T businessObject);
- public EClass getBusinessObjectClass();
- public void postExecute(IExecutionInfo executionInfo);
-}
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.context.IContext;
+
+public interface IBpmn2CreateFeature<T extends EObject, C extends IContext> {
+
+ public T createBusinessObject(C context);
+ public T getBusinessObject(C context);
+ public void putBusinessObject(C context, T businessObject);
+ public EClass getBusinessObjectClass();
+ public void postExecute(IExecutionInfo executionInfo);
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MoveFlowNodeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MoveFlowNodeFeature.java
index 3b51d2f..e9a1fe8 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MoveFlowNodeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MoveFlowNodeFeature.java
@@ -1,339 +1,339 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.FlowNode;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveFlowNodeFeature extends DefaultMoveBPMNShapeFeature {
-
- private final List<Algorithm> algorithms;
-
- private AlgorithmContainer algorithmContainer;
-
- public MoveFlowNodeFeature(IFeatureProvider fp) {
- super(fp);
- algorithms = new ArrayList<MoveFlowNodeFeature.Algorithm>();
- algorithms.add(new FromLaneAlgorithm());
- algorithms.add(new ToLaneAlgorithm());
- algorithms.add(new FromParticipantAlgorithm());
- algorithms.add(new ToParticipantAlgorithm());
- algorithms.add(new FromFlowElementsContainerAlgorithm());
- algorithms.add(new ToFlowElementsContainerAlgorithm());
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- if (!(getBusinessObjectForPictogramElement(context.getShape()) instanceof FlowNode)) {
- return false;
- }
-
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
-
- algorithmContainer = getAlgorithmContainer(context);
-
- if (algorithmContainer.isEmpty()) {
- return onMoveAlgorithmNotFound(context);
- }
-
- return algorithmContainer.isMoveAllowed(getSourceBo(context, handler), getTargetBo(context, handler));
- } catch (IOException e) {
- Activator.logError(e);
- }
-
- return false;
- }
-
- protected boolean onMoveAlgorithmNotFound(IMoveShapeContext context) {
- return super.canMoveShape(context);
- }
-
- @Override
- protected void postMoveShape(IMoveShapeContext context) {
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- Object[] node = getAllBusinessObjectsForPictogramElement(context.getShape());
- for (Object object : node) {
- if (object instanceof FlowNode && !algorithmContainer.isEmpty()) {
- algorithmContainer.move(((FlowNode) object), getSourceBo(context, handler),
- getTargetBo(context, handler));
- }
- }
- } catch (Exception e) {
- Activator.logError(e);
- }
- super.postMoveShape(context);
- }
-
- private Object getSourceBo(IMoveShapeContext context, ModelHandler handler) {
- if (context.getSourceContainer().equals(getDiagram()))
- return handler.getFlowElementContainer(context.getSourceContainer());
- return getBusinessObjectForPictogramElement(context.getSourceContainer());
- }
-
- private Object getTargetBo(IMoveShapeContext context, ModelHandler handler) {
- if (context.getTargetContainer().equals(getDiagram()))
- return handler.getFlowElementContainer(context.getTargetContainer());
- return getBusinessObjectForPictogramElement(context.getTargetContainer());
- }
-
- private boolean isSourceParticipant(IMoveShapeContext context) {
- Object bo = getBusinessObjectForPictogramElement(context.getSourceContainer());
- return context.getSourceContainer().equals(getDiagram()) || (bo != null && bo instanceof Participant);
- }
-
- private boolean isSourceLane(IMoveShapeContext context) {
- Object bo = getBusinessObjectForPictogramElement(context.getSourceContainer());
- return bo != null && bo instanceof Lane;
- }
-
- class AlgorithmContainer {
- public Algorithm fromAlgorithm;
- public Algorithm toAlgorithm;
-
- public AlgorithmContainer(Algorithm fromAlgorithm, Algorithm toAlgorithm) {
- this.fromAlgorithm = fromAlgorithm;
- this.toAlgorithm = toAlgorithm;
- }
-
- boolean isMoveAllowed(Object source, Object target) {
- return fromAlgorithm.isMoveAllowed(source, target) && toAlgorithm.isMoveAllowed(source, target);
- }
-
- void move(FlowNode node, Object source, Object target) {
- fromAlgorithm.move(node, source, target);
- toAlgorithm.move(node, source, target);
- }
-
- boolean isEmpty() {
- return fromAlgorithm == null || toAlgorithm == null;
- }
- }
-
- private AlgorithmContainer getAlgorithmContainer(IMoveShapeContext context) {
- Algorithm fromAlgorithm = null;
- Algorithm toAlgorithm = null;
-
- for (Algorithm a : algorithms) {
- if (a.canApplyTo(context)) {
- switch (a.getType()) {
- case Algorithm.TYPE_FROM:
- fromAlgorithm = a;
- break;
- case Algorithm.TYPE_TO:
- toAlgorithm = a;
- break;
- }
- }
- }
-
- return new AlgorithmContainer(fromAlgorithm, toAlgorithm);
- }
-
- interface Algorithm {
-
- int TYPE_FROM = 0;
-
- int TYPE_TO = 1;
-
- int getType();
-
- boolean canApplyTo(IMoveShapeContext context);
-
- boolean isMoveAllowed(Object source, Object target);
-
- void move(FlowNode node, Object source, Object target);
- }
-
- abstract class DefaultAlgorithm implements Algorithm {
-
- @Override
- public boolean isMoveAllowed(Object source, Object target) {
- return true;
- }
-
- @Override
- public void move(FlowNode node, Object source, Object target) {
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- handler.moveFlowNode(node, source, target);
- } catch (IOException e) {
- Activator.logError(e);
- }
- }
- }
-
- class FromLaneAlgorithm extends DefaultAlgorithm {
-
- @Override
- public int getType() {
- return TYPE_FROM;
- }
-
- @Override
- public boolean canApplyTo(IMoveShapeContext context) {
- return isSourceLane(context);
- }
-
- @Override
- public void move(FlowNode node, Object source, Object target) {
- Lane lane = (Lane) source;
- lane.getFlowNodeRefs().remove(node);
- node.getLanes().remove(lane);
- }
- }
-
- class ToLaneAlgorithm extends DefaultAlgorithm {
-
- @Override
- public int getType() {
- return TYPE_TO;
- }
-
- @Override
- public boolean canApplyTo(IMoveShapeContext context) {
- return FeatureSupport.isTargetLane(context);
- }
-
- @Override
- public boolean isMoveAllowed(Object source, Object target) {
- Lane lane = (Lane) target;
- return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
- }
-
- @Override
- public void move(FlowNode node, Object source, Object target) {
- Lane lane = (Lane) target;
- lane.getFlowNodeRefs().add(node);
- node.getLanes().add(lane);
- super.move(node, source, target);
- }
- }
-
- class FromParticipantAlgorithm extends DefaultAlgorithm {
-
- @Override
- public int getType() {
- return TYPE_FROM;
- }
-
- @Override
- public boolean canApplyTo(IMoveShapeContext context) {
- return isSourceParticipant(context);
- }
-
- @Override
- public void move(FlowNode node, Object source, Object target) {
- // DO NOTHING HERE
- }
- }
-
- class ToParticipantAlgorithm extends DefaultAlgorithm {
-
- @Override
- public int getType() {
- return TYPE_TO;
- }
-
- @Override
- public boolean canApplyTo(IMoveShapeContext context) {
- return context.getTargetContainer().equals(getDiagram()) || FeatureSupport.isTargetParticipant(context);
- }
-
- @Override
- public boolean isMoveAllowed(Object source, Object target) {
- try {
- if (source==target)
- return true;
- if (target instanceof Participant) {
- Participant p = (Participant) target;
- if (p.equals(ModelHandler.getInstance(getDiagram()).getInternalParticipant())) {
- return true;
- }
- if (p.getProcessRef() == null) {
- return true;
- }
- if (p.getProcessRef().getLaneSets().isEmpty()) {
- return true;
- }
- }
- else if (target instanceof FlowElementsContainer) {
- FlowElementsContainer p = (FlowElementsContainer) target;
- if (p.getLaneSets().isEmpty()) {
- return true;
- }
- }
- } catch (Exception e) {
- Activator.logError(e);
- }
- return false;
- }
-
- @Override
- public void move(FlowNode node, Object source, Object target) {
- try {
- if (ModelHandler.getInstance(node).getInternalParticipant() == null){ // this is not a collaboration, don't move
- return;
- }else{
- super.move(node, source, target);
- }
- } catch (IOException e) {
- Activator.logError(e);
- }
- }
- }
-
- class FromFlowElementsContainerAlgorithm extends DefaultAlgorithm {
-
- @Override
- public int getType() {
- return TYPE_FROM;
- }
-
- @Override
- public boolean canApplyTo(IMoveShapeContext context) {
- Object bo = getBusinessObjectForPictogramElement(context.getSourceContainer());
- return bo != null && bo instanceof FlowElementsContainer;
- }
-
- @Override
- public void move(FlowNode node, Object source, Object target) {
- }
- }
-
- class ToFlowElementsContainerAlgorithm extends DefaultAlgorithm {
-
- @Override
- public int getType() {
- return TYPE_TO;
- }
-
- @Override
- public boolean canApplyTo(IMoveShapeContext context) {
- Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
- return bo != null && bo instanceof FlowElementsContainer;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.FlowElementsContainer;
+import org.eclipse.bpmn2.FlowNode;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveFlowNodeFeature extends DefaultMoveBPMNShapeFeature {
+
+ private final List<Algorithm> algorithms;
+
+ private AlgorithmContainer algorithmContainer;
+
+ public MoveFlowNodeFeature(IFeatureProvider fp) {
+ super(fp);
+ algorithms = new ArrayList<MoveFlowNodeFeature.Algorithm>();
+ algorithms.add(new FromLaneAlgorithm());
+ algorithms.add(new ToLaneAlgorithm());
+ algorithms.add(new FromParticipantAlgorithm());
+ algorithms.add(new ToParticipantAlgorithm());
+ algorithms.add(new FromFlowElementsContainerAlgorithm());
+ algorithms.add(new ToFlowElementsContainerAlgorithm());
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ if (!(getBusinessObjectForPictogramElement(context.getShape()) instanceof FlowNode)) {
+ return false;
+ }
+
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+
+ algorithmContainer = getAlgorithmContainer(context);
+
+ if (algorithmContainer.isEmpty()) {
+ return onMoveAlgorithmNotFound(context);
+ }
+
+ return algorithmContainer.isMoveAllowed(getSourceBo(context, handler), getTargetBo(context, handler));
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+
+ return false;
+ }
+
+ protected boolean onMoveAlgorithmNotFound(IMoveShapeContext context) {
+ return super.canMoveShape(context);
+ }
+
+ @Override
+ protected void postMoveShape(IMoveShapeContext context) {
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ Object[] node = getAllBusinessObjectsForPictogramElement(context.getShape());
+ for (Object object : node) {
+ if (object instanceof FlowNode && !algorithmContainer.isEmpty()) {
+ algorithmContainer.move(((FlowNode) object), getSourceBo(context, handler),
+ getTargetBo(context, handler));
+ }
+ }
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ super.postMoveShape(context);
+ }
+
+ private Object getSourceBo(IMoveShapeContext context, ModelHandler handler) {
+ if (context.getSourceContainer().equals(getDiagram()))
+ return handler.getFlowElementContainer(context.getSourceContainer());
+ return getBusinessObjectForPictogramElement(context.getSourceContainer());
+ }
+
+ private Object getTargetBo(IMoveShapeContext context, ModelHandler handler) {
+ if (context.getTargetContainer().equals(getDiagram()))
+ return handler.getFlowElementContainer(context.getTargetContainer());
+ return getBusinessObjectForPictogramElement(context.getTargetContainer());
+ }
+
+ private boolean isSourceParticipant(IMoveShapeContext context) {
+ Object bo = getBusinessObjectForPictogramElement(context.getSourceContainer());
+ return context.getSourceContainer().equals(getDiagram()) || (bo != null && bo instanceof Participant);
+ }
+
+ private boolean isSourceLane(IMoveShapeContext context) {
+ Object bo = getBusinessObjectForPictogramElement(context.getSourceContainer());
+ return bo != null && bo instanceof Lane;
+ }
+
+ class AlgorithmContainer {
+ public Algorithm fromAlgorithm;
+ public Algorithm toAlgorithm;
+
+ public AlgorithmContainer(Algorithm fromAlgorithm, Algorithm toAlgorithm) {
+ this.fromAlgorithm = fromAlgorithm;
+ this.toAlgorithm = toAlgorithm;
+ }
+
+ boolean isMoveAllowed(Object source, Object target) {
+ return fromAlgorithm.isMoveAllowed(source, target) && toAlgorithm.isMoveAllowed(source, target);
+ }
+
+ void move(FlowNode node, Object source, Object target) {
+ fromAlgorithm.move(node, source, target);
+ toAlgorithm.move(node, source, target);
+ }
+
+ boolean isEmpty() {
+ return fromAlgorithm == null || toAlgorithm == null;
+ }
+ }
+
+ private AlgorithmContainer getAlgorithmContainer(IMoveShapeContext context) {
+ Algorithm fromAlgorithm = null;
+ Algorithm toAlgorithm = null;
+
+ for (Algorithm a : algorithms) {
+ if (a.canApplyTo(context)) {
+ switch (a.getType()) {
+ case Algorithm.TYPE_FROM:
+ fromAlgorithm = a;
+ break;
+ case Algorithm.TYPE_TO:
+ toAlgorithm = a;
+ break;
+ }
+ }
+ }
+
+ return new AlgorithmContainer(fromAlgorithm, toAlgorithm);
+ }
+
+ interface Algorithm {
+
+ int TYPE_FROM = 0;
+
+ int TYPE_TO = 1;
+
+ int getType();
+
+ boolean canApplyTo(IMoveShapeContext context);
+
+ boolean isMoveAllowed(Object source, Object target);
+
+ void move(FlowNode node, Object source, Object target);
+ }
+
+ abstract class DefaultAlgorithm implements Algorithm {
+
+ @Override
+ public boolean isMoveAllowed(Object source, Object target) {
+ return true;
+ }
+
+ @Override
+ public void move(FlowNode node, Object source, Object target) {
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ handler.moveFlowNode(node, source, target);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+ }
+ }
+
+ class FromLaneAlgorithm extends DefaultAlgorithm {
+
+ @Override
+ public int getType() {
+ return TYPE_FROM;
+ }
+
+ @Override
+ public boolean canApplyTo(IMoveShapeContext context) {
+ return isSourceLane(context);
+ }
+
+ @Override
+ public void move(FlowNode node, Object source, Object target) {
+ Lane lane = (Lane) source;
+ lane.getFlowNodeRefs().remove(node);
+ node.getLanes().remove(lane);
+ }
+ }
+
+ class ToLaneAlgorithm extends DefaultAlgorithm {
+
+ @Override
+ public int getType() {
+ return TYPE_TO;
+ }
+
+ @Override
+ public boolean canApplyTo(IMoveShapeContext context) {
+ return FeatureSupport.isTargetLane(context);
+ }
+
+ @Override
+ public boolean isMoveAllowed(Object source, Object target) {
+ Lane lane = (Lane) target;
+ return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
+ }
+
+ @Override
+ public void move(FlowNode node, Object source, Object target) {
+ Lane lane = (Lane) target;
+ lane.getFlowNodeRefs().add(node);
+ node.getLanes().add(lane);
+ super.move(node, source, target);
+ }
+ }
+
+ class FromParticipantAlgorithm extends DefaultAlgorithm {
+
+ @Override
+ public int getType() {
+ return TYPE_FROM;
+ }
+
+ @Override
+ public boolean canApplyTo(IMoveShapeContext context) {
+ return isSourceParticipant(context);
+ }
+
+ @Override
+ public void move(FlowNode node, Object source, Object target) {
+ // DO NOTHING HERE
+ }
+ }
+
+ class ToParticipantAlgorithm extends DefaultAlgorithm {
+
+ @Override
+ public int getType() {
+ return TYPE_TO;
+ }
+
+ @Override
+ public boolean canApplyTo(IMoveShapeContext context) {
+ return context.getTargetContainer().equals(getDiagram()) || FeatureSupport.isTargetParticipant(context);
+ }
+
+ @Override
+ public boolean isMoveAllowed(Object source, Object target) {
+ try {
+ if (source==target)
+ return true;
+ if (target instanceof Participant) {
+ Participant p = (Participant) target;
+ if (p.equals(ModelHandler.getInstance(getDiagram()).getInternalParticipant())) {
+ return true;
+ }
+ if (p.getProcessRef() == null) {
+ return true;
+ }
+ if (p.getProcessRef().getLaneSets().isEmpty()) {
+ return true;
+ }
+ }
+ else if (target instanceof FlowElementsContainer) {
+ FlowElementsContainer p = (FlowElementsContainer) target;
+ if (p.getLaneSets().isEmpty()) {
+ return true;
+ }
+ }
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ return false;
+ }
+
+ @Override
+ public void move(FlowNode node, Object source, Object target) {
+ try {
+ if (ModelHandler.getInstance(node).getInternalParticipant() == null){ // this is not a collaboration, don't move
+ return;
+ }else{
+ super.move(node, source, target);
+ }
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+ }
+ }
+
+ class FromFlowElementsContainerAlgorithm extends DefaultAlgorithm {
+
+ @Override
+ public int getType() {
+ return TYPE_FROM;
+ }
+
+ @Override
+ public boolean canApplyTo(IMoveShapeContext context) {
+ Object bo = getBusinessObjectForPictogramElement(context.getSourceContainer());
+ return bo != null && bo instanceof FlowElementsContainer;
+ }
+
+ @Override
+ public void move(FlowNode node, Object source, Object target) {
+ }
+ }
+
+ class ToFlowElementsContainerAlgorithm extends DefaultAlgorithm {
+
+ @Override
+ public int getType() {
+ return TYPE_TO;
+ }
+
+ @Override
+ public boolean canApplyTo(IMoveShapeContext context) {
+ Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
+ return bo != null && bo instanceof FlowElementsContainer;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MultiUpdateFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MultiUpdateFeature.java
index d1e469e..016b404 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MultiUpdateFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/MultiUpdateFeature.java
@@ -1,71 +1,71 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-
-public class MultiUpdateFeature extends AbstractUpdateFeature {
-
- protected List<IUpdateFeature> features = new ArrayList<IUpdateFeature>();
-
- public MultiUpdateFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- for (IUpdateFeature p : features) {
- if (p.canUpdate(context)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- for (IUpdateFeature p : features) {
- if (p.updateNeeded(context).toBoolean()) {
- return Reason.createTrueReason();
- }
- }
- return Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- boolean updated = false;
-
- for (IUpdateFeature p : features) {
- if (p.updateNeeded(context).toBoolean() && p.update(context)) {
- updated = true;
- }
- }
-
- return updated;
- }
-
- public void addUpdateFeature(IUpdateFeature feature) {
- if (feature != null) {
- features.add(feature);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+
+public class MultiUpdateFeature extends AbstractUpdateFeature {
+
+ protected List<IUpdateFeature> features = new ArrayList<IUpdateFeature>();
+
+ public MultiUpdateFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ for (IUpdateFeature p : features) {
+ if (p.canUpdate(context)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ for (IUpdateFeature p : features) {
+ if (p.updateNeeded(context).toBoolean()) {
+ return Reason.createTrueReason();
+ }
+ }
+ return Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ boolean updated = false;
+
+ for (IUpdateFeature p : features) {
+ if (p.updateNeeded(context).toBoolean() && p.update(context)) {
+ updated = true;
+ }
+ }
+
+ return updated;
+ }
+
+ public void addUpdateFeature(IUpdateFeature feature) {
+ if (feature != null) {
+ features.add(feature);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/PropertyBasedFeatureContainer.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/PropertyBasedFeatureContainer.java
index 1555c9b..595c6de 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/PropertyBasedFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/PropertyBasedFeatureContainer.java
@@ -1,58 +1,58 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.PropertyContainer;
-import org.eclipse.graphiti.services.Graphiti;
-
-public abstract class PropertyBasedFeatureContainer implements FeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context instanceof IPictogramElementContext) {
- return ((IPictogramElementContext) context).getPictogramElement();
- }
- return null;
- }
-
- @Override
- public boolean canApplyTo(Object o) {
- if (!(o instanceof PropertyContainer)) {
- return false;
- }
- String property = Graphiti.getPeService().getPropertyValue((PropertyContainer) o, getPropertyKey());
- if (property == null) {
- return false;
- }
- return canApplyToProperty(property);
- }
-
- protected abstract String getPropertyKey();
-
- protected abstract boolean canApplyToProperty(String value);
-
- @Override
- public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IRemoveFeature;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.PropertyContainer;
+import org.eclipse.graphiti.services.Graphiti;
+
+public abstract class PropertyBasedFeatureContainer implements FeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context instanceof IPictogramElementContext) {
+ return ((IPictogramElementContext) context).getPictogramElement();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ if (!(o instanceof PropertyContainer)) {
+ return false;
+ }
+ String property = Graphiti.getPeService().getPropertyValue((PropertyContainer) o, getPropertyKey());
+ if (property == null) {
+ return false;
+ }
+ return canApplyToProperty(property);
+ }
+
+ protected abstract String getPropertyKey();
+
+ protected abstract boolean canApplyToProperty(String value);
+
+ @Override
+ public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ReconnectBaseElementFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ReconnectBaseElementFeature.java
index 588d153..423f949 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ReconnectBaseElementFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ReconnectBaseElementFeature.java
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IReconnectionContext;
-import org.eclipse.graphiti.features.context.impl.ReconnectionContext;
-import org.eclipse.graphiti.features.impl.DefaultReconnectionFeature;
-
-public class ReconnectBaseElementFeature extends DefaultReconnectionFeature {
-
- public ReconnectBaseElementFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canReconnect(IReconnectionContext context) {
- // TODO Auto-generated method stub
- return super.canReconnect(context);
- }
-
- @Override
- public void preReconnect(IReconnectionContext context) {
- // TODO Auto-generated method stub
- super.preReconnect(context);
- }
-
- @Override
- public void postReconnect(IReconnectionContext context) {
- super.postReconnect(context);
-
- BPMNEdge edge = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BPMNEdge.class);
- DiagramElement de = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), DiagramElement.class);
- if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
- edge.setTargetElement(de);
- }
- else {
- edge.setSourceElement(de);
- }
-
- BaseElement flow = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BaseElement.class);
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
- if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
- EStructuralFeature feature = flow.eClass().getEStructuralFeature("targetRef");
- if (feature!=null)
- flow.eSet(feature, be);
- }
- else {
- EStructuralFeature feature = flow.eClass().getEStructuralFeature("sourceRef");
- if (feature!=null)
- flow.eSet(feature, be);
- }
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IReconnectionContext;
+import org.eclipse.graphiti.features.context.impl.ReconnectionContext;
+import org.eclipse.graphiti.features.impl.DefaultReconnectionFeature;
+
+public class ReconnectBaseElementFeature extends DefaultReconnectionFeature {
+
+ public ReconnectBaseElementFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canReconnect(IReconnectionContext context) {
+ // TODO Auto-generated method stub
+ return super.canReconnect(context);
+ }
+
+ @Override
+ public void preReconnect(IReconnectionContext context) {
+ // TODO Auto-generated method stub
+ super.preReconnect(context);
+ }
+
+ @Override
+ public void postReconnect(IReconnectionContext context) {
+ super.postReconnect(context);
+
+ BPMNEdge edge = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BPMNEdge.class);
+ DiagramElement de = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), DiagramElement.class);
+ if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
+ edge.setTargetElement(de);
+ }
+ else {
+ edge.setSourceElement(de);
+ }
+
+ BaseElement flow = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BaseElement.class);
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
+ if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
+ EStructuralFeature feature = flow.eClass().getEStructuralFeature("targetRef");
+ if (feature!=null)
+ flow.eSet(feature, be);
+ }
+ else {
+ EStructuralFeature feature = flow.eClass().getEStructuralFeature("sourceRef");
+ if (feature!=null)
+ flow.eSet(feature, be);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/UpdateBaseElementNameFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/UpdateBaseElementNameFeature.java
index 262123b..3103a89 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/UpdateBaseElementNameFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/UpdateBaseElementNameFeature.java
@@ -1,128 +1,128 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features;
-
-import static org.eclipse.bpmn2.modeler.core.utils.FeatureSupport.getChildElementOfType;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.AbstractText;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class UpdateBaseElementNameFeature extends AbstractUpdateFeature {
-
- public static final String TEXT_ELEMENT = "baseelement.text";
-
- public UpdateBaseElementNameFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- BaseElement.class);
- if (element == null) {
- return false;
- }
- return ModelUtil.hasName(element);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- PictogramElement container = context.getPictogramElement();
-
- BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(container,
- BaseElement.class);
-
- Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
- if (textShape!=null) {
- String oldLabel = ModelUtil.getName(element);
- if (oldLabel==null || oldLabel.isEmpty())
- oldLabel = "";
- String newLabel = "";
- if (textShape.getGraphicsAlgorithm() instanceof AbstractText) {
- AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
- newLabel = text.getValue();
- }
- if (newLabel==null || newLabel.isEmpty())
- newLabel = "";
-
- return oldLabel.equals(newLabel) ? Reason.createFalseReason() : Reason.createTrueReason();
- }
- return Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- PictogramElement pe = (PictogramElement) context.getPictogramElement();
- BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- BaseElement.class);
- Shape textShape = getChildElementOfType(pe, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
- if (textShape!=null) {
- AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
- String name = ModelUtil.getName(element);
- if (name == null) {
- name = "";
- }
- text.setValue(name);
- layoutPictogramElement(context.getPictogramElement());
-
- }
-
- if (pe instanceof ContainerShape) {
- IGaService gaService = Graphiti.getGaService();
- ContainerShape container = (ContainerShape)pe;
-
- Shape shape = container.getChildren().get(0); // Otherwise, this would never be reached!
- if (!(shape.getGraphicsAlgorithm() instanceof AbstractText))
- return true;
-
- GraphicsAlgorithm textGA = container.getGraphicsAlgorithm();
- AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
-
- int oldWidth = textGA.getWidth() - GraphicsUtil.SHAPE_PADDING;
- int x = textGA.getX() + ((oldWidth + GraphicsUtil.SHAPE_PADDING) / 2);
- int y = textGA.getY();
-
- BaseElement o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
- String name = ModelUtil.getName(o);
-
- if (name == null) {
- gaService.setLocationAndSize(textGA, x, y, 0, 0);
- gaService.setLocationAndSize(text, 0, 0, 0, 0);
- container.setVisible(false);
- } else {
- int newWidth = GraphicsUtil.getLabelWidth(text);
- int newHeight = GraphicsUtil.getLabelHeight(text);
- x = x - ((newWidth + GraphicsUtil.SHAPE_PADDING) / 2);
- gaService.setLocationAndSize(textGA, x, y, newWidth + GraphicsUtil.SHAPE_PADDING, newHeight + GraphicsUtil.SHAPE_PADDING);
- gaService.setLocationAndSize(text, 0, 0, newWidth + GraphicsUtil.TEXT_PADDING, newHeight + GraphicsUtil.TEXT_PADDING);
- container.setVisible(true);
- }
- }
-
- return true;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features;
+
+import static org.eclipse.bpmn2.modeler.core.utils.FeatureSupport.getChildElementOfType;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.AbstractText;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class UpdateBaseElementNameFeature extends AbstractUpdateFeature {
+
+ public static final String TEXT_ELEMENT = "baseelement.text";
+
+ public UpdateBaseElementNameFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ BaseElement.class);
+ if (element == null) {
+ return false;
+ }
+ return ModelUtil.hasName(element);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ PictogramElement container = context.getPictogramElement();
+
+ BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(container,
+ BaseElement.class);
+
+ Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
+ if (textShape!=null) {
+ String oldLabel = ModelUtil.getName(element);
+ if (oldLabel==null || oldLabel.isEmpty())
+ oldLabel = "";
+ String newLabel = "";
+ if (textShape.getGraphicsAlgorithm() instanceof AbstractText) {
+ AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
+ newLabel = text.getValue();
+ }
+ if (newLabel==null || newLabel.isEmpty())
+ newLabel = "";
+
+ return oldLabel.equals(newLabel) ? Reason.createFalseReason() : Reason.createTrueReason();
+ }
+ return Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ PictogramElement pe = (PictogramElement) context.getPictogramElement();
+ BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ BaseElement.class);
+ Shape textShape = getChildElementOfType(pe, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
+ if (textShape!=null) {
+ AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
+ String name = ModelUtil.getName(element);
+ if (name == null) {
+ name = "";
+ }
+ text.setValue(name);
+ layoutPictogramElement(context.getPictogramElement());
+
+ }
+
+ if (pe instanceof ContainerShape) {
+ IGaService gaService = Graphiti.getGaService();
+ ContainerShape container = (ContainerShape)pe;
+
+ Shape shape = container.getChildren().get(0); // Otherwise, this would never be reached!
+ if (!(shape.getGraphicsAlgorithm() instanceof AbstractText))
+ return true;
+
+ GraphicsAlgorithm textGA = container.getGraphicsAlgorithm();
+ AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
+
+ int oldWidth = textGA.getWidth() - GraphicsUtil.SHAPE_PADDING;
+ int x = textGA.getX() + ((oldWidth + GraphicsUtil.SHAPE_PADDING) / 2);
+ int y = textGA.getY();
+
+ BaseElement o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
+ String name = ModelUtil.getName(o);
+
+ if (name == null) {
+ gaService.setLocationAndSize(textGA, x, y, 0, 0);
+ gaService.setLocationAndSize(text, 0, 0, 0, 0);
+ container.setVisible(false);
+ } else {
+ int newWidth = GraphicsUtil.getLabelWidth(text);
+ int newHeight = GraphicsUtil.getLabelHeight(text);
+ x = x - ((newWidth + GraphicsUtil.SHAPE_PADDING) / 2);
+ gaService.setLocationAndSize(textGA, x, y, newWidth + GraphicsUtil.SHAPE_PADDING, newHeight + GraphicsUtil.SHAPE_PADDING);
+ gaService.setLocationAndSize(text, 0, 0, newWidth + GraphicsUtil.TEXT_PADDING, newHeight + GraphicsUtil.TEXT_PADDING);
+ container.setVisible(true);
+ }
+ }
+
+ return true;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractCreateExpandableFlowNodeFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractCreateExpandableFlowNodeFeature.java
index dbba899..3efd4da 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractCreateExpandableFlowNodeFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractCreateExpandableFlowNodeFeature.java
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity;
-
-import org.eclipse.bpmn2.FlowNode;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-
-public abstract class AbstractCreateExpandableFlowNodeFeature<T extends FlowNode> extends
- AbstractCreateFlowElementFeature<T> {
-
- public AbstractCreateExpandableFlowNodeFeature(IFeatureProvider fp, String name,
- String description) {
- super(fp, name, description);
- }
-
- @Override
- public Object[] create(ICreateContext context) {
- Object[] elems = super.create(context);
- try {
-
- BPMNShape shape = (BPMNShape) ModelHandlerLocator.getModelHandler(getDiagram().eResource()).findDIElement((T)elems[0]);
-
- // if the Activity is expandable, set "isExpanded" to true because
- // this feature will always create an expanded BPMNShape.
-// EStructuralFeature feature = ((EObject)shape).eClass().getEStructuralFeature("isExpanded");
-// if (feature!=null)
-// shape.eSet(feature, Boolean.TRUE);
-
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return elems;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity;
+
+import org.eclipse.bpmn2.FlowNode;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+
+public abstract class AbstractCreateExpandableFlowNodeFeature<T extends FlowNode> extends
+ AbstractCreateFlowElementFeature<T> {
+
+ public AbstractCreateExpandableFlowNodeFeature(IFeatureProvider fp, String name,
+ String description) {
+ super(fp, name, description);
+ }
+
+ @Override
+ public Object[] create(ICreateContext context) {
+ Object[] elems = super.create(context);
+ try {
+
+ BPMNShape shape = (BPMNShape) ModelHandlerLocator.getModelHandler(getDiagram().eResource()).findDIElement((T)elems[0]);
+
+ // if the Activity is expandable, set "isExpanded" to true because
+ // this feature will always create an expanded BPMNShape.
+// EStructuralFeature feature = ((EObject)shape).eClass().getEStructuralFeature("isExpanded");
+// if (feature!=null)
+// shape.eSet(feature, Boolean.TRUE);
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return elems;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/ActivitySelectionBehavior.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/ActivitySelectionBehavior.java
index 9462246..63118bd 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/ActivitySelectionBehavior.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/ActivitySelectionBehavior.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class ActivitySelectionBehavior {
-
- public static boolean canApplyTo(PictogramElement element) {
- if (element.getLink() == null || !(element instanceof ContainerShape)) {
- return false;
- }
-
- EList<EObject> objects = element.getLink().getBusinessObjects();
-
- for (EObject eObject : objects) {
- if (eObject instanceof Activity) {
- return true;
- }
- }
-
- return false;
- }
-
- public static GraphicsAlgorithm[] getClickArea(PictogramElement element) {
- Iterator<PictogramElement> iterator = Graphiti.getPeService().getPictogramElementChildren(element).iterator();
- GraphicsAlgorithm[] algorithms = new GraphicsAlgorithm[2];
- algorithms[0] = iterator.next().getGraphicsAlgorithm();
- algorithms[1] = iterator.next().getGraphicsAlgorithm();
- return algorithms;
- }
-
- public static GraphicsAlgorithm getSelectionBorder(PictogramElement element) {
- Collection<PictogramElement> children = Graphiti.getPeService().getPictogramElementChildren(element);
- PictogramElement first = children.iterator().next();
- return first.getGraphicsAlgorithm();
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class ActivitySelectionBehavior {
+
+ public static boolean canApplyTo(PictogramElement element) {
+ if (element.getLink() == null || !(element instanceof ContainerShape)) {
+ return false;
+ }
+
+ EList<EObject> objects = element.getLink().getBusinessObjects();
+
+ for (EObject eObject : objects) {
+ if (eObject instanceof Activity) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static GraphicsAlgorithm[] getClickArea(PictogramElement element) {
+ Iterator<PictogramElement> iterator = Graphiti.getPeService().getPictogramElementChildren(element).iterator();
+ GraphicsAlgorithm[] algorithms = new GraphicsAlgorithm[2];
+ algorithms[0] = iterator.next().getGraphicsAlgorithm();
+ algorithms[1] = iterator.next().getGraphicsAlgorithm();
+ return algorithms;
+ }
+
+ public static GraphicsAlgorithm getSelectionBorder(PictogramElement element) {
+ Collection<PictogramElement> children = Graphiti.getPeService().getPictogramElementChildren(element);
+ PictogramElement first = children.iterator().next();
+ return first.getGraphicsAlgorithm();
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/MoveActivityFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/MoveActivityFeature.java
index 0f5262d..8b6289b 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/MoveActivityFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/MoveActivityFeature.java
@@ -1,131 +1,131 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractBoundaryEventOperation;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.context.impl.MoveShapeContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeLayoutService;
-
-public class MoveActivityFeature extends MoveFlowNodeFeature {
-
- public static final String ACTIVITY_MOVE_PROPERTY = "activity.move";
- public static final String SELECTION_MOVE_PROPERTY = "selection.move";
-
- public MoveActivityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected void preMoveShape(IMoveShapeContext context) {
- MoveShapeContext msc = (MoveShapeContext)context;
- ContainerShape oldContainer = context.getSourceContainer();
- ContainerShape newContainer = context.getTargetContainer();
- IPeLayoutService peLayoutService = Graphiti.getPeLayoutService();
-// Shape shape = context.getShape();
-// ILocation loc = peService.getLocationRelativeToDiagram(shape);
- ILocation oldLoc = peLayoutService.getLocationRelativeToDiagram(oldContainer);
- ILocation newLoc = peLayoutService.getLocationRelativeToDiagram(newContainer);
-// System.out.println(
-// (oldContainer==newContainer ? "inside:\n" : "outside:\n")+
-// "oldContainer:\n" +
-// " x="+oldLoc.getX()+"\n"+
-// " y="+oldLoc.getY()+"\n"+
-// "newContainer:\n" +
-// " x="+newLoc.getX()+"\n"+
-// " y="+newLoc.getY()+"\n"+
-// "shape:\n" +
-// " rel x="+shape.getGraphicsAlgorithm().getX()+"\n"+
-// " rel y="+shape.getGraphicsAlgorithm().getY()+"\n"+
-// " abs x="+loc.getX()+"\n"+
-// " abs y="+loc.getY()+"\n"+
-// "context:\n" +
-// " x="+msc.getX()+"\n"+
-// " y="+msc.getY()+"\n"+
-// " deltaX="+msc.getDeltaX()+"\n"+
-// " deltaY="+msc.getDeltaY()+"\n"+
-// "\n"
-// );
-
- if (oldContainer!=newContainer) {
- int x = newLoc.getX() + msc.getX() - oldLoc.getX();
- int y = newLoc.getY() + msc.getY() - oldLoc.getY();
- int deltaX = newLoc.getX() + msc.getDeltaX() - oldLoc.getX();
- int deltaY = newLoc.getY() + msc.getDeltaY() - oldLoc.getY();
-
-// System.out.println(
-// "new context:\n"+
-// " x="+( newLoc.getX() + msc.getX() - oldLoc.getX() )+"\n"+
-// " y="+msc.getY()+"\n"+
-// " deltaX="+( newLoc.getX() + msc.getDeltaX() - oldLoc.getX() )+"\n"+
-// " deltaY="+msc.getDeltaY()+"\n"+
-// "\n"
-// );
-
-// msc.setX(x);
-// msc.setY(y);
-// msc.setDeltaX(deltaX);
-// msc.setDeltaY(deltaY);
-// msc.setTargetContainer(oldContainer);
- }
-
- super.preMoveShape(context);
- }
-
- @Override
- protected void postMoveShape(final IMoveShapeContext context) {
- super.postMoveShape(context);
- PictogramElement containerShape = context.getPictogramElement();
- Activity activity = BusinessObjectUtil.getFirstElementOfType(containerShape, Activity.class);
- Graphiti.getPeService().sendToFront(context.getShape());
-
- new AbstractBoundaryEventOperation() {
- @Override
- protected void doWorkInternal(ContainerShape container) {
- GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
-
- MoveShapeContext newContext = new MoveShapeContext(container);
- newContext.setDeltaX(context.getDeltaX());
- newContext.setDeltaY(context.getDeltaY());
- newContext.setSourceContainer(context.getSourceContainer());
- newContext.setTargetContainer(context.getTargetContainer());
- newContext.setTargetConnection(context.getTargetConnection());
- newContext.setLocation(ga.getX(), ga.getY());
- newContext.putProperty(ACTIVITY_MOVE_PROPERTY, true);
-
- IMoveShapeFeature moveFeature = getFeatureProvider().getMoveShapeFeature(newContext);
- if (moveFeature.canMoveShape(newContext)) {
- moveFeature.moveShape(newContext);
- }
- }
- }.doWork(activity, getDiagram());
-
- if (containerShape.eContainer() instanceof ContainerShape) {
- PictogramElement pe = (PictogramElement) containerShape.eContainer();
- if (BusinessObjectUtil.containsElementOfType(pe, SubProcess.class)) {
- layoutPictogramElement(pe);
- }
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractBoundaryEventOperation;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.context.impl.MoveShapeContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeLayoutService;
+
+public class MoveActivityFeature extends MoveFlowNodeFeature {
+
+ public static final String ACTIVITY_MOVE_PROPERTY = "activity.move";
+ public static final String SELECTION_MOVE_PROPERTY = "selection.move";
+
+ public MoveActivityFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected void preMoveShape(IMoveShapeContext context) {
+ MoveShapeContext msc = (MoveShapeContext)context;
+ ContainerShape oldContainer = context.getSourceContainer();
+ ContainerShape newContainer = context.getTargetContainer();
+ IPeLayoutService peLayoutService = Graphiti.getPeLayoutService();
+// Shape shape = context.getShape();
+// ILocation loc = peService.getLocationRelativeToDiagram(shape);
+ ILocation oldLoc = peLayoutService.getLocationRelativeToDiagram(oldContainer);
+ ILocation newLoc = peLayoutService.getLocationRelativeToDiagram(newContainer);
+// System.out.println(
+// (oldContainer==newContainer ? "inside:\n" : "outside:\n")+
+// "oldContainer:\n" +
+// " x="+oldLoc.getX()+"\n"+
+// " y="+oldLoc.getY()+"\n"+
+// "newContainer:\n" +
+// " x="+newLoc.getX()+"\n"+
+// " y="+newLoc.getY()+"\n"+
+// "shape:\n" +
+// " rel x="+shape.getGraphicsAlgorithm().getX()+"\n"+
+// " rel y="+shape.getGraphicsAlgorithm().getY()+"\n"+
+// " abs x="+loc.getX()+"\n"+
+// " abs y="+loc.getY()+"\n"+
+// "context:\n" +
+// " x="+msc.getX()+"\n"+
+// " y="+msc.getY()+"\n"+
+// " deltaX="+msc.getDeltaX()+"\n"+
+// " deltaY="+msc.getDeltaY()+"\n"+
+// "\n"
+// );
+
+ if (oldContainer!=newContainer) {
+ int x = newLoc.getX() + msc.getX() - oldLoc.getX();
+ int y = newLoc.getY() + msc.getY() - oldLoc.getY();
+ int deltaX = newLoc.getX() + msc.getDeltaX() - oldLoc.getX();
+ int deltaY = newLoc.getY() + msc.getDeltaY() - oldLoc.getY();
+
+// System.out.println(
+// "new context:\n"+
+// " x="+( newLoc.getX() + msc.getX() - oldLoc.getX() )+"\n"+
+// " y="+msc.getY()+"\n"+
+// " deltaX="+( newLoc.getX() + msc.getDeltaX() - oldLoc.getX() )+"\n"+
+// " deltaY="+msc.getDeltaY()+"\n"+
+// "\n"
+// );
+
+// msc.setX(x);
+// msc.setY(y);
+// msc.setDeltaX(deltaX);
+// msc.setDeltaY(deltaY);
+// msc.setTargetContainer(oldContainer);
+ }
+
+ super.preMoveShape(context);
+ }
+
+ @Override
+ protected void postMoveShape(final IMoveShapeContext context) {
+ super.postMoveShape(context);
+ PictogramElement containerShape = context.getPictogramElement();
+ Activity activity = BusinessObjectUtil.getFirstElementOfType(containerShape, Activity.class);
+ Graphiti.getPeService().sendToFront(context.getShape());
+
+ new AbstractBoundaryEventOperation() {
+ @Override
+ protected void doWorkInternal(ContainerShape container) {
+ GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
+
+ MoveShapeContext newContext = new MoveShapeContext(container);
+ newContext.setDeltaX(context.getDeltaX());
+ newContext.setDeltaY(context.getDeltaY());
+ newContext.setSourceContainer(context.getSourceContainer());
+ newContext.setTargetContainer(context.getTargetContainer());
+ newContext.setTargetConnection(context.getTargetConnection());
+ newContext.setLocation(ga.getX(), ga.getY());
+ newContext.putProperty(ACTIVITY_MOVE_PROPERTY, true);
+
+ IMoveShapeFeature moveFeature = getFeatureProvider().getMoveShapeFeature(newContext);
+ if (moveFeature.canMoveShape(newContext)) {
+ moveFeature.moveShape(newContext);
+ }
+ }
+ }.doWork(activity, getDiagram());
+
+ if (containerShape.eContainer() instanceof ContainerShape) {
+ PictogramElement pe = (PictogramElement) containerShape.eContainer();
+ if (BusinessObjectUtil.containsElementOfType(pe, SubProcess.class)) {
+ layoutPictogramElement(pe);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AbstractCreateTaskFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AbstractCreateTaskFeature.java
index daf9bf6..d3f2e32 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AbstractCreateTaskFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AbstractCreateTaskFeature.java
@@ -1,24 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity.task;
-
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-
-public abstract class AbstractCreateTaskFeature<T extends Task> extends AbstractCreateFlowElementFeature<T> {
-
- public AbstractCreateTaskFeature(IFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity.task;
+
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+
+public abstract class AbstractCreateTaskFeature<T extends Task> extends AbstractCreateFlowElementFeature<T> {
+
+ public AbstractCreateTaskFeature(IFeatureProvider fp, String name, String description) {
+ super(fp, name, description);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AddTaskFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AddTaskFeature.java
index 1b6e1d4..d01ad79 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AddTaskFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/AddTaskFeature.java
@@ -1,71 +1,71 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity.task;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.modeler.core.features.activity.AbstractAddActivityFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.mm.algorithms.MultiText;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class AddTaskFeature<T extends Task> extends AbstractAddActivityFeature<T> {
-
- public AddTaskFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canAdd(IAddContext context) {
- return super.canAdd(context)
- || BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), FlowElementsContainer.class);
- }
-
- @Override
- protected void hook(T activity, ContainerShape container, IAddContext context, int width, int height) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
-
- Shape textShape = peService.createShape(container, false);
- MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, activity.getName());
- int padding = GraphicsUtil.TASK_IMAGE_SIZE;
- gaService.setLocationAndSize(text, 0, padding, width, height - padding);
- StyleUtil.applyStyle(text, activity);
- text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
- text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
-// text.setFont(gaService.manageFont(getDiagram(), GaServiceImpl.DEFAULT_FONT, 8, false, true));
- link(textShape, activity);
- }
-
- @Override
- public int getWidth() {
- return GraphicsUtil.getActivitySize(getDiagram()).getWidth();
-// return GraphicsUtil.TASK_DEFAULT_WIDTH;
- }
-
- @Override
- public int getHeight() {
- return GraphicsUtil.getActivitySize(getDiagram()).getHeight();
-// return GraphicsUtil.TASK_DEFAULT_HEIGHT;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity.task;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.FlowElementsContainer;
+import org.eclipse.bpmn2.modeler.core.features.activity.AbstractAddActivityFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.mm.algorithms.MultiText;
+import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class AddTaskFeature<T extends Task> extends AbstractAddActivityFeature<T> {
+
+ public AddTaskFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canAdd(IAddContext context) {
+ return super.canAdd(context)
+ || BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), FlowElementsContainer.class);
+ }
+
+ @Override
+ protected void hook(T activity, ContainerShape container, IAddContext context, int width, int height) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+
+ Shape textShape = peService.createShape(container, false);
+ MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, activity.getName());
+ int padding = GraphicsUtil.TASK_IMAGE_SIZE;
+ gaService.setLocationAndSize(text, 0, padding, width, height - padding);
+ StyleUtil.applyStyle(text, activity);
+ text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
+ text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
+// text.setFont(gaService.manageFont(getDiagram(), GaServiceImpl.DEFAULT_FONT, 8, false, true));
+ link(textShape, activity);
+ }
+
+ @Override
+ public int getWidth() {
+ return GraphicsUtil.getActivitySize(getDiagram()).getWidth();
+// return GraphicsUtil.TASK_DEFAULT_WIDTH;
+ }
+
+ @Override
+ public int getHeight() {
+ return GraphicsUtil.getActivitySize(getDiagram()).getHeight();
+// return GraphicsUtil.TASK_DEFAULT_HEIGHT;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/DirectEditTaskFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/DirectEditTaskFeature.java
index 21e9e84..ab7fe32 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/DirectEditTaskFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/DirectEditTaskFeature.java
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity.task;
-
-import org.eclipse.bpmn2.modeler.core.features.DirectEditFlowElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-
-public class DirectEditTaskFeature extends DirectEditFlowElementFeature {
-
- public DirectEditTaskFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public String checkValueValid(String value, IDirectEditingContext context) {
- if (value.length() < 1) {
- return "Please enter any text as Task name.";
- } else if (value.contains("\n")) {
- return "Line breakes are not allowed in Task names.";
- }
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity.task;
+
+import org.eclipse.bpmn2.modeler.core.features.DirectEditFlowElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+
+public class DirectEditTaskFeature extends DirectEditFlowElementFeature {
+
+ public DirectEditTaskFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String checkValueValid(String value, IDirectEditingContext context) {
+ if (value.length() < 1) {
+ return "Please enter any text as Task name.";
+ } else if (value.contains("\n")) {
+ return "Line breakes are not allowed in Task names.";
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/ICustomTaskFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/ICustomTaskFeature.java
index 5471470..1ba54ee 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/ICustomTaskFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/ICustomTaskFeature.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity.task;
-
-import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskDescriptor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-
-public interface ICustomTaskFeature {
-
- public final static String CUSTOM_TASK_ID = "custom.task.id";
-
- public abstract void setId(String id);
-
- public abstract String getId();
-
- public abstract void setCustomTaskDescriptor(CustomTaskDescriptor customTaskDescriptor);
-
- /**
- * Return a Custom Task ID from inspection of the given model object. If the object
- * is not a custom task, return null.
- *
- * @param object - the model object to inspect
- * @return a Custom Task ID string or null
- */
- public abstract String getId(EObject object);
-
- public abstract ICustomFeature[] getCustomFeatures(IFeatureProvider fp);
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity.task;
+
+import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskDescriptor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+
+public interface ICustomTaskFeature {
+
+ public final static String CUSTOM_TASK_ID = "custom.task.id";
+
+ public abstract void setId(String id);
+
+ public abstract String getId();
+
+ public abstract void setCustomTaskDescriptor(CustomTaskDescriptor customTaskDescriptor);
+
+ /**
+ * Return a Custom Task ID from inspection of the given model object. If the object
+ * is not a custom task, return null.
+ *
+ * @param object - the model object to inspect
+ * @return a Custom Task ID string or null
+ */
+ public abstract String getId(EObject object);
+
+ public abstract ICustomFeature[] getCustomFeatures(IFeatureProvider fp);
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/UpdateTaskFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/UpdateTaskFeature.java
index 12ef9ff..b886a2f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/UpdateTaskFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/task/UpdateTaskFeature.java
@@ -1,30 +1,30 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.activity.task;
-
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-
-public class UpdateTaskFeature extends AbstractUpdateBaseElementFeature {
-
- public UpdateTaskFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof Task;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.activity.task;
+
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+
+public class UpdateTaskFeature extends AbstractUpdateBaseElementFeature {
+
+ public UpdateTaskFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof Task;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/DirectEditTextAnnotationFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/DirectEditTextAnnotationFeature.java
index fefa46e..04386a3 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/DirectEditTextAnnotationFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/DirectEditTextAnnotationFeature.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.artifact;
-
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.MultiText;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class DirectEditTextAnnotationFeature extends AbstractDirectEditingFeature {
-
- public DirectEditTextAnnotationFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public String getInitialValue(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- TextAnnotation annotation = (TextAnnotation) getBusinessObjectForPictogramElement(pe);
- return annotation.getText();
- }
-
- @Override
- public void setValue(String value, IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- TextAnnotation annotation = (TextAnnotation) getBusinessObjectForPictogramElement(pe);
- annotation.setText(value);
- updatePictogramElement(((Shape) pe).getContainer());
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
- return bo instanceof TextAnnotation && ga instanceof MultiText;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.artifact;
+
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.MultiText;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class DirectEditTextAnnotationFeature extends AbstractDirectEditingFeature {
+
+ public DirectEditTextAnnotationFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public int getEditingType() {
+ return TYPE_TEXT;
+ }
+
+ @Override
+ public String getInitialValue(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ TextAnnotation annotation = (TextAnnotation) getBusinessObjectForPictogramElement(pe);
+ return annotation.getText();
+ }
+
+ @Override
+ public void setValue(String value, IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ TextAnnotation annotation = (TextAnnotation) getBusinessObjectForPictogramElement(pe);
+ annotation.setText(value);
+ updatePictogramElement(((Shape) pe).getContainer());
+ }
+
+ @Override
+ public boolean canDirectEdit(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
+ return bo instanceof TextAnnotation && ga instanceof MultiText;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/LayoutTextAnnotationFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/LayoutTextAnnotationFeature.java
index 1e55506..713b0a7 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/LayoutTextAnnotationFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/LayoutTextAnnotationFeature.java
@@ -1,101 +1,101 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.artifact;
-
-import java.util.Iterator;
-
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.MultiText;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class LayoutTextAnnotationFeature extends DefaultLayoutBPMNShapeFeature {
-
- public LayoutTextAnnotationFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- PictogramElement pictoElem = context.getPictogramElement();
- if (!(pictoElem instanceof ContainerShape)) {
- return false;
- }
- Object bo = getBusinessObjectForPictogramElement(pictoElem);
- return bo instanceof TextAnnotation;
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- boolean changed = false;
-
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
- GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
- IGaService gaService = Graphiti.getGaService();
-
- if (ga.getWidth() < 100) {
- ga.setWidth(100);
- changed = true;
- }
-
- if (ga.getHeight() < 50) {
- ga.setHeight(50);
- changed = true;
- }
-
- int containerWidth = ga.getWidth();
- int containerHeight = ga.getHeight();
-
- DIUtils.updateDIShape(containerShape);
-
- Iterator<Shape> iterator = containerShape.getChildren().iterator();
- while (iterator.hasNext()) {
- Shape shape = iterator.next();
- GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
- IDimension size = gaService.calculateSize(shapeGa);
- if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
- gaService.setWidth(shapeGa, containerWidth - 5);
- changed = true;
- }
- if (containerHeight != size.getHeight()) {
- if (shapeGa instanceof Polyline) {
- Polyline line = (Polyline) shapeGa;
- line.getPoints().set(2, getNewPoint(line, 2, containerHeight, gaService));
- line.getPoints().set(3, getNewPoint(line, 3, containerHeight, gaService));
- changed = true;
- } else if (shapeGa instanceof MultiText) {
- gaService.setHeight(shapeGa, containerHeight - 5);
- changed = true;
- }
- }
- }
-
- return changed;
- }
-
- private Point getNewPoint(Polyline line, int pointIndex, int height, IGaService gaService) {
- Point p = line.getPoints().get(pointIndex);
- return gaService.createPoint(p.getX(), height);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.artifact;
+
+import java.util.Iterator;
+
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
+import org.eclipse.graphiti.datatypes.IDimension;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.MultiText;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class LayoutTextAnnotationFeature extends DefaultLayoutBPMNShapeFeature {
+
+ public LayoutTextAnnotationFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ PictogramElement pictoElem = context.getPictogramElement();
+ if (!(pictoElem instanceof ContainerShape)) {
+ return false;
+ }
+ Object bo = getBusinessObjectForPictogramElement(pictoElem);
+ return bo instanceof TextAnnotation;
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ boolean changed = false;
+
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+ GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
+ IGaService gaService = Graphiti.getGaService();
+
+ if (ga.getWidth() < 100) {
+ ga.setWidth(100);
+ changed = true;
+ }
+
+ if (ga.getHeight() < 50) {
+ ga.setHeight(50);
+ changed = true;
+ }
+
+ int containerWidth = ga.getWidth();
+ int containerHeight = ga.getHeight();
+
+ DIUtils.updateDIShape(containerShape);
+
+ Iterator<Shape> iterator = containerShape.getChildren().iterator();
+ while (iterator.hasNext()) {
+ Shape shape = iterator.next();
+ GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
+ IDimension size = gaService.calculateSize(shapeGa);
+ if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
+ gaService.setWidth(shapeGa, containerWidth - 5);
+ changed = true;
+ }
+ if (containerHeight != size.getHeight()) {
+ if (shapeGa instanceof Polyline) {
+ Polyline line = (Polyline) shapeGa;
+ line.getPoints().set(2, getNewPoint(line, 2, containerHeight, gaService));
+ line.getPoints().set(3, getNewPoint(line, 3, containerHeight, gaService));
+ changed = true;
+ } else if (shapeGa instanceof MultiText) {
+ gaService.setHeight(shapeGa, containerHeight - 5);
+ changed = true;
+ }
+ }
+ }
+
+ return changed;
+ }
+
+ private Point getNewPoint(Polyline line, int pointIndex, int height, IGaService gaService) {
+ Point p = line.getPoints().get(pointIndex);
+ return gaService.createPoint(p.getX(), height);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/MoveTextAnnotationFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/MoveTextAnnotationFeature.java
index 8957662..3b82ba7 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/MoveTextAnnotationFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/MoveTextAnnotationFeature.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.artifact;
-
-import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveTextAnnotationFeature extends DefaultMoveBPMNShapeFeature {
-
- public MoveTextAnnotationFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- boolean intoDiagram = context.getTargetContainer().equals(getDiagram());
- boolean intoLane = FeatureSupport.isTargetLane(context);
- boolean intoParticipant = FeatureSupport.isTargetParticipant(context);
-
- return intoDiagram || intoLane || intoParticipant;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- super.internalMove(context);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.artifact;
+
+import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveTextAnnotationFeature extends DefaultMoveBPMNShapeFeature {
+
+ public MoveTextAnnotationFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ boolean intoDiagram = context.getTargetContainer().equals(getDiagram());
+ boolean intoLane = FeatureSupport.isTargetLane(context);
+ boolean intoParticipant = FeatureSupport.isTargetParticipant(context);
+
+ return intoDiagram || intoLane || intoParticipant;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ super.internalMove(context);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/UpdateTextAnnotationFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/UpdateTextAnnotationFeature.java
index 36807d9..d4cf70d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/UpdateTextAnnotationFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/artifact/UpdateTextAnnotationFeature.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.artifact;
-
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-
-public class UpdateTextAnnotationFeature extends AbstractUpdateBaseElementFeature {
-
- public UpdateTextAnnotationFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof TextAnnotation;
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- boolean ret = super.update(context);
- DIUtils.updateDIShape(context.getPictogramElement());
- return ret;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.artifact;
+
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+
+public class UpdateTextAnnotationFeature extends AbstractUpdateBaseElementFeature {
+
+ public UpdateTextAnnotationFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof TextAnnotation;
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ boolean ret = super.update(context);
+ DIUtils.updateDIShape(context.getPictogramElement());
+ return ret;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java
index e81c474..b5d5e97 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java
@@ -1,61 +1,61 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.bendpoint;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.dd.dc.DcFactory;
-import org.eclipse.dd.dc.Point;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddBendpointContext;
-import org.eclipse.graphiti.features.impl.DefaultAddBendpointFeature;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-
-public class AddBendpointFeature extends DefaultAddBendpointFeature {
-
- public AddBendpointFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public void addBendpoint(IAddBendpointContext context) {
- super.addBendpoint(context);
- try {
- FreeFormConnection connection = context.getConnection();
- BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
- ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
-
- Point p = DcFactory.eINSTANCE.createPoint();
- p.setX(context.getX());
- p.setY(context.getY());
-
- BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(element);
- int index = context.getBendpointIndex() + 1;
- edge.getWaypoint().add(index, p);
- if (index == 1) {
- AnchorUtil.reConnect((DiagramElement) edge.getSourceElement(), getDiagram());
- } else if (index == connection.getBendpoints().size()) {
- AnchorUtil.reConnect((DiagramElement) edge.getTargetElement(), getDiagram());
- }
-
- } catch (Exception e) {
- Activator.logError(e);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.bendpoint;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.dd.dc.DcFactory;
+import org.eclipse.dd.dc.Point;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddBendpointContext;
+import org.eclipse.graphiti.features.impl.DefaultAddBendpointFeature;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+
+public class AddBendpointFeature extends DefaultAddBendpointFeature {
+
+ public AddBendpointFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public void addBendpoint(IAddBendpointContext context) {
+ super.addBendpoint(context);
+ try {
+ FreeFormConnection connection = context.getConnection();
+ BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
+ ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
+
+ Point p = DcFactory.eINSTANCE.createPoint();
+ p.setX(context.getX());
+ p.setY(context.getY());
+
+ BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(element);
+ int index = context.getBendpointIndex() + 1;
+ edge.getWaypoint().add(index, p);
+ if (index == 1) {
+ AnchorUtil.reConnect((DiagramElement) edge.getSourceElement(), getDiagram());
+ } else if (index == connection.getBendpoints().size()) {
+ AnchorUtil.reConnect((DiagramElement) edge.getTargetElement(), getDiagram());
+ }
+
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java
index 08889f6..ed7f62e 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.bendpoint;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.dd.dc.Point;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveBendpointContext;
-import org.eclipse.graphiti.features.impl.DefaultMoveBendpointFeature;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class MoveBendpointFeature extends DefaultMoveBendpointFeature {
-
- public MoveBendpointFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean moveBendpoint(IMoveBendpointContext context) {
- boolean moved = super.moveBendpoint(context);
- try {
- FreeFormConnection connection = context.getConnection();
- BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
- ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
- BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(element);
- int index = context.getBendpointIndex() + 1;
- Point p = edge.getWaypoint().get(index);
- p.setX(context.getX());
- p.setY(context.getY());
-
- // also need to move the connection point if there is one at this bendpoint
- Shape connectionPointShape = AnchorUtil.getConnectionPointAt(connection, context.getBendpoint());
- if (connectionPointShape!=null)
- AnchorUtil.setConnectionPointLocation(connectionPointShape, context.getX(), context.getY());
-
- if (index == 1) {
- AnchorUtil.reConnect((DiagramElement) edge.getSourceElement(), getDiagram());
- } else if (index == connection.getBendpoints().size()) {
- AnchorUtil.reConnect((DiagramElement) edge.getTargetElement(), getDiagram());
- }
- } catch (Exception e) {
- Activator.logError(e);
- }
- return moved;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.bendpoint;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.dd.dc.Point;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveBendpointContext;
+import org.eclipse.graphiti.features.impl.DefaultMoveBendpointFeature;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class MoveBendpointFeature extends DefaultMoveBendpointFeature {
+
+ public MoveBendpointFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean moveBendpoint(IMoveBendpointContext context) {
+ boolean moved = super.moveBendpoint(context);
+ try {
+ FreeFormConnection connection = context.getConnection();
+ BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
+ ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
+ BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(element);
+ int index = context.getBendpointIndex() + 1;
+ Point p = edge.getWaypoint().get(index);
+ p.setX(context.getX());
+ p.setY(context.getY());
+
+ // also need to move the connection point if there is one at this bendpoint
+ Shape connectionPointShape = AnchorUtil.getConnectionPointAt(connection, context.getBendpoint());
+ if (connectionPointShape!=null)
+ AnchorUtil.setConnectionPointLocation(connectionPointShape, context.getX(), context.getY());
+
+ if (index == 1) {
+ AnchorUtil.reConnect((DiagramElement) edge.getSourceElement(), getDiagram());
+ } else if (index == connection.getBendpoints().size()) {
+ AnchorUtil.reConnect((DiagramElement) edge.getTargetElement(), getDiagram());
+ }
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ return moved;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java
index 02a1bd2..834e902 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.bendpoint;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IRemoveBendpointContext;
-import org.eclipse.graphiti.features.impl.DefaultRemoveBendpointFeature;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class RemoveBendpointFeature extends DefaultRemoveBendpointFeature {
-
- public RemoveBendpointFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canRemoveBendpoint(IRemoveBendpointContext context) {
- Shape connectionPointShape = AnchorUtil.getConnectionPointAt(context.getConnection(), context.getBendpoint());
- if (connectionPointShape!=null)
- return false;
-
- return super.canRemoveBendpoint(context);
- }
-
- @Override
- public void removeBendpoint(IRemoveBendpointContext context) {
- super.removeBendpoint(context);
- try {
- FreeFormConnection connection = context.getConnection();
- BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
- ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
- BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(element);
- edge.getWaypoint().remove(context.getBendpointIndex() + 1);
- } catch (Exception e) {
- Activator.logError(e);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.bendpoint;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IRemoveBendpointContext;
+import org.eclipse.graphiti.features.impl.DefaultRemoveBendpointFeature;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class RemoveBendpointFeature extends DefaultRemoveBendpointFeature {
+
+ public RemoveBendpointFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canRemoveBendpoint(IRemoveBendpointContext context) {
+ Shape connectionPointShape = AnchorUtil.getConnectionPointAt(context.getConnection(), context.getBendpoint());
+ if (connectionPointShape!=null)
+ return false;
+
+ return super.canRemoveBendpoint(context);
+ }
+
+ @Override
+ public void removeBendpoint(IRemoveBendpointContext context) {
+ super.removeBendpoint(context);
+ try {
+ FreeFormConnection connection = context.getConnection();
+ BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
+ ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
+ BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(element);
+ edge.getWaypoint().remove(context.getBendpointIndex() + 1);
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/ChoreographyProperties.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/ChoreographyProperties.java
index 46551f8..1ec3594 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/ChoreographyProperties.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/ChoreographyProperties.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.choreography;
-
-public interface ChoreographyProperties {
-
- final static int PARTICIPANT_BAND_HEIGHT = 20;
- final static int ENV_W = 30;
- final static int ENV_H = 18;
- final static int ENVELOPE_HEIGHT_MODIFIER = 30;
- final static int R = 10;
- final static int TEXT_H = 15;
- final static int MARKER_H = 20;
-
- final static String CHOREOGRAPHY_ACTIVITY_PROPERTY = "choreography.activity";
- final static String PARTICIPANT_REF = "choreography.activity.participant.ref";
- final static String PARTICIPANT_REF_ID = "choreography.activity.participant.ref.id";
- final static String PARTICIPANT_REF_IDS = "choreography.activity.participant.ref.ids";
- final static String INITIATING_PARTICIPANT_REF = "choreography.activity.initiating.participant.ref";
- final static String MESSAGE_VISIBLE = "choreography.activity.band.message.visible";
- final static String BAND = "choreography.activity.band";
- final static String MESSAGE_LINK = "choreography.messageLink";
- final static String MESSAGE_NAME = "choreography.messageName";
- final static String CHOREOGRAPHY_NAME = "choreography.name";
- final static String CALL_CHOREO_BORDER = "call.choreography.border";
- final static String CHOREOGRAPHY_MARKER = "choreography.marker";
- final static String CHOREOGRAPHY_MARKER_SHAPE = "choreography.marker.shape";
- final static String MESSAGE_REF_IDS = "choreography.message.ref.ids";
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.choreography;
+
+public interface ChoreographyProperties {
+
+ final static int PARTICIPANT_BAND_HEIGHT = 20;
+ final static int ENV_W = 30;
+ final static int ENV_H = 18;
+ final static int ENVELOPE_HEIGHT_MODIFIER = 30;
+ final static int R = 10;
+ final static int TEXT_H = 15;
+ final static int MARKER_H = 20;
+
+ final static String CHOREOGRAPHY_ACTIVITY_PROPERTY = "choreography.activity";
+ final static String PARTICIPANT_REF = "choreography.activity.participant.ref";
+ final static String PARTICIPANT_REF_ID = "choreography.activity.participant.ref.id";
+ final static String PARTICIPANT_REF_IDS = "choreography.activity.participant.ref.ids";
+ final static String INITIATING_PARTICIPANT_REF = "choreography.activity.initiating.participant.ref";
+ final static String MESSAGE_VISIBLE = "choreography.activity.band.message.visible";
+ final static String BAND = "choreography.activity.band";
+ final static String MESSAGE_LINK = "choreography.messageLink";
+ final static String MESSAGE_NAME = "choreography.messageName";
+ final static String CHOREOGRAPHY_NAME = "choreography.name";
+ final static String CALL_CHOREO_BORDER = "call.choreography.border";
+ final static String CHOREOGRAPHY_MARKER = "choreography.marker";
+ final static String CHOREOGRAPHY_MARKER_SHAPE = "choreography.marker.shape";
+ final static String MESSAGE_REF_IDS = "choreography.message.ref.ids";
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/LayoutChoreographyFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/LayoutChoreographyFeature.java
index 51f14ba..3f044cf 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/LayoutChoreographyFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/LayoutChoreographyFeature.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.TEXT_H;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class LayoutChoreographyFeature extends DefaultLayoutBPMNShapeFeature {
-
- protected IPeService peService = Graphiti.getPeService();
- protected IGaService gaService = Graphiti.getGaService();
-
- public LayoutChoreographyFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- return BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), ChoreographyActivity.class) != null;
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
- GraphicsAlgorithm parentGa = choreographyContainer.getGraphicsAlgorithm();
-
- int newWidth = parentGa.getWidth();
- int newHeight = parentGa.getHeight();
-
- for (Shape s : peService.getAllContainedShapes(choreographyContainer)) {
- String property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_NAME);
- if (property != null && new Boolean(property)) {
- GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
- setTextLocation(choreographyContainer, (Text) ga, newWidth, newHeight);
- }
- property = peService.getPropertyValue(s, ChoreographyProperties.CALL_CHOREO_BORDER);
- if (property != null && new Boolean(property)) {
- GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
- gaService.setSize(ga, newWidth, newHeight);
- peService.sendToFront(s);
- }
- // use it when property editor supports enums
- // property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_MARKER_SHAPE);
- // if (property != null && new Boolean(property)) {
- // List<ContainerShape> bands = ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer);
- // List<ContainerShape> bottomBands = ChoreographyUtil.getTopAndBottomBands(bands).getSecond();
- // int x = (newWidth / 2) - (MARKER_H / 2);
- // int y = newHeight - MARKER_H;
- // if (!bottomBands.isEmpty()) {
- // ContainerShape b = bottomBands.get(0);
- // y = b.getGraphicsAlgorithm().getY() - MARKER_H;
- // }
- // gaService.setLocation(s.getGraphicsAlgorithm(), x, y);
- // }
- }
-
- return super.layout(context);
- }
-
- protected void setTextLocation(ContainerShape choreographyContainer, Text text, int w, int h) {
- int y = (h / 2) - (TEXT_H / 2);
- gaService.setLocationAndSize(text, 0, y, w, TEXT_H);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.TEXT_H;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class LayoutChoreographyFeature extends DefaultLayoutBPMNShapeFeature {
+
+ protected IPeService peService = Graphiti.getPeService();
+ protected IGaService gaService = Graphiti.getGaService();
+
+ public LayoutChoreographyFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ return BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), ChoreographyActivity.class) != null;
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
+ GraphicsAlgorithm parentGa = choreographyContainer.getGraphicsAlgorithm();
+
+ int newWidth = parentGa.getWidth();
+ int newHeight = parentGa.getHeight();
+
+ for (Shape s : peService.getAllContainedShapes(choreographyContainer)) {
+ String property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_NAME);
+ if (property != null && new Boolean(property)) {
+ GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
+ setTextLocation(choreographyContainer, (Text) ga, newWidth, newHeight);
+ }
+ property = peService.getPropertyValue(s, ChoreographyProperties.CALL_CHOREO_BORDER);
+ if (property != null && new Boolean(property)) {
+ GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
+ gaService.setSize(ga, newWidth, newHeight);
+ peService.sendToFront(s);
+ }
+ // use it when property editor supports enums
+ // property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_MARKER_SHAPE);
+ // if (property != null && new Boolean(property)) {
+ // List<ContainerShape> bands = ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer);
+ // List<ContainerShape> bottomBands = ChoreographyUtil.getTopAndBottomBands(bands).getSecond();
+ // int x = (newWidth / 2) - (MARKER_H / 2);
+ // int y = newHeight - MARKER_H;
+ // if (!bottomBands.isEmpty()) {
+ // ContainerShape b = bottomBands.get(0);
+ // y = b.getGraphicsAlgorithm().getY() - MARKER_H;
+ // }
+ // gaService.setLocation(s.getGraphicsAlgorithm(), x, y);
+ // }
+ }
+
+ return super.layout(context);
+ }
+
+ protected void setTextLocation(ContainerShape choreographyContainer, Text text, int w, int h) {
+ int y = (h / 2) - (TEXT_H / 2);
+ gaService.setLocationAndSize(text, 0, y, w, TEXT_H);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/UpdateChoreographyNameFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/UpdateChoreographyNameFeature.java
index bf25869..11d164d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/UpdateChoreographyNameFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/choreography/UpdateChoreographyNameFeature.java
@@ -1,74 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.choreography;
-
-import java.util.Iterator;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class UpdateChoreographyNameFeature extends AbstractUpdateFeature {
-
- private static final IPeService peService = Graphiti.getPeService();
-
- public UpdateChoreographyNameFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- ChoreographyActivity activity = (ChoreographyActivity) BusinessObjectUtil.getFirstElementOfType(
- context.getPictogramElement(), ChoreographyActivity.class);
- if (activity.getName().equals(getBodyText(context).getValue())) {
- return Reason.createFalseReason();
- } else {
- return Reason.createTrueReason("Name is out of date");
- }
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- ChoreographyActivity task = (ChoreographyActivity) BusinessObjectUtil.getFirstElementOfType(
- context.getPictogramElement(), ChoreographyActivity.class);
- getBodyText(context).setValue(task.getName());
- return true;
- }
-
- private Text getBodyText(IUpdateContext context) {
- Iterator<Shape> iterator = peService.getAllContainedShapes((ContainerShape) context.getPictogramElement())
- .iterator();
- while (iterator.hasNext()) {
- Shape shape = (Shape) iterator.next();
- String property = peService.getPropertyValue(shape, ChoreographyProperties.CHOREOGRAPHY_NAME);
- if (property != null && Boolean.parseBoolean(property)) {
- return (Text) shape.getGraphicsAlgorithm();
- }
- }
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.choreography;
+
+import java.util.Iterator;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class UpdateChoreographyNameFeature extends AbstractUpdateFeature {
+
+ private static final IPeService peService = Graphiti.getPeService();
+
+ public UpdateChoreographyNameFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ ChoreographyActivity activity = (ChoreographyActivity) BusinessObjectUtil.getFirstElementOfType(
+ context.getPictogramElement(), ChoreographyActivity.class);
+ if (activity.getName().equals(getBodyText(context).getValue())) {
+ return Reason.createFalseReason();
+ } else {
+ return Reason.createTrueReason("Name is out of date");
+ }
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ ChoreographyActivity task = (ChoreographyActivity) BusinessObjectUtil.getFirstElementOfType(
+ context.getPictogramElement(), ChoreographyActivity.class);
+ getBodyText(context).setValue(task.getName());
+ return true;
+ }
+
+ private Text getBodyText(IUpdateContext context) {
+ Iterator<Shape> iterator = peService.getAllContainedShapes((ContainerShape) context.getPictogramElement())
+ .iterator();
+ while (iterator.hasNext()) {
+ Shape shape = (Shape) iterator.next();
+ String property = peService.getPropertyValue(shape, ChoreographyProperties.CHOREOGRAPHY_NAME);
+ if (property != null && Boolean.parseBoolean(property)) {
+ return (Text) shape.getGraphicsAlgorithm();
+ }
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/data/Properties.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/data/Properties.java
index 1047618..9df4b2a 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/data/Properties.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/data/Properties.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.data;
-
-public interface Properties {
-
- public static final String COLLECTION_PROPERTY = "isCollection";
- public static final String HIDEABLE_PROPERTY = "hideable";
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.data;
+
+public interface Properties {
+
+ public static final String COLLECTION_PROPERTY = "isCollection";
+ public static final String HIDEABLE_PROPERTY = "hideable";
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractBoundaryEventOperation.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractBoundaryEventOperation.java
index c49664e..62175c4 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractBoundaryEventOperation.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractBoundaryEventOperation.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event;
-
-import java.util.Collection;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public abstract class AbstractBoundaryEventOperation {
-
- public void doWork(Activity activity, Diagram diagram) {
- IPeService peService = Graphiti.getPeService();
- Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
- for (PictogramElement e : elements) {
- BoundaryEvent boundaryEvent = BusinessObjectUtil.getFirstElementOfType(e, BoundaryEvent.class);
- if (boundaryEvent != null && activity.getBoundaryEventRefs().contains(boundaryEvent)) {
- ContainerShape container = (ContainerShape) e;
- doWorkInternal(container);
- }
- }
- }
-
- protected abstract void doWorkInternal(ContainerShape container);
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event;
+
+import java.util.Collection;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public abstract class AbstractBoundaryEventOperation {
+
+ public void doWork(Activity activity, Diagram diagram) {
+ IPeService peService = Graphiti.getPeService();
+ Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
+ for (PictogramElement e : elements) {
+ BoundaryEvent boundaryEvent = BusinessObjectUtil.getFirstElementOfType(e, BoundaryEvent.class);
+ if (boundaryEvent != null && activity.getBoundaryEventRefs().contains(boundaryEvent)) {
+ ContainerShape container = (ContainerShape) e;
+ doWorkInternal(container);
+ }
+ }
+ }
+
+ protected abstract void doWorkInternal(ContainerShape container);
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractCreateEventFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractCreateEventFeature.java
index bbc5ee7..3175bdb 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractCreateEventFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractCreateEventFeature.java
@@ -1,24 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event;
-
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-
-public abstract class AbstractCreateEventFeature<T extends Event> extends AbstractCreateFlowElementFeature<T> {
-
- public AbstractCreateEventFeature(IFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event;
+
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+
+public abstract class AbstractCreateEventFeature<T extends Event> extends AbstractCreateFlowElementFeature<T> {
+
+ public AbstractCreateEventFeature(IFeatureProvider fp, String name, String description) {
+ super(fp, name, description);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractUpdateEventFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractUpdateEventFeature.java
index aa3e8ad..0b4e998 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractUpdateEventFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AbstractUpdateEventFeature.java
@@ -1,126 +1,126 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.features.event;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.impl.UpdateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-
-/**
- * @author Bob Brodt
- *
- */
-
-public abstract class AbstractUpdateEventFeature extends AbstractUpdateMarkerFeature<Event> {
-
- /**
- * @param fp
- */
- public AbstractUpdateEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#isPropertyChanged(org.eclipse.bpmn2.FlowElement, java.lang.String)
- */
- @Override
- protected boolean isPropertyChanged(Event element, String propertyValue) {
- return !getEventDefinitionsValue(element).equals(propertyValue);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#doUpdate(org.eclipse.bpmn2.FlowElement, org.eclipse.graphiti.mm.pictograms.ContainerShape)
- */
- @Override
- protected void doUpdate(Event event, ContainerShape container) {
- List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(event);
- int size = eventDefinitions.size();
-
- GraphicsUtil.deleteEventShape(container);
- if (size!=0) {
- EventDefinition eventDefinition = eventDefinitions.get(0);
-
- // either find the existing Shape that is linked with an EventDefinition...
- PictogramElement eventDefinitionShape = null;
- Iterator<PictogramElement> iterator = Graphiti.getPeService().getAllContainedPictogramElements(container).iterator();
- while (iterator.hasNext()) {
- PictogramElement pe = iterator.next();
- if (pe.getLink() != null) {
- EList<EObject> objects = pe.getLink().getBusinessObjects();
- if (objects.size()==1 && objects.get(0) instanceof EventDefinition) {
- eventDefinition = (EventDefinition)objects.get(0);
- eventDefinitionShape = pe;
- break;
- }
- }
- }
-
- if (eventDefinitionShape==null) {
- // ...or create a temporary Shape that we can link
- // with the event definition business object...
- eventDefinitionShape = Graphiti.getPeService().createShape(container, true);
- link(eventDefinitionShape,eventDefinition);
- }
- // ...so we can create an UpdateContext...
- UpdateContext context = new UpdateContext(eventDefinitionShape);
- // ...to look up the EventDefinitionUpdateFeature
- IUpdateFeature upateFeature = getFeatureProvider().getUpdateFeature(context);
- if (upateFeature!=null) {
- // and do the update with the Event object (not the EventDefinition!)
- context = new UpdateContext(container);
- upateFeature.update(context);
- }
- }
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#convertPropertyToString(org.eclipse.bpmn2.FlowElement)
- */
- @Override
- protected String convertPropertyToString(Event element) {
- return getEventDefinitionsValue(element);
- }
-
- public static String getEventDefinitionsValue(Event element) {
- String result = "";
- List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(element);
- for (EventDefinition ed : eventDefinitions) {
- if (!result.isEmpty())
- result += " ";
- result += ed.getId();
- }
- // Parallel Multiple has a different visual than Multiple for Catch Events
- if (element instanceof CatchEvent) {
- if (((CatchEvent)element).isParallelMultiple())
- result += "+";
- }
- return result;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.features.event;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.impl.UpdateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+
+public abstract class AbstractUpdateEventFeature extends AbstractUpdateMarkerFeature<Event> {
+
+ /**
+ * @param fp
+ */
+ public AbstractUpdateEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#isPropertyChanged(org.eclipse.bpmn2.FlowElement, java.lang.String)
+ */
+ @Override
+ protected boolean isPropertyChanged(Event element, String propertyValue) {
+ return !getEventDefinitionsValue(element).equals(propertyValue);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#doUpdate(org.eclipse.bpmn2.FlowElement, org.eclipse.graphiti.mm.pictograms.ContainerShape)
+ */
+ @Override
+ protected void doUpdate(Event event, ContainerShape container) {
+ List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(event);
+ int size = eventDefinitions.size();
+
+ GraphicsUtil.deleteEventShape(container);
+ if (size!=0) {
+ EventDefinition eventDefinition = eventDefinitions.get(0);
+
+ // either find the existing Shape that is linked with an EventDefinition...
+ PictogramElement eventDefinitionShape = null;
+ Iterator<PictogramElement> iterator = Graphiti.getPeService().getAllContainedPictogramElements(container).iterator();
+ while (iterator.hasNext()) {
+ PictogramElement pe = iterator.next();
+ if (pe.getLink() != null) {
+ EList<EObject> objects = pe.getLink().getBusinessObjects();
+ if (objects.size()==1 && objects.get(0) instanceof EventDefinition) {
+ eventDefinition = (EventDefinition)objects.get(0);
+ eventDefinitionShape = pe;
+ break;
+ }
+ }
+ }
+
+ if (eventDefinitionShape==null) {
+ // ...or create a temporary Shape that we can link
+ // with the event definition business object...
+ eventDefinitionShape = Graphiti.getPeService().createShape(container, true);
+ link(eventDefinitionShape,eventDefinition);
+ }
+ // ...so we can create an UpdateContext...
+ UpdateContext context = new UpdateContext(eventDefinitionShape);
+ // ...to look up the EventDefinitionUpdateFeature
+ IUpdateFeature upateFeature = getFeatureProvider().getUpdateFeature(context);
+ if (upateFeature!=null) {
+ // and do the update with the Event object (not the EventDefinition!)
+ context = new UpdateContext(container);
+ upateFeature.update(context);
+ }
+ }
+
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#convertPropertyToString(org.eclipse.bpmn2.FlowElement)
+ */
+ @Override
+ protected String convertPropertyToString(Event element) {
+ return getEventDefinitionsValue(element);
+ }
+
+ public static String getEventDefinitionsValue(Event element) {
+ String result = "";
+ List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(element);
+ for (EventDefinition ed : eventDefinitions) {
+ if (!result.isEmpty())
+ result += " ";
+ result += ed.getId();
+ }
+ // Parallel Multiple has a different visual than Multiple for Catch Events
+ if (element instanceof CatchEvent) {
+ if (((CatchEvent)element).isParallelMultiple())
+ result += "+";
+ }
+ return result;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/EventSelectionBehavior.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/EventSelectionBehavior.java
index b865a79..84ce9bb 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/EventSelectionBehavior.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/EventSelectionBehavior.java
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class EventSelectionBehavior {
-
- public static boolean canApplyTo(PictogramElement element) {
- if (element.getLink() == null || !(element instanceof ContainerShape)) {
- return false;
- }
-
- EList<EObject> objects = element.getLink().getBusinessObjects();
-
- for (EObject eObject : objects) {
- if (eObject instanceof Event && !(eObject instanceof BoundaryEvent)) {
- return true;
- }
- }
-
- return false;
- }
-
- public static GraphicsAlgorithm[] getClickArea(PictogramElement element) {
- Iterator<Shape> iterator = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element).iterator();
- GraphicsAlgorithm[] algorithms = new GraphicsAlgorithm[1];
- algorithms[0] = iterator.next().getGraphicsAlgorithm();
-// algorithms[1] = iterator.next().getGraphicsAlgorithm();
- return algorithms;
- }
-
- public static GraphicsAlgorithm getSelectionBorder(PictogramElement element) {
- Collection<Shape> children = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element);
- PictogramElement first = children.iterator().next();
- return first.getGraphicsAlgorithm();
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class EventSelectionBehavior {
+
+ public static boolean canApplyTo(PictogramElement element) {
+ if (element.getLink() == null || !(element instanceof ContainerShape)) {
+ return false;
+ }
+
+ EList<EObject> objects = element.getLink().getBusinessObjects();
+
+ for (EObject eObject : objects) {
+ if (eObject instanceof Event && !(eObject instanceof BoundaryEvent)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static GraphicsAlgorithm[] getClickArea(PictogramElement element) {
+ Iterator<Shape> iterator = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element).iterator();
+ GraphicsAlgorithm[] algorithms = new GraphicsAlgorithm[1];
+ algorithms[0] = iterator.next().getGraphicsAlgorithm();
+// algorithms[1] = iterator.next().getGraphicsAlgorithm();
+ return algorithms;
+ }
+
+ public static GraphicsAlgorithm getSelectionBorder(PictogramElement element) {
+ Collection<Shape> children = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element);
+ PictogramElement first = children.iterator().next();
+ return first.getGraphicsAlgorithm();
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractAddEventDefinitionFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractAddEventDefinitionFeature.java
index b7afde2..a19fcc0 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractAddEventDefinitionFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractAddEventDefinitionFeature.java
@@ -1,139 +1,139 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event.definitions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
-import org.eclipse.bpmn2.modeler.core.features.IBpmn2AddFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.IFeature;
-import org.eclipse.graphiti.features.IFeatureAndContext;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public abstract class AbstractAddEventDefinitionFeature<T extends EventDefinition>
- extends AbstractAddShapeFeature
- implements IBpmn2AddFeature<T> {
-
-
- public AbstractAddEventDefinitionFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canAdd(IAddContext context) {
- Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
- return bo != null && bo instanceof Event;
- }
-
- @Override
- public PictogramElement add(IAddContext context) {
- ContainerShape container = context.getTargetContainer();
- Event event = (Event) getBusinessObjectForPictogramElement(container);
-
- draw(event, getBusinessObject(context), container);
- return null;
- }
-
- public void draw(Event event, EventDefinition eventDef, ContainerShape container) {
-
- List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(event);
- int size = eventDefinitions.size();
-
- GraphicsUtil.deleteEventShape(container);
- if (size > 1) {
- Shape multipleShape = Graphiti.getPeService().createShape(container, false);
- drawForEvent(event, multipleShape);
- link(multipleShape, eventDefinitions.toArray(new EventDefinition[size]));
- } else {
- Shape addedShape = getDecorationAlgorithm(event).draw(container);
- link(addedShape, eventDef);
- }
- }
-
- public abstract DecorationAlgorithm getDecorationAlgorithm(Event event);
-
- private void drawForEvent(Event event, Shape shape) {
- if(event instanceof CatchEvent && ((CatchEvent) event).isParallelMultiple()) {
- drawParallelMultiple(event, shape);
- } else {
- drawMultiple(event, shape);
- }
- }
-
- private void drawMultiple(Event event, Shape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Polygon pentagon = GraphicsUtil.createEventPentagon(shape);
- if (event instanceof ThrowEvent) {
- StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_FOREGROUND);
- } else {
- StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_BACKGROUND);
- }
- StyleUtil.applyStyle(pentagon, be);
- }
-
- private void drawParallelMultiple(Event event, Shape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Polygon cross = GraphicsUtil.createEventParallelMultiple(shape);
- StyleUtil.setFillStyle(cross, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(cross, be);
- }
-
- @Override
- public T getBusinessObject(IAddContext context) {
- Object businessObject = context.getProperty(ContextConstants.BUSINESS_OBJECT);
- if (businessObject instanceof EventDefinition)
- return (T)businessObject;
- return (T)context.getNewObject();
- }
-
- @Override
- public void putBusinessObject(IAddContext context, T businessObject) {
- context.putProperty(ContextConstants.BUSINESS_OBJECT, businessObject);
- }
-
- @Override
- public void postExecute(IExecutionInfo executionInfo) {
- List<PictogramElement> pes = new ArrayList<PictogramElement>();
- for (IFeatureAndContext fc : executionInfo.getExecutionList()) {
- IContext context = fc.getContext();
- IFeature feature = fc.getFeature();
- if (context instanceof AddContext) {
- AddContext ac = (AddContext)context;
- pes.add(ac.getTargetContainer());
- }
- }
- getDiagramEditor().setPictogramElementsForSelection(pes.toArray(new PictogramElement[pes.size()]));
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event.definitions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
+import org.eclipse.bpmn2.modeler.core.features.IBpmn2AddFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.IFeature;
+import org.eclipse.graphiti.features.IFeatureAndContext;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.impl.AddContext;
+import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public abstract class AbstractAddEventDefinitionFeature<T extends EventDefinition>
+ extends AbstractAddShapeFeature
+ implements IBpmn2AddFeature<T> {
+
+
+ public AbstractAddEventDefinitionFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canAdd(IAddContext context) {
+ Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
+ return bo != null && bo instanceof Event;
+ }
+
+ @Override
+ public PictogramElement add(IAddContext context) {
+ ContainerShape container = context.getTargetContainer();
+ Event event = (Event) getBusinessObjectForPictogramElement(container);
+
+ draw(event, getBusinessObject(context), container);
+ return null;
+ }
+
+ public void draw(Event event, EventDefinition eventDef, ContainerShape container) {
+
+ List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(event);
+ int size = eventDefinitions.size();
+
+ GraphicsUtil.deleteEventShape(container);
+ if (size > 1) {
+ Shape multipleShape = Graphiti.getPeService().createShape(container, false);
+ drawForEvent(event, multipleShape);
+ link(multipleShape, eventDefinitions.toArray(new EventDefinition[size]));
+ } else {
+ Shape addedShape = getDecorationAlgorithm(event).draw(container);
+ link(addedShape, eventDef);
+ }
+ }
+
+ public abstract DecorationAlgorithm getDecorationAlgorithm(Event event);
+
+ private void drawForEvent(Event event, Shape shape) {
+ if(event instanceof CatchEvent && ((CatchEvent) event).isParallelMultiple()) {
+ drawParallelMultiple(event, shape);
+ } else {
+ drawMultiple(event, shape);
+ }
+ }
+
+ private void drawMultiple(Event event, Shape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Polygon pentagon = GraphicsUtil.createEventPentagon(shape);
+ if (event instanceof ThrowEvent) {
+ StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_FOREGROUND);
+ } else {
+ StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_BACKGROUND);
+ }
+ StyleUtil.applyStyle(pentagon, be);
+ }
+
+ private void drawParallelMultiple(Event event, Shape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Polygon cross = GraphicsUtil.createEventParallelMultiple(shape);
+ StyleUtil.setFillStyle(cross, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(cross, be);
+ }
+
+ @Override
+ public T getBusinessObject(IAddContext context) {
+ Object businessObject = context.getProperty(ContextConstants.BUSINESS_OBJECT);
+ if (businessObject instanceof EventDefinition)
+ return (T)businessObject;
+ return (T)context.getNewObject();
+ }
+
+ @Override
+ public void putBusinessObject(IAddContext context, T businessObject) {
+ context.putProperty(ContextConstants.BUSINESS_OBJECT, businessObject);
+ }
+
+ @Override
+ public void postExecute(IExecutionInfo executionInfo) {
+ List<PictogramElement> pes = new ArrayList<PictogramElement>();
+ for (IFeatureAndContext fc : executionInfo.getExecutionList()) {
+ IContext context = fc.getContext();
+ IFeature feature = fc.getFeature();
+ if (context instanceof AddContext) {
+ AddContext ac = (AddContext)context;
+ pes.add(ac.getTargetContainer());
+ }
+ }
+ getDiagramEditor().setPictogramElementsForSelection(pes.toArray(new PictogramElement[pes.size()]));
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractEventDefinitionFeatureContainer.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractEventDefinitionFeatureContainer.java
index e70eab5..ce53048 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractEventDefinitionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractEventDefinitionFeatureContainer.java
@@ -1,206 +1,206 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event.definitions;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.styles.Color;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.util.IColorConstant;
-
-public abstract class AbstractEventDefinitionFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context instanceof IAddContext) {
- return ((IAddContext) context).getNewObject();
- } else if (context instanceof IPictogramElementContext) {
- EventDefinition ed = BusinessObjectUtil.getFirstElementOfType(
- (((IPictogramElementContext) context).getPictogramElement()), EventDefinition.class);
- if (ed!=null) {
- return ed;
- }
- }
- return null;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddEventDefinitionFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateEventDefinitionFeature(fp);
- }
-
- protected abstract Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape);
-
- protected abstract Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape);
-
- protected abstract Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape);
-
- protected abstract Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape);
-
- protected abstract Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape);
-
- public class AddEventDefinitionFeature extends AbstractAddEventDefinitionFeature<EventDefinition> {
-
- public AddEventDefinitionFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public DecorationAlgorithm getDecorationAlgorithm(final Event event) {
- return new DecorationAlgorithm() {
-
- @Override
- public Shape draw(ContainerShape shape) {
- if (event instanceof BoundaryEvent) {
- return drawForBoundary(this, shape);
- }
- if (event instanceof IntermediateCatchEvent) {
- return drawForCatch(this, shape);
- }
- if (event instanceof IntermediateThrowEvent) {
- return drawForThrow(this, shape);
- }
- if (event instanceof StartEvent) {
- return drawForStart(this, shape);
- }
- if (event instanceof EndEvent) {
- return drawForEnd(this, shape);
- }
- return null;
- }
-
- @Override
- public Color manageColor(IColorConstant colorConstant) {
- return AddEventDefinitionFeature.this.manageColor(colorConstant);
- }
- };
- }
- }
-
- public class UpdateEventDefinitionFeature extends AbstractUpdateEventDefinitionFeature {
-
- public UpdateEventDefinitionFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public DecorationAlgorithm getDecorationAlgorithm(final Event event) {
- return new DecorationAlgorithm() {
-
- @Override
- public Shape draw(ContainerShape shape) {
- if (event instanceof BoundaryEvent) {
- return drawForBoundary(this, shape);
- }
- if (event instanceof IntermediateCatchEvent) {
- return drawForCatch(this, shape);
- }
- if (event instanceof IntermediateThrowEvent) {
- return drawForThrow(this, shape);
- }
- if (event instanceof StartEvent) {
- return drawForStart(this, shape);
- }
- if (event instanceof EndEvent) {
- return drawForEnd(this, shape);
- }
- return null;
- }
-
- @Override
- public Color manageColor(IColorConstant colorConstant) {
- return UpdateEventDefinitionFeature.this.manageColor(colorConstant);
- }
- };
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- ContainerShape container = (ContainerShape) context.getPictogramElement();
- Event event = (Event) getBusinessObjectForPictogramElement(container);
-
- this.draw(event, container);
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.IUpdate#canUpdate(org.eclipse.graphiti.features.context.IUpdateContext)
- */
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.IUpdate#updateNeeded(org.eclipse.graphiti.features.context.IUpdateContext)
- */
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- return new Reason(false);
- }
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider context) {
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event.definitions;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.styles.Color;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.util.IColorConstant;
+
+public abstract class AbstractEventDefinitionFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context instanceof IAddContext) {
+ return ((IAddContext) context).getNewObject();
+ } else if (context instanceof IPictogramElementContext) {
+ EventDefinition ed = BusinessObjectUtil.getFirstElementOfType(
+ (((IPictogramElementContext) context).getPictogramElement()), EventDefinition.class);
+ if (ed!=null) {
+ return ed;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddEventDefinitionFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateEventDefinitionFeature(fp);
+ }
+
+ protected abstract Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape);
+
+ protected abstract Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape);
+
+ protected abstract Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape);
+
+ protected abstract Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape);
+
+ protected abstract Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape);
+
+ public class AddEventDefinitionFeature extends AbstractAddEventDefinitionFeature<EventDefinition> {
+
+ public AddEventDefinitionFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public DecorationAlgorithm getDecorationAlgorithm(final Event event) {
+ return new DecorationAlgorithm() {
+
+ @Override
+ public Shape draw(ContainerShape shape) {
+ if (event instanceof BoundaryEvent) {
+ return drawForBoundary(this, shape);
+ }
+ if (event instanceof IntermediateCatchEvent) {
+ return drawForCatch(this, shape);
+ }
+ if (event instanceof IntermediateThrowEvent) {
+ return drawForThrow(this, shape);
+ }
+ if (event instanceof StartEvent) {
+ return drawForStart(this, shape);
+ }
+ if (event instanceof EndEvent) {
+ return drawForEnd(this, shape);
+ }
+ return null;
+ }
+
+ @Override
+ public Color manageColor(IColorConstant colorConstant) {
+ return AddEventDefinitionFeature.this.manageColor(colorConstant);
+ }
+ };
+ }
+ }
+
+ public class UpdateEventDefinitionFeature extends AbstractUpdateEventDefinitionFeature {
+
+ public UpdateEventDefinitionFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public DecorationAlgorithm getDecorationAlgorithm(final Event event) {
+ return new DecorationAlgorithm() {
+
+ @Override
+ public Shape draw(ContainerShape shape) {
+ if (event instanceof BoundaryEvent) {
+ return drawForBoundary(this, shape);
+ }
+ if (event instanceof IntermediateCatchEvent) {
+ return drawForCatch(this, shape);
+ }
+ if (event instanceof IntermediateThrowEvent) {
+ return drawForThrow(this, shape);
+ }
+ if (event instanceof StartEvent) {
+ return drawForStart(this, shape);
+ }
+ if (event instanceof EndEvent) {
+ return drawForEnd(this, shape);
+ }
+ return null;
+ }
+
+ @Override
+ public Color manageColor(IColorConstant colorConstant) {
+ return UpdateEventDefinitionFeature.this.manageColor(colorConstant);
+ }
+ };
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ ContainerShape container = (ContainerShape) context.getPictogramElement();
+ Event event = (Event) getBusinessObjectForPictogramElement(container);
+
+ this.draw(event, container);
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.IUpdate#canUpdate(org.eclipse.graphiti.features.context.IUpdateContext)
+ */
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.IUpdate#updateNeeded(org.eclipse.graphiti.features.context.IUpdateContext)
+ */
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ return new Reason(false);
+ }
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider context) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractUpdateEventDefinitionFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractUpdateEventDefinitionFeature.java
index ce7c2a3..efdb71d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractUpdateEventDefinitionFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/AbstractUpdateEventDefinitionFeature.java
@@ -1,84 +1,84 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event.definitions;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public abstract class AbstractUpdateEventDefinitionFeature extends AbstractUpdateFeature {
-
- public AbstractUpdateEventDefinitionFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void draw(Event event, ContainerShape container) {
-
- List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(event);
- int size = eventDefinitions.size();
-
- GraphicsUtil.deleteEventShape(container);
- if (size==1) {
- Shape addedShape = getDecorationAlgorithm(event).draw(container);
- link(addedShape, eventDefinitions.get(0));
- }
- else if (size > 1) {
- Shape multipleShape = Graphiti.getPeService().createShape(container, false);
- drawForEvent(event, multipleShape);
- link(multipleShape, eventDefinitions.toArray(new EventDefinition[size]));
- }
- }
-
- public abstract DecorationAlgorithm getDecorationAlgorithm(Event event);
-
- private void drawForEvent(Event event, Shape shape) {
- if(event instanceof CatchEvent && ((CatchEvent) event).isParallelMultiple()) {
- drawParallelMultiple(event, shape);
- } else {
- drawMultiple(event, shape);
- }
- }
-
- private void drawMultiple(Event event, Shape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Polygon pentagon = GraphicsUtil.createEventPentagon(shape);
- if (event instanceof ThrowEvent) {
- StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_FOREGROUND);
- } else {
- StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_BACKGROUND);
- }
- StyleUtil.applyStyle(pentagon, be);
- }
-
- private void drawParallelMultiple(Event event, Shape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Polygon cross = GraphicsUtil.createEventParallelMultiple(shape);
- StyleUtil.setFillStyle(cross, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(cross, be);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event.definitions;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public abstract class AbstractUpdateEventDefinitionFeature extends AbstractUpdateFeature {
+
+ public AbstractUpdateEventDefinitionFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ public void draw(Event event, ContainerShape container) {
+
+ List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(event);
+ int size = eventDefinitions.size();
+
+ GraphicsUtil.deleteEventShape(container);
+ if (size==1) {
+ Shape addedShape = getDecorationAlgorithm(event).draw(container);
+ link(addedShape, eventDefinitions.get(0));
+ }
+ else if (size > 1) {
+ Shape multipleShape = Graphiti.getPeService().createShape(container, false);
+ drawForEvent(event, multipleShape);
+ link(multipleShape, eventDefinitions.toArray(new EventDefinition[size]));
+ }
+ }
+
+ public abstract DecorationAlgorithm getDecorationAlgorithm(Event event);
+
+ private void drawForEvent(Event event, Shape shape) {
+ if(event instanceof CatchEvent && ((CatchEvent) event).isParallelMultiple()) {
+ drawParallelMultiple(event, shape);
+ } else {
+ drawMultiple(event, shape);
+ }
+ }
+
+ private void drawMultiple(Event event, Shape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Polygon pentagon = GraphicsUtil.createEventPentagon(shape);
+ if (event instanceof ThrowEvent) {
+ StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_FOREGROUND);
+ } else {
+ StyleUtil.setFillStyle(pentagon, FillStyle.FILL_STYLE_BACKGROUND);
+ }
+ StyleUtil.applyStyle(pentagon, be);
+ }
+
+ private void drawParallelMultiple(Event event, Shape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Polygon cross = GraphicsUtil.createEventParallelMultiple(shape);
+ StyleUtil.setFillStyle(cross, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(cross, be);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/CreateEventDefinition.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/CreateEventDefinition.java
index 71c617f..208a68a 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/CreateEventDefinition.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/CreateEventDefinition.java
@@ -1,82 +1,82 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event.definitions;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.IFeatureAndContext;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-
-public abstract class CreateEventDefinition<T extends EventDefinition> extends AbstractBpmn2CreateFeature<T> {
-
- public CreateEventDefinition(IFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
- return bo != null && bo instanceof Event;
- }
-
- @Override
- public Object[] create(ICreateContext context) {
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
- List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(e);
- EventDefinition definition = createBusinessObject(context);
- eventDefinitions.add(definition);
- addGraphicalRepresentation(context, definition);
- ModelUtil.setID(definition);
- return new Object[] { definition };
- }
-
- protected abstract String getStencilImageId();
-
- @Override
- public String getCreateImageId() {
- return getStencilImageId();
- }
-
- @Override
- public String getCreateLargeImageId() {
- return getStencilImageId(); // FIXME
- }
-
-// @Override
-// public void postExecute(IExecutionInfo executionInfo) {
-// for (IFeatureAndContext fc : executionInfo.getExecutionList()) {
-// IContext context = fc.getContext();
-// if (context instanceof ICreateContext) {
-// ICreateContext cc = (ICreateContext)context;
-// T businessObject = getBusinessObject(cc);
-// Bpmn2Preferences prefs = (Bpmn2Preferences) ((DiagramEditor) getDiagramEditor()).getAdapter(Bpmn2Preferences.class);
-// if (prefs!=null && prefs.getShowPopupConfigDialog(businessObject)) {
-// ObjectEditingDialog dialog =
-// new ObjectEditingDialog((DiagramEditor)getDiagramEditor(), businessObject);
-// dialog.open();
-// }
-// }
-// }
-// }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event.definitions;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.IFeatureAndContext;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+
+public abstract class CreateEventDefinition<T extends EventDefinition> extends AbstractBpmn2CreateFeature<T> {
+
+ public CreateEventDefinition(IFeatureProvider fp, String name, String description) {
+ super(fp, name, description);
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
+ return bo != null && bo instanceof Event;
+ }
+
+ @Override
+ public Object[] create(ICreateContext context) {
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+ List<EventDefinition> eventDefinitions = ModelUtil.getEventDefinitions(e);
+ EventDefinition definition = createBusinessObject(context);
+ eventDefinitions.add(definition);
+ addGraphicalRepresentation(context, definition);
+ ModelUtil.setID(definition);
+ return new Object[] { definition };
+ }
+
+ protected abstract String getStencilImageId();
+
+ @Override
+ public String getCreateImageId() {
+ return getStencilImageId();
+ }
+
+ @Override
+ public String getCreateLargeImageId() {
+ return getStencilImageId(); // FIXME
+ }
+
+// @Override
+// public void postExecute(IExecutionInfo executionInfo) {
+// for (IFeatureAndContext fc : executionInfo.getExecutionList()) {
+// IContext context = fc.getContext();
+// if (context instanceof ICreateContext) {
+// ICreateContext cc = (ICreateContext)context;
+// T businessObject = getBusinessObject(cc);
+// Bpmn2Preferences prefs = (Bpmn2Preferences) ((DiagramEditor) getDiagramEditor()).getAdapter(Bpmn2Preferences.class);
+// if (prefs!=null && prefs.getShowPopupConfigDialog(businessObject)) {
+// ObjectEditingDialog dialog =
+// new ObjectEditingDialog((DiagramEditor)getDiagramEditor(), businessObject);
+// dialog.open();
+// }
+// }
+// }
+// }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/DecorationAlgorithm.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/DecorationAlgorithm.java
index d9683ce..6d7a39e 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/DecorationAlgorithm.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/definitions/DecorationAlgorithm.java
@@ -1,26 +1,26 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.event.definitions;
-
-import org.eclipse.graphiti.mm.algorithms.styles.Color;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.util.IColorConstant;
-
-
-public abstract class DecorationAlgorithm {
-
- public abstract Shape draw(ContainerShape shape);
-
- public abstract Color manageColor(IColorConstant colorCOnstant);
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.event.definitions;
+
+import org.eclipse.graphiti.mm.algorithms.styles.Color;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.util.IColorConstant;
+
+
+public abstract class DecorationAlgorithm {
+
+ public abstract Shape draw(ContainerShape shape);
+
+ public abstract Color manageColor(IColorConstant colorCOnstant);
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractAddFlowFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractAddFlowFeature.java
index 9f45af4..211bd3d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractAddFlowFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractAddFlowFeature.java
@@ -1,115 +1,115 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.flow;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.di.DIImport;
-import org.eclipse.bpmn2.modeler.core.features.AbstractAddBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddConnectionContext;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public abstract class AbstractAddFlowFeature<T extends BaseElement>
- extends AbstractAddBPMNShapeFeature<T> {
-
- public AbstractAddFlowFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canAdd(IAddContext context) {
- return context instanceof IAddConnectionContext
- && getBoClass().isAssignableFrom(getBusinessObject(context).getClass());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.func.IAdd#add(org.eclipse.graphiti.features.context.IAddContext)
- */
- @Override
- public PictogramElement add(IAddContext context) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
-
- T element = getBusinessObject(context);
- IAddConnectionContext addConContext = (IAddConnectionContext) context;
-
- Connection connection = peService.createFreeFormConnection(getDiagram());
-
- Object importProp = context.getProperty(DIImport.IMPORT_PROPERTY);
- if (importProp != null && (Boolean) importProp) {
- connection.setStart(addConContext.getSourceAnchor());
- connection.setEnd(addConContext.getTargetAnchor());
- } else {
- AnchorContainer sourceContainer = (AnchorContainer) addConContext.getSourceAnchor().eContainer();
- AnchorContainer targetContainer = (AnchorContainer) addConContext.getTargetAnchor().eContainer();
- Tuple<FixPointAnchor, FixPointAnchor> anchors = AnchorUtil.getSourceAndTargetBoundaryAnchors(
- sourceContainer, targetContainer, connection);
-
- connection.setStart(anchors.getFirst());
- connection.setEnd(anchors.getSecond());
- }
-
- if (ModelUtil.hasName(element)) {
- ConnectionDecorator labelDecorator = Graphiti.getPeService().createConnectionDecorator(connection, true, 0.5, true);
- Text text = gaService.createText(labelDecorator, ModelUtil.getName(element));
- peService.setPropertyValue(labelDecorator, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
- StyleUtil.applyStyle(text, element);
- }
-
- createDIEdge(connection, element);
-
- createConnectionLine(connection);
- hook(addConContext, connection, element);
-
- return connection;
- }
-
- @Override
- public int getHeight() {
- return -1;
- }
-
- @Override
- public int getWidth() {
- return -1;
- }
-
- protected abstract Class<? extends BaseElement> getBoClass();
-
- protected void hook(IAddContext context, Connection connection, BaseElement element) {
- }
-
- protected Polyline createConnectionLine(Connection connection) {
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
- Polyline connectionLine = Graphiti.getGaService().createPolyline(connection);
- StyleUtil.applyStyle(connectionLine, be);
-
- return connectionLine;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.flow;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
+import org.eclipse.bpmn2.modeler.core.features.AbstractAddBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddConnectionContext;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public abstract class AbstractAddFlowFeature<T extends BaseElement>
+ extends AbstractAddBPMNShapeFeature<T> {
+
+ public AbstractAddFlowFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canAdd(IAddContext context) {
+ return context instanceof IAddConnectionContext
+ && getBoClass().isAssignableFrom(getBusinessObject(context).getClass());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.func.IAdd#add(org.eclipse.graphiti.features.context.IAddContext)
+ */
+ @Override
+ public PictogramElement add(IAddContext context) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+
+ T element = getBusinessObject(context);
+ IAddConnectionContext addConContext = (IAddConnectionContext) context;
+
+ Connection connection = peService.createFreeFormConnection(getDiagram());
+
+ Object importProp = context.getProperty(DIImport.IMPORT_PROPERTY);
+ if (importProp != null && (Boolean) importProp) {
+ connection.setStart(addConContext.getSourceAnchor());
+ connection.setEnd(addConContext.getTargetAnchor());
+ } else {
+ AnchorContainer sourceContainer = (AnchorContainer) addConContext.getSourceAnchor().eContainer();
+ AnchorContainer targetContainer = (AnchorContainer) addConContext.getTargetAnchor().eContainer();
+ Tuple<FixPointAnchor, FixPointAnchor> anchors = AnchorUtil.getSourceAndTargetBoundaryAnchors(
+ sourceContainer, targetContainer, connection);
+
+ connection.setStart(anchors.getFirst());
+ connection.setEnd(anchors.getSecond());
+ }
+
+ if (ModelUtil.hasName(element)) {
+ ConnectionDecorator labelDecorator = Graphiti.getPeService().createConnectionDecorator(connection, true, 0.5, true);
+ Text text = gaService.createText(labelDecorator, ModelUtil.getName(element));
+ peService.setPropertyValue(labelDecorator, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
+ StyleUtil.applyStyle(text, element);
+ }
+
+ createDIEdge(connection, element);
+
+ createConnectionLine(connection);
+ hook(addConContext, connection, element);
+
+ return connection;
+ }
+
+ @Override
+ public int getHeight() {
+ return -1;
+ }
+
+ @Override
+ public int getWidth() {
+ return -1;
+ }
+
+ protected abstract Class<? extends BaseElement> getBoClass();
+
+ protected void hook(IAddContext context, Connection connection, BaseElement element) {
+ }
+
+ protected Polyline createConnectionLine(Connection connection) {
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
+ Polyline connectionLine = Graphiti.getGaService().createPolyline(connection);
+ StyleUtil.applyStyle(connectionLine, be);
+
+ return connectionLine;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractReconnectFlowFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractReconnectFlowFeature.java
index 6b14905..227ce8e 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractReconnectFlowFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractReconnectFlowFeature.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.flow;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.features.ReconnectBaseElementFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IReconnectionContext;
-import org.eclipse.graphiti.features.context.impl.ReconnectionContext;
-
-public abstract class AbstractReconnectFlowFeature extends ReconnectBaseElementFeature {
-
- public AbstractReconnectFlowFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- protected abstract Class<? extends EObject> getTargetClass();
- protected abstract Class<? extends EObject> getSourceClass();
-
-
- @Override
- public boolean canReconnect(IReconnectionContext context) {
- if (super.canReconnect(context)) {
- BaseElement targetElement = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
- if (targetElement!=null) {
- if (context.getReconnectType() == ReconnectionContext.RECONNECT_TARGET)
- return getTargetClass().isAssignableFrom(targetElement.getClass());
- return getSourceClass().isAssignableFrom(targetElement.getClass());
- }
- }
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.flow;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.features.ReconnectBaseElementFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IReconnectionContext;
+import org.eclipse.graphiti.features.context.impl.ReconnectionContext;
+
+public abstract class AbstractReconnectFlowFeature extends ReconnectBaseElementFeature {
+
+ public AbstractReconnectFlowFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ protected abstract Class<? extends EObject> getTargetClass();
+ protected abstract Class<? extends EObject> getSourceClass();
+
+
+ @Override
+ public boolean canReconnect(IReconnectionContext context) {
+ if (super.canReconnect(context)) {
+ BaseElement targetElement = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
+ if (targetElement!=null) {
+ if (context.getReconnectType() == ReconnectionContext.RECONNECT_TARGET)
+ return getTargetClass().isAssignableFrom(targetElement.getClass());
+ return getSourceClass().isAssignableFrom(targetElement.getClass());
+ }
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AbstractCreateGatewayFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AbstractCreateGatewayFeature.java
index e4a1f62..2785b50 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AbstractCreateGatewayFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AbstractCreateGatewayFeature.java
@@ -1,24 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.gateway;
-
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-
-public abstract class AbstractCreateGatewayFeature<T extends Gateway> extends AbstractCreateFlowElementFeature<T> {
-
- public AbstractCreateGatewayFeature(IFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.gateway;
+
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+
+public abstract class AbstractCreateGatewayFeature<T extends Gateway> extends AbstractCreateFlowElementFeature<T> {
+
+ public AbstractCreateGatewayFeature(IFeatureProvider fp, String name, String description) {
+ super(fp, name, description);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/DirectEditExclusiveGatewayFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/DirectEditExclusiveGatewayFeature.java
index 9046ae4..41a1939 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/DirectEditExclusiveGatewayFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/DirectEditExclusiveGatewayFeature.java
@@ -1,60 +1,60 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.gateway;
-
-import org.eclipse.bpmn2.ExclusiveGateway;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class DirectEditExclusiveGatewayFeature extends AbstractDirectEditingFeature {
-
- public DirectEditExclusiveGatewayFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public String getInitialValue(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- ExclusiveGateway eClass = (ExclusiveGateway) getBusinessObjectForPictogramElement(pe);
- return eClass.getName();
- }
-
- @Override
- public void setValue(String value, IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
-
- ExclusiveGateway gateway = (ExclusiveGateway) getBusinessObjectForPictogramElement(pe);
- gateway.setName(value);
-
- updatePictogramElement(((Shape) pe).getContainer());
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
-
- return bo instanceof ExclusiveGateway && ga instanceof Text;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.gateway;
+
+import org.eclipse.bpmn2.ExclusiveGateway;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class DirectEditExclusiveGatewayFeature extends AbstractDirectEditingFeature {
+
+ public DirectEditExclusiveGatewayFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public int getEditingType() {
+ return TYPE_TEXT;
+ }
+
+ @Override
+ public String getInitialValue(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ ExclusiveGateway eClass = (ExclusiveGateway) getBusinessObjectForPictogramElement(pe);
+ return eClass.getName();
+ }
+
+ @Override
+ public void setValue(String value, IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+
+ ExclusiveGateway gateway = (ExclusiveGateway) getBusinessObjectForPictogramElement(pe);
+ gateway.setName(value);
+
+ updatePictogramElement(((Shape) pe).getContainer());
+ }
+
+ @Override
+ public boolean canDirectEdit(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
+
+ return bo instanceof ExclusiveGateway && ga instanceof Text;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/DirectEditLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/DirectEditLaneFeature.java
index 7bd6585..9745bc9 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/DirectEditLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/DirectEditLaneFeature.java
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class DirectEditLaneFeature extends AbstractDirectEditingFeature {
-
- public DirectEditLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public String getInitialValue(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Lane lane = (Lane) getBusinessObjectForPictogramElement(pe);
- return lane.getName();
- }
-
- @Override
- public void setValue(String value, IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Lane lane = (Lane) getBusinessObjectForPictogramElement(pe);
- lane.setName(value);
- updatePictogramElement(((Shape) pe).getContainer());
- }
-
- @Override
- public String checkValueValid(String value, IDirectEditingContext context) {
- if (value.length() < 1) {
- return "Please enter any text as Pool name.";
- } else if (value.contains("\n")) {
- return "Line breakes are not allowed in Pool names.";
- }
- return null;
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
- return bo instanceof Lane && ga instanceof Text;
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class DirectEditLaneFeature extends AbstractDirectEditingFeature {
+
+ public DirectEditLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public int getEditingType() {
+ return TYPE_TEXT;
+ }
+
+ @Override
+ public String getInitialValue(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Lane lane = (Lane) getBusinessObjectForPictogramElement(pe);
+ return lane.getName();
+ }
+
+ @Override
+ public void setValue(String value, IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Lane lane = (Lane) getBusinessObjectForPictogramElement(pe);
+ lane.setName(value);
+ updatePictogramElement(((Shape) pe).getContainer());
+ }
+
+ @Override
+ public String checkValueValid(String value, IDirectEditingContext context) {
+ if (value.length() < 1) {
+ return "Please enter any text as Pool name.";
+ } else if (value.contains("\n")) {
+ return "Line breakes are not allowed in Pool names.";
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canDirectEdit(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
+ return bo instanceof Lane && ga instanceof Text;
+ }
+
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/LayoutLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/LayoutLaneFeature.java
index 115391a..b1907a7 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/LayoutLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/LayoutLaneFeature.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class LayoutLaneFeature extends DefaultLayoutBPMNShapeFeature {
-
- public LayoutLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- return FeatureSupport.isLane(context.getPictogramElement());
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- FeatureSupport.redraw((ContainerShape) context.getPictogramElement());
- DIUtils.updateDIShape(context.getPictogramElement());
-
- return super.layout(context);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class LayoutLaneFeature extends DefaultLayoutBPMNShapeFeature {
+
+ public LayoutLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ return FeatureSupport.isLane(context.getPictogramElement());
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ FeatureSupport.redraw((ContainerShape) context.getPictogramElement());
+ DIUtils.updateDIShape(context.getPictogramElement());
+
+ return super.layout(context);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToLaneFeature.java
index bb42428..9d7438f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToLaneFeature.java
@@ -1,135 +1,135 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.FlowNode;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.context.ITargetContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class MoveFromDiagramToLaneFeature extends MoveLaneFeature {
-
- public MoveFromDiagramToLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- boolean moveableHasFlowNodes = movedLane.getFlowNodeRefs().size() > 0;
-
- Lane targetLane = getTargetLane(context);
- boolean targetHasFlowNodeRefs = targetLane.getFlowNodeRefs().size() > 0;
-
- if (!moveableHasFlowNodes && !targetHasFlowNodeRefs) {
- return true;
- }
-
- return moveableHasFlowNodes ^ targetHasFlowNodeRefs;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- IGaService gaService = Graphiti.getGaService();
-
- Lane movedLane = getMovedLane(context);
- GraphicsAlgorithm laneGa = context.getShape().getGraphicsAlgorithm();
-
- Lane targetLane = getTargetLane(context);
- GraphicsAlgorithm tga = context.getTargetContainer().getGraphicsAlgorithm();
-
- List<Shape> shapes = getFlowNodeShapes(context, targetLane);
- modifyModelStructure(targetLane, movedLane);
-
- if (getNumberOfLanes(context) == 1) {
- gaService.setLocationAndSize(laneGa, 15, 0, tga.getWidth() - 15, tga.getHeight());
- for (Shape s : shapes) {
- Graphiti.getPeService().sendToFront(s);
- s.setContainer((ContainerShape) context.getShape());
- }
- } else {
- gaService.setLocationAndSize(laneGa, 15, tga.getHeight() - 1, tga.getWidth() - 15, laneGa.getHeight() + 1);
- }
-
- FeatureSupport.redraw(context.getTargetContainer());
- }
-
- private void modifyModelStructure(Lane targetLane, Lane lane) {
- LaneSet laneSet = (LaneSet) lane.eContainer();
- laneSet.getLanes().remove(lane);
-
- if (laneSet.getLanes().size() == 0) {
- EObject container = laneSet.eContainer();
- if (container instanceof Process) {
- Process p = (Process) container;
- p.getLaneSets().remove(laneSet);
- }
- }
-
- if (targetLane.getChildLaneSet() == null) {
- LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// createLaneSet.setId(EcoreUtil.generateUUID());
- targetLane.setChildLaneSet(createLaneSet);
- ModelUtil.setID(createLaneSet);
- }
-
- List<Lane> lanes = targetLane.getChildLaneSet().getLanes();
- lanes.add(lane);
-
- if (lanes.size() == 1) {
- List<FlowNode> flowNodeRefs = targetLane.getFlowNodeRefs();
- for (FlowNode flowNode : flowNodeRefs) {
- flowNode.getLanes().add(lane);
- }
- targetLane.getFlowNodeRefs().clear();
- }
- }
-
- private List<Shape> getFlowNodeShapes(IMoveShapeContext context, Lane lane) {
- List<FlowNode> nodes = lane.getFlowNodeRefs();
- List<Shape> shapes = new ArrayList<Shape>();
- for (Shape s : context.getTargetContainer().getChildren()) {
- Object bo = getBusinessObjectForPictogramElement(s);
- if (bo != null && nodes.contains(bo)) {
- shapes.add(s);
- }
- }
- return shapes;
- }
-
- private int getNumberOfLanes(ITargetContext context) {
- ContainerShape targetContainer = context.getTargetContainer();
- Lane lane = (Lane) getBusinessObjectForPictogramElement(targetContainer);
- return lane.getChildLaneSet().getLanes().size();
- }
-
- private Lane getTargetLane(IMoveShapeContext context) {
- ContainerShape targetContainer = context.getTargetContainer();
- return (Lane) getBusinessObjectForPictogramElement(targetContainer);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.FlowNode;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.context.ITargetContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class MoveFromDiagramToLaneFeature extends MoveLaneFeature {
+
+ public MoveFromDiagramToLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ boolean moveableHasFlowNodes = movedLane.getFlowNodeRefs().size() > 0;
+
+ Lane targetLane = getTargetLane(context);
+ boolean targetHasFlowNodeRefs = targetLane.getFlowNodeRefs().size() > 0;
+
+ if (!moveableHasFlowNodes && !targetHasFlowNodeRefs) {
+ return true;
+ }
+
+ return moveableHasFlowNodes ^ targetHasFlowNodeRefs;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ IGaService gaService = Graphiti.getGaService();
+
+ Lane movedLane = getMovedLane(context);
+ GraphicsAlgorithm laneGa = context.getShape().getGraphicsAlgorithm();
+
+ Lane targetLane = getTargetLane(context);
+ GraphicsAlgorithm tga = context.getTargetContainer().getGraphicsAlgorithm();
+
+ List<Shape> shapes = getFlowNodeShapes(context, targetLane);
+ modifyModelStructure(targetLane, movedLane);
+
+ if (getNumberOfLanes(context) == 1) {
+ gaService.setLocationAndSize(laneGa, 15, 0, tga.getWidth() - 15, tga.getHeight());
+ for (Shape s : shapes) {
+ Graphiti.getPeService().sendToFront(s);
+ s.setContainer((ContainerShape) context.getShape());
+ }
+ } else {
+ gaService.setLocationAndSize(laneGa, 15, tga.getHeight() - 1, tga.getWidth() - 15, laneGa.getHeight() + 1);
+ }
+
+ FeatureSupport.redraw(context.getTargetContainer());
+ }
+
+ private void modifyModelStructure(Lane targetLane, Lane lane) {
+ LaneSet laneSet = (LaneSet) lane.eContainer();
+ laneSet.getLanes().remove(lane);
+
+ if (laneSet.getLanes().size() == 0) {
+ EObject container = laneSet.eContainer();
+ if (container instanceof Process) {
+ Process p = (Process) container;
+ p.getLaneSets().remove(laneSet);
+ }
+ }
+
+ if (targetLane.getChildLaneSet() == null) {
+ LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// createLaneSet.setId(EcoreUtil.generateUUID());
+ targetLane.setChildLaneSet(createLaneSet);
+ ModelUtil.setID(createLaneSet);
+ }
+
+ List<Lane> lanes = targetLane.getChildLaneSet().getLanes();
+ lanes.add(lane);
+
+ if (lanes.size() == 1) {
+ List<FlowNode> flowNodeRefs = targetLane.getFlowNodeRefs();
+ for (FlowNode flowNode : flowNodeRefs) {
+ flowNode.getLanes().add(lane);
+ }
+ targetLane.getFlowNodeRefs().clear();
+ }
+ }
+
+ private List<Shape> getFlowNodeShapes(IMoveShapeContext context, Lane lane) {
+ List<FlowNode> nodes = lane.getFlowNodeRefs();
+ List<Shape> shapes = new ArrayList<Shape>();
+ for (Shape s : context.getTargetContainer().getChildren()) {
+ Object bo = getBusinessObjectForPictogramElement(s);
+ if (bo != null && nodes.contains(bo)) {
+ shapes.add(s);
+ }
+ }
+ return shapes;
+ }
+
+ private int getNumberOfLanes(ITargetContext context) {
+ ContainerShape targetContainer = context.getTargetContainer();
+ Lane lane = (Lane) getBusinessObjectForPictogramElement(targetContainer);
+ return lane.getChildLaneSet().getLanes().size();
+ }
+
+ private Lane getTargetLane(IMoveShapeContext context) {
+ ContainerShape targetContainer = context.getTargetContainer();
+ return (Lane) getBusinessObjectForPictogramElement(targetContainer);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToParticipantFeature.java
index 4ccb7bd..e627530 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToParticipantFeature.java
@@ -1,94 +1,94 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveFromDiagramToParticipantFeature extends MoveLaneFeature {
-
- public MoveFromDiagramToParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- Participant p = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
- return true;
- }
-
- if (p.getProcessRef() == null) {
- return true;
- }
-
- if (!p.getProcessRef().getLaneSets().isEmpty()) {
- return true;
- }
-
- return false;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- modifyModelStructure(context);
- FeatureSupport.redraw(context.getTargetContainer());
- }
-
- private void modifyModelStructure(IMoveShapeContext context) {
- try {
- Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context
- .getTargetContainer());
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- Lane movedLane = getMovedLane(context);
- handler.moveLane(movedLane, targetParticipant);
- Participant internalParticipant = handler.getParticipant(getDiagram());
- LaneSet laneSet = null;
- for (LaneSet set : internalParticipant.getProcessRef().getLaneSets()) {
- if (set.getLanes().contains(movedLane)) {
- laneSet = set;
- break;
- }
- }
- if (laneSet != null) {
- laneSet.getLanes().remove(movedLane);
- if (laneSet.getLanes().isEmpty()) {
- internalParticipant.getProcessRef().getLaneSets().remove(laneSet);
- }
-
- Process process = targetParticipant.getProcessRef();
- if (process.getLaneSets().isEmpty()) {
- LaneSet claneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// claneSet.setId(EcoreUtil.generateUUID());
- process.getLaneSets().add(claneSet);
- ModelUtil.setID(claneSet);
- }
- process.getLaneSets().get(0).getLanes().add(movedLane);
- }
- } catch (IOException e) {
- Activator.logError(e);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveFromDiagramToParticipantFeature extends MoveLaneFeature {
+
+ public MoveFromDiagramToParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ Participant p = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
+ return true;
+ }
+
+ if (p.getProcessRef() == null) {
+ return true;
+ }
+
+ if (!p.getProcessRef().getLaneSets().isEmpty()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ modifyModelStructure(context);
+ FeatureSupport.redraw(context.getTargetContainer());
+ }
+
+ private void modifyModelStructure(IMoveShapeContext context) {
+ try {
+ Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context
+ .getTargetContainer());
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ Lane movedLane = getMovedLane(context);
+ handler.moveLane(movedLane, targetParticipant);
+ Participant internalParticipant = handler.getParticipant(getDiagram());
+ LaneSet laneSet = null;
+ for (LaneSet set : internalParticipant.getProcessRef().getLaneSets()) {
+ if (set.getLanes().contains(movedLane)) {
+ laneSet = set;
+ break;
+ }
+ }
+ if (laneSet != null) {
+ laneSet.getLanes().remove(movedLane);
+ if (laneSet.getLanes().isEmpty()) {
+ internalParticipant.getProcessRef().getLaneSets().remove(laneSet);
+ }
+
+ Process process = targetParticipant.getProcessRef();
+ if (process.getLaneSets().isEmpty()) {
+ LaneSet claneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// claneSet.setId(EcoreUtil.generateUUID());
+ process.getLaneSets().add(claneSet);
+ ModelUtil.setID(claneSet);
+ }
+ process.getLaneSets().get(0).getLanes().add(movedLane);
+ }
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToDiagramFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToDiagramFeature.java
index 9bf67ea..7d4f990 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToDiagramFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToDiagramFeature.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveFromLaneToDiagramFeature extends MoveLaneFeature {
-
- public MoveFromLaneToDiagramFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- return true;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- modifyModelStructure(context);
- FeatureSupport.redraw(context.getSourceContainer());
- }
-
- private void modifyModelStructure(IMoveShapeContext context) {
- Lane parentLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
- Lane movedLane = (Lane) getBusinessObjectForPictogramElement(context.getShape());
- parentLane.getChildLaneSet().getLanes().remove(movedLane);
- try {
- ModelHandler mh = ModelHandler.getInstance(getDiagram());
- mh.laneToTop(movedLane);
- } catch (IOException e) {
- Activator.logError(e);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveFromLaneToDiagramFeature extends MoveLaneFeature {
+
+ public MoveFromLaneToDiagramFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ return true;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ modifyModelStructure(context);
+ FeatureSupport.redraw(context.getSourceContainer());
+ }
+
+ private void modifyModelStructure(IMoveShapeContext context) {
+ Lane parentLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
+ Lane movedLane = (Lane) getBusinessObjectForPictogramElement(context.getShape());
+ parentLane.getChildLaneSet().getLanes().remove(movedLane);
+ try {
+ ModelHandler mh = ModelHandler.getInstance(getDiagram());
+ mh.laneToTop(movedLane);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToLaneFeature.java
index b511153..0b6f7e8 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToLaneFeature.java
@@ -1,101 +1,101 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.context.ITargetContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class MoveFromLaneToLaneFeature extends MoveLaneFeature {
-
- public MoveFromLaneToLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- Lane targetLane = getTargetLane(context);
-
- if (targetLane.getFlowNodeRefs() != null && targetLane.getFlowNodeRefs().size() > 0) {
- return false;
- }
-
- Lane movedLane = getMovedLane(context);
-
- if (targetLane.getChildLaneSet() != null && targetLane.getChildLaneSet().getLanes().contains(movedLane)) {
- return false;
- }
-
- return true;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- Lane targetLane = getTargetLane(context);
- Lane sourceLane = getSourceLane(context);
-
- modifyModelStructure(sourceLane, targetLane, movedLane);
-
- FeatureSupport.redraw(context.getSourceContainer());
- FeatureSupport.redraw(context.getTargetContainer());
- }
-
- private void modifyModelStructure(Lane sourceLane, Lane targetLane, Lane movedLane) {
- if (targetLane.getChildLaneSet() == null) {
- LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// createLaneSet.setId(EcoreUtil.generateUUID());
- targetLane.setChildLaneSet(createLaneSet);
- ModelUtil.setID(createLaneSet);
- }
-
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- Participant sourceParticipant = handler.getParticipant(sourceLane);
- Participant targetParticipant = handler.getParticipant(targetLane);
- if (!sourceParticipant.equals(targetParticipant)) {
- handler.moveLane(movedLane, sourceParticipant, targetParticipant);
- }
- } catch (IOException e) {
- Activator.logError(e);
- }
-
- targetLane.getChildLaneSet().getLanes().add(movedLane);
- sourceLane.getChildLaneSet().getLanes().remove(movedLane);
-
- if (sourceLane.getChildLaneSet().getLanes().isEmpty()) {
- sourceLane.setChildLaneSet(null);
- }
- }
-
- private Lane getTargetLane(ITargetContext context) {
- ContainerShape targetContainer = context.getTargetContainer();
- return (Lane) getBusinessObjectForPictogramElement(targetContainer);
- }
-
- private Lane getSourceLane(IMoveShapeContext context) {
- ContainerShape sourceContainer = context.getSourceContainer();
- return (Lane) getBusinessObjectForPictogramElement(sourceContainer);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.context.ITargetContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class MoveFromLaneToLaneFeature extends MoveLaneFeature {
+
+ public MoveFromLaneToLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ Lane targetLane = getTargetLane(context);
+
+ if (targetLane.getFlowNodeRefs() != null && targetLane.getFlowNodeRefs().size() > 0) {
+ return false;
+ }
+
+ Lane movedLane = getMovedLane(context);
+
+ if (targetLane.getChildLaneSet() != null && targetLane.getChildLaneSet().getLanes().contains(movedLane)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ Lane targetLane = getTargetLane(context);
+ Lane sourceLane = getSourceLane(context);
+
+ modifyModelStructure(sourceLane, targetLane, movedLane);
+
+ FeatureSupport.redraw(context.getSourceContainer());
+ FeatureSupport.redraw(context.getTargetContainer());
+ }
+
+ private void modifyModelStructure(Lane sourceLane, Lane targetLane, Lane movedLane) {
+ if (targetLane.getChildLaneSet() == null) {
+ LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// createLaneSet.setId(EcoreUtil.generateUUID());
+ targetLane.setChildLaneSet(createLaneSet);
+ ModelUtil.setID(createLaneSet);
+ }
+
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ Participant sourceParticipant = handler.getParticipant(sourceLane);
+ Participant targetParticipant = handler.getParticipant(targetLane);
+ if (!sourceParticipant.equals(targetParticipant)) {
+ handler.moveLane(movedLane, sourceParticipant, targetParticipant);
+ }
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+
+ targetLane.getChildLaneSet().getLanes().add(movedLane);
+ sourceLane.getChildLaneSet().getLanes().remove(movedLane);
+
+ if (sourceLane.getChildLaneSet().getLanes().isEmpty()) {
+ sourceLane.setChildLaneSet(null);
+ }
+ }
+
+ private Lane getTargetLane(ITargetContext context) {
+ ContainerShape targetContainer = context.getTargetContainer();
+ return (Lane) getBusinessObjectForPictogramElement(targetContainer);
+ }
+
+ private Lane getSourceLane(IMoveShapeContext context) {
+ ContainerShape sourceContainer = context.getSourceContainer();
+ return (Lane) getBusinessObjectForPictogramElement(sourceContainer);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToParticipantFeature.java
index eb943ae..f1053b3 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToParticipantFeature.java
@@ -1,87 +1,87 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveFromLaneToParticipantFeature extends MoveLaneFeature {
-
- public MoveFromLaneToParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
- return true;
- }
-
- Participant p = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (p.getProcessRef() == null) {
- return true;
- }
-
- if (!p.getProcessRef().getLaneSets().isEmpty()) {
- return true;
- }
-
- return false;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- modifyModelStructure(context);
- FeatureSupport.redraw(context.getTargetContainer());
- FeatureSupport.redraw(context.getSourceContainer());
- }
-
- private void modifyModelStructure(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- handler.moveLane(movedLane, targetParticipant);
- } catch (IOException e) {
- Activator.logError(e);
- }
-
- Process process = targetParticipant.getProcessRef();
- if (process.getLaneSets().isEmpty()) {
- LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// createLaneSet.setId(EcoreUtil.generateUUID());
- process.getLaneSets().add(createLaneSet);
- ModelUtil.setID(createLaneSet);
- }
- process.getLaneSets().get(0).getLanes().add(movedLane);
-
- Lane fromLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
- fromLane.getChildLaneSet().getLanes().remove(movedLane);
- if (fromLane.getChildLaneSet().getLanes().isEmpty()) {
- fromLane.setChildLaneSet(null);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveFromLaneToParticipantFeature extends MoveLaneFeature {
+
+ public MoveFromLaneToParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
+ return true;
+ }
+
+ Participant p = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (p.getProcessRef() == null) {
+ return true;
+ }
+
+ if (!p.getProcessRef().getLaneSets().isEmpty()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ modifyModelStructure(context);
+ FeatureSupport.redraw(context.getTargetContainer());
+ FeatureSupport.redraw(context.getSourceContainer());
+ }
+
+ private void modifyModelStructure(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ handler.moveLane(movedLane, targetParticipant);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+
+ Process process = targetParticipant.getProcessRef();
+ if (process.getLaneSets().isEmpty()) {
+ LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// createLaneSet.setId(EcoreUtil.generateUUID());
+ process.getLaneSets().add(createLaneSet);
+ ModelUtil.setID(createLaneSet);
+ }
+ process.getLaneSets().get(0).getLanes().add(movedLane);
+
+ Lane fromLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
+ fromLane.getChildLaneSet().getLanes().remove(movedLane);
+ if (fromLane.getChildLaneSet().getLanes().isEmpty()) {
+ fromLane.setChildLaneSet(null);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToDiagramFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToDiagramFeature.java
index d635cce..3c26797 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToDiagramFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToDiagramFeature.java
@@ -1,83 +1,83 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveFromParticipantToDiagramFeature extends MoveLaneFeature {
-
- public MoveFromParticipantToDiagramFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- return true;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- modifyModelStructure(context);
- FeatureSupport.redraw(context.getSourceContainer());
- }
-
- private void modifyModelStructure(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
- Participant internalParticipant = null;
-
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- internalParticipant = handler.getInternalParticipant();
- handler.moveLane(movedLane, internalParticipant);
- } catch (IOException e) {
- Activator.logError(e);
- }
-
- LaneSet laneSet = null;
- for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
- if (set.getLanes().contains(movedLane)) {
- laneSet = set;
- break;
- }
- }
-
- if (laneSet != null) {
- laneSet.getLanes().remove(movedLane);
- if (laneSet.getLanes().isEmpty()) {
- sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
- }
-
- Process process = internalParticipant.getProcessRef();
- if (process.getLaneSets().isEmpty()) {
- LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// createLaneSet.setId(EcoreUtil.generateUUID());
- process.getLaneSets().add(createLaneSet);
- ModelUtil.setID(createLaneSet);
- }
- process.getLaneSets().get(0).getLanes().add(movedLane);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveFromParticipantToDiagramFeature extends MoveLaneFeature {
+
+ public MoveFromParticipantToDiagramFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ return true;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ modifyModelStructure(context);
+ FeatureSupport.redraw(context.getSourceContainer());
+ }
+
+ private void modifyModelStructure(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
+ Participant internalParticipant = null;
+
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ internalParticipant = handler.getInternalParticipant();
+ handler.moveLane(movedLane, internalParticipant);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+
+ LaneSet laneSet = null;
+ for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
+ if (set.getLanes().contains(movedLane)) {
+ laneSet = set;
+ break;
+ }
+ }
+
+ if (laneSet != null) {
+ laneSet.getLanes().remove(movedLane);
+ if (laneSet.getLanes().isEmpty()) {
+ sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
+ }
+
+ Process process = internalParticipant.getProcessRef();
+ if (process.getLaneSets().isEmpty()) {
+ LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// createLaneSet.setId(EcoreUtil.generateUUID());
+ process.getLaneSets().add(createLaneSet);
+ ModelUtil.setID(createLaneSet);
+ }
+ process.getLaneSets().get(0).getLanes().add(movedLane);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToLaneFeature.java
index e1982fc..28ce0c7 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToLaneFeature.java
@@ -1,99 +1,99 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class MoveFromParticipantToLaneFeature extends MoveLaneFeature {
-
- public MoveFromParticipantToLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- boolean moveableHasFlowNodes = movedLane.getFlowNodeRefs().size() > 0;
-
- Lane targetLane = getTargetLane(context);
- boolean targetHasFlowNodeRefs = targetLane.getFlowNodeRefs().size() > 0;
-
- if (!moveableHasFlowNodes && !targetHasFlowNodeRefs) {
- return true;
- }
-
- return moveableHasFlowNodes ^ targetHasFlowNodeRefs;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- modifyModelStructure(context);
- FeatureSupport.redraw(context.getSourceContainer());
- FeatureSupport.redraw(context.getTargetContainer());
- }
-
- private Lane getTargetLane(IMoveShapeContext context) {
- ContainerShape targetContainer = context.getTargetContainer();
- return (Lane) getBusinessObjectForPictogramElement(targetContainer);
- }
-
- private void modifyModelStructure(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- Lane toLane = getTargetLane(context);
-
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- Participant participant = handler.getParticipant(toLane);
- handler.moveLane(movedLane, participant);
- } catch (IOException e) {
- Activator.logError(e);
- }
-
- Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
-
- LaneSet laneSet = null;
- for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
- if (set.getLanes().contains(movedLane)) {
- laneSet = set;
- break;
- }
- }
-
- if (laneSet != null) {
- laneSet.getLanes().remove(movedLane);
- if (laneSet.getLanes().isEmpty()) {
- sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
- }
- }
-
- if (toLane.getChildLaneSet() == null) {
- LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// createLaneSet.setId(EcoreUtil.generateUUID());
- toLane.setChildLaneSet(createLaneSet);
- ModelUtil.setID(createLaneSet);
- }
- toLane.getChildLaneSet().getLanes().add(movedLane);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class MoveFromParticipantToLaneFeature extends MoveLaneFeature {
+
+ public MoveFromParticipantToLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ boolean moveableHasFlowNodes = movedLane.getFlowNodeRefs().size() > 0;
+
+ Lane targetLane = getTargetLane(context);
+ boolean targetHasFlowNodeRefs = targetLane.getFlowNodeRefs().size() > 0;
+
+ if (!moveableHasFlowNodes && !targetHasFlowNodeRefs) {
+ return true;
+ }
+
+ return moveableHasFlowNodes ^ targetHasFlowNodeRefs;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ modifyModelStructure(context);
+ FeatureSupport.redraw(context.getSourceContainer());
+ FeatureSupport.redraw(context.getTargetContainer());
+ }
+
+ private Lane getTargetLane(IMoveShapeContext context) {
+ ContainerShape targetContainer = context.getTargetContainer();
+ return (Lane) getBusinessObjectForPictogramElement(targetContainer);
+ }
+
+ private void modifyModelStructure(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ Lane toLane = getTargetLane(context);
+
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ Participant participant = handler.getParticipant(toLane);
+ handler.moveLane(movedLane, participant);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+
+ Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
+
+ LaneSet laneSet = null;
+ for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
+ if (set.getLanes().contains(movedLane)) {
+ laneSet = set;
+ break;
+ }
+ }
+
+ if (laneSet != null) {
+ laneSet.getLanes().remove(movedLane);
+ if (laneSet.getLanes().isEmpty()) {
+ sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
+ }
+ }
+
+ if (toLane.getChildLaneSet() == null) {
+ LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// createLaneSet.setId(EcoreUtil.generateUUID());
+ toLane.setChildLaneSet(createLaneSet);
+ ModelUtil.setID(createLaneSet);
+ }
+ toLane.getChildLaneSet().getLanes().add(movedLane);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToParticipantFeature.java
index 29d25c3..d5161ab 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToParticipantFeature.java
@@ -1,103 +1,103 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveFromParticipantToParticipantFeature extends MoveLaneFeature {
-
- public MoveFromParticipantToParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- Participant p1 = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
- Participant p2 = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (p1.equals(p2)) {
- return false;
- }
-
- if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
- return true;
- }
-
- if (p2.getProcessRef() == null) {
- return true;
- }
-
- if (!p2.getProcessRef().getLaneSets().isEmpty()) {
- return true;
- }
-
- return false;
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- modifyModelStructure(context);
- FeatureSupport.redraw(context.getSourceContainer());
- FeatureSupport.redraw(context.getTargetContainer());
- }
-
- private void modifyModelStructure(IMoveShapeContext context) {
- Lane movedLane = getMovedLane(context);
- Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- handler.moveLane(movedLane, targetParticipant);
- } catch (IOException e) {
- Activator.logError(e);
- }
-
- Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
-
- LaneSet laneSet = null;
- for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
- if (set.getLanes().contains(movedLane)) {
- laneSet = set;
- break;
- }
- }
-
- if (laneSet != null) {
- laneSet.getLanes().remove(movedLane);
- if (laneSet.getLanes().isEmpty()) {
- sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
- }
-
- Process process = targetParticipant.getProcessRef();
- if (process.getLaneSets().isEmpty()) {
- LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
-// createLaneSet.setId(EcoreUtil.generateUUID());
- process.getLaneSets().add(createLaneSet);
- ModelUtil.setID(createLaneSet);
- }
- process.getLaneSets().get(0).getLanes().add(movedLane);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveFromParticipantToParticipantFeature extends MoveLaneFeature {
+
+ public MoveFromParticipantToParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ Participant p1 = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
+ Participant p2 = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (p1.equals(p2)) {
+ return false;
+ }
+
+ if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
+ return true;
+ }
+
+ if (p2.getProcessRef() == null) {
+ return true;
+ }
+
+ if (!p2.getProcessRef().getLaneSets().isEmpty()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ modifyModelStructure(context);
+ FeatureSupport.redraw(context.getSourceContainer());
+ FeatureSupport.redraw(context.getTargetContainer());
+ }
+
+ private void modifyModelStructure(IMoveShapeContext context) {
+ Lane movedLane = getMovedLane(context);
+ Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ handler.moveLane(movedLane, targetParticipant);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+
+ Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
+
+ LaneSet laneSet = null;
+ for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
+ if (set.getLanes().contains(movedLane)) {
+ laneSet = set;
+ break;
+ }
+ }
+
+ if (laneSet != null) {
+ laneSet.getLanes().remove(movedLane);
+ if (laneSet.getLanes().isEmpty()) {
+ sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
+ }
+
+ Process process = targetParticipant.getProcessRef();
+ if (process.getLaneSets().isEmpty()) {
+ LaneSet createLaneSet = Bpmn2ModelerFactory.create(LaneSet.class);
+// createLaneSet.setId(EcoreUtil.generateUUID());
+ process.getLaneSets().add(createLaneSet);
+ ModelUtil.setID(createLaneSet);
+ }
+ process.getLaneSets().get(0).getLanes().add(movedLane);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveLaneFeature.java
index 1443cff..fc88df3 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveLaneFeature.java
@@ -1,89 +1,89 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-
-public class MoveLaneFeature extends DefaultMoveBPMNShapeFeature {
-
- private MoveLaneFeature moveStrategy;
-
- public MoveLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- if (context.getSourceContainer() == null) {
- return false;
- }
-
- moveStrategy = getStrategy(context);
-
- if (moveStrategy == null) {
- return super.canMoveShape(context);
- }
-
- return moveStrategy.canMoveShape(context);
- }
-
- @Override
- protected void internalMove(IMoveShapeContext context) {
- super.internalMove(context);
- if (moveStrategy != null) {
- moveStrategy.internalMove(context);
- }
- }
-
- private MoveLaneFeature getStrategy(IMoveShapeContext context) {
-
- if (context.getSourceContainer().equals(getDiagram())) { // from diagram
-
- if (FeatureSupport.isTargetLane(context)) { // to lane
- return new MoveFromDiagramToLaneFeature(getFeatureProvider());
- } else if (FeatureSupport.isTargetParticipant(context)) { // to participant
- return new MoveFromDiagramToParticipantFeature(getFeatureProvider());
- }
-
- } else if (FeatureSupport.isLane(context.getSourceContainer())) { // from lane
-
- if (context.getTargetContainer().equals(getDiagram())) { // to diagram
- return new MoveFromLaneToDiagramFeature(getFeatureProvider());
- } else if (FeatureSupport.isTargetLane(context)) { // to another lane
- return new MoveFromLaneToLaneFeature(getFeatureProvider());
- } else if (FeatureSupport.isTargetParticipant(context)) { // to participant
- return new MoveFromLaneToParticipantFeature(getFeatureProvider());
- }
-
- } else if (FeatureSupport.isParticipant(context.getSourceContainer())) { // from participant
-
- if (context.getTargetContainer().equals(getDiagram())) { // to diagram
- return new MoveFromParticipantToDiagramFeature(getFeatureProvider());
- } else if (FeatureSupport.isTargetLane(context)) { // to another lane
- return new MoveFromParticipantToLaneFeature(getFeatureProvider());
- } else if (FeatureSupport.isTargetParticipant(context)) { // to another participant
- return new MoveFromParticipantToParticipantFeature(getFeatureProvider());
- }
- }
-
- return null;
- }
-
- protected Lane getMovedLane(IMoveShapeContext context) {
- return (Lane) getBusinessObjectForPictogramElement(context.getShape());
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+
+public class MoveLaneFeature extends DefaultMoveBPMNShapeFeature {
+
+ private MoveLaneFeature moveStrategy;
+
+ public MoveLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ if (context.getSourceContainer() == null) {
+ return false;
+ }
+
+ moveStrategy = getStrategy(context);
+
+ if (moveStrategy == null) {
+ return super.canMoveShape(context);
+ }
+
+ return moveStrategy.canMoveShape(context);
+ }
+
+ @Override
+ protected void internalMove(IMoveShapeContext context) {
+ super.internalMove(context);
+ if (moveStrategy != null) {
+ moveStrategy.internalMove(context);
+ }
+ }
+
+ private MoveLaneFeature getStrategy(IMoveShapeContext context) {
+
+ if (context.getSourceContainer().equals(getDiagram())) { // from diagram
+
+ if (FeatureSupport.isTargetLane(context)) { // to lane
+ return new MoveFromDiagramToLaneFeature(getFeatureProvider());
+ } else if (FeatureSupport.isTargetParticipant(context)) { // to participant
+ return new MoveFromDiagramToParticipantFeature(getFeatureProvider());
+ }
+
+ } else if (FeatureSupport.isLane(context.getSourceContainer())) { // from lane
+
+ if (context.getTargetContainer().equals(getDiagram())) { // to diagram
+ return new MoveFromLaneToDiagramFeature(getFeatureProvider());
+ } else if (FeatureSupport.isTargetLane(context)) { // to another lane
+ return new MoveFromLaneToLaneFeature(getFeatureProvider());
+ } else if (FeatureSupport.isTargetParticipant(context)) { // to participant
+ return new MoveFromLaneToParticipantFeature(getFeatureProvider());
+ }
+
+ } else if (FeatureSupport.isParticipant(context.getSourceContainer())) { // from participant
+
+ if (context.getTargetContainer().equals(getDiagram())) { // to diagram
+ return new MoveFromParticipantToDiagramFeature(getFeatureProvider());
+ } else if (FeatureSupport.isTargetLane(context)) { // to another lane
+ return new MoveFromParticipantToLaneFeature(getFeatureProvider());
+ } else if (FeatureSupport.isTargetParticipant(context)) { // to another participant
+ return new MoveFromParticipantToParticipantFeature(getFeatureProvider());
+ }
+ }
+
+ return null;
+ }
+
+ protected Lane getMovedLane(IMoveShapeContext context) {
+ return (Lane) getBusinessObjectForPictogramElement(context.getShape());
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/ResizeLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/ResizeLaneFeature.java
index 4b8368a..4f079dd 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/ResizeLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/ResizeLaneFeature.java
@@ -1,258 +1,258 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.modeler.core.features.DefaultResizeBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.participant.ResizeParticipantFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class ResizeLaneFeature extends DefaultResizeBPMNShapeFeature {
-
- public static final String LANE_RESIZE_PROPERTY = "lane.resize";
-
- public ResizeLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- boolean isLane = FeatureSupport.isLane(context.getPictogramElement());
- if (!isLane) {
- return false;
- }
-
- boolean isParentLane = FeatureSupport.isLane(((ContainerShape) context
- .getPictogramElement()).getContainer());
- if (!isParentLane) {
- return true;
- }
-
- if (context.getHeight() == -1 && context.getWidth() == -1) {
- return true;
- }
-
- GraphicsAlgorithm ga = ((ContainerShape) context.getPictogramElement())
- .getGraphicsAlgorithm();
-
- int i = compare(ga.getHeight(), ga.getWidth(), context.getHeight(),
- context.getWidth());
-
- Lane lane = (Lane) BusinessObjectUtil.getFirstElementOfType(
- context.getPictogramElement(), Lane.class);
-
- if (i < 0 && lane.getFlowNodeRefs().size() == 0) {
- return true;
- }
-
- if (i > 0) {
- return true;
- }
-
- return true;
- }
-
- private int compare(int heightBefore, int widthBefore, int heightAfter,
- int widthAfter) {
- if (heightAfter > heightBefore || widthAfter > widthBefore) {
- return 1;
- }
- if (heightAfter < heightBefore || widthAfter < widthBefore) {
- return -1;
- }
- return 0;
- }
-
- private void resizeHeight(IResizeShapeContext context) {
- ContainerShape laneContainerShape = (ContainerShape) context.getShape();
- GraphicsAlgorithm ga = laneContainerShape.getGraphicsAlgorithm();
-
- boolean isHorizontal = FeatureSupport.isHorizontal(laneContainerShape);
-
- if ((isHorizontal && ga.getHeight() != context.getHeight())
- || (!isHorizontal && ga.getWidth() != context.getWidth())) {
-
- ContainerShape rootContainer = FeatureSupport.getRootContainer(laneContainerShape);
-
- boolean fetchFirstProp = false;
- Object fetchFirstProperty = context.getProperty(ResizeParticipantFeature.RESIZE_FIRST_LANE);
- if (fetchFirstProperty != null && ((Boolean) fetchFirstProperty).booleanValue()) {
- fetchFirstProp = true;
- } else {
- if ((isHorizontal && context.getY() != ga.getY()) ||
- (!isHorizontal && context.getX() != ga.getX())) {
- fetchFirstProp = true;
- if (laneContainerShape.equals(rootContainer)) {
- Graphiti.getGaService().setLocation(ga, context.getX(), context.getY());
- }
- }
- }
-
- ContainerShape lowestContainingLane = getLowestLane(laneContainerShape, fetchFirstProp);
- GraphicsAlgorithm lowestLaneGA = lowestContainingLane.getGraphicsAlgorithm();
-
- int width = 0;
- int height = 0;
-
- if (isHorizontal) {
- int dHeight = context.getHeight() - ga.getHeight();
- height = lowestLaneGA.getHeight() + dHeight;
- if (height < 100) {
- height = 100;
- }
- width = lowestLaneGA.getWidth();
- } else {
- int dWidth = context.getWidth() - ga.getWidth();
- width = lowestLaneGA.getWidth() + dWidth;
- if (width < 100) {
- width = 100;
- }
- height = lowestLaneGA.getHeight();
- }
-
- ResizeShapeContext newContext = new ResizeShapeContext(lowestContainingLane);
-
- newContext.setX(lowestLaneGA.getX());
- newContext.setY(lowestLaneGA.getY());
- newContext.setHeight(height);
- newContext.setWidth(width);
-
- super.resizeShape(newContext);
- }
- }
-
- private void resizeWidth(IResizeShapeContext context) {
- ContainerShape laneContainerShape = (ContainerShape) context.getShape();
- GraphicsAlgorithm ga = laneContainerShape.getGraphicsAlgorithm();
-
- boolean isHorizontal = FeatureSupport.isHorizontal(laneContainerShape);
-
- if ((isHorizontal && ga.getWidth() != context.getWidth())
- || (!isHorizontal && ga.getHeight() != context.getHeight())) {
-
-
- int dWidth = 0;
- int dHeight = 0;
- if (isHorizontal) {
- dWidth = context.getWidth() - ga.getWidth();
- } else {
- dHeight = context.getHeight() - ga.getHeight();
- }
-
- Object poolResizeProperty = context.getProperty(ResizeParticipantFeature.POOL_RESIZE_PROPERTY);
- if (poolResizeProperty != null && ((Boolean) poolResizeProperty).booleanValue()) {
- if (isHorizontal) {
- Graphiti.getGaService().setWidth(ga, context.getWidth());
- } else {
- Graphiti.getGaService().setHeight(ga, context.getHeight());
- }
- for (PictogramElement currentChild : FeatureSupport.getChildsOfBusinessObjectType(laneContainerShape, Lane.class)) {
- if (currentChild instanceof ContainerShape) {
- ContainerShape currentContainer = (ContainerShape) currentChild;
- GraphicsAlgorithm currentGA = currentChild.getGraphicsAlgorithm();
-
- ResizeShapeContext newContext = new ResizeShapeContext(currentContainer);
-
- newContext.setX(currentGA.getX());
- newContext.setY(currentGA.getY());
- newContext.setHeight(currentGA.getHeight() + dHeight);
- newContext.setWidth(currentGA.getWidth() + dWidth);
-
-
- newContext.putProperty(ResizeParticipantFeature.POOL_RESIZE_PROPERTY, true);
-
- resizeShape(newContext);
- }
- }
- } else {
- ContainerShape rootContainer = FeatureSupport.getRootContainer(laneContainerShape);
- GraphicsAlgorithm rootGA = rootContainer.getGraphicsAlgorithm();
-
- if (FeatureSupport.isParticipant(rootContainer)) {
- ResizeShapeContext newContext = new ResizeShapeContext(rootContainer);
-
- newContext.setX(rootGA.getX());
- newContext.setY(rootGA.getY());
- newContext.setWidth(rootGA.getWidth() + dWidth);
- newContext.setHeight(rootGA.getHeight() + dHeight);
-
- IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
- if (resizeFeature.canResizeShape(newContext)) {
- resizeFeature.resizeShape(newContext);
- }
- } else {
- ContainerShape container = null;
- Object rootIsLaneProperty = context.getProperty(LANE_RESIZE_PROPERTY);
- if (rootIsLaneProperty != null && ((Boolean) rootIsLaneProperty).booleanValue()) {
- Graphiti.getGaService().setWidth(ga, context.getWidth());
- Graphiti.getGaService().setHeight(ga, context.getHeight());
- container = laneContainerShape;
- } else {
- container = rootContainer;
- if (isHorizontal) {
- Graphiti.getGaService().setWidth(rootGA, rootGA.getWidth() + dWidth);
- } else {
- Graphiti.getGaService().setHeight(rootGA, rootGA.getHeight() + dHeight);
- }
- }
- for (PictogramElement currentChild : FeatureSupport.getChildsOfBusinessObjectType(container, Lane.class)) {
- if (currentChild instanceof ContainerShape) {
- ContainerShape currentContainer = (ContainerShape) currentChild;
- GraphicsAlgorithm currentGA = currentChild.getGraphicsAlgorithm();
-
- ResizeShapeContext newContext = new ResizeShapeContext(currentContainer);
-
- newContext.setX(currentGA.getX());
- newContext.setY(currentGA.getY());
- newContext.setHeight(currentGA.getHeight() + dHeight);
- newContext.setWidth(currentGA.getHeight() + dHeight);
-
- newContext.putProperty(LANE_RESIZE_PROPERTY, true);
-
- resizeShape(newContext);
- }
- }
- }
- }
- }
- }
-
- @Override
- public void resizeShape(IResizeShapeContext context) {
- resizeHeight(context);
- resizeWidth(context);
- }
-
- private ContainerShape getLowestLane(ContainerShape root, boolean fetchFirst) {
- ContainerShape result;
- if (fetchFirst) {
- result = (ContainerShape) FeatureSupport.getFirstLaneInContainer(root);
- } else {
- result = (ContainerShape) FeatureSupport.getLastLaneInContainer(root);
- }
- if (!result.equals(root)) {
- return getLowestLane(result, fetchFirst);
- }
- return result;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.modeler.core.features.DefaultResizeBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.participant.ResizeParticipantFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class ResizeLaneFeature extends DefaultResizeBPMNShapeFeature {
+
+ public static final String LANE_RESIZE_PROPERTY = "lane.resize";
+
+ public ResizeLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ boolean isLane = FeatureSupport.isLane(context.getPictogramElement());
+ if (!isLane) {
+ return false;
+ }
+
+ boolean isParentLane = FeatureSupport.isLane(((ContainerShape) context
+ .getPictogramElement()).getContainer());
+ if (!isParentLane) {
+ return true;
+ }
+
+ if (context.getHeight() == -1 && context.getWidth() == -1) {
+ return true;
+ }
+
+ GraphicsAlgorithm ga = ((ContainerShape) context.getPictogramElement())
+ .getGraphicsAlgorithm();
+
+ int i = compare(ga.getHeight(), ga.getWidth(), context.getHeight(),
+ context.getWidth());
+
+ Lane lane = (Lane) BusinessObjectUtil.getFirstElementOfType(
+ context.getPictogramElement(), Lane.class);
+
+ if (i < 0 && lane.getFlowNodeRefs().size() == 0) {
+ return true;
+ }
+
+ if (i > 0) {
+ return true;
+ }
+
+ return true;
+ }
+
+ private int compare(int heightBefore, int widthBefore, int heightAfter,
+ int widthAfter) {
+ if (heightAfter > heightBefore || widthAfter > widthBefore) {
+ return 1;
+ }
+ if (heightAfter < heightBefore || widthAfter < widthBefore) {
+ return -1;
+ }
+ return 0;
+ }
+
+ private void resizeHeight(IResizeShapeContext context) {
+ ContainerShape laneContainerShape = (ContainerShape) context.getShape();
+ GraphicsAlgorithm ga = laneContainerShape.getGraphicsAlgorithm();
+
+ boolean isHorizontal = FeatureSupport.isHorizontal(laneContainerShape);
+
+ if ((isHorizontal && ga.getHeight() != context.getHeight())
+ || (!isHorizontal && ga.getWidth() != context.getWidth())) {
+
+ ContainerShape rootContainer = FeatureSupport.getRootContainer(laneContainerShape);
+
+ boolean fetchFirstProp = false;
+ Object fetchFirstProperty = context.getProperty(ResizeParticipantFeature.RESIZE_FIRST_LANE);
+ if (fetchFirstProperty != null && ((Boolean) fetchFirstProperty).booleanValue()) {
+ fetchFirstProp = true;
+ } else {
+ if ((isHorizontal && context.getY() != ga.getY()) ||
+ (!isHorizontal && context.getX() != ga.getX())) {
+ fetchFirstProp = true;
+ if (laneContainerShape.equals(rootContainer)) {
+ Graphiti.getGaService().setLocation(ga, context.getX(), context.getY());
+ }
+ }
+ }
+
+ ContainerShape lowestContainingLane = getLowestLane(laneContainerShape, fetchFirstProp);
+ GraphicsAlgorithm lowestLaneGA = lowestContainingLane.getGraphicsAlgorithm();
+
+ int width = 0;
+ int height = 0;
+
+ if (isHorizontal) {
+ int dHeight = context.getHeight() - ga.getHeight();
+ height = lowestLaneGA.getHeight() + dHeight;
+ if (height < 100) {
+ height = 100;
+ }
+ width = lowestLaneGA.getWidth();
+ } else {
+ int dWidth = context.getWidth() - ga.getWidth();
+ width = lowestLaneGA.getWidth() + dWidth;
+ if (width < 100) {
+ width = 100;
+ }
+ height = lowestLaneGA.getHeight();
+ }
+
+ ResizeShapeContext newContext = new ResizeShapeContext(lowestContainingLane);
+
+ newContext.setX(lowestLaneGA.getX());
+ newContext.setY(lowestLaneGA.getY());
+ newContext.setHeight(height);
+ newContext.setWidth(width);
+
+ super.resizeShape(newContext);
+ }
+ }
+
+ private void resizeWidth(IResizeShapeContext context) {
+ ContainerShape laneContainerShape = (ContainerShape) context.getShape();
+ GraphicsAlgorithm ga = laneContainerShape.getGraphicsAlgorithm();
+
+ boolean isHorizontal = FeatureSupport.isHorizontal(laneContainerShape);
+
+ if ((isHorizontal && ga.getWidth() != context.getWidth())
+ || (!isHorizontal && ga.getHeight() != context.getHeight())) {
+
+
+ int dWidth = 0;
+ int dHeight = 0;
+ if (isHorizontal) {
+ dWidth = context.getWidth() - ga.getWidth();
+ } else {
+ dHeight = context.getHeight() - ga.getHeight();
+ }
+
+ Object poolResizeProperty = context.getProperty(ResizeParticipantFeature.POOL_RESIZE_PROPERTY);
+ if (poolResizeProperty != null && ((Boolean) poolResizeProperty).booleanValue()) {
+ if (isHorizontal) {
+ Graphiti.getGaService().setWidth(ga, context.getWidth());
+ } else {
+ Graphiti.getGaService().setHeight(ga, context.getHeight());
+ }
+ for (PictogramElement currentChild : FeatureSupport.getChildsOfBusinessObjectType(laneContainerShape, Lane.class)) {
+ if (currentChild instanceof ContainerShape) {
+ ContainerShape currentContainer = (ContainerShape) currentChild;
+ GraphicsAlgorithm currentGA = currentChild.getGraphicsAlgorithm();
+
+ ResizeShapeContext newContext = new ResizeShapeContext(currentContainer);
+
+ newContext.setX(currentGA.getX());
+ newContext.setY(currentGA.getY());
+ newContext.setHeight(currentGA.getHeight() + dHeight);
+ newContext.setWidth(currentGA.getWidth() + dWidth);
+
+
+ newContext.putProperty(ResizeParticipantFeature.POOL_RESIZE_PROPERTY, true);
+
+ resizeShape(newContext);
+ }
+ }
+ } else {
+ ContainerShape rootContainer = FeatureSupport.getRootContainer(laneContainerShape);
+ GraphicsAlgorithm rootGA = rootContainer.getGraphicsAlgorithm();
+
+ if (FeatureSupport.isParticipant(rootContainer)) {
+ ResizeShapeContext newContext = new ResizeShapeContext(rootContainer);
+
+ newContext.setX(rootGA.getX());
+ newContext.setY(rootGA.getY());
+ newContext.setWidth(rootGA.getWidth() + dWidth);
+ newContext.setHeight(rootGA.getHeight() + dHeight);
+
+ IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
+ if (resizeFeature.canResizeShape(newContext)) {
+ resizeFeature.resizeShape(newContext);
+ }
+ } else {
+ ContainerShape container = null;
+ Object rootIsLaneProperty = context.getProperty(LANE_RESIZE_PROPERTY);
+ if (rootIsLaneProperty != null && ((Boolean) rootIsLaneProperty).booleanValue()) {
+ Graphiti.getGaService().setWidth(ga, context.getWidth());
+ Graphiti.getGaService().setHeight(ga, context.getHeight());
+ container = laneContainerShape;
+ } else {
+ container = rootContainer;
+ if (isHorizontal) {
+ Graphiti.getGaService().setWidth(rootGA, rootGA.getWidth() + dWidth);
+ } else {
+ Graphiti.getGaService().setHeight(rootGA, rootGA.getHeight() + dHeight);
+ }
+ }
+ for (PictogramElement currentChild : FeatureSupport.getChildsOfBusinessObjectType(container, Lane.class)) {
+ if (currentChild instanceof ContainerShape) {
+ ContainerShape currentContainer = (ContainerShape) currentChild;
+ GraphicsAlgorithm currentGA = currentChild.getGraphicsAlgorithm();
+
+ ResizeShapeContext newContext = new ResizeShapeContext(currentContainer);
+
+ newContext.setX(currentGA.getX());
+ newContext.setY(currentGA.getY());
+ newContext.setHeight(currentGA.getHeight() + dHeight);
+ newContext.setWidth(currentGA.getHeight() + dHeight);
+
+ newContext.putProperty(LANE_RESIZE_PROPERTY, true);
+
+ resizeShape(newContext);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void resizeShape(IResizeShapeContext context) {
+ resizeHeight(context);
+ resizeWidth(context);
+ }
+
+ private ContainerShape getLowestLane(ContainerShape root, boolean fetchFirst) {
+ ContainerShape result;
+ if (fetchFirst) {
+ result = (ContainerShape) FeatureSupport.getFirstLaneInContainer(root);
+ } else {
+ result = (ContainerShape) FeatureSupport.getLastLaneInContainer(root);
+ }
+ if (!result.equals(root)) {
+ return getLowestLane(result, fetchFirst);
+ }
+ return result;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/UpdateLaneFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/UpdateLaneFeature.java
index 8604f6a..b58b4b2 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/UpdateLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/UpdateLaneFeature.java
@@ -1,30 +1,30 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.lane;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-
-public class UpdateLaneFeature extends AbstractUpdateBaseElementFeature {
-
- public UpdateLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof Lane;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.lane;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+
+public class UpdateLaneFeature extends AbstractUpdateBaseElementFeature {
+
+ public UpdateLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof Lane;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/DirectEditParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/DirectEditParticipantFeature.java
index 9c54a9f..03a262e 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/DirectEditParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/DirectEditParticipantFeature.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.participant;
-
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class DirectEditParticipantFeature extends AbstractDirectEditingFeature {
-
- public DirectEditParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public String getInitialValue(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
- return participant.getName();
- }
-
- @Override
- public void setValue(String value, IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
- participant.setName(value);
- updatePictogramElement(((Shape) pe).getContainer());
- }
-
- @Override
- public String checkValueValid(String value, IDirectEditingContext context) {
- if (value.length() < 1) {
- return "Please enter any text as Pool name.";
- } else if (value.contains("\n")) {
- return "Line breakes are not allowed in Pool names.";
- }
- return null;
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
- return bo instanceof Participant && ga instanceof Text;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.participant;
+
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class DirectEditParticipantFeature extends AbstractDirectEditingFeature {
+
+ public DirectEditParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public int getEditingType() {
+ return TYPE_TEXT;
+ }
+
+ @Override
+ public String getInitialValue(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
+ return participant.getName();
+ }
+
+ @Override
+ public void setValue(String value, IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
+ participant.setName(value);
+ updatePictogramElement(((Shape) pe).getContainer());
+ }
+
+ @Override
+ public String checkValueValid(String value, IDirectEditingContext context) {
+ if (value.length() < 1) {
+ return "Please enter any text as Pool name.";
+ } else if (value.contains("\n")) {
+ return "Line breakes are not allowed in Pool names.";
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canDirectEdit(IDirectEditingContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
+ return bo instanceof Participant && ga instanceof Text;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/LayoutParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/LayoutParticipantFeature.java
index b98c591..b3a9a63 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/LayoutParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/LayoutParticipantFeature.java
@@ -1,105 +1,105 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.participant;
-
-import java.util.Iterator;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class LayoutParticipantFeature extends DefaultLayoutBPMNShapeFeature {
-
- public LayoutParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- Object bo = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
- return bo != null && bo instanceof Participant;
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
-
- GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
- IGaService gaService = Graphiti.getGaService();
-
- boolean horz = FeatureSupport.isHorizontal(containerShape);
-
- int containerHeight = containerGa.getHeight();
- int containerWidth = containerGa.getWidth();
- Iterator<Shape> iterator = containerShape.getChildren().iterator();
- while (iterator.hasNext()) {
- Shape shape = iterator.next();
- GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
- IDimension size = gaService.calculateSize(ga);
-
- if (ga instanceof Polyline) {
- Polyline line = (Polyline) ga;
- Point p0 = line.getPoints().get(0);
- Point p1 = line.getPoints().get(1);
- if (horz) {
- p0.setX(30); p0.setY(0);
- p1.setX(30); p1.setY(containerHeight);
- }
- else {
- p0.setX(0); p0.setY(30);
- p1.setX(containerWidth); p1.setY(30);
- }
- } else if (ga instanceof Text) {
- if (horz) {
- Text text = (Text)ga;
- text.setAngle(-90);
- gaService.setLocationAndSize(ga, 5, 0, 15, containerHeight);
- }
- else {
- Text text = (Text)ga;
- text.setAngle(0);
- gaService.setLocationAndSize(ga, 0, 5, containerWidth, 15);
- }
- }
- }
-
- Shape shape = FeatureSupport.getShape(containerShape, UpdateParticipantMultiplicityFeature.MULTIPLICITY_MARKER,
- Boolean.toString(true));
- if (shape != null) {
- GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
- int x = (containerGa.getWidth() / 2) - 10;
- int y = containerGa.getHeight() - 20;
- gaService.setLocation(ga, x, y);
- }
-
- DIUtils.updateDIShape(containerShape);
- return super.layout(context);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.participant;
+
+import java.util.Iterator;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.graphiti.datatypes.IDimension;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class LayoutParticipantFeature extends DefaultLayoutBPMNShapeFeature {
+
+ public LayoutParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ Object bo = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
+ return bo != null && bo instanceof Participant;
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+
+ GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
+ IGaService gaService = Graphiti.getGaService();
+
+ boolean horz = FeatureSupport.isHorizontal(containerShape);
+
+ int containerHeight = containerGa.getHeight();
+ int containerWidth = containerGa.getWidth();
+ Iterator<Shape> iterator = containerShape.getChildren().iterator();
+ while (iterator.hasNext()) {
+ Shape shape = iterator.next();
+ GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
+ IDimension size = gaService.calculateSize(ga);
+
+ if (ga instanceof Polyline) {
+ Polyline line = (Polyline) ga;
+ Point p0 = line.getPoints().get(0);
+ Point p1 = line.getPoints().get(1);
+ if (horz) {
+ p0.setX(30); p0.setY(0);
+ p1.setX(30); p1.setY(containerHeight);
+ }
+ else {
+ p0.setX(0); p0.setY(30);
+ p1.setX(containerWidth); p1.setY(30);
+ }
+ } else if (ga instanceof Text) {
+ if (horz) {
+ Text text = (Text)ga;
+ text.setAngle(-90);
+ gaService.setLocationAndSize(ga, 5, 0, 15, containerHeight);
+ }
+ else {
+ Text text = (Text)ga;
+ text.setAngle(0);
+ gaService.setLocationAndSize(ga, 0, 5, containerWidth, 15);
+ }
+ }
+ }
+
+ Shape shape = FeatureSupport.getShape(containerShape, UpdateParticipantMultiplicityFeature.MULTIPLICITY_MARKER,
+ Boolean.toString(true));
+ if (shape != null) {
+ GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
+ int x = (containerGa.getWidth() / 2) - 10;
+ int y = containerGa.getHeight() - 20;
+ gaService.setLocation(ga, x, y);
+ }
+
+ DIUtils.updateDIShape(containerShape);
+ return super.layout(context);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/ResizeParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/ResizeParticipantFeature.java
index ff01db7..7442f88 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/ResizeParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/ResizeParticipantFeature.java
@@ -1,166 +1,166 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.participant;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public class ResizeParticipantFeature extends DefaultResizeShapeFeature {
-
- public static final String POOL_RESIZE_PROPERTY = "pool.resize";
- public static final String RESIZE_FIRST_LANE = "resize.first.lane";
-
- public ResizeParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- EObject container = context.getShape().eContainer();
- if (container instanceof PictogramElement) {
- PictogramElement containerElem = (PictogramElement) container;
- if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
- return false;
- }
- }
- return super.canResizeShape(context);
- }
-
- private void resizeLaneHeight(IResizeShapeContext context) {
- ContainerShape participantShape = (ContainerShape) context.getShape();
- GraphicsAlgorithm ga = participantShape.getGraphicsAlgorithm();
-
- ContainerShape laneToResize = null;
- GraphicsAlgorithm laneToResizeGA = null;
- int width = 0;
- int height = 0;
- int x = 0;
- int y = 0;
- boolean resizeFirstLane = false;
- boolean resize = false;
- if (FeatureSupport.isHorizontal(participantShape)) {
- int dHeight = context.getHeight() - ga.getHeight();
- if (dHeight != 0) {
- resize = true;
- if (context.getY() != ga.getY()) {
- laneToResize = (ContainerShape) FeatureSupport.getFirstLaneInContainer(participantShape);
- resizeFirstLane = true;
- } else {
- laneToResize = (ContainerShape) FeatureSupport.getLastLaneInContainer(participantShape);
- }
- laneToResizeGA = laneToResize.getGraphicsAlgorithm();
- width = laneToResizeGA.getWidth();
- height = laneToResizeGA.getHeight() + dHeight;
- x = laneToResizeGA.getX();
- y = laneToResizeGA.getY();
- }
- } else {
- int dWidth = context.getWidth() - ga.getWidth();
- if (dWidth != 0) {
- resize = true;
- if (context.getX() != ga.getX()) {
- laneToResize = (ContainerShape) FeatureSupport.getFirstLaneInContainer(participantShape);
- resizeFirstLane = true;
- } else {
- laneToResize = (ContainerShape) FeatureSupport.getLastLaneInContainer(participantShape);
- }
- laneToResizeGA = laneToResize.getGraphicsAlgorithm();
- width = laneToResizeGA.getWidth() + dWidth;
- height = laneToResizeGA.getHeight();
- x = laneToResizeGA.getX();
- y = laneToResizeGA.getY();
- }
- }
- if (resize) {
- ResizeShapeContext newContext = new ResizeShapeContext(laneToResize);
-
- newContext.setLocation(x, y);
- newContext.setHeight(height);
- newContext.setWidth(width);
-
- newContext.putProperty(POOL_RESIZE_PROPERTY, true);
- newContext.putProperty(RESIZE_FIRST_LANE, resizeFirstLane);
-
- IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
- if (resizeFeature.canResizeShape(newContext)) {
- resizeFeature.resizeShape(newContext);
- }
- if (FeatureSupport.isHorizontal(participantShape)) {
- ((ResizeShapeContext) context).setHeight(ga.getHeight());
- } else {
- ((ResizeShapeContext) context).setWidth(ga.getWidth());
- }
- }
- }
-
- private void resizeLaneWidth(IResizeShapeContext context) {
- ContainerShape participantShape = (ContainerShape) context.getShape();
- GraphicsAlgorithm ga = participantShape.getGraphicsAlgorithm();
-
- int dHeight = context.getHeight() - ga.getHeight();
- int dWidth = context.getWidth() - ga.getWidth();
-
- if ((dWidth != 0 && FeatureSupport.isHorizontal(participantShape)) ||
- (dHeight != 0 && !FeatureSupport.isHorizontal(participantShape))) {
- List<PictogramElement> childrenShapes = FeatureSupport.getChildsOfBusinessObjectType(participantShape, Lane.class);
- for (PictogramElement currentPicElem : childrenShapes) {
- if (currentPicElem instanceof ContainerShape) {
- ContainerShape currentContainerShape = (ContainerShape) currentPicElem;
- GraphicsAlgorithm laneGA = currentContainerShape.getGraphicsAlgorithm();
-
- ResizeShapeContext newContext = new ResizeShapeContext(currentContainerShape);
-
- newContext.setLocation(laneGA.getX(), laneGA.getY());
- if (FeatureSupport.isHorizontal(participantShape)) {
- newContext.setWidth(laneGA.getWidth() + dWidth);
- newContext.setHeight(laneGA.getHeight());
- } else {
- newContext.setHeight(laneGA.getHeight() + dHeight);
- newContext.setWidth(laneGA.getWidth());
- }
-
- newContext.putProperty(POOL_RESIZE_PROPERTY, true);
-
- IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
- if (resizeFeature.canResizeShape(newContext)) {
- resizeFeature.resizeShape(newContext);
- }
- }
- }
- }
- }
-
- @Override
- public void resizeShape(IResizeShapeContext context) {
- if (BusinessObjectUtil.containsChildElementOfType(context.getPictogramElement(), Lane.class)) {
-
- resizeLaneHeight(context);
- resizeLaneWidth(context);
-
- }
- super.resizeShape(context);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.participant;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public class ResizeParticipantFeature extends DefaultResizeShapeFeature {
+
+ public static final String POOL_RESIZE_PROPERTY = "pool.resize";
+ public static final String RESIZE_FIRST_LANE = "resize.first.lane";
+
+ public ResizeParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ EObject container = context.getShape().eContainer();
+ if (container instanceof PictogramElement) {
+ PictogramElement containerElem = (PictogramElement) container;
+ if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
+ return false;
+ }
+ }
+ return super.canResizeShape(context);
+ }
+
+ private void resizeLaneHeight(IResizeShapeContext context) {
+ ContainerShape participantShape = (ContainerShape) context.getShape();
+ GraphicsAlgorithm ga = participantShape.getGraphicsAlgorithm();
+
+ ContainerShape laneToResize = null;
+ GraphicsAlgorithm laneToResizeGA = null;
+ int width = 0;
+ int height = 0;
+ int x = 0;
+ int y = 0;
+ boolean resizeFirstLane = false;
+ boolean resize = false;
+ if (FeatureSupport.isHorizontal(participantShape)) {
+ int dHeight = context.getHeight() - ga.getHeight();
+ if (dHeight != 0) {
+ resize = true;
+ if (context.getY() != ga.getY()) {
+ laneToResize = (ContainerShape) FeatureSupport.getFirstLaneInContainer(participantShape);
+ resizeFirstLane = true;
+ } else {
+ laneToResize = (ContainerShape) FeatureSupport.getLastLaneInContainer(participantShape);
+ }
+ laneToResizeGA = laneToResize.getGraphicsAlgorithm();
+ width = laneToResizeGA.getWidth();
+ height = laneToResizeGA.getHeight() + dHeight;
+ x = laneToResizeGA.getX();
+ y = laneToResizeGA.getY();
+ }
+ } else {
+ int dWidth = context.getWidth() - ga.getWidth();
+ if (dWidth != 0) {
+ resize = true;
+ if (context.getX() != ga.getX()) {
+ laneToResize = (ContainerShape) FeatureSupport.getFirstLaneInContainer(participantShape);
+ resizeFirstLane = true;
+ } else {
+ laneToResize = (ContainerShape) FeatureSupport.getLastLaneInContainer(participantShape);
+ }
+ laneToResizeGA = laneToResize.getGraphicsAlgorithm();
+ width = laneToResizeGA.getWidth() + dWidth;
+ height = laneToResizeGA.getHeight();
+ x = laneToResizeGA.getX();
+ y = laneToResizeGA.getY();
+ }
+ }
+ if (resize) {
+ ResizeShapeContext newContext = new ResizeShapeContext(laneToResize);
+
+ newContext.setLocation(x, y);
+ newContext.setHeight(height);
+ newContext.setWidth(width);
+
+ newContext.putProperty(POOL_RESIZE_PROPERTY, true);
+ newContext.putProperty(RESIZE_FIRST_LANE, resizeFirstLane);
+
+ IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
+ if (resizeFeature.canResizeShape(newContext)) {
+ resizeFeature.resizeShape(newContext);
+ }
+ if (FeatureSupport.isHorizontal(participantShape)) {
+ ((ResizeShapeContext) context).setHeight(ga.getHeight());
+ } else {
+ ((ResizeShapeContext) context).setWidth(ga.getWidth());
+ }
+ }
+ }
+
+ private void resizeLaneWidth(IResizeShapeContext context) {
+ ContainerShape participantShape = (ContainerShape) context.getShape();
+ GraphicsAlgorithm ga = participantShape.getGraphicsAlgorithm();
+
+ int dHeight = context.getHeight() - ga.getHeight();
+ int dWidth = context.getWidth() - ga.getWidth();
+
+ if ((dWidth != 0 && FeatureSupport.isHorizontal(participantShape)) ||
+ (dHeight != 0 && !FeatureSupport.isHorizontal(participantShape))) {
+ List<PictogramElement> childrenShapes = FeatureSupport.getChildsOfBusinessObjectType(participantShape, Lane.class);
+ for (PictogramElement currentPicElem : childrenShapes) {
+ if (currentPicElem instanceof ContainerShape) {
+ ContainerShape currentContainerShape = (ContainerShape) currentPicElem;
+ GraphicsAlgorithm laneGA = currentContainerShape.getGraphicsAlgorithm();
+
+ ResizeShapeContext newContext = new ResizeShapeContext(currentContainerShape);
+
+ newContext.setLocation(laneGA.getX(), laneGA.getY());
+ if (FeatureSupport.isHorizontal(participantShape)) {
+ newContext.setWidth(laneGA.getWidth() + dWidth);
+ newContext.setHeight(laneGA.getHeight());
+ } else {
+ newContext.setHeight(laneGA.getHeight() + dHeight);
+ newContext.setWidth(laneGA.getWidth());
+ }
+
+ newContext.putProperty(POOL_RESIZE_PROPERTY, true);
+
+ IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
+ if (resizeFeature.canResizeShape(newContext)) {
+ resizeFeature.resizeShape(newContext);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void resizeShape(IResizeShapeContext context) {
+ if (BusinessObjectUtil.containsChildElementOfType(context.getPictogramElement(), Lane.class)) {
+
+ resizeLaneHeight(context);
+ resizeLaneWidth(context);
+
+ }
+ super.resizeShape(context);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantFeature.java
index 0f1bd63..a920755 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantFeature.java
@@ -1,30 +1,30 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.participant;
-
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-
-public class UpdateParticipantFeature extends AbstractUpdateBaseElementFeature {
-
- public UpdateParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof Participant;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.participant;
+
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.features.AbstractUpdateBaseElementFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+
+public class UpdateParticipantFeature extends AbstractUpdateBaseElementFeature {
+
+ public UpdateParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof Participant;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantMultiplicityFeature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantMultiplicityFeature.java
index ef99b4e..c6d1cf1 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantMultiplicityFeature.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/participant/UpdateParticipantMultiplicityFeature.java
@@ -1,119 +1,119 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.features.participant;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class UpdateParticipantMultiplicityFeature extends AbstractUpdateFeature {
-
- public static final String MULTIPLICITY_MARKER = "multiplicity.marker";
-
- public UpdateParticipantMultiplicityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- EObject container = context.getPictogramElement().eContainer();
- if (container instanceof PictogramElement) {
- PictogramElement containerElem = (PictogramElement) container;
- if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
- return false;
- }
- }
- return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), Participant.class)
- && context.getPictogramElement() instanceof ContainerShape;
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- EObject container = context.getPictogramElement().eContainer();
- if (container instanceof PictogramElement) {
- PictogramElement containerElem = (PictogramElement) container;
- if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
- return Reason.createFalseReason();
- }
- }
- if (!(context.getPictogramElement() instanceof ContainerShape)) {
- return Reason.createFalseReason();
- }
- IPeService peService = Graphiti.getPeService();
- Participant participant = (Participant) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- Participant.class);
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
-
- boolean multiplicityProperty = new Boolean(peService.getPropertyValue(containerShape,
- AddParticipantFeature.MULTIPLICITY));
- boolean hasMultiplicity = participant.getParticipantMultiplicity() != null;
-
- return multiplicityProperty != hasMultiplicity ? Reason.createTrueReason() : Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
-
- Participant participant = (Participant) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- Participant.class);
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
-
- if (participant.getParticipantMultiplicity() != null) {
- Shape shape = peService.createShape(containerShape, false);
- peService.setPropertyValue(shape, MULTIPLICITY_MARKER, Boolean.toString(true));
- Rectangle invisibleRectangle = gaService.createInvisibleRectangle(shape);
- GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
- int x = (parentGa.getWidth() / 2) - 10;
- int y = parentGa.getHeight() - 20;
- gaService.setLocationAndSize(invisibleRectangle, x, y, 20, 20);
-
- Polyline line1 = gaService.createPolyline(invisibleRectangle, new int[] { 0, 0, 0, 20 });
- line1.setLineWidth(2);
- line1.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- Polyline line2 = gaService.createPolyline(invisibleRectangle, new int[] { 9, 0, 9, 20 });
- line2.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- line2.setLineWidth(2);
- Polyline line3 = gaService.createPolyline(invisibleRectangle, new int[] { 18, 0, 18, 20 });
- line3.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- line3.setLineWidth(2);
- } else {
- Shape shape = FeatureSupport.getShape(containerShape, MULTIPLICITY_MARKER, Boolean.toString(true));
- if (shape != null) {
- peService.deletePictogramElement(shape);
- }
- }
-
- peService.setPropertyValue(containerShape, AddParticipantFeature.MULTIPLICITY,
- participant.getParticipantMultiplicity() != null ? Boolean.toString(true) : Boolean.toString(false));
- return true;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.features.participant;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.Rectangle;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class UpdateParticipantMultiplicityFeature extends AbstractUpdateFeature {
+
+ public static final String MULTIPLICITY_MARKER = "multiplicity.marker";
+
+ public UpdateParticipantMultiplicityFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ EObject container = context.getPictogramElement().eContainer();
+ if (container instanceof PictogramElement) {
+ PictogramElement containerElem = (PictogramElement) container;
+ if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
+ return false;
+ }
+ }
+ return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), Participant.class)
+ && context.getPictogramElement() instanceof ContainerShape;
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ EObject container = context.getPictogramElement().eContainer();
+ if (container instanceof PictogramElement) {
+ PictogramElement containerElem = (PictogramElement) container;
+ if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
+ return Reason.createFalseReason();
+ }
+ }
+ if (!(context.getPictogramElement() instanceof ContainerShape)) {
+ return Reason.createFalseReason();
+ }
+ IPeService peService = Graphiti.getPeService();
+ Participant participant = (Participant) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ Participant.class);
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+
+ boolean multiplicityProperty = new Boolean(peService.getPropertyValue(containerShape,
+ AddParticipantFeature.MULTIPLICITY));
+ boolean hasMultiplicity = participant.getParticipantMultiplicity() != null;
+
+ return multiplicityProperty != hasMultiplicity ? Reason.createTrueReason() : Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+
+ Participant participant = (Participant) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ Participant.class);
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+
+ if (participant.getParticipantMultiplicity() != null) {
+ Shape shape = peService.createShape(containerShape, false);
+ peService.setPropertyValue(shape, MULTIPLICITY_MARKER, Boolean.toString(true));
+ Rectangle invisibleRectangle = gaService.createInvisibleRectangle(shape);
+ GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
+ int x = (parentGa.getWidth() / 2) - 10;
+ int y = parentGa.getHeight() - 20;
+ gaService.setLocationAndSize(invisibleRectangle, x, y, 20, 20);
+
+ Polyline line1 = gaService.createPolyline(invisibleRectangle, new int[] { 0, 0, 0, 20 });
+ line1.setLineWidth(2);
+ line1.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ Polyline line2 = gaService.createPolyline(invisibleRectangle, new int[] { 9, 0, 9, 20 });
+ line2.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ line2.setLineWidth(2);
+ Polyline line3 = gaService.createPolyline(invisibleRectangle, new int[] { 18, 0, 18, 20 });
+ line3.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ line3.setLineWidth(2);
+ } else {
+ Shape shape = FeatureSupport.getShape(containerShape, MULTIPLICITY_MARKER, Boolean.toString(true));
+ if (shape != null) {
+ peService.deletePictogramElement(shape);
+ }
+ }
+
+ peService.setPropertyValue(containerShape, AddParticipantFeature.MULTIPLICITY,
+ participant.getParticipantMultiplicity() != null ? Boolean.toString(true) : Boolean.toString(false));
+ return true;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/ListCompositeContentProvider.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/ListCompositeContentProvider.java
index 9eb0154..e97ee26 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/ListCompositeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/ListCompositeContentProvider.java
@@ -1,55 +1,55 @@
-package org.eclipse.bpmn2.modeler.core.merrimac.clad;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class ListCompositeContentProvider implements IStructuredContentProvider {
- /**
- *
- */
- protected final AbstractListComposite listComposite;
- protected EObject object;
- protected EStructuralFeature feature;
- protected EList<EObject> list;
-
- public ListCompositeContentProvider(AbstractListComposite listComposite, EObject object, EStructuralFeature feature, EList<EObject> list) {
- this.listComposite = listComposite;
- this.object = object;
- this.feature = feature;
- this.list = list;
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- @Override
- public Object[] getElements(Object inputElement) {
- EClass listItemClass = listComposite.getListItemClass(object,feature);
- if (listItemClass==null) {
- // display all items in the list that are subclasses of listItemClass
- return list.toArray();
- }
- else {
- // we're only interested in display specific EClass instances
- List<EObject> elements = new ArrayList<EObject>();
- for (EObject o : list) {
- EClass ec = o.eClass();
- if (ec == listItemClass)
- elements.add(o);
- }
- return elements.toArray(new EObject[elements.size()]);
- }
- }
+package org.eclipse.bpmn2.modeler.core.merrimac.clad;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class ListCompositeContentProvider implements IStructuredContentProvider {
+ /**
+ *
+ */
+ protected final AbstractListComposite listComposite;
+ protected EObject object;
+ protected EStructuralFeature feature;
+ protected EList<EObject> list;
+
+ public ListCompositeContentProvider(AbstractListComposite listComposite, EObject object, EStructuralFeature feature, EList<EObject> list) {
+ this.listComposite = listComposite;
+ this.object = object;
+ this.feature = feature;
+ this.list = list;
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ EClass listItemClass = listComposite.getListItemClass(object,feature);
+ if (listItemClass==null) {
+ // display all items in the list that are subclasses of listItemClass
+ return list.toArray();
+ }
+ else {
+ // we're only interested in display specific EClass instances
+ List<EObject> elements = new ArrayList<EObject>();
+ for (EObject o : list) {
+ EClass ec = o.eClass();
+ if (ec == listItemClass)
+ elements.add(o);
+ }
+ return elements.toArray(new EObject[elements.size()]);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/PropertiesCompositeFactory.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/PropertiesCompositeFactory.java
index 353ed52..d634b11 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/PropertiesCompositeFactory.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/PropertiesCompositeFactory.java
@@ -1,278 +1,278 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.merrimac.clad;
-
-import java.lang.reflect.Constructor;
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This class maintains the registry of PropertySheetPage Composite widgets for each
- * BPMN2 metamodel type. This ensures that the same Property Section layout is used
- * for each model object regardless of where the Composite is embedded. This happens,
- * for example, in the Advanced Property Section which displays a customized details
- * section depending on the currently selected object type.
- *
- * @author Bob Brodt
- *
- */
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class PropertiesCompositeFactory {
-
- protected final static Hashtable<TargetRuntime, Hashtable<Class,Class>> detailRegistry = new Hashtable<TargetRuntime,Hashtable<Class,Class>>();
- protected final static Hashtable<TargetRuntime, Hashtable<Class,Class>> listRegistry = new Hashtable<TargetRuntime,Hashtable<Class,Class>>();
- protected final static Hashtable<TargetRuntime, Hashtable<Class,Class>> dialogRegistry = new Hashtable<TargetRuntime,Hashtable<Class,Class>>();
-
- public static void register(Class eClass, Class composite) {
- TargetRuntime rt = TargetRuntime.getCurrentRuntime();
- Hashtable<Class,Class> map = null;
- if (AbstractListComposite.class.isAssignableFrom(composite))
- map = listRegistry.get(rt);
- else if (AbstractDialogComposite.class.isAssignableFrom(composite))
- map = dialogRegistry.get(rt);
- else if (AbstractDetailComposite.class.isAssignableFrom(composite))
- map = detailRegistry.get(rt);
- else
- throw new IllegalArgumentException("Unknown Composite type: "+composite.getName());
-
- if (map==null) {
- map = new Hashtable<Class,Class>();
- if (AbstractListComposite.class.isAssignableFrom(composite))
- listRegistry.put(rt,map);
- else if (AbstractDialogComposite.class.isAssignableFrom(composite))
- dialogRegistry.put(rt,map);
- else if (AbstractDetailComposite.class.isAssignableFrom(composite))
- detailRegistry.put(rt,map);
- }
- map.put(eClass, composite);
-
- // make sure the constructors are declared
- try {
- Constructor ctor = null;
- Class ec = composite.getEnclosingClass();
- if (ec!=null) {
- if (AbstractDialogComposite.class.isAssignableFrom(composite)) {
- ctor = composite.getConstructor(ec,Composite.class,EClass.class,int.class);
- }
- else {
- ctor = composite.getConstructor(ec,AbstractBpmn2PropertySection.class);
- ctor = composite.getConstructor(ec,Composite.class,int.class);
- }
- }
- else {
- if (AbstractDialogComposite.class.isAssignableFrom(composite)) {
- ctor = composite.getConstructor(Composite.class,EClass.class,int.class);
- }
- else {
- ctor = composite.getConstructor(AbstractBpmn2PropertySection.class);
- ctor = composite.getConstructor(Composite.class,int.class);
- }
- }
- } catch (Exception e) {
- Activator.logError(e);
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // Detail Composite methods
- ////////////////////////////////////////////////////////////////////////////////
- public static Class findDetailCompositeClass(Class eClass) {
- TargetRuntime rt = TargetRuntime.getCurrentRuntime();
- Class composite = findCompositeClass(detailRegistry.get(rt),eClass);
- if (composite==null && rt!=TargetRuntime.getDefaultRuntime()) {
- // fall back to default target runtime
- rt = TargetRuntime.getDefaultRuntime();
- composite = findCompositeClass(detailRegistry.get(rt),eClass);
- }
- return composite;
- }
-
- public static AbstractDetailComposite createDetailComposite(Class eClass, AbstractBpmn2PropertySection section) {
- Class clazz = findDetailCompositeClass(eClass);
- return (AbstractDetailComposite)createComposite(clazz, eClass, section);
- }
-
- public static AbstractDetailComposite createDetailComposite(Class eClass, Composite parent, int style) {
- Class clazz = findDetailCompositeClass(eClass);
- return (AbstractDetailComposite)createComposite(clazz, eClass, parent, style);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // List Composite methods
- ////////////////////////////////////////////////////////////////////////////////
- public static Class findListCompositeClass(Class eClass) {
- TargetRuntime rt = TargetRuntime.getCurrentRuntime();
- Class composite = findCompositeClass(listRegistry.get(rt),eClass);
- if (composite==null && rt!=TargetRuntime.getDefaultRuntime()) {
- // fall back to default target runtime
- rt = TargetRuntime.getDefaultRuntime();
- composite = findCompositeClass(listRegistry.get(rt),eClass);
- }
- return composite;
- }
-
- public static AbstractListComposite createListComposite(Class eClass, AbstractBpmn2PropertySection section) {
- Class clazz = findListCompositeClass(eClass);
- return (AbstractListComposite)createComposite(clazz, eClass, section);
- }
-
- public static AbstractListComposite createListComposite(Class eClass, Composite parent, int style) {
- Class clazz = findListCompositeClass(eClass);
- return (AbstractListComposite)createComposite(clazz, eClass, parent, style);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // Dialog Composite methods
- ////////////////////////////////////////////////////////////////////////////////
- public static Class findDialogCompositeClass(Class eClass) {
- TargetRuntime rt = TargetRuntime.getCurrentRuntime();
- Class composite = findCompositeClass(dialogRegistry.get(rt),eClass);
- if (composite==null && rt!=TargetRuntime.getDefaultRuntime()) {
- // fall back to default target runtime
- rt = TargetRuntime.getDefaultRuntime();
- composite = findCompositeClass(dialogRegistry.get(rt),eClass);
- }
- return composite;
- }
-
- public static AbstractDialogComposite createDialogComposite(EClass eClass, Composite parent, int style) {
- Class clazz = findDialogCompositeClass(eClass.getInstanceClass());
- Composite composite = null;
- try {
- Constructor ctor = null;
- // allow the composite to be declared in an enclosing class
- Class ec = clazz.getEnclosingClass();
- if (ec!=null) {
- ctor = clazz.getConstructor(ec,Composite.class,EClass.class,int.class);
- composite = (Composite) ctor.newInstance(null,parent,eClass,style);
- }
- else {
- ctor = clazz.getConstructor(Composite.class,EClass.class,int.class);
- composite = (Composite) ctor.newInstance(parent,eClass,style);
- }
- } catch (Exception e) {
- logError(eClass.getInstanceClass(),e);
- }
- return (AbstractDialogComposite)composite;
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // Common
- ////////////////////////////////////////////////////////////////////////////////
- private static Class findCompositeClass(Hashtable<Class,Class> map, Class eClass) {
- if (map!=null) {
- while (eClass!=null && eClass!=EObjectImpl.class) {
- if (map.containsKey(eClass)) {
- return map.get(eClass);
- }
- for (Class iface : eClass.getInterfaces()) {
- if (map.containsKey(iface)) {
- return map.get(iface);
- }
- Class composite = findCompositeClass(map,iface);
- if (composite!=null)
- return composite;
- }
- // if this is an interface, it won't have a super class,
- // so check all implemented interfaces
- if (eClass.isInterface()) {
- for (Class iface : eClass.getInterfaces()) {
- Class composite = findCompositeClass(map,iface);
- if (composite!=null)
- return composite;
- }
- }
- eClass = eClass.getSuperclass();
- }
- }
- return null;
- }
-
- private static Composite createComposite(Class clazz, Class eClass, AbstractBpmn2PropertySection section) {
- Composite composite = null;
- if (clazz!=null) {
- try {
- Constructor ctor = null;
- // allow the composite to be declared in an enclosing class
- Class ec = clazz.getEnclosingClass();
- if (ec!=null) {
- ctor = clazz.getConstructor(ec,AbstractBpmn2PropertySection.class);
- composite = (Composite) ctor.newInstance(null,section);
- }
- else {
- ctor = clazz.getConstructor(AbstractBpmn2PropertySection.class);
- composite = (Composite) ctor.newInstance(section);
- }
- } catch (Exception e) {
- logError(eClass,e);
- }
-
- }
-
- return composite;
- }
-
- private static Composite createComposite(Class clazz, Class eClass, Composite parent, int style) {
- Composite composite = null;
- if (clazz!=null) {
- try {
- Constructor ctor = null;
- // allow the composite to be declared in an enclosing class
- Class ec = clazz.getEnclosingClass();
- if (ec!=null) {
- ctor = clazz.getConstructor(ec,Composite.class,int.class);
- composite = (Composite) ctor.newInstance(null,parent,style);
- }
- else {
- ctor = clazz.getConstructor(Composite.class,int.class);
- composite = (Composite) ctor.newInstance(parent,style);
- }
- } catch (Exception e) {
- logError(eClass,e);
- }
-
- }
-
- // set a default layout data
- if (composite!=null) {
- if (parent.getLayout() instanceof GridLayout) {
- GridLayout layout = (GridLayout)parent.getLayout();
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, layout.numColumns, 1));
- }
- }
-
- return composite;
- }
-
- private static void logError(Class eClass, Exception e) {
- Activator.logError(e);
- MessageDialog.openError(Display.getDefault().getActiveShell(), "Internal Error",
- "The property sheet for the object type:\n\n"+
- eClass+"\n\nhas not been defined or is not visible."+
- "\n\nCause: "+
- e+"\n\n"+
- "Using the default property sheet instead.");
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.merrimac.clad;
+
+import java.lang.reflect.Constructor;
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This class maintains the registry of PropertySheetPage Composite widgets for each
+ * BPMN2 metamodel type. This ensures that the same Property Section layout is used
+ * for each model object regardless of where the Composite is embedded. This happens,
+ * for example, in the Advanced Property Section which displays a customized details
+ * section depending on the currently selected object type.
+ *
+ * @author Bob Brodt
+ *
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class PropertiesCompositeFactory {
+
+ protected final static Hashtable<TargetRuntime, Hashtable<Class,Class>> detailRegistry = new Hashtable<TargetRuntime,Hashtable<Class,Class>>();
+ protected final static Hashtable<TargetRuntime, Hashtable<Class,Class>> listRegistry = new Hashtable<TargetRuntime,Hashtable<Class,Class>>();
+ protected final static Hashtable<TargetRuntime, Hashtable<Class,Class>> dialogRegistry = new Hashtable<TargetRuntime,Hashtable<Class,Class>>();
+
+ public static void register(Class eClass, Class composite) {
+ TargetRuntime rt = TargetRuntime.getCurrentRuntime();
+ Hashtable<Class,Class> map = null;
+ if (AbstractListComposite.class.isAssignableFrom(composite))
+ map = listRegistry.get(rt);
+ else if (AbstractDialogComposite.class.isAssignableFrom(composite))
+ map = dialogRegistry.get(rt);
+ else if (AbstractDetailComposite.class.isAssignableFrom(composite))
+ map = detailRegistry.get(rt);
+ else
+ throw new IllegalArgumentException("Unknown Composite type: "+composite.getName());
+
+ if (map==null) {
+ map = new Hashtable<Class,Class>();
+ if (AbstractListComposite.class.isAssignableFrom(composite))
+ listRegistry.put(rt,map);
+ else if (AbstractDialogComposite.class.isAssignableFrom(composite))
+ dialogRegistry.put(rt,map);
+ else if (AbstractDetailComposite.class.isAssignableFrom(composite))
+ detailRegistry.put(rt,map);
+ }
+ map.put(eClass, composite);
+
+ // make sure the constructors are declared
+ try {
+ Constructor ctor = null;
+ Class ec = composite.getEnclosingClass();
+ if (ec!=null) {
+ if (AbstractDialogComposite.class.isAssignableFrom(composite)) {
+ ctor = composite.getConstructor(ec,Composite.class,EClass.class,int.class);
+ }
+ else {
+ ctor = composite.getConstructor(ec,AbstractBpmn2PropertySection.class);
+ ctor = composite.getConstructor(ec,Composite.class,int.class);
+ }
+ }
+ else {
+ if (AbstractDialogComposite.class.isAssignableFrom(composite)) {
+ ctor = composite.getConstructor(Composite.class,EClass.class,int.class);
+ }
+ else {
+ ctor = composite.getConstructor(AbstractBpmn2PropertySection.class);
+ ctor = composite.getConstructor(Composite.class,int.class);
+ }
+ }
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Detail Composite methods
+ ////////////////////////////////////////////////////////////////////////////////
+ public static Class findDetailCompositeClass(Class eClass) {
+ TargetRuntime rt = TargetRuntime.getCurrentRuntime();
+ Class composite = findCompositeClass(detailRegistry.get(rt),eClass);
+ if (composite==null && rt!=TargetRuntime.getDefaultRuntime()) {
+ // fall back to default target runtime
+ rt = TargetRuntime.getDefaultRuntime();
+ composite = findCompositeClass(detailRegistry.get(rt),eClass);
+ }
+ return composite;
+ }
+
+ public static AbstractDetailComposite createDetailComposite(Class eClass, AbstractBpmn2PropertySection section) {
+ Class clazz = findDetailCompositeClass(eClass);
+ return (AbstractDetailComposite)createComposite(clazz, eClass, section);
+ }
+
+ public static AbstractDetailComposite createDetailComposite(Class eClass, Composite parent, int style) {
+ Class clazz = findDetailCompositeClass(eClass);
+ return (AbstractDetailComposite)createComposite(clazz, eClass, parent, style);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // List Composite methods
+ ////////////////////////////////////////////////////////////////////////////////
+ public static Class findListCompositeClass(Class eClass) {
+ TargetRuntime rt = TargetRuntime.getCurrentRuntime();
+ Class composite = findCompositeClass(listRegistry.get(rt),eClass);
+ if (composite==null && rt!=TargetRuntime.getDefaultRuntime()) {
+ // fall back to default target runtime
+ rt = TargetRuntime.getDefaultRuntime();
+ composite = findCompositeClass(listRegistry.get(rt),eClass);
+ }
+ return composite;
+ }
+
+ public static AbstractListComposite createListComposite(Class eClass, AbstractBpmn2PropertySection section) {
+ Class clazz = findListCompositeClass(eClass);
+ return (AbstractListComposite)createComposite(clazz, eClass, section);
+ }
+
+ public static AbstractListComposite createListComposite(Class eClass, Composite parent, int style) {
+ Class clazz = findListCompositeClass(eClass);
+ return (AbstractListComposite)createComposite(clazz, eClass, parent, style);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Dialog Composite methods
+ ////////////////////////////////////////////////////////////////////////////////
+ public static Class findDialogCompositeClass(Class eClass) {
+ TargetRuntime rt = TargetRuntime.getCurrentRuntime();
+ Class composite = findCompositeClass(dialogRegistry.get(rt),eClass);
+ if (composite==null && rt!=TargetRuntime.getDefaultRuntime()) {
+ // fall back to default target runtime
+ rt = TargetRuntime.getDefaultRuntime();
+ composite = findCompositeClass(dialogRegistry.get(rt),eClass);
+ }
+ return composite;
+ }
+
+ public static AbstractDialogComposite createDialogComposite(EClass eClass, Composite parent, int style) {
+ Class clazz = findDialogCompositeClass(eClass.getInstanceClass());
+ Composite composite = null;
+ try {
+ Constructor ctor = null;
+ // allow the composite to be declared in an enclosing class
+ Class ec = clazz.getEnclosingClass();
+ if (ec!=null) {
+ ctor = clazz.getConstructor(ec,Composite.class,EClass.class,int.class);
+ composite = (Composite) ctor.newInstance(null,parent,eClass,style);
+ }
+ else {
+ ctor = clazz.getConstructor(Composite.class,EClass.class,int.class);
+ composite = (Composite) ctor.newInstance(parent,eClass,style);
+ }
+ } catch (Exception e) {
+ logError(eClass.getInstanceClass(),e);
+ }
+ return (AbstractDialogComposite)composite;
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Common
+ ////////////////////////////////////////////////////////////////////////////////
+ private static Class findCompositeClass(Hashtable<Class,Class> map, Class eClass) {
+ if (map!=null) {
+ while (eClass!=null && eClass!=EObjectImpl.class) {
+ if (map.containsKey(eClass)) {
+ return map.get(eClass);
+ }
+ for (Class iface : eClass.getInterfaces()) {
+ if (map.containsKey(iface)) {
+ return map.get(iface);
+ }
+ Class composite = findCompositeClass(map,iface);
+ if (composite!=null)
+ return composite;
+ }
+ // if this is an interface, it won't have a super class,
+ // so check all implemented interfaces
+ if (eClass.isInterface()) {
+ for (Class iface : eClass.getInterfaces()) {
+ Class composite = findCompositeClass(map,iface);
+ if (composite!=null)
+ return composite;
+ }
+ }
+ eClass = eClass.getSuperclass();
+ }
+ }
+ return null;
+ }
+
+ private static Composite createComposite(Class clazz, Class eClass, AbstractBpmn2PropertySection section) {
+ Composite composite = null;
+ if (clazz!=null) {
+ try {
+ Constructor ctor = null;
+ // allow the composite to be declared in an enclosing class
+ Class ec = clazz.getEnclosingClass();
+ if (ec!=null) {
+ ctor = clazz.getConstructor(ec,AbstractBpmn2PropertySection.class);
+ composite = (Composite) ctor.newInstance(null,section);
+ }
+ else {
+ ctor = clazz.getConstructor(AbstractBpmn2PropertySection.class);
+ composite = (Composite) ctor.newInstance(section);
+ }
+ } catch (Exception e) {
+ logError(eClass,e);
+ }
+
+ }
+
+ return composite;
+ }
+
+ private static Composite createComposite(Class clazz, Class eClass, Composite parent, int style) {
+ Composite composite = null;
+ if (clazz!=null) {
+ try {
+ Constructor ctor = null;
+ // allow the composite to be declared in an enclosing class
+ Class ec = clazz.getEnclosingClass();
+ if (ec!=null) {
+ ctor = clazz.getConstructor(ec,Composite.class,int.class);
+ composite = (Composite) ctor.newInstance(null,parent,style);
+ }
+ else {
+ ctor = clazz.getConstructor(Composite.class,int.class);
+ composite = (Composite) ctor.newInstance(parent,style);
+ }
+ } catch (Exception e) {
+ logError(eClass,e);
+ }
+
+ }
+
+ // set a default layout data
+ if (composite!=null) {
+ if (parent.getLayout() instanceof GridLayout) {
+ GridLayout layout = (GridLayout)parent.getLayout();
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, layout.numColumns, 1));
+ }
+ }
+
+ return composite;
+ }
+
+ private static void logError(Class eClass, Exception e) {
+ Activator.logError(e);
+ MessageDialog.openError(Display.getDefault().getActiveShell(), "Internal Error",
+ "The property sheet for the object type:\n\n"+
+ eClass+"\n\nhas not been defined or is not visible."+
+ "\n\nCause: "+
+ e+"\n\n"+
+ "Using the default property sheet instead.");
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextAndButtonObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextAndButtonObjectEditor.java
index 5751665..4f10fbb 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextAndButtonObjectEditor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextAndButtonObjectEditor.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.merrimac.dialogs;
-
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.IConstants;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author Bob Brodt
- *
- */
-public abstract class TextAndButtonObjectEditor extends TextObjectEditor {
-
- protected Button button;
-
- /**
- * @param parent
- * @param object
- * @param feature
- */
- public TextAndButtonObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) {
- super(parent, object, feature);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor#createControl(org.eclipse.swt.widgets.Composite, java.lang.String, int)
- */
- @Override
- public Control createControl(Composite composite, String label, int style) {
- super.createControl(composite, label, style);
-
- // we assume that the "Edit" button will handle editing of this read-only text field
- text.setEditable(false);
- GridData data = (GridData)text.getLayoutData();
- data.horizontalSpan = 1;
-
- button = getToolkit().createButton(composite, null, SWT.PUSH);
- button.setImage( Activator.getDefault().getImage(IConstants.ICON_EDIT_20));
- button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
-
- updateText();
-
- SelectionAdapter editListener = new SelectionAdapter() {
-
- @SuppressWarnings("unchecked")
- @Override
- public void widgetSelected(SelectionEvent e) {
- buttonClicked();
- }
- };
- button.addSelectionListener(editListener);
-
- return text;
- }
-
- /**
- * The implementation must override this to handle the "Edit..." button click.
- */
- protected abstract void buttonClicked();
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.merrimac.dialogs;
+
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.IConstants;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public abstract class TextAndButtonObjectEditor extends TextObjectEditor {
+
+ protected Button button;
+
+ /**
+ * @param parent
+ * @param object
+ * @param feature
+ */
+ public TextAndButtonObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) {
+ super(parent, object, feature);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor#createControl(org.eclipse.swt.widgets.Composite, java.lang.String, int)
+ */
+ @Override
+ public Control createControl(Composite composite, String label, int style) {
+ super.createControl(composite, label, style);
+
+ // we assume that the "Edit" button will handle editing of this read-only text field
+ text.setEditable(false);
+ GridData data = (GridData)text.getLayoutData();
+ data.horizontalSpan = 1;
+
+ button = getToolkit().createButton(composite, null, SWT.PUSH);
+ button.setImage( Activator.getDefault().getImage(IConstants.ICON_EDIT_20));
+ button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+
+ updateText();
+
+ SelectionAdapter editListener = new SelectionAdapter() {
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ buttonClicked();
+ }
+ };
+ button.addSelectionListener(editListener);
+
+ return text;
+ }
+
+ /**
+ * The implementation must override this to handle the "Edit..." button click.
+ */
+ protected abstract void buttonClicked();
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/providers/TableCursor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/providers/TableCursor.java
index d955827..9b15203 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/providers/TableCursor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/providers/TableCursor.java
@@ -1,644 +1,644 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.merrimac.providers;
-
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.Accessible;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TypedListener;
-
-
-/**
- * A modification of the SWT TableCursor class to better handle empty tables and dynamic tables
- */
-public class TableCursor extends Canvas {
-
- Table table;
- int row = -1, column = 0; // having row negative will end up hiding the cursor
- Listener tableListener, resizeListener;
- boolean progVisible = false;
- boolean userVisible = true;
- boolean hasFocus = false;
- AccessibleAdapter accessAdapter = null;
- Listener selectionAccessListener = null;
- Listener focusAccessListener = null;
- AccessibleControlAdapter accessControlAdapter = null;
- boolean hasAccessibility = false;
-
- public TableCursor(Table parent, int style) {
- super(parent, style);
- table = parent;
- Listener listener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.Dispose :
- dispose(event);
- break;
- case SWT.KeyDown :
- keyDown(event);
- break;
- case SWT.Paint :
- paint(event);
- break;
- case SWT.Traverse :
- traverse(event);
- break;
- }
- }
- };
- addListener(SWT.Dispose, listener);
- addListener(SWT.KeyDown, listener);
- addListener(SWT.Paint, listener);
- addListener(SWT.Traverse, listener);
-
- tableListener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.MouseDown :
- tableMouseDown(event);
- break;
- case SWT.FocusIn :
- tableFocusIn(event);
- break;
- }
- }
- };
- table.addListener(SWT.FocusIn, tableListener);
- table.addListener(SWT.MouseDown, tableListener);
-
- resizeListener = new Listener() {
- public void handleEvent(Event event) {
- resize();
- }
- };
-
- ScrollBar hBar = table.getHorizontalBar();
- if (hBar != null)
- hBar.addListener(SWT.Selection, resizeListener);
-
- ScrollBar vBar = table.getVerticalBar();
- if (vBar != null)
- vBar.addListener(SWT.Selection, resizeListener);
-
- this.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- hasFocus = true;
- redraw();
- }
-
- public void focusLost(FocusEvent e) {
- hasFocus = false;
- redraw();
-
- }});
-
- refresh();
-
- initAccessible();
- }
-
- /**
- * Creates a table cursor that can be used to navigate tables for keyboard accessibility
- * @param table
- * @param tableViewer
- * @return
- */
- public static TableCursor create(final Table table, final TableViewer tableViewer) {
- // create a TableCursor to navigate around the table
- final TableCursor cursor = new TableCursor(table, SWT.NONE);
- cursor.addSelectionListener(new SelectionAdapter() {
- // when the TableEditor is over a cell, select the corresponding row in the table
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (cursor.getRow() != null)
- table.setSelection(new TableItem[] {cursor.getRow()});
- }
- // when the user hits "ENTER" in the TableCursor, pop up an editor
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- TableItem row = cursor.getRow();
- if (row != null) {
- int nRow = table.indexOf(row);
- int column = cursor.getColumn();
- Object obj = tableViewer.getElementAt(nRow);
- tableViewer.editElement(obj, column);
- }
- }
- });
-
- // Hide the TableCursor when the user hits the "CTRL" or "SHIFT" key.
- // This alows the user to select multiple items in the table.
- cursor.addKeyListener(new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent e) {
- if ((e.keyCode == SWT.CTRL) || (e.keyCode == SWT.SHIFT) ||
- (e.stateMask & SWT.CONTROL) != 0 || (e.stateMask & SWT.SHIFT) != 0) {
- cursor.setVisible(false);
- }
- }
- });
-
- cursor.addMouseListener(new MouseListener() {
- public void mouseDoubleClick(MouseEvent e) { }
- public void mouseDown(MouseEvent e) {
- TableItem row = cursor.getRow();
- if (row != null) {
- int nRow = table.indexOf(row);
- int column = cursor.getColumn();
- Object obj = tableViewer.getElementAt(nRow);
- tableViewer.editElement(obj, column);
- }
- }
- public void mouseUp(MouseEvent e) {
- }
- });
-
- // Show the TableCursor when the user releases the "SHIFT" or "CTRL" key.
- // This signals the end of the multiple selection modelObject.
- table.addKeyListener(new KeyAdapter() {
- @Override
- public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.CONTROL && (e.stateMask & SWT.SHIFT) != 0)
- return;
- if (e.keyCode == SWT.SHIFT && (e.stateMask & SWT.CONTROL) != 0)
- return;
- if (e.keyCode != SWT.CONTROL && (e.stateMask & SWT.CONTROL) != 0)
- return;
- if (e.keyCode != SWT.SHIFT && (e.stateMask & SWT.SHIFT) != 0)
- return;
-
- if (table.getItemCount() == 0)
- return;
- TableItem[] selection = table.getSelection();
- TableItem row = (selection.length == 0) ? table.getItem(table.getTopIndex()) : selection[0];
- table.showItem(row);
- cursor.setSelection(row, 0);
- cursor.setVisible(true);
- cursor.setFocus();
- }
- });
- return cursor;
- }
-
- /**
- * this is called whenever the content of the table has changed, it
- * will reconcile the cursor and any listeners that we need
- */
-
- public void refresh() {
- // the number of rows and columns could have changed, ideally we should track
- // which columns have listeners but for the now, we'll just remove and readd
- int columns = table.getColumnCount();
- for (int i = 0; i < columns; i++) {
- TableColumn column = table.getColumn(i);
- column.removeListener(SWT.Resize, resizeListener);
- }
- for (int i = 0; i < columns; i++) {
- TableColumn column = table.getColumn(i);
- column.addListener(SWT.Resize, resizeListener);
- }
-
- // reset the row and column to be a valid one
- //boolean repaint = false;
- if (row >= table.getItemCount()) {
- row = table.getItemCount()-1;
- }
- if (column >= columns) {
- column = columns - 1;
- }
-
- // check to see what the selection is, and reset the tablecursor to
- // a valid row/column in that selection
-
- TableItem[] selection = table.getSelection();
- if (selection.length == 0) {
- row = -1;
- }
- else {
-// // there is a selection, so make sure our table cursor is in that selection
-// // range
-// int min = 999999;
-// int max = -1;
-// for (int i = 0; i < selection.length; i++) {
-// int temp = table.indexOf(selection[i]);
-// min = Math.min(temp, min);
-// max = Math.max(temp, max);
-// }
-// if (row > max || row < min)
-// row = min;
- }
- setSelection(row, column);
- }
-
- public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener(listener);
- addListener(SWT.Selection, typedListener);
- addListener(SWT.DefaultSelection, typedListener);
- }
-
- void dispose(Event event) {
- Display display = getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if (table.isDisposed())
- return;
- table.removeListener(SWT.FocusIn, tableListener);
- table.removeListener(SWT.MouseDown, tableListener);
- int columns = table.getColumnCount();
- for (int i = 0; i < columns; i++) {
- TableColumn column = table.getColumn(i);
- column.removeListener(SWT.Resize, resizeListener);
- }
- ScrollBar hBar = table.getHorizontalBar();
- if (hBar != null) {
- hBar.removeListener(SWT.Selection, resizeListener);
- }
- ScrollBar vBar = table.getVerticalBar();
- if (vBar != null) {
- vBar.removeListener(SWT.Selection, resizeListener);
- }
- }
- });
- }
-
- void keyDown(Event event) {
- switch (event.character) {
- case SWT.CR :
- notifyListeners(SWT.DefaultSelection, new Event());
- return;
- }
- switch (event.keyCode) {
- case SWT.ARROW_UP :
- if (column < 0)
- column = 0;
- setRowColumn(row - 1, column, true);
- break;
- case SWT.ARROW_DOWN :
- if (column < 0)
- column = 0;
- setRowColumn(row + 1, column, true);
- break;
- case SWT.ARROW_LEFT :
- case SWT.ARROW_RIGHT :
- {
- if (column < 0)
- column = 0;
- int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
- if (event.keyCode == leadKey) {
- setRowColumn(row, column - 1, true);
- } else {
- setRowColumn(row, column + 1, true);
- }
- break;
- }
- case SWT.HOME :
- if (column < 0)
- column = 0;
- setRowColumn(0, column, true);
- break;
- case SWT.END :
- {
- if (column < 0)
- column = 0;
- int row = table.getItemCount() - 1;
- setRowColumn(row, column, true);
- break;
- }
- }
- }
-
- void paint(Event event) {
- GC gc = event.gc;
- Display display = getDisplay();
- gc.setBackground(display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
- gc.setForeground(display.getSystemColor(SWT.COLOR_LIST_SELECTION));
- gc.fillRectangle(event.x, event.y, event.width, event.height);
- TableItem item = null;
- if (row >= 0 && row<table.getItemCount())
- item = table.getItem(row);
- int x = 0, y = 0;
- Point size = getSize();
- if (item != null) {
- Image image = item.getImage(column);
- if (image != null) {
- Rectangle imageSize = image.getBounds();
- int imageY = y + (int) (((float)size.y - (float)imageSize.height) / 2.0);
- gc.drawImage(image, x, imageY);
- x += imageSize.width;
- }
- x += (column == 0) ? 2 : 6;
- int textY = y + (int) (((float)size.y - (float)gc.getFontMetrics().getHeight()) / 2.0);
- gc.drawString(item.getText(column), x, textY);
- }
-
- if (isFocusControl()) {
- gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
- gc.drawFocus(0, 0, size.x, size.y);
- }
-
- }
-
- void tableFocusIn(Event event) {
- if (isDisposed())
- return;
- if (isVisible()) {
- setFocus();
- redraw();
- }
- }
-
- void tableMouseDown(Event event) {
- event.doit = true;
- if (isDisposed() || !isVisible())
- return;
- Point pt = new Point(event.x, event.y);
- Rectangle clientRect = table.getClientArea();
- int columns = table.getColumnCount();
- int start = table.getTopIndex();
- int end = table.getItemCount();
- for (int row = start; row < end; row++) {
- TableItem item = table.getItem(row);
- for (int column = 0; column < columns; column++) {
- Rectangle rect = item.getBounds(column);
- if (rect.y > clientRect.y + clientRect.height)
- return;
- if (rect.contains(pt)) {
- setRowColumn(row, column, true);
- //setFocus();
- return;
- }
- }
- }
- }
-
- void traverse(Event event) {
- switch (event.detail) {
- case SWT.TRAVERSE_ARROW_NEXT :
- case SWT.TRAVERSE_ARROW_PREVIOUS :
- case SWT.TRAVERSE_RETURN :
- event.doit = false;
- return;
- }
- event.doit = true;
- }
-
- void setRowColumn(int row, int column, boolean notify) {
- if (0 <= row && row < table.getItemCount()) {
- if (0 <= column && column < table.getColumnCount()) {
- this.row = row;
- this.column = column;
- TableItem item = table.getItem(row);
- table.showItem(item);
- setBounds(item.getBounds(column));
-// redraw();
- if (notify) {
- notifyListeners(SWT.Selection, new Event());
- }
- }
- }
- redraw();
- updateVisible();
- }
-
- @Override
- public void setVisible(boolean visible) {
- checkWidget();
- userVisible = visible;
- resize();
- }
-
- void resize() {
- if (row >= 0 && row < table.getItemCount()) {
- TableItem item = table.getItem(row);
- setBounds(item.getBounds(column));
- }
- updateVisible();
- }
-
- void updateVisible() {
- progVisible = false;
- if (0 <= row && row < table.getItemCount()) {
- if (0 <= column && column < table.getColumnCount()) {
- progVisible = true;
- }
- }
- super.setVisible(progVisible && userVisible);
- }
-
- public int getColumn() {
- checkWidget();
- return column;
- }
-
- public TableItem getRow() {
- checkWidget();
- if (row<0 || row>=table.getItemCount())
- return null;
- return table.getItem(row);
- }
-
- public void setSelection(int row, int column) {
- checkWidget();
- setRowColumn(row, column, false);
- }
-
- public void setSelection(TableItem row, int column) {
- checkWidget();
- setRowColumn(table.indexOf(row), column, false);
- }
-
- private void initAccessible() {
- final Accessible accessible = getAccessible();
- if (accessAdapter == null) {
- accessAdapter = new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent e) {
- String name = null;
- TableItem item = null;
- TableColumn[] tableColumns = table.getColumns();
- TableColumn thisCol = null;
-
- if (row >= 0 && row < table.getItemCount() && column >= 0 && column < table.getColumnCount()) {
- item = table.getItem(row);
- if (column >= 0 && column < tableColumns.length) {
- thisCol = tableColumns[column];
- }
- }
- if (item != null) {
- if (thisCol != null)
- name = thisCol.getText();
- if (name != null && name.length() > 0)
- name = name + "=" + item.getText(column); //$NON-NLS-1$
- else
- name = item.getText(column);
- }
- e.result = name;
- }
-
- @Override
- public void getHelp(AccessibleEvent e) {
- String help = null;
- e.result = help;
- }
- @Override
- public void getKeyboardShortcut(AccessibleEvent e) {
- }
- };
-
- accessControlAdapter = new AccessibleControlAdapter() {
- @Override
- public void getChildAtPoint(AccessibleControlEvent e) {
- Point testPoint = toControl(new Point(e.x, e.y));
- int childID = ACC.CHILDID_NONE;
- if (childID == ACC.CHILDID_NONE) {
- Rectangle location = getBounds();
- location.height = location.height - getClientArea().height;
- if (location.contains(testPoint)) {
- childID = ACC.CHILDID_SELF;
- }
- }
- e.childID = childID;
- }
-
- @Override
- public void getLocation(AccessibleControlEvent e) {
- Rectangle location = null;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF) {
- location = getBounds();
- }
- if (location != null) {
- Point pt = toDisplay(new Point(location.x, location.y));
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
- }
-
- @Override
- public void getChildCount(AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- @Override
- public void getDefaultAction(AccessibleControlEvent e) {
- String action = "Edit field";
- e.result = action;
- }
-
- @Override
- public void getFocus(AccessibleControlEvent e) {
- int childID = ACC.CHILDID_NONE;
- if (isFocusControl()) {
- childID = ACC.CHILDID_SELF;
- }
- e.childID = childID;
- }
-
- @Override
- public void getRole(AccessibleControlEvent e) {
- int role = 0;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF)
- role = ACC.ROLE_LISTITEM;
- e.detail = role;
- }
-
- @Override
- public void getSelection(AccessibleControlEvent e) {
- e.childID = ACC.CHILDID_NONE;
- }
-
- @Override
- public void getState(AccessibleControlEvent e) {
- int state = 0;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF) {
- state = ACC.STATE_SELECTABLE;
- if (isFocusControl()) {
- state |= ACC.STATE_FOCUSABLE;
- if (TableCursor.this.hasFocus) {
- state += ACC.STATE_FOCUSED | ACC.STATE_SELECTED;
- }
- }
- }
- e.detail = state;
- }
-
- @Override
- public void getChildren(AccessibleControlEvent e) {
- e.children = null;
- }
- };
-
- selectionAccessListener = new Listener() {
- public void handleEvent(Event event) {
- accessible.setFocus(ACC.CHILDID_SELF);
- }
- };
-
- focusAccessListener = new Listener() {
- public void handleEvent(Event event) {
- accessible.setFocus(ACC.CHILDID_SELF);
- }
- };
- }
-
- if (hasAccessibility) {
- accessible.removeAccessibleListener(accessAdapter);
- accessible.removeAccessibleControlListener(accessControlAdapter);
- removeListener(SWT.Selection, selectionAccessListener);
- removeListener(SWT.FocusIn, focusAccessListener);
- hasAccessibility = false;
- }
- if (hasAccessibility == false) {
- accessible.addAccessibleListener(accessAdapter);
- accessible.addAccessibleControlListener(accessControlAdapter);
- addListener(SWT.Selection, selectionAccessListener);
- addListener(SWT.FocusIn, focusAccessListener);
- hasAccessibility = true;
- }
- }
-}
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.merrimac.providers;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.TypedListener;
+
+
+/**
+ * A modification of the SWT TableCursor class to better handle empty tables and dynamic tables
+ */
+public class TableCursor extends Canvas {
+
+ Table table;
+ int row = -1, column = 0; // having row negative will end up hiding the cursor
+ Listener tableListener, resizeListener;
+ boolean progVisible = false;
+ boolean userVisible = true;
+ boolean hasFocus = false;
+ AccessibleAdapter accessAdapter = null;
+ Listener selectionAccessListener = null;
+ Listener focusAccessListener = null;
+ AccessibleControlAdapter accessControlAdapter = null;
+ boolean hasAccessibility = false;
+
+ public TableCursor(Table parent, int style) {
+ super(parent, style);
+ table = parent;
+ Listener listener = new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Dispose :
+ dispose(event);
+ break;
+ case SWT.KeyDown :
+ keyDown(event);
+ break;
+ case SWT.Paint :
+ paint(event);
+ break;
+ case SWT.Traverse :
+ traverse(event);
+ break;
+ }
+ }
+ };
+ addListener(SWT.Dispose, listener);
+ addListener(SWT.KeyDown, listener);
+ addListener(SWT.Paint, listener);
+ addListener(SWT.Traverse, listener);
+
+ tableListener = new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.MouseDown :
+ tableMouseDown(event);
+ break;
+ case SWT.FocusIn :
+ tableFocusIn(event);
+ break;
+ }
+ }
+ };
+ table.addListener(SWT.FocusIn, tableListener);
+ table.addListener(SWT.MouseDown, tableListener);
+
+ resizeListener = new Listener() {
+ public void handleEvent(Event event) {
+ resize();
+ }
+ };
+
+ ScrollBar hBar = table.getHorizontalBar();
+ if (hBar != null)
+ hBar.addListener(SWT.Selection, resizeListener);
+
+ ScrollBar vBar = table.getVerticalBar();
+ if (vBar != null)
+ vBar.addListener(SWT.Selection, resizeListener);
+
+ this.addFocusListener(new FocusListener() {
+ public void focusGained(FocusEvent e) {
+ hasFocus = true;
+ redraw();
+ }
+
+ public void focusLost(FocusEvent e) {
+ hasFocus = false;
+ redraw();
+
+ }});
+
+ refresh();
+
+ initAccessible();
+ }
+
+ /**
+ * Creates a table cursor that can be used to navigate tables for keyboard accessibility
+ * @param table
+ * @param tableViewer
+ * @return
+ */
+ public static TableCursor create(final Table table, final TableViewer tableViewer) {
+ // create a TableCursor to navigate around the table
+ final TableCursor cursor = new TableCursor(table, SWT.NONE);
+ cursor.addSelectionListener(new SelectionAdapter() {
+ // when the TableEditor is over a cell, select the corresponding row in the table
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (cursor.getRow() != null)
+ table.setSelection(new TableItem[] {cursor.getRow()});
+ }
+ // when the user hits "ENTER" in the TableCursor, pop up an editor
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ TableItem row = cursor.getRow();
+ if (row != null) {
+ int nRow = table.indexOf(row);
+ int column = cursor.getColumn();
+ Object obj = tableViewer.getElementAt(nRow);
+ tableViewer.editElement(obj, column);
+ }
+ }
+ });
+
+ // Hide the TableCursor when the user hits the "CTRL" or "SHIFT" key.
+ // This alows the user to select multiple items in the table.
+ cursor.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if ((e.keyCode == SWT.CTRL) || (e.keyCode == SWT.SHIFT) ||
+ (e.stateMask & SWT.CONTROL) != 0 || (e.stateMask & SWT.SHIFT) != 0) {
+ cursor.setVisible(false);
+ }
+ }
+ });
+
+ cursor.addMouseListener(new MouseListener() {
+ public void mouseDoubleClick(MouseEvent e) { }
+ public void mouseDown(MouseEvent e) {
+ TableItem row = cursor.getRow();
+ if (row != null) {
+ int nRow = table.indexOf(row);
+ int column = cursor.getColumn();
+ Object obj = tableViewer.getElementAt(nRow);
+ tableViewer.editElement(obj, column);
+ }
+ }
+ public void mouseUp(MouseEvent e) {
+ }
+ });
+
+ // Show the TableCursor when the user releases the "SHIFT" or "CTRL" key.
+ // This signals the end of the multiple selection modelObject.
+ table.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.keyCode == SWT.CONTROL && (e.stateMask & SWT.SHIFT) != 0)
+ return;
+ if (e.keyCode == SWT.SHIFT && (e.stateMask & SWT.CONTROL) != 0)
+ return;
+ if (e.keyCode != SWT.CONTROL && (e.stateMask & SWT.CONTROL) != 0)
+ return;
+ if (e.keyCode != SWT.SHIFT && (e.stateMask & SWT.SHIFT) != 0)
+ return;
+
+ if (table.getItemCount() == 0)
+ return;
+ TableItem[] selection = table.getSelection();
+ TableItem row = (selection.length == 0) ? table.getItem(table.getTopIndex()) : selection[0];
+ table.showItem(row);
+ cursor.setSelection(row, 0);
+ cursor.setVisible(true);
+ cursor.setFocus();
+ }
+ });
+ return cursor;
+ }
+
+ /**
+ * this is called whenever the content of the table has changed, it
+ * will reconcile the cursor and any listeners that we need
+ */
+
+ public void refresh() {
+ // the number of rows and columns could have changed, ideally we should track
+ // which columns have listeners but for the now, we'll just remove and readd
+ int columns = table.getColumnCount();
+ for (int i = 0; i < columns; i++) {
+ TableColumn column = table.getColumn(i);
+ column.removeListener(SWT.Resize, resizeListener);
+ }
+ for (int i = 0; i < columns; i++) {
+ TableColumn column = table.getColumn(i);
+ column.addListener(SWT.Resize, resizeListener);
+ }
+
+ // reset the row and column to be a valid one
+ //boolean repaint = false;
+ if (row >= table.getItemCount()) {
+ row = table.getItemCount()-1;
+ }
+ if (column >= columns) {
+ column = columns - 1;
+ }
+
+ // check to see what the selection is, and reset the tablecursor to
+ // a valid row/column in that selection
+
+ TableItem[] selection = table.getSelection();
+ if (selection.length == 0) {
+ row = -1;
+ }
+ else {
+// // there is a selection, so make sure our table cursor is in that selection
+// // range
+// int min = 999999;
+// int max = -1;
+// for (int i = 0; i < selection.length; i++) {
+// int temp = table.indexOf(selection[i]);
+// min = Math.min(temp, min);
+// max = Math.max(temp, max);
+// }
+// if (row > max || row < min)
+// row = min;
+ }
+ setSelection(row, column);
+ }
+
+ public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null)
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection, typedListener);
+ addListener(SWT.DefaultSelection, typedListener);
+ }
+
+ void dispose(Event event) {
+ Display display = getDisplay();
+ display.asyncExec(new Runnable() {
+ public void run() {
+ if (table.isDisposed())
+ return;
+ table.removeListener(SWT.FocusIn, tableListener);
+ table.removeListener(SWT.MouseDown, tableListener);
+ int columns = table.getColumnCount();
+ for (int i = 0; i < columns; i++) {
+ TableColumn column = table.getColumn(i);
+ column.removeListener(SWT.Resize, resizeListener);
+ }
+ ScrollBar hBar = table.getHorizontalBar();
+ if (hBar != null) {
+ hBar.removeListener(SWT.Selection, resizeListener);
+ }
+ ScrollBar vBar = table.getVerticalBar();
+ if (vBar != null) {
+ vBar.removeListener(SWT.Selection, resizeListener);
+ }
+ }
+ });
+ }
+
+ void keyDown(Event event) {
+ switch (event.character) {
+ case SWT.CR :
+ notifyListeners(SWT.DefaultSelection, new Event());
+ return;
+ }
+ switch (event.keyCode) {
+ case SWT.ARROW_UP :
+ if (column < 0)
+ column = 0;
+ setRowColumn(row - 1, column, true);
+ break;
+ case SWT.ARROW_DOWN :
+ if (column < 0)
+ column = 0;
+ setRowColumn(row + 1, column, true);
+ break;
+ case SWT.ARROW_LEFT :
+ case SWT.ARROW_RIGHT :
+ {
+ if (column < 0)
+ column = 0;
+ int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
+ if (event.keyCode == leadKey) {
+ setRowColumn(row, column - 1, true);
+ } else {
+ setRowColumn(row, column + 1, true);
+ }
+ break;
+ }
+ case SWT.HOME :
+ if (column < 0)
+ column = 0;
+ setRowColumn(0, column, true);
+ break;
+ case SWT.END :
+ {
+ if (column < 0)
+ column = 0;
+ int row = table.getItemCount() - 1;
+ setRowColumn(row, column, true);
+ break;
+ }
+ }
+ }
+
+ void paint(Event event) {
+ GC gc = event.gc;
+ Display display = getDisplay();
+ gc.setBackground(display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
+ gc.setForeground(display.getSystemColor(SWT.COLOR_LIST_SELECTION));
+ gc.fillRectangle(event.x, event.y, event.width, event.height);
+ TableItem item = null;
+ if (row >= 0 && row<table.getItemCount())
+ item = table.getItem(row);
+ int x = 0, y = 0;
+ Point size = getSize();
+ if (item != null) {
+ Image image = item.getImage(column);
+ if (image != null) {
+ Rectangle imageSize = image.getBounds();
+ int imageY = y + (int) (((float)size.y - (float)imageSize.height) / 2.0);
+ gc.drawImage(image, x, imageY);
+ x += imageSize.width;
+ }
+ x += (column == 0) ? 2 : 6;
+ int textY = y + (int) (((float)size.y - (float)gc.getFontMetrics().getHeight()) / 2.0);
+ gc.drawString(item.getText(column), x, textY);
+ }
+
+ if (isFocusControl()) {
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+ gc.drawFocus(0, 0, size.x, size.y);
+ }
+
+ }
+
+ void tableFocusIn(Event event) {
+ if (isDisposed())
+ return;
+ if (isVisible()) {
+ setFocus();
+ redraw();
+ }
+ }
+
+ void tableMouseDown(Event event) {
+ event.doit = true;
+ if (isDisposed() || !isVisible())
+ return;
+ Point pt = new Point(event.x, event.y);
+ Rectangle clientRect = table.getClientArea();
+ int columns = table.getColumnCount();
+ int start = table.getTopIndex();
+ int end = table.getItemCount();
+ for (int row = start; row < end; row++) {
+ TableItem item = table.getItem(row);
+ for (int column = 0; column < columns; column++) {
+ Rectangle rect = item.getBounds(column);
+ if (rect.y > clientRect.y + clientRect.height)
+ return;
+ if (rect.contains(pt)) {
+ setRowColumn(row, column, true);
+ //setFocus();
+ return;
+ }
+ }
+ }
+ }
+
+ void traverse(Event event) {
+ switch (event.detail) {
+ case SWT.TRAVERSE_ARROW_NEXT :
+ case SWT.TRAVERSE_ARROW_PREVIOUS :
+ case SWT.TRAVERSE_RETURN :
+ event.doit = false;
+ return;
+ }
+ event.doit = true;
+ }
+
+ void setRowColumn(int row, int column, boolean notify) {
+ if (0 <= row && row < table.getItemCount()) {
+ if (0 <= column && column < table.getColumnCount()) {
+ this.row = row;
+ this.column = column;
+ TableItem item = table.getItem(row);
+ table.showItem(item);
+ setBounds(item.getBounds(column));
+// redraw();
+ if (notify) {
+ notifyListeners(SWT.Selection, new Event());
+ }
+ }
+ }
+ redraw();
+ updateVisible();
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ checkWidget();
+ userVisible = visible;
+ resize();
+ }
+
+ void resize() {
+ if (row >= 0 && row < table.getItemCount()) {
+ TableItem item = table.getItem(row);
+ setBounds(item.getBounds(column));
+ }
+ updateVisible();
+ }
+
+ void updateVisible() {
+ progVisible = false;
+ if (0 <= row && row < table.getItemCount()) {
+ if (0 <= column && column < table.getColumnCount()) {
+ progVisible = true;
+ }
+ }
+ super.setVisible(progVisible && userVisible);
+ }
+
+ public int getColumn() {
+ checkWidget();
+ return column;
+ }
+
+ public TableItem getRow() {
+ checkWidget();
+ if (row<0 || row>=table.getItemCount())
+ return null;
+ return table.getItem(row);
+ }
+
+ public void setSelection(int row, int column) {
+ checkWidget();
+ setRowColumn(row, column, false);
+ }
+
+ public void setSelection(TableItem row, int column) {
+ checkWidget();
+ setRowColumn(table.indexOf(row), column, false);
+ }
+
+ private void initAccessible() {
+ final Accessible accessible = getAccessible();
+ if (accessAdapter == null) {
+ accessAdapter = new AccessibleAdapter() {
+ @Override
+ public void getName(AccessibleEvent e) {
+ String name = null;
+ TableItem item = null;
+ TableColumn[] tableColumns = table.getColumns();
+ TableColumn thisCol = null;
+
+ if (row >= 0 && row < table.getItemCount() && column >= 0 && column < table.getColumnCount()) {
+ item = table.getItem(row);
+ if (column >= 0 && column < tableColumns.length) {
+ thisCol = tableColumns[column];
+ }
+ }
+ if (item != null) {
+ if (thisCol != null)
+ name = thisCol.getText();
+ if (name != null && name.length() > 0)
+ name = name + "=" + item.getText(column); //$NON-NLS-1$
+ else
+ name = item.getText(column);
+ }
+ e.result = name;
+ }
+
+ @Override
+ public void getHelp(AccessibleEvent e) {
+ String help = null;
+ e.result = help;
+ }
+ @Override
+ public void getKeyboardShortcut(AccessibleEvent e) {
+ }
+ };
+
+ accessControlAdapter = new AccessibleControlAdapter() {
+ @Override
+ public void getChildAtPoint(AccessibleControlEvent e) {
+ Point testPoint = toControl(new Point(e.x, e.y));
+ int childID = ACC.CHILDID_NONE;
+ if (childID == ACC.CHILDID_NONE) {
+ Rectangle location = getBounds();
+ location.height = location.height - getClientArea().height;
+ if (location.contains(testPoint)) {
+ childID = ACC.CHILDID_SELF;
+ }
+ }
+ e.childID = childID;
+ }
+
+ @Override
+ public void getLocation(AccessibleControlEvent e) {
+ Rectangle location = null;
+ int childID = e.childID;
+ if (childID == ACC.CHILDID_SELF) {
+ location = getBounds();
+ }
+ if (location != null) {
+ Point pt = toDisplay(new Point(location.x, location.y));
+ e.x = pt.x;
+ e.y = pt.y;
+ e.width = location.width;
+ e.height = location.height;
+ }
+ }
+
+ @Override
+ public void getChildCount(AccessibleControlEvent e) {
+ e.detail = 0;
+ }
+
+ @Override
+ public void getDefaultAction(AccessibleControlEvent e) {
+ String action = "Edit field";
+ e.result = action;
+ }
+
+ @Override
+ public void getFocus(AccessibleControlEvent e) {
+ int childID = ACC.CHILDID_NONE;
+ if (isFocusControl()) {
+ childID = ACC.CHILDID_SELF;
+ }
+ e.childID = childID;
+ }
+
+ @Override
+ public void getRole(AccessibleControlEvent e) {
+ int role = 0;
+ int childID = e.childID;
+ if (childID == ACC.CHILDID_SELF)
+ role = ACC.ROLE_LISTITEM;
+ e.detail = role;
+ }
+
+ @Override
+ public void getSelection(AccessibleControlEvent e) {
+ e.childID = ACC.CHILDID_NONE;
+ }
+
+ @Override
+ public void getState(AccessibleControlEvent e) {
+ int state = 0;
+ int childID = e.childID;
+ if (childID == ACC.CHILDID_SELF) {
+ state = ACC.STATE_SELECTABLE;
+ if (isFocusControl()) {
+ state |= ACC.STATE_FOCUSABLE;
+ if (TableCursor.this.hasFocus) {
+ state += ACC.STATE_FOCUSED | ACC.STATE_SELECTED;
+ }
+ }
+ }
+ e.detail = state;
+ }
+
+ @Override
+ public void getChildren(AccessibleControlEvent e) {
+ e.children = null;
+ }
+ };
+
+ selectionAccessListener = new Listener() {
+ public void handleEvent(Event event) {
+ accessible.setFocus(ACC.CHILDID_SELF);
+ }
+ };
+
+ focusAccessListener = new Listener() {
+ public void handleEvent(Event event) {
+ accessible.setFocus(ACC.CHILDID_SELF);
+ }
+ };
+ }
+
+ if (hasAccessibility) {
+ accessible.removeAccessibleListener(accessAdapter);
+ accessible.removeAccessibleControlListener(accessControlAdapter);
+ removeListener(SWT.Selection, selectionAccessListener);
+ removeListener(SWT.FocusIn, focusAccessListener);
+ hasAccessibility = false;
+ }
+ if (hasAccessibility == false) {
+ accessible.addAccessibleListener(accessAdapter);
+ accessible.addAccessibleControlListener(accessControlAdapter);
+ addListener(SWT.Selection, selectionAccessListener);
+ addListener(SWT.FocusIn, focusAccessListener);
+ hasAccessibility = true;
+ }
+ }
+}
+
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java
index 9a14d42..f78b5de 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java
@@ -1,100 +1,100 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.model;
-
-import java.util.Map;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DocumentRoot;
-import org.eclipse.bpmn2.impl.Bpmn2FactoryImpl;
-import org.eclipse.bpmn2.impl.DocumentRootImpl;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl;
-import org.eclipse.emf.ecore.util.EcoreEMap;
-
-/**
- * This Factory will invoke the super factory to create a "bare bones"
- * model object, and then "decorate" it with model extensions defined
- * by the Target Runtime plugin extension.
- *
- * @author Bob Brodt
- *
- */
-public class Bpmn2ModelerFactory extends Bpmn2FactoryImpl {
-
- // Allows the XML loader for a particular target runtime to temporarily disable
- // model extensions. This prevents extensions being added multiple times by
- // ModelExtensionDescriptor.populateObject() every time a file is loaded.
- protected static boolean enableModelExtensions = true;
-
- public static Bpmn2ModelerFactory getInstance() {
- return (Bpmn2ModelerFactory) Bpmn2ModelerFactory.eINSTANCE;
- }
-
- @Override
- public EObject create(EClass eClass) {
- EObject object = super.create(eClass);
- if (enableModelExtensions)
- {
- TargetRuntime rt = TargetRuntime.getCurrentRuntime();
- if (rt!=null) {
-
- if (!eClass.getName().equals(Bpmn2Package.eINSTANCE.getDocumentRoot().getName()) &&
- rt.getModelDescriptor().getEPackage() != Bpmn2Package.eINSTANCE &&
- rt.getModelDescriptor().getEPackage().getEClassifier(eClass.getName()) != null ) {
- EClass clazz = (EClass) rt.getModelDescriptor().getEPackage().getEClassifier(eClass.getName());
- object = rt.getModelDescriptor().getEFactory().create(clazz);
- }
-
- for (ModelExtensionDescriptor med : rt.getModelExtensions()) {
- if (med.getType().equals(eClass.getName())) {
- med.populateObject(object, eResource());
- break;
- }
- }
- }
- }
- return object;
- }
-
- public static void setEnableModelExtensions(boolean enable) {
- enableModelExtensions = enable;
- }
-
- public static boolean getEnableModelExtensions() {
- return enableModelExtensions;
- }
-
- @SuppressWarnings("unchecked")
- public static <T extends EObject> T create(Class<T> clazz) {
- EObject newObject = null;
- EClassifier eClassifier = Bpmn2Package.eINSTANCE.getEClassifier(clazz.getSimpleName());
- if (eClassifier instanceof EClass) {
- newObject = Bpmn2ModelerFactory.eINSTANCE.create((EClass)eClassifier);
- }
- return (T)newObject;
- }
-
- public DocumentRoot createDocumentRoot() {
- DocumentRoot documentRoot = super.createDocumentRoot();
- documentRoot.eSetDeliver(false);
- return documentRoot;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.model;
+
+import java.util.Map;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DocumentRoot;
+import org.eclipse.bpmn2.impl.Bpmn2FactoryImpl;
+import org.eclipse.bpmn2.impl.DocumentRootImpl;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl;
+import org.eclipse.emf.ecore.util.EcoreEMap;
+
+/**
+ * This Factory will invoke the super factory to create a "bare bones"
+ * model object, and then "decorate" it with model extensions defined
+ * by the Target Runtime plugin extension.
+ *
+ * @author Bob Brodt
+ *
+ */
+public class Bpmn2ModelerFactory extends Bpmn2FactoryImpl {
+
+ // Allows the XML loader for a particular target runtime to temporarily disable
+ // model extensions. This prevents extensions being added multiple times by
+ // ModelExtensionDescriptor.populateObject() every time a file is loaded.
+ protected static boolean enableModelExtensions = true;
+
+ public static Bpmn2ModelerFactory getInstance() {
+ return (Bpmn2ModelerFactory) Bpmn2ModelerFactory.eINSTANCE;
+ }
+
+ @Override
+ public EObject create(EClass eClass) {
+ EObject object = super.create(eClass);
+ if (enableModelExtensions)
+ {
+ TargetRuntime rt = TargetRuntime.getCurrentRuntime();
+ if (rt!=null) {
+
+ if (!eClass.getName().equals(Bpmn2Package.eINSTANCE.getDocumentRoot().getName()) &&
+ rt.getModelDescriptor().getEPackage() != Bpmn2Package.eINSTANCE &&
+ rt.getModelDescriptor().getEPackage().getEClassifier(eClass.getName()) != null ) {
+ EClass clazz = (EClass) rt.getModelDescriptor().getEPackage().getEClassifier(eClass.getName());
+ object = rt.getModelDescriptor().getEFactory().create(clazz);
+ }
+
+ for (ModelExtensionDescriptor med : rt.getModelExtensions()) {
+ if (med.getType().equals(eClass.getName())) {
+ med.populateObject(object, eResource());
+ break;
+ }
+ }
+ }
+ }
+ return object;
+ }
+
+ public static void setEnableModelExtensions(boolean enable) {
+ enableModelExtensions = enable;
+ }
+
+ public static boolean getEnableModelExtensions() {
+ return enableModelExtensions;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T extends EObject> T create(Class<T> clazz) {
+ EObject newObject = null;
+ EClassifier eClassifier = Bpmn2Package.eINSTANCE.getEClassifier(clazz.getSimpleName());
+ if (eClassifier instanceof EClass) {
+ newObject = Bpmn2ModelerFactory.eINSTANCE.create((EClass)eClassifier);
+ }
+ return (T)newObject;
+ }
+
+ public DocumentRoot createDocumentRoot() {
+ DocumentRoot documentRoot = super.createDocumentRoot();
+ documentRoot.eSetDeliver(false);
+ return documentRoot;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceFactoryImpl.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceFactoryImpl.java
index 566ee42..ddbeec1 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceFactoryImpl.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceFactoryImpl.java
@@ -1,107 +1,107 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/**
- * <copyright>
- *
- * Copyright (c) 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
- *
- * </copyright>
- */
-package org.eclipse.bpmn2.modeler.core.model;
-
-import java.util.ArrayList;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.DocumentRoot;
-import org.eclipse.bpmn2.util.OnlyContainmentTypeInfo;
-import org.eclipse.bpmn2.util.XmlExtendedMetadata;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xmi.impl.ElementHandlerImpl;
-
-/**
- * The <b>Resource Factory</b> for the BPMN2 Modeler. Constructs a specialized BPMN2 Resource
- * which enhances the base Resource by adding ID lookup to sourceRef and targetRef object references.
- * @see org.eclipse.bpmn2.util.Bpmn2ResourceImpl
- */
-public class Bpmn2ModelerResourceFactoryImpl extends ResourceFactoryImpl {
- /**
- * Creates an instance of the resource eFactory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Bpmn2ModelerResourceFactoryImpl() {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- @Override
- public Resource createResource(URI uri) {
- Bpmn2ModelerResourceImpl result = new Bpmn2ModelerResourceImpl(uri);
- ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
- new OnlyContainmentTypeInfo());
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE,
- Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_ELEMENT_HANDLER,
- new ElementHandlerImpl(true));
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8");
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE,
- new ArrayList<Object>());
-
- return result;
- }
-
- /*
- *
- * Creates a new BpmnResourceImpl and initializes it.
- *
- * The method creates a DocumentRoot and a Definitions element, as both are
- * mandatory.
- */
-
- public Definitions createAndInitResource(URI uri) {
- Resource resource = createResource(uri);
- Definitions definitions = Bpmn2ModelerFactory.create(Definitions.class);
- DocumentRoot docummentRoot = Bpmn2ModelerFactory.create(DocumentRoot.class);
- docummentRoot.setDefinitions(definitions);
- resource.getContents().add(docummentRoot);
-
- return definitions;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2010 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
+ *
+ * </copyright>
+ */
+package org.eclipse.bpmn2.modeler.core.model;
+
+import java.util.ArrayList;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.DocumentRoot;
+import org.eclipse.bpmn2.util.OnlyContainmentTypeInfo;
+import org.eclipse.bpmn2.util.XmlExtendedMetadata;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.ElementHandlerImpl;
+
+/**
+ * The <b>Resource Factory</b> for the BPMN2 Modeler. Constructs a specialized BPMN2 Resource
+ * which enhances the base Resource by adding ID lookup to sourceRef and targetRef object references.
+ * @see org.eclipse.bpmn2.util.Bpmn2ResourceImpl
+ */
+public class Bpmn2ModelerResourceFactoryImpl extends ResourceFactoryImpl {
+ /**
+ * Creates an instance of the resource eFactory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Bpmn2ModelerResourceFactoryImpl() {
+ super();
+ }
+
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public Resource createResource(URI uri) {
+ Bpmn2ModelerResourceImpl result = new Bpmn2ModelerResourceImpl(uri);
+ ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
+ new OnlyContainmentTypeInfo());
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE,
+ Boolean.TRUE);
+
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_ELEMENT_HANDLER,
+ new ElementHandlerImpl(true));
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8");
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE,
+ new ArrayList<Object>());
+
+ return result;
+ }
+
+ /*
+ *
+ * Creates a new BpmnResourceImpl and initializes it.
+ *
+ * The method creates a DocumentRoot and a Definitions element, as both are
+ * mandatory.
+ */
+
+ public Definitions createAndInitResource(URI uri) {
+ Resource resource = createResource(uri);
+ Definitions definitions = Bpmn2ModelerFactory.create(Definitions.class);
+ DocumentRoot docummentRoot = Bpmn2ModelerFactory.create(DocumentRoot.class);
+ docummentRoot.setDefinitions(definitions);
+ resource.getContents().add(docummentRoot);
+
+ return definitions;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceSetImpl.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceSetImpl.java
index 7af0d90..6dd6c77 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceSetImpl.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceSetImpl.java
@@ -1,383 +1,383 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.model;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Apr 17, 2007
- *
- */
-
-
-@SuppressWarnings("nls")
-
-public class Bpmn2ModelerResourceSetImpl extends ResourceSetImpl implements IResourceChangeListener {
- // this ID identifies the BPMN file content type
- public static final String BPMN2_CONTENT_TYPE = "org.eclipse.bpmn2.content-type.xml"; //$NON-NLS-1$
-
- private String connectionTimeout;
- private String readTimeout;
-
- public Bpmn2ModelerResourceSetImpl() {
- super();
- }
-
- /**
- * Used to force loading using the right resource loaders.
- */
- static public final String SLIGHTLY_HACKED_KEY = "slightly.hacked.resource.set";
-
- /* (non-Javadoc)
- *
- * Intercept getEObject() calls and validate the URI.
- * This allows us to use arbitrary proxy URIs for things like ItemDefinition.structureRef
- *
- * Also handle the setting of connection timeout here for URIs that do not point to physical
- * resources, or resources that are currently unavailable due to (e.g. possibly) server outages.
- *
- * @see org.eclipse.emf.ecore.resource.impl.ResourceSetImpl#getEObject(org.eclipse.emf.common.util.URI, boolean)
- */
- @Override
- public EObject getEObject(URI uri, boolean loadOnDemand) {
- EObject o = null;
- if (uri!=null) {
- uri.trimFragment();
- if (uri.fragment()!=null) {
- setDefaultTimeoutProperties();
- o = super.getEObject(uri, loadOnDemand);
- restoreTimeoutProperties();
- }
- }
- return o;
- }
-
- private void saveTimeoutProperties() {
- if (connectionTimeout==null) {
- connectionTimeout = System.getProperty("sun.net.client.defaultConnectTimeout");
- if (connectionTimeout==null)
- connectionTimeout = "";
- }
- if (readTimeout==null) {
- readTimeout = System.getProperty("sun.net.client.defaultReadTimeout");
- if (readTimeout==null)
- readTimeout = "";
- }
- }
-
- private void restoreTimeoutProperties() {
- if(connectionTimeout!=null) {
- System.setProperty("sun.net.client.defaultConnectTimeout", connectionTimeout);
- connectionTimeout = null;
- }
- if (readTimeout!=null) {
- System.setProperty("sun.net.client.defaultReadTimeout", readTimeout);
- readTimeout = null;
- }
- }
-
- private void setDefaultTimeoutProperties() {
- saveTimeoutProperties();
- String timeout = Bpmn2Preferences.getInstance().getConnectionTimeout();
- System.setProperty("sun.net.client.defaultConnectTimeout", timeout);
- System.setProperty("sun.net.client.defaultReadTimeout", timeout);
- }
-
- /**
- * Load the resource from the resource set, assuming that it is the kind
- * indicated by the last argument. The "kind" parameter is the extension
- * without the . of the resource.
- *
- * This forces the right resource to be loaded even if the URI of the resource
- * is "wrong".
- *
- * @param uri the URI of the resource.
- * @param loadOnDemand load on demand
- * @param kind the resource kind. It has to be of the form "*.wsdl", or "*.xsd", or "*.bpmn"
- * @return the loaded resource.
- */
-
- @SuppressWarnings("nls")
- public Resource getResource(URI uri, boolean loadOnDemand, String kind) {
-
- // Bugzilla 324164
- // don't bother if URI is null or empty
- if (uri==null || uri.isEmpty())
- return null;
- Map<URI, Resource> map = getURIResourceMap();
-
- if (map != null) {
- Resource resource = map.get(uri);
- if (resource != null) {
- if (loadOnDemand && !resource.isLoaded()) {
- // Bugzilla 324164
- // if load fails, mark resource as unloaded
- try {
- demandLoadHelper(resource);
- } catch (Exception ex) {
- resource.unload();
- }
- }
-
- return resource;
- }
- }
-
- URIConverter theURIConverter = getURIConverter();
- URI normalizedURI = theURIConverter.normalize(uri);
-
- for (Resource resource : getResources()) {
- if (theURIConverter.normalize(resource.getURI()).equals(
- normalizedURI)) {
- if (loadOnDemand && !resource.isLoaded()) {
- // Bugzilla 324164
- // if load fails, mark resource as unloaded
- try {
- demandLoadHelper(resource);
- } catch (Exception ex) {
- resource.unload();
- break;
- }
- }
-
- if (map != null) {
- map.put(uri, resource);
- }
- return resource;
- }
- }
-
- if (loadOnDemand) {
- Resource resource = demandCreateResource(uri,kind);
- if (resource == null) {
- throw new RuntimeException("Cannot create a resource for '"
- + uri + "'; a registered resource factory is needed");
- }
-
- demandLoadHelper(resource);
-
- if (map != null) {
- map.put(uri, resource);
- }
- return resource;
- }
-
- return null;
- }
-
-
- protected Resource demandCreateResource ( URI uri, String kind ) {
- return createResource ( uri, kind );
- }
-
- /*
- * Fix for Bug 278205 - Problem with importing remote WSIL/WSDL still exists.
- * Telesh Alexandr added this method to solve this which is to load remote WSIL/WSDL
- * by the correct resource loader based on known before loading resouce
- * extension which is posed as resource content type.
- */
- public Resource.Factory.Registry getResourceFactoryRegistry() {
- if (resourceFactoryRegistry == null) {
-
- resourceFactoryRegistry = new ResourceFactoryRegistryImpl() {
- @Override
- protected Resource.Factory delegatedGetFactory(URI uri, String contentTypeIdentifier) {
- // patch for "wsil" and "wsdl" resources without extensions
- final Map<String, Object> extensionToFactoryMap =
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
-
- final Object wsilFactory = extensionToFactoryMap.get("wsil");
- final Object wsdlFactory = extensionToFactoryMap.get("wsdl");
-
- final Map<String, Object> contentTypeToFactoryMap =
- Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap();
-
- if (null != wsilFactory) {
- contentTypeToFactoryMap.put("wsil", wsilFactory);
- }
- if (null != wsdlFactory) {
- contentTypeToFactoryMap.put("wsdl", wsdlFactory);
- }
-
- return convert(getFactory(uri,
- Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap(),
- extensionToFactoryMap, contentTypeToFactoryMap,
- contentTypeIdentifier, false));
- }
-
- @Override
- protected URIConverter getURIConverter() {
- // return ResourceSetImpl.this.getURIConverter();
- return Bpmn2ModelerResourceSetImpl.this.getURIConverter();
- }
-
- @Override
- protected Map<?, ?> getContentDescriptionOptions() {
- return getLoadOptions();
- }
- };
- }
- return resourceFactoryRegistry;
- }
-
- /**
- * Create the resource based on the kind.
- * @param uri
- * @param kind
- * @return the created resource
- */
-
- // TODO: ganymede [ this method apparently is already in the parent resource set ]
- // we can strike it from this resourceset.
-
-// @SuppressWarnings("nls")
-// public Resource createResource ( URI uri, String kind) {
-//
-// if (kind == null) {
-// return super.createResource(uri);
-// }
-//
-// Resource resource = createResource(URI.createURI("*." + kind));
-// resource.setURI(uri);
-// return resource;
-// }
-
-
-
-
-
-
- /**
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged (IResourceChangeEvent event) {
-
- // System.out.println("IResourceChangeEvent: " + event + "; " + event.getType() );
- IResourceDelta[] deltas = event.getDelta().getAffectedChildren( IResourceDelta.CHANGED | IResourceDelta.REMOVED, IResource.FILE );
- processDeltas ( deltas );
- }
-
- void processDeltas ( IResourceDelta [] deltas ) {
-
- for(IResourceDelta delta : deltas) {
- processDeltas( delta.getAffectedChildren(IResourceDelta.CHANGED | IResourceDelta.REMOVED, IResource.FILE) );
-
- IResource resource = delta.getResource();
- if (resource.getType () != IResource.FILE) {
- continue;
- }
-
- if (delta.getKind() == IResourceDelta.REMOVED){
- resourceChanged((IFile)resource);
- continue;
- }
-
-// * @see IResourceDelta#CONTENT
-// * @see IResourceDelta#DESCRIPTION
-// * @see IResourceDelta#ENCODING
-// * @see IResourceDelta#OPEN
-// * @see IResourceDelta#MOVED_TO
-// * @see IResourceDelta#MOVED_FROM
-// * @see IResourceDelta#TYPE
-// * @see IResourceDelta#SYNC
-// * @see IResourceDelta#MARKERS
-// * @see IResourceDelta#REPLACED
-
- if ((delta.getFlags() & IResourceDelta.CONTENT) == 0){
- continue;
- }
-
- // TODO: Temporary hack
- // Actually we should remove all resources from the resourceSet,
- // but for some reasons bpmn files can't be removed now
- // Bugzilla 320545:
- if (isBPMN2File(resource)){
- continue;
- }
-
- resourceChanged((IFile) resource);
- }
- }
-
- public void setLoadOptions (Map<Object, Object> options) {
- loadOptions = options;
- }
-
- /**
- * Resource has changed, remove it from the cache or list of loaded resources.
- *
- * @param file
- */
- public void resourceChanged (IFile file) {
- // System.out.println("ResourceChanged: " + file );
- URI uri = URI.createPlatformResourceURI( file.getFullPath().toString() ) ;
- // System.out.println(" ResourceURI: " + uri );
- URIConverter theURIConverter = getURIConverter();
- URI normalizedURI = theURIConverter.normalize(uri);
-
- if (uriResourceMap != null) {
- uriResourceMap.remove(uri);
- uriResourceMap.remove(normalizedURI);
- // System.out.println("Removed from Map: " + map );
- }
-
- List<Resource> resourceList = getResources();
- if (resources.size() < 1) {
- return ;
- }
-
- for(Resource r : new ArrayList<Resource>(resourceList) ) {
- if (uri.equals(r.getURI()) || normalizedURI.equals(r.getURI() )) {
- resources.remove(r);
- // System.out.println("Removed from List: " + r );
- }
- }
- }
-
- // Bugzilla 320545:
- public static boolean isBPMN2File(IResource res)
- {
- try
- {
- if (res.getType() == IResource.FILE) {
- IContentDescription desc = ((IFile) res).getContentDescription();
- if (desc != null) {
- IContentType type = desc.getContentType();
- if (type.getId().equals(BPMN2_CONTENT_TYPE))
- return true;
- }
- }
- }
- catch(Exception ex)
- {
- }
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.URIConverter;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Apr 17, 2007
+ *
+ */
+
+
+@SuppressWarnings("nls")
+
+public class Bpmn2ModelerResourceSetImpl extends ResourceSetImpl implements IResourceChangeListener {
+ // this ID identifies the BPMN file content type
+ public static final String BPMN2_CONTENT_TYPE = "org.eclipse.bpmn2.content-type.xml"; //$NON-NLS-1$
+
+ private String connectionTimeout;
+ private String readTimeout;
+
+ public Bpmn2ModelerResourceSetImpl() {
+ super();
+ }
+
+ /**
+ * Used to force loading using the right resource loaders.
+ */
+ static public final String SLIGHTLY_HACKED_KEY = "slightly.hacked.resource.set";
+
+ /* (non-Javadoc)
+ *
+ * Intercept getEObject() calls and validate the URI.
+ * This allows us to use arbitrary proxy URIs for things like ItemDefinition.structureRef
+ *
+ * Also handle the setting of connection timeout here for URIs that do not point to physical
+ * resources, or resources that are currently unavailable due to (e.g. possibly) server outages.
+ *
+ * @see org.eclipse.emf.ecore.resource.impl.ResourceSetImpl#getEObject(org.eclipse.emf.common.util.URI, boolean)
+ */
+ @Override
+ public EObject getEObject(URI uri, boolean loadOnDemand) {
+ EObject o = null;
+ if (uri!=null) {
+ uri.trimFragment();
+ if (uri.fragment()!=null) {
+ setDefaultTimeoutProperties();
+ o = super.getEObject(uri, loadOnDemand);
+ restoreTimeoutProperties();
+ }
+ }
+ return o;
+ }
+
+ private void saveTimeoutProperties() {
+ if (connectionTimeout==null) {
+ connectionTimeout = System.getProperty("sun.net.client.defaultConnectTimeout");
+ if (connectionTimeout==null)
+ connectionTimeout = "";
+ }
+ if (readTimeout==null) {
+ readTimeout = System.getProperty("sun.net.client.defaultReadTimeout");
+ if (readTimeout==null)
+ readTimeout = "";
+ }
+ }
+
+ private void restoreTimeoutProperties() {
+ if(connectionTimeout!=null) {
+ System.setProperty("sun.net.client.defaultConnectTimeout", connectionTimeout);
+ connectionTimeout = null;
+ }
+ if (readTimeout!=null) {
+ System.setProperty("sun.net.client.defaultReadTimeout", readTimeout);
+ readTimeout = null;
+ }
+ }
+
+ private void setDefaultTimeoutProperties() {
+ saveTimeoutProperties();
+ String timeout = Bpmn2Preferences.getInstance().getConnectionTimeout();
+ System.setProperty("sun.net.client.defaultConnectTimeout", timeout);
+ System.setProperty("sun.net.client.defaultReadTimeout", timeout);
+ }
+
+ /**
+ * Load the resource from the resource set, assuming that it is the kind
+ * indicated by the last argument. The "kind" parameter is the extension
+ * without the . of the resource.
+ *
+ * This forces the right resource to be loaded even if the URI of the resource
+ * is "wrong".
+ *
+ * @param uri the URI of the resource.
+ * @param loadOnDemand load on demand
+ * @param kind the resource kind. It has to be of the form "*.wsdl", or "*.xsd", or "*.bpmn"
+ * @return the loaded resource.
+ */
+
+ @SuppressWarnings("nls")
+ public Resource getResource(URI uri, boolean loadOnDemand, String kind) {
+
+ // Bugzilla 324164
+ // don't bother if URI is null or empty
+ if (uri==null || uri.isEmpty())
+ return null;
+ Map<URI, Resource> map = getURIResourceMap();
+
+ if (map != null) {
+ Resource resource = map.get(uri);
+ if (resource != null) {
+ if (loadOnDemand && !resource.isLoaded()) {
+ // Bugzilla 324164
+ // if load fails, mark resource as unloaded
+ try {
+ demandLoadHelper(resource);
+ } catch (Exception ex) {
+ resource.unload();
+ }
+ }
+
+ return resource;
+ }
+ }
+
+ URIConverter theURIConverter = getURIConverter();
+ URI normalizedURI = theURIConverter.normalize(uri);
+
+ for (Resource resource : getResources()) {
+ if (theURIConverter.normalize(resource.getURI()).equals(
+ normalizedURI)) {
+ if (loadOnDemand && !resource.isLoaded()) {
+ // Bugzilla 324164
+ // if load fails, mark resource as unloaded
+ try {
+ demandLoadHelper(resource);
+ } catch (Exception ex) {
+ resource.unload();
+ break;
+ }
+ }
+
+ if (map != null) {
+ map.put(uri, resource);
+ }
+ return resource;
+ }
+ }
+
+ if (loadOnDemand) {
+ Resource resource = demandCreateResource(uri,kind);
+ if (resource == null) {
+ throw new RuntimeException("Cannot create a resource for '"
+ + uri + "'; a registered resource factory is needed");
+ }
+
+ demandLoadHelper(resource);
+
+ if (map != null) {
+ map.put(uri, resource);
+ }
+ return resource;
+ }
+
+ return null;
+ }
+
+
+ protected Resource demandCreateResource ( URI uri, String kind ) {
+ return createResource ( uri, kind );
+ }
+
+ /*
+ * Fix for Bug 278205 - Problem with importing remote WSIL/WSDL still exists.
+ * Telesh Alexandr added this method to solve this which is to load remote WSIL/WSDL
+ * by the correct resource loader based on known before loading resouce
+ * extension which is posed as resource content type.
+ */
+ public Resource.Factory.Registry getResourceFactoryRegistry() {
+ if (resourceFactoryRegistry == null) {
+
+ resourceFactoryRegistry = new ResourceFactoryRegistryImpl() {
+ @Override
+ protected Resource.Factory delegatedGetFactory(URI uri, String contentTypeIdentifier) {
+ // patch for "wsil" and "wsdl" resources without extensions
+ final Map<String, Object> extensionToFactoryMap =
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
+
+ final Object wsilFactory = extensionToFactoryMap.get("wsil");
+ final Object wsdlFactory = extensionToFactoryMap.get("wsdl");
+
+ final Map<String, Object> contentTypeToFactoryMap =
+ Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap();
+
+ if (null != wsilFactory) {
+ contentTypeToFactoryMap.put("wsil", wsilFactory);
+ }
+ if (null != wsdlFactory) {
+ contentTypeToFactoryMap.put("wsdl", wsdlFactory);
+ }
+
+ return convert(getFactory(uri,
+ Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap(),
+ extensionToFactoryMap, contentTypeToFactoryMap,
+ contentTypeIdentifier, false));
+ }
+
+ @Override
+ protected URIConverter getURIConverter() {
+ // return ResourceSetImpl.this.getURIConverter();
+ return Bpmn2ModelerResourceSetImpl.this.getURIConverter();
+ }
+
+ @Override
+ protected Map<?, ?> getContentDescriptionOptions() {
+ return getLoadOptions();
+ }
+ };
+ }
+ return resourceFactoryRegistry;
+ }
+
+ /**
+ * Create the resource based on the kind.
+ * @param uri
+ * @param kind
+ * @return the created resource
+ */
+
+ // TODO: ganymede [ this method apparently is already in the parent resource set ]
+ // we can strike it from this resourceset.
+
+// @SuppressWarnings("nls")
+// public Resource createResource ( URI uri, String kind) {
+//
+// if (kind == null) {
+// return super.createResource(uri);
+// }
+//
+// Resource resource = createResource(URI.createURI("*." + kind));
+// resource.setURI(uri);
+// return resource;
+// }
+
+
+
+
+
+
+ /**
+ * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+ */
+ public void resourceChanged (IResourceChangeEvent event) {
+
+ // System.out.println("IResourceChangeEvent: " + event + "; " + event.getType() );
+ IResourceDelta[] deltas = event.getDelta().getAffectedChildren( IResourceDelta.CHANGED | IResourceDelta.REMOVED, IResource.FILE );
+ processDeltas ( deltas );
+ }
+
+ void processDeltas ( IResourceDelta [] deltas ) {
+
+ for(IResourceDelta delta : deltas) {
+ processDeltas( delta.getAffectedChildren(IResourceDelta.CHANGED | IResourceDelta.REMOVED, IResource.FILE) );
+
+ IResource resource = delta.getResource();
+ if (resource.getType () != IResource.FILE) {
+ continue;
+ }
+
+ if (delta.getKind() == IResourceDelta.REMOVED){
+ resourceChanged((IFile)resource);
+ continue;
+ }
+
+// * @see IResourceDelta#CONTENT
+// * @see IResourceDelta#DESCRIPTION
+// * @see IResourceDelta#ENCODING
+// * @see IResourceDelta#OPEN
+// * @see IResourceDelta#MOVED_TO
+// * @see IResourceDelta#MOVED_FROM
+// * @see IResourceDelta#TYPE
+// * @see IResourceDelta#SYNC
+// * @see IResourceDelta#MARKERS
+// * @see IResourceDelta#REPLACED
+
+ if ((delta.getFlags() & IResourceDelta.CONTENT) == 0){
+ continue;
+ }
+
+ // TODO: Temporary hack
+ // Actually we should remove all resources from the resourceSet,
+ // but for some reasons bpmn files can't be removed now
+ // Bugzilla 320545:
+ if (isBPMN2File(resource)){
+ continue;
+ }
+
+ resourceChanged((IFile) resource);
+ }
+ }
+
+ public void setLoadOptions (Map<Object, Object> options) {
+ loadOptions = options;
+ }
+
+ /**
+ * Resource has changed, remove it from the cache or list of loaded resources.
+ *
+ * @param file
+ */
+ public void resourceChanged (IFile file) {
+ // System.out.println("ResourceChanged: " + file );
+ URI uri = URI.createPlatformResourceURI( file.getFullPath().toString() ) ;
+ // System.out.println(" ResourceURI: " + uri );
+ URIConverter theURIConverter = getURIConverter();
+ URI normalizedURI = theURIConverter.normalize(uri);
+
+ if (uriResourceMap != null) {
+ uriResourceMap.remove(uri);
+ uriResourceMap.remove(normalizedURI);
+ // System.out.println("Removed from Map: " + map );
+ }
+
+ List<Resource> resourceList = getResources();
+ if (resources.size() < 1) {
+ return ;
+ }
+
+ for(Resource r : new ArrayList<Resource>(resourceList) ) {
+ if (uri.equals(r.getURI()) || normalizedURI.equals(r.getURI() )) {
+ resources.remove(r);
+ // System.out.println("Removed from List: " + r );
+ }
+ }
+ }
+
+ // Bugzilla 320545:
+ public static boolean isBPMN2File(IResource res)
+ {
+ try
+ {
+ if (res.getType() == IResource.FILE) {
+ IContentDescription desc = ((IFile) res).getContentDescription();
+ if (desc != null) {
+ IContentType type = desc.getContentType();
+ if (type.getId().equals(BPMN2_CONTENT_TYPE))
+ return true;
+ }
+ }
+ }
+ catch(Exception ex)
+ {
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
index 8eeb6a1..c01db8d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
@@ -1,273 +1,273 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.preferences;
-
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.graphiti.mm.algorithms.styles.Font;
-import org.eclipse.graphiti.mm.algorithms.styles.StylesFactory;
-import org.eclipse.graphiti.mm.algorithms.styles.StylesPackage;
-import org.eclipse.graphiti.util.ColorConstant;
-import org.eclipse.graphiti.util.ColorUtil;
-import org.eclipse.graphiti.util.IColorConstant;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ShapeStyle {
-
- public static IColorConstant DEFAULT_COLOR = new ColorConstant(212, 231, 248);
- public static String DEFAULT_FONT_STRING = "arial,10,-,-";
- IColorConstant shapeBackground;
- IColorConstant shapePrimarySelectedColor;
- IColorConstant shapeSecondarySelectedColor;
- IColorConstant shapeForeground;
- Font textFont;
- IColorConstant textColor;
- boolean dirty;
-
- public ShapeStyle() {
- setDefaultColors(DEFAULT_COLOR);
- textFont = stringToFont(DEFAULT_FONT_STRING);
- }
-
- public ShapeStyle(ShapeStyle other) {
- this(encode(other));
- }
-
- public ShapeStyle(String foreground, String background, String textColor, String font) {
- // only background color is required to set up default color scheme
- shapeBackground = stringToColor(background);
- setDefaultColors(shapeBackground);
-
- // optional:
- if (foreground!=null && !foreground.isEmpty())
- shapeForeground = stringToColor(foreground);
- if (textColor!=null && !textColor.isEmpty())
- this.textColor = stringToColor(textColor);
- if (font==null || font.isEmpty())
- font = DEFAULT_FONT_STRING;
- textFont = stringToFont(font);
- }
-
- protected ShapeStyle(String s) {
- String[] a = s.trim().split(";");
- shapeBackground = stringToColor(a[0]);
- shapePrimarySelectedColor = stringToColor(a[1]);
- shapeSecondarySelectedColor = stringToColor(a[2]);
- shapeForeground = stringToColor(a[3]);
- textFont = stringToFont(a[4]);
- textColor = stringToColor(a[5]);
- }
-
- public void setDefaultColors(IColorConstant defaultColor) {
- setShapeBackground(defaultColor);
- setShapePrimarySelectedColor(StyleUtil.shiftColor(defaultColor, 32));
- setShapeSecondarySelectedColor(StyleUtil.shiftColor(defaultColor, -32));
- setShapeForeground(StyleUtil.shiftColor(defaultColor, -128));
- setTextColor(StyleUtil.shiftColor(defaultColor, -128));
- }
-
- public boolean isDirty() {
- return dirty;
- }
-
- public void setDirty(boolean dirty) {
- this.dirty = dirty;
- }
-
- public IColorConstant getShapeBackground() {
- return shapeBackground;
- }
-
- public void setShapeBackground(IColorConstant shapeDefaultColor) {
- if (!compare(this.shapeBackground, shapeDefaultColor)) {
- this.shapeBackground = shapeDefaultColor;
- setDirty(true);
- }
- }
-
- public IColorConstant getShapePrimarySelectedColor() {
- return shapePrimarySelectedColor;
- }
-
- public void setShapePrimarySelectedColor(IColorConstant shapePrimarySelectedColor) {
- if (!compare(this.shapePrimarySelectedColor, shapePrimarySelectedColor)) {
- this.shapePrimarySelectedColor = shapePrimarySelectedColor;
- setDirty(true);
- }
- }
-
- public IColorConstant getShapeSecondarySelectedColor() {
- return shapeSecondarySelectedColor;
- }
-
- public void setShapeSecondarySelectedColor(IColorConstant shapeSecondarySelectedColor) {
- if (!compare(this.shapeSecondarySelectedColor, shapeSecondarySelectedColor)) {
- this.shapeSecondarySelectedColor = shapeSecondarySelectedColor;
- setDirty(true);
- }
- }
-
- public IColorConstant getShapeForeground() {
- return shapeForeground;
- }
-
- public void setShapeForeground(IColorConstant shapeBorderColor) {
- if (!compare(this.shapeForeground, shapeBorderColor)) {
- this.shapeForeground = shapeBorderColor;
- setDirty(true);
- }
- }
-
- public Font getTextFont() {
- return textFont;
- }
-
- public void setTextFont(Font textFont) {
- if (!compare(this.textFont, textFont)) {
- this.textFont = textFont;
- setDirty(true);
- }
- }
-
- public IColorConstant getTextColor() {
- return textColor;
- }
-
- public void setTextColor(IColorConstant textColor) {
- if (!compare(this.textColor, textColor)) {
- this.textColor = textColor;
- setDirty(true);
- }
- }
-
- public static String colorToString(IColorConstant c) {
- return new String(
- String.format("%02X",c.getRed()) +
- String.format("%02X",c.getGreen()) +
- String.format("%02X",c.getBlue())
- );
- }
-
- public static IColorConstant stringToColor(String s) {
- if (s.contains(",")) {
- String[] a = s.split(",");
- int r = Integer.parseInt(a[0]);
- int g = Integer.parseInt(a[1]);
- int b = Integer.parseInt(a[2]);
- return new ColorConstant(r, g, b);
- }
- if (s.length()<6)
- return new ColorConstant(0,0,0);
- return new ColorConstant(
- ColorUtil.getRedFromHex(s),
- ColorUtil.getGreenFromHex(s),
- ColorUtil.getBlueFromHex(s)
- );
- }
-
- public static RGB colorToRGB(IColorConstant c) {
- return new RGB(c.getRed(),c.getGreen(),c.getBlue());
- }
-
- public static IColorConstant RGBToColor(RGB rgb) {
- return new ColorConstant(rgb.red, rgb.green, rgb.blue);
- }
-
- public static String fontToString(Font f) {
- return new String(
- f.getName() + "," +
- f.getSize() + "," +
- (f.isItalic() ? "I" : "-") + "," +
- (f.isBold() ? "B" : "-")
- );
- }
-
- public static Font stringToFont(String s) {
- String[] a = s.split(",");
- Font f = StylesFactory.eINSTANCE.createFont();
- f.eSet(StylesPackage.eINSTANCE.getFont_Name(), a[0]);
- f.eSet(StylesPackage.eINSTANCE.getFont_Size(), Integer.valueOf(a[1]));
- f.eSet(StylesPackage.eINSTANCE.getFont_Italic(), a[2].equals("I"));
- f.eSet(StylesPackage.eINSTANCE.getFont_Bold(), a[3].equals("B"));
- return f;
- }
-
- public static FontData fontToFontData(Font f) {
- int style = 0;
- if (f.isItalic())
- style |= SWT.ITALIC;
- if (f.isBold())
- style |= SWT.BOLD;
- return new FontData(f.getName(), f.getSize(), style);
- }
-
- public static Font fontDataToFont(FontData fd) {
- Font f = StylesFactory.eINSTANCE.createFont();
- f.eSet(StylesPackage.eINSTANCE.getFont_Name(),fd.getName());
- f.eSet(StylesPackage.eINSTANCE.getFont_Size(), fd.getHeight());
- f.eSet(StylesPackage.eINSTANCE.getFont_Italic(), (fd.getStyle() & SWT.ITALIC)!=0);
- f.eSet(StylesPackage.eINSTANCE.getFont_Bold(), (fd.getStyle() & SWT.BOLD)!=0);
- return f;
- }
-
- public static String encode(ShapeStyle sp) {
- if (sp==null)
- return encode(new ShapeStyle());
- return new String(
- colorToString(sp.shapeBackground) + ";" +
- colorToString(sp.shapePrimarySelectedColor) + ";" +
- colorToString(sp.shapeSecondarySelectedColor) + ";" +
- colorToString(sp.shapeForeground) + ";" +
- fontToString(sp.textFont) + ";" +
- colorToString(sp.textColor)
- );
- }
-
- public static ShapeStyle decode(String s) {
- if (s==null || s.trim().split(";").length!=6)
- return new ShapeStyle();
- return new ShapeStyle(s);
- }
-
- public static boolean compare(IColorConstant c1, IColorConstant c2) {
- if (c1==c2)
- return true;
- if (c1==null || c2==null)
- return false;
- return c1.getRed() == c2.getRed() &&
- c1.getGreen() == c2.getGreen() &&
- c1.getBlue() == c2.getBlue();
- }
-
- public static boolean compare(Font f1, Font f2) {
- String s1 = fontToString(f1);
- String s2 = fontToString(f2);
- return s1.equals(s2);
- }
-
- public static boolean compare(ShapeStyle s1, ShapeStyle s2) {
- return
- compare(s1.shapeBackground, s2.shapeBackground) ||
- compare(s1.shapePrimarySelectedColor, s2.shapePrimarySelectedColor) ||
- compare(s1.shapeSecondarySelectedColor, s2.shapeSecondarySelectedColor) ||
- compare(s1.shapeForeground, s2.shapeForeground) ||
- compare(s1.textFont, s2.textFont) ||
- compare(s1.textColor, s2.textColor);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.preferences;
+
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.graphiti.mm.algorithms.styles.Font;
+import org.eclipse.graphiti.mm.algorithms.styles.StylesFactory;
+import org.eclipse.graphiti.mm.algorithms.styles.StylesPackage;
+import org.eclipse.graphiti.util.ColorConstant;
+import org.eclipse.graphiti.util.ColorUtil;
+import org.eclipse.graphiti.util.IColorConstant;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ShapeStyle {
+
+ public static IColorConstant DEFAULT_COLOR = new ColorConstant(212, 231, 248);
+ public static String DEFAULT_FONT_STRING = "arial,10,-,-";
+ IColorConstant shapeBackground;
+ IColorConstant shapePrimarySelectedColor;
+ IColorConstant shapeSecondarySelectedColor;
+ IColorConstant shapeForeground;
+ Font textFont;
+ IColorConstant textColor;
+ boolean dirty;
+
+ public ShapeStyle() {
+ setDefaultColors(DEFAULT_COLOR);
+ textFont = stringToFont(DEFAULT_FONT_STRING);
+ }
+
+ public ShapeStyle(ShapeStyle other) {
+ this(encode(other));
+ }
+
+ public ShapeStyle(String foreground, String background, String textColor, String font) {
+ // only background color is required to set up default color scheme
+ shapeBackground = stringToColor(background);
+ setDefaultColors(shapeBackground);
+
+ // optional:
+ if (foreground!=null && !foreground.isEmpty())
+ shapeForeground = stringToColor(foreground);
+ if (textColor!=null && !textColor.isEmpty())
+ this.textColor = stringToColor(textColor);
+ if (font==null || font.isEmpty())
+ font = DEFAULT_FONT_STRING;
+ textFont = stringToFont(font);
+ }
+
+ protected ShapeStyle(String s) {
+ String[] a = s.trim().split(";");
+ shapeBackground = stringToColor(a[0]);
+ shapePrimarySelectedColor = stringToColor(a[1]);
+ shapeSecondarySelectedColor = stringToColor(a[2]);
+ shapeForeground = stringToColor(a[3]);
+ textFont = stringToFont(a[4]);
+ textColor = stringToColor(a[5]);
+ }
+
+ public void setDefaultColors(IColorConstant defaultColor) {
+ setShapeBackground(defaultColor);
+ setShapePrimarySelectedColor(StyleUtil.shiftColor(defaultColor, 32));
+ setShapeSecondarySelectedColor(StyleUtil.shiftColor(defaultColor, -32));
+ setShapeForeground(StyleUtil.shiftColor(defaultColor, -128));
+ setTextColor(StyleUtil.shiftColor(defaultColor, -128));
+ }
+
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ public void setDirty(boolean dirty) {
+ this.dirty = dirty;
+ }
+
+ public IColorConstant getShapeBackground() {
+ return shapeBackground;
+ }
+
+ public void setShapeBackground(IColorConstant shapeDefaultColor) {
+ if (!compare(this.shapeBackground, shapeDefaultColor)) {
+ this.shapeBackground = shapeDefaultColor;
+ setDirty(true);
+ }
+ }
+
+ public IColorConstant getShapePrimarySelectedColor() {
+ return shapePrimarySelectedColor;
+ }
+
+ public void setShapePrimarySelectedColor(IColorConstant shapePrimarySelectedColor) {
+ if (!compare(this.shapePrimarySelectedColor, shapePrimarySelectedColor)) {
+ this.shapePrimarySelectedColor = shapePrimarySelectedColor;
+ setDirty(true);
+ }
+ }
+
+ public IColorConstant getShapeSecondarySelectedColor() {
+ return shapeSecondarySelectedColor;
+ }
+
+ public void setShapeSecondarySelectedColor(IColorConstant shapeSecondarySelectedColor) {
+ if (!compare(this.shapeSecondarySelectedColor, shapeSecondarySelectedColor)) {
+ this.shapeSecondarySelectedColor = shapeSecondarySelectedColor;
+ setDirty(true);
+ }
+ }
+
+ public IColorConstant getShapeForeground() {
+ return shapeForeground;
+ }
+
+ public void setShapeForeground(IColorConstant shapeBorderColor) {
+ if (!compare(this.shapeForeground, shapeBorderColor)) {
+ this.shapeForeground = shapeBorderColor;
+ setDirty(true);
+ }
+ }
+
+ public Font getTextFont() {
+ return textFont;
+ }
+
+ public void setTextFont(Font textFont) {
+ if (!compare(this.textFont, textFont)) {
+ this.textFont = textFont;
+ setDirty(true);
+ }
+ }
+
+ public IColorConstant getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(IColorConstant textColor) {
+ if (!compare(this.textColor, textColor)) {
+ this.textColor = textColor;
+ setDirty(true);
+ }
+ }
+
+ public static String colorToString(IColorConstant c) {
+ return new String(
+ String.format("%02X",c.getRed()) +
+ String.format("%02X",c.getGreen()) +
+ String.format("%02X",c.getBlue())
+ );
+ }
+
+ public static IColorConstant stringToColor(String s) {
+ if (s.contains(",")) {
+ String[] a = s.split(",");
+ int r = Integer.parseInt(a[0]);
+ int g = Integer.parseInt(a[1]);
+ int b = Integer.parseInt(a[2]);
+ return new ColorConstant(r, g, b);
+ }
+ if (s.length()<6)
+ return new ColorConstant(0,0,0);
+ return new ColorConstant(
+ ColorUtil.getRedFromHex(s),
+ ColorUtil.getGreenFromHex(s),
+ ColorUtil.getBlueFromHex(s)
+ );
+ }
+
+ public static RGB colorToRGB(IColorConstant c) {
+ return new RGB(c.getRed(),c.getGreen(),c.getBlue());
+ }
+
+ public static IColorConstant RGBToColor(RGB rgb) {
+ return new ColorConstant(rgb.red, rgb.green, rgb.blue);
+ }
+
+ public static String fontToString(Font f) {
+ return new String(
+ f.getName() + "," +
+ f.getSize() + "," +
+ (f.isItalic() ? "I" : "-") + "," +
+ (f.isBold() ? "B" : "-")
+ );
+ }
+
+ public static Font stringToFont(String s) {
+ String[] a = s.split(",");
+ Font f = StylesFactory.eINSTANCE.createFont();
+ f.eSet(StylesPackage.eINSTANCE.getFont_Name(), a[0]);
+ f.eSet(StylesPackage.eINSTANCE.getFont_Size(), Integer.valueOf(a[1]));
+ f.eSet(StylesPackage.eINSTANCE.getFont_Italic(), a[2].equals("I"));
+ f.eSet(StylesPackage.eINSTANCE.getFont_Bold(), a[3].equals("B"));
+ return f;
+ }
+
+ public static FontData fontToFontData(Font f) {
+ int style = 0;
+ if (f.isItalic())
+ style |= SWT.ITALIC;
+ if (f.isBold())
+ style |= SWT.BOLD;
+ return new FontData(f.getName(), f.getSize(), style);
+ }
+
+ public static Font fontDataToFont(FontData fd) {
+ Font f = StylesFactory.eINSTANCE.createFont();
+ f.eSet(StylesPackage.eINSTANCE.getFont_Name(),fd.getName());
+ f.eSet(StylesPackage.eINSTANCE.getFont_Size(), fd.getHeight());
+ f.eSet(StylesPackage.eINSTANCE.getFont_Italic(), (fd.getStyle() & SWT.ITALIC)!=0);
+ f.eSet(StylesPackage.eINSTANCE.getFont_Bold(), (fd.getStyle() & SWT.BOLD)!=0);
+ return f;
+ }
+
+ public static String encode(ShapeStyle sp) {
+ if (sp==null)
+ return encode(new ShapeStyle());
+ return new String(
+ colorToString(sp.shapeBackground) + ";" +
+ colorToString(sp.shapePrimarySelectedColor) + ";" +
+ colorToString(sp.shapeSecondarySelectedColor) + ";" +
+ colorToString(sp.shapeForeground) + ";" +
+ fontToString(sp.textFont) + ";" +
+ colorToString(sp.textColor)
+ );
+ }
+
+ public static ShapeStyle decode(String s) {
+ if (s==null || s.trim().split(";").length!=6)
+ return new ShapeStyle();
+ return new ShapeStyle(s);
+ }
+
+ public static boolean compare(IColorConstant c1, IColorConstant c2) {
+ if (c1==c2)
+ return true;
+ if (c1==null || c2==null)
+ return false;
+ return c1.getRed() == c2.getRed() &&
+ c1.getGreen() == c2.getGreen() &&
+ c1.getBlue() == c2.getBlue();
+ }
+
+ public static boolean compare(Font f1, Font f2) {
+ String s1 = fontToString(f1);
+ String s2 = fontToString(f2);
+ return s1.equals(s2);
+ }
+
+ public static boolean compare(ShapeStyle s1, ShapeStyle s2) {
+ return
+ compare(s1.shapeBackground, s2.shapeBackground) ||
+ compare(s1.shapePrimarySelectedColor, s2.shapePrimarySelectedColor) ||
+ compare(s1.shapeSecondarySelectedColor, s2.shapeSecondarySelectedColor) ||
+ compare(s1.shapeForeground, s2.shapeForeground) ||
+ compare(s1.textFont, s2.textFont) ||
+ compare(s1.textColor, s2.textColor);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablement.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablement.java
index 7cb53e0..5f7731d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablement.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablement.java
@@ -1,90 +1,90 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.preferences;
-
-import java.util.ArrayList;
-
-import org.eclipse.bpmn2.modeler.core.AbstractPropertyChangeListenerProvider;
-import org.eclipse.emf.ecore.ENamedElement;
-
-public class ToolEnablement extends AbstractPropertyChangeListenerProvider {
-
- private ENamedElement tool;
- private Boolean enabled;
-
- private ArrayList<ToolEnablement> children = new ArrayList<ToolEnablement>();
- private ToolEnablement parent;
-
- public ToolEnablement() {
- }
-
- public ToolEnablement(ENamedElement tool, ToolEnablement parent) {
- this.tool = tool;
- this.parent = parent;
- }
-
- public String getName() {
- return tool.getName();
- }
-
- public String getPreferenceName() {
- if (parent == null) {
- return tool.getName();
- } else {
- return parent.getPreferenceName() + "." + getName();
- }
- }
-
- public Boolean getEnabled() {
- return enabled;
- }
-
- public void setEnabled(Boolean enabled) {
- this.enabled = enabled;
- }
-
- public void setTool(ENamedElement tool) {
- this.tool = tool;
- }
-
- public ENamedElement getTool() {
- return tool;
- }
-
- public void setChildren(ArrayList<ToolEnablement> children) {
- this.children = children;
- }
-
- public ArrayList<ToolEnablement> getChildren() {
- return children;
- }
-
- public void setParent(ToolEnablement parent) {
- this.parent = parent;
- }
-
- public ToolEnablement getParent() {
- return parent;
- }
-
- @Override
- public String toString() {
- return "ToolEnablement [tool=" + getName() + ", enabled=" + enabled + ", children=" + children + ", parent="
- + (parent == null ? "null" : parent.getName()) + "]";
- }
-
- public boolean isAnyChildren() {
- return children != null && children.size() > 0;
-
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.bpmn2.modeler.core.AbstractPropertyChangeListenerProvider;
+import org.eclipse.emf.ecore.ENamedElement;
+
+public class ToolEnablement extends AbstractPropertyChangeListenerProvider {
+
+ private ENamedElement tool;
+ private Boolean enabled;
+
+ private ArrayList<ToolEnablement> children = new ArrayList<ToolEnablement>();
+ private ToolEnablement parent;
+
+ public ToolEnablement() {
+ }
+
+ public ToolEnablement(ENamedElement tool, ToolEnablement parent) {
+ this.tool = tool;
+ this.parent = parent;
+ }
+
+ public String getName() {
+ return tool.getName();
+ }
+
+ public String getPreferenceName() {
+ if (parent == null) {
+ return tool.getName();
+ } else {
+ return parent.getPreferenceName() + "." + getName();
+ }
+ }
+
+ public Boolean getEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(Boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public void setTool(ENamedElement tool) {
+ this.tool = tool;
+ }
+
+ public ENamedElement getTool() {
+ return tool;
+ }
+
+ public void setChildren(ArrayList<ToolEnablement> children) {
+ this.children = children;
+ }
+
+ public ArrayList<ToolEnablement> getChildren() {
+ return children;
+ }
+
+ public void setParent(ToolEnablement parent) {
+ this.parent = parent;
+ }
+
+ public ToolEnablement getParent() {
+ return parent;
+ }
+
+ @Override
+ public String toString() {
+ return "ToolEnablement [tool=" + getName() + ", enabled=" + enabled + ", children=" + children + ", parent="
+ + (parent == null ? "null" : parent.getName()) + "]";
+ }
+
+ public boolean isAnyChildren() {
+ return children != null && children.size() > 0;
+
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablementPreferences.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablementPreferences.java
index 8d931fc..f791fa6 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablementPreferences.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ToolEnablementPreferences.java
@@ -1,275 +1,275 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.preferences;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class ToolEnablementPreferences {
-
- private final Preferences prefs;
-
- private static HashSet<EClass> elementSet = new HashSet<EClass>();
-
-
- static {
- Bpmn2Package i = Bpmn2Package.eINSTANCE;
- final List<EClass> items = new ArrayList<EClass>();
- for (EClassifier eclassifier : i.getEClassifiers() ) {
- if (eclassifier instanceof EClass) {
- items.add((EClass)eclassifier);
- }
- }
- elementSet.addAll(items);
-// elementSet.addAll(getSubClasses(i.getFlowElement()));
-// elementSet.addAll(getSubClasses(i.getItemAwareElement()));
-// elementSet.addAll(getSubClasses(i.getDataAssociation()));
-// elementSet.addAll(getSubClasses(i.getRootElement()));
-// elementSet.addAll(getSubClasses(i.getEventDefinition()));
-// elementSet.addAll(getSubClasses(i.getLoopCharacteristics()));
-// elementSet.addAll(getSubClasses(i.getExpression()));
-// elementSet.add(i.getDefinitions());
-// elementSet.add(i.getOperation());
-// elementSet.add(i.getLane());
-// elementSet.add(i.getEscalation());
-// elementSet.add(i.getPotentialOwner());
-// elementSet.add(i.getResourceAssignmentExpression());
-// elementSet.add(i.getInputSet());
-// elementSet.add(i.getOutputSet());
-// elementSet.add(i.getAssignment());
-// elementSet.add(i.getAssociation());
-// elementSet.add(i.getTextAnnotation());
-// elementSet.add(i.getMessageFlow());
-// elementSet.add(i.getConversationLink());
-// elementSet.add(i.getGroup());
-// elementSet.add(i.getConversation());
- }
-
- private ToolEnablementPreferences(Preferences prefs) {
- this.prefs = prefs;
- }
-
- public static ToolEnablementPreferences getPreferences(IProject project) {
- IEclipsePreferences rootNode = Platform.getPreferencesService().getRootNode();
- Preferences prefs = rootNode.node(ProjectScope.SCOPE).node(project.getName())
- .node("org.eclipse.bpmn2.modeler.tools");
- return new ToolEnablementPreferences(prefs);
- }
-
- public void setEnablements(ModelEnablementDescriptor md) {
- setEnabledAll(false);
-
- Collection<String> enablements = md.getAllEnabled();
- for (String s : enablements) {
- String className = null;
- String featureName = null;
- if (s.contains(".")) {
- String[] a = s.split("\\.");
- className = a[0];
- featureName = a[1];
- }
- else
- className = s;
- for (EClass e : elementSet) {
- if (e.getName().equals(className)) {
- prefs.putBoolean(className, true);
- if (featureName!=null)
- prefs.putBoolean(className+"."+featureName, true);
- break;
- }
- }
- }
- }
-
- public List<ToolEnablement> getAllElements() {
- ArrayList<ToolEnablement> ret = new ArrayList<ToolEnablement>();
-
- for (EClass e : elementSet) {
-
- ToolEnablement tool = new ToolEnablement();
- tool.setTool(e);
- tool.setEnabled(isEnabled(e));
- ret.add(tool);
-
- HashSet<EStructuralFeature> possibleFeatures = new HashSet<EStructuralFeature>();
-
- ArrayList<ToolEnablement> children = new ArrayList<ToolEnablement>();
-
- for (EAttribute a : e.getEAllAttributes()) {
- possibleFeatures.add(a);
- }
-
- for (EReference a : e.getEAllContainments()) {
- possibleFeatures.add(a);
- }
-
- for (EReference a : e.getEAllReferences()) {
- possibleFeatures.add(a);
- }
-
- for (EStructuralFeature feature : possibleFeatures) {
- ToolEnablement toolEnablement = new ToolEnablement(feature, tool);
- toolEnablement.setEnabled(isEnabled(e, feature));
- children.add(toolEnablement);
- }
- sortTools(children);
- tool.setChildren(children);
- }
- sortTools(ret);
- return ret;
- }
-
- private void setEnabledAll(boolean enabled) {
- for (EClass e : elementSet) {
- prefs.putBoolean(e.getName(), enabled);
-
- for (EAttribute a : e.getEAllAttributes()) {
- prefs.putBoolean(e.getName()+"."+a.getName(), enabled);
- }
-
- for (EReference a : e.getEAllContainments()) {
- prefs.putBoolean(e.getName()+"."+a.getName(), enabled);
- }
-
- for (EReference a : e.getEAllReferences()) {
- prefs.putBoolean(e.getName()+"."+a.getName(), enabled);
- }
- }
- }
-
- private void sortTools(ArrayList<ToolEnablement> ret) {
- Collections.sort(ret, new Comparator<ToolEnablement>() {
-
- @Override
- public int compare(ToolEnablement o1, ToolEnablement o2) {
- return o1.getName().compareToIgnoreCase(o2.getName());
- }
-
- });
- }
-
- public boolean isEnabled(EClass element) {
- return prefs.getBoolean(element.getName(), true);
- }
-
- public boolean isEnabled(String name) {
- return prefs.getBoolean(name, true);
- }
-
- public boolean isEnabled(String name, boolean b) {
- return prefs.getBoolean(name, b);
- }
-
- public boolean isEnabled(EClass c, ENamedElement element) {
- return prefs.getBoolean(c.getName() + "." + element.getName(), true);
- }
-
- public void setEnabled(ToolEnablement tool, boolean enabled) {
- prefs.putBoolean(tool.getPreferenceName(), enabled);
- }
-
- public boolean isEnabled(ToolEnablement tool) {
- return prefs.getBoolean(tool.getPreferenceName(), true);
- }
-
- public void flush() throws BackingStoreException {
- prefs.flush();
- }
-
- public static List<EClass> getSubClasses(EClass parentClass) {
-
- List<EClass> classList = new ArrayList<EClass>();
- EList<EClassifier> classifiers = Bpmn2Package.eINSTANCE.getEClassifiers();
-
- for (EClassifier classifier : classifiers) {
- if (classifier instanceof EClass) {
- EClass clazz = (EClass) classifier;
-
- clazz.getEAllSuperTypes().contains(parentClass);
- if (parentClass.isSuperTypeOf(clazz) && !clazz.isAbstract()) {
- classList.add(clazz);
- }
- }
- }
- return classList;
- }
-
- public void importPreferences(String path) throws FileNotFoundException, IOException, BackingStoreException {
- Properties p = new Properties();
- p.load(new FileInputStream(path));
-
- for (Object k : p.keySet()) {
- Object object = p.get(k);
- if (k instanceof String && object instanceof String) {
- prefs.putBoolean((String) k, Boolean.parseBoolean((String) object));
- }
- }
- prefs.flush();
- }
-
- public void export(String path) throws BackingStoreException, FileNotFoundException, IOException {
- FileWriter fw = new FileWriter(path);
-
- List<String> keys = Arrays.asList(prefs.keys());
- Collections.sort(keys);
- for (String k : keys) {
- fw.write(k + "=" + prefs.getBoolean(k, true) + "\r\n");
- }
- fw.flush();
- fw.close();
- }
-
- public static ArrayList<EStructuralFeature> getAttributes(EClass eClass) {
- ArrayList<EStructuralFeature> ret = new ArrayList<EStructuralFeature>();
-
-// if (Bpmn2Package.eINSTANCE.getTask().equals(eClass)) {
-// ret.add(taskName);
-// } else if (Bpmn2Package.eINSTANCE.getCallActivity().equals(eClass)) {
-// ret.add(waitFor);
-// ret.add(independent);
-// } else if (Bpmn2Package.eINSTANCE.getBusinessRuleTask().equals(eClass)) {
-// ret.add(ruleFlowGroup);
-// } else if (Bpmn2Package.eINSTANCE.getProcess().equals(eClass)) {
-// ret.add(packageName);
-// }
-
- return ret;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.preferences;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+public class ToolEnablementPreferences {
+
+ private final Preferences prefs;
+
+ private static HashSet<EClass> elementSet = new HashSet<EClass>();
+
+
+ static {
+ Bpmn2Package i = Bpmn2Package.eINSTANCE;
+ final List<EClass> items = new ArrayList<EClass>();
+ for (EClassifier eclassifier : i.getEClassifiers() ) {
+ if (eclassifier instanceof EClass) {
+ items.add((EClass)eclassifier);
+ }
+ }
+ elementSet.addAll(items);
+// elementSet.addAll(getSubClasses(i.getFlowElement()));
+// elementSet.addAll(getSubClasses(i.getItemAwareElement()));
+// elementSet.addAll(getSubClasses(i.getDataAssociation()));
+// elementSet.addAll(getSubClasses(i.getRootElement()));
+// elementSet.addAll(getSubClasses(i.getEventDefinition()));
+// elementSet.addAll(getSubClasses(i.getLoopCharacteristics()));
+// elementSet.addAll(getSubClasses(i.getExpression()));
+// elementSet.add(i.getDefinitions());
+// elementSet.add(i.getOperation());
+// elementSet.add(i.getLane());
+// elementSet.add(i.getEscalation());
+// elementSet.add(i.getPotentialOwner());
+// elementSet.add(i.getResourceAssignmentExpression());
+// elementSet.add(i.getInputSet());
+// elementSet.add(i.getOutputSet());
+// elementSet.add(i.getAssignment());
+// elementSet.add(i.getAssociation());
+// elementSet.add(i.getTextAnnotation());
+// elementSet.add(i.getMessageFlow());
+// elementSet.add(i.getConversationLink());
+// elementSet.add(i.getGroup());
+// elementSet.add(i.getConversation());
+ }
+
+ private ToolEnablementPreferences(Preferences prefs) {
+ this.prefs = prefs;
+ }
+
+ public static ToolEnablementPreferences getPreferences(IProject project) {
+ IEclipsePreferences rootNode = Platform.getPreferencesService().getRootNode();
+ Preferences prefs = rootNode.node(ProjectScope.SCOPE).node(project.getName())
+ .node("org.eclipse.bpmn2.modeler.tools");
+ return new ToolEnablementPreferences(prefs);
+ }
+
+ public void setEnablements(ModelEnablementDescriptor md) {
+ setEnabledAll(false);
+
+ Collection<String> enablements = md.getAllEnabled();
+ for (String s : enablements) {
+ String className = null;
+ String featureName = null;
+ if (s.contains(".")) {
+ String[] a = s.split("\\.");
+ className = a[0];
+ featureName = a[1];
+ }
+ else
+ className = s;
+ for (EClass e : elementSet) {
+ if (e.getName().equals(className)) {
+ prefs.putBoolean(className, true);
+ if (featureName!=null)
+ prefs.putBoolean(className+"."+featureName, true);
+ break;
+ }
+ }
+ }
+ }
+
+ public List<ToolEnablement> getAllElements() {
+ ArrayList<ToolEnablement> ret = new ArrayList<ToolEnablement>();
+
+ for (EClass e : elementSet) {
+
+ ToolEnablement tool = new ToolEnablement();
+ tool.setTool(e);
+ tool.setEnabled(isEnabled(e));
+ ret.add(tool);
+
+ HashSet<EStructuralFeature> possibleFeatures = new HashSet<EStructuralFeature>();
+
+ ArrayList<ToolEnablement> children = new ArrayList<ToolEnablement>();
+
+ for (EAttribute a : e.getEAllAttributes()) {
+ possibleFeatures.add(a);
+ }
+
+ for (EReference a : e.getEAllContainments()) {
+ possibleFeatures.add(a);
+ }
+
+ for (EReference a : e.getEAllReferences()) {
+ possibleFeatures.add(a);
+ }
+
+ for (EStructuralFeature feature : possibleFeatures) {
+ ToolEnablement toolEnablement = new ToolEnablement(feature, tool);
+ toolEnablement.setEnabled(isEnabled(e, feature));
+ children.add(toolEnablement);
+ }
+ sortTools(children);
+ tool.setChildren(children);
+ }
+ sortTools(ret);
+ return ret;
+ }
+
+ private void setEnabledAll(boolean enabled) {
+ for (EClass e : elementSet) {
+ prefs.putBoolean(e.getName(), enabled);
+
+ for (EAttribute a : e.getEAllAttributes()) {
+ prefs.putBoolean(e.getName()+"."+a.getName(), enabled);
+ }
+
+ for (EReference a : e.getEAllContainments()) {
+ prefs.putBoolean(e.getName()+"."+a.getName(), enabled);
+ }
+
+ for (EReference a : e.getEAllReferences()) {
+ prefs.putBoolean(e.getName()+"."+a.getName(), enabled);
+ }
+ }
+ }
+
+ private void sortTools(ArrayList<ToolEnablement> ret) {
+ Collections.sort(ret, new Comparator<ToolEnablement>() {
+
+ @Override
+ public int compare(ToolEnablement o1, ToolEnablement o2) {
+ return o1.getName().compareToIgnoreCase(o2.getName());
+ }
+
+ });
+ }
+
+ public boolean isEnabled(EClass element) {
+ return prefs.getBoolean(element.getName(), true);
+ }
+
+ public boolean isEnabled(String name) {
+ return prefs.getBoolean(name, true);
+ }
+
+ public boolean isEnabled(String name, boolean b) {
+ return prefs.getBoolean(name, b);
+ }
+
+ public boolean isEnabled(EClass c, ENamedElement element) {
+ return prefs.getBoolean(c.getName() + "." + element.getName(), true);
+ }
+
+ public void setEnabled(ToolEnablement tool, boolean enabled) {
+ prefs.putBoolean(tool.getPreferenceName(), enabled);
+ }
+
+ public boolean isEnabled(ToolEnablement tool) {
+ return prefs.getBoolean(tool.getPreferenceName(), true);
+ }
+
+ public void flush() throws BackingStoreException {
+ prefs.flush();
+ }
+
+ public static List<EClass> getSubClasses(EClass parentClass) {
+
+ List<EClass> classList = new ArrayList<EClass>();
+ EList<EClassifier> classifiers = Bpmn2Package.eINSTANCE.getEClassifiers();
+
+ for (EClassifier classifier : classifiers) {
+ if (classifier instanceof EClass) {
+ EClass clazz = (EClass) classifier;
+
+ clazz.getEAllSuperTypes().contains(parentClass);
+ if (parentClass.isSuperTypeOf(clazz) && !clazz.isAbstract()) {
+ classList.add(clazz);
+ }
+ }
+ }
+ return classList;
+ }
+
+ public void importPreferences(String path) throws FileNotFoundException, IOException, BackingStoreException {
+ Properties p = new Properties();
+ p.load(new FileInputStream(path));
+
+ for (Object k : p.keySet()) {
+ Object object = p.get(k);
+ if (k instanceof String && object instanceof String) {
+ prefs.putBoolean((String) k, Boolean.parseBoolean((String) object));
+ }
+ }
+ prefs.flush();
+ }
+
+ public void export(String path) throws BackingStoreException, FileNotFoundException, IOException {
+ FileWriter fw = new FileWriter(path);
+
+ List<String> keys = Arrays.asList(prefs.keys());
+ Collections.sort(keys);
+ for (String k : keys) {
+ fw.write(k + "=" + prefs.getBoolean(k, true) + "\r\n");
+ }
+ fw.flush();
+ fw.close();
+ }
+
+ public static ArrayList<EStructuralFeature> getAttributes(EClass eClass) {
+ ArrayList<EStructuralFeature> ret = new ArrayList<EStructuralFeature>();
+
+// if (Bpmn2Package.eINSTANCE.getTask().equals(eClass)) {
+// ret.add(taskName);
+// } else if (Bpmn2Package.eINSTANCE.getCallActivity().equals(eClass)) {
+// ret.add(waitFor);
+// ret.add(independent);
+// } else if (Bpmn2Package.eINSTANCE.getBusinessRuleTask().equals(eClass)) {
+// ret.add(ruleFlowGroup);
+// } else if (Bpmn2Package.eINSTANCE.getProcess().equals(eClass)) {
+// ret.add(packageName);
+// }
+
+ return ret;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/TristateCheckboxFieldEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/TristateCheckboxFieldEditor.java
index 6d74f3f..8685ec9 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/TristateCheckboxFieldEditor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/TristateCheckboxFieldEditor.java
@@ -1,165 +1,165 @@
-package org.eclipse.bpmn2.modeler.core.preferences;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class TristateCheckboxFieldEditor extends BooleanFieldEditor {
-
- private List<TristateCheckboxFieldEditor> fields = null;
- private Composite parent;
- private int value = 0;
- private int oldValue = 0;
- private SelectionListener selectionListener = null;
-
- public TristateCheckboxFieldEditor(String name, String label, Composite parent) {
- super(name, label, parent);
- this.parent = parent;
- }
-
- public Button getCheckbox() {
- return getChangeControl(parent);
- }
-
- protected List<TristateCheckboxFieldEditor> getFields() {
- if (fields==null)
- fields = new ArrayList<TristateCheckboxFieldEditor>();
- return fields;
- }
-
- public void addField(final TristateCheckboxFieldEditor field) {
- getFields().add(field);
- if (selectionListener==null) {
- selectionListener = new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- int newValue = getCheckbox().getSelection() ? 1 : 0;
- if (getCheckbox().getGrayed()) {
- newValue = 2;
- }
- valueChanged(oldValue, newValue);
- oldValue = newValue;
- for (TristateCheckboxFieldEditor field : fields) {
- field.setValue(newValue);
- }
- updateCheckState();
- }
- };
- getCheckbox().addSelectionListener(selectionListener);
- }
-
- field.getCheckbox().addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- int newValue = getCheckbox().getSelection() ? 2 : 0;
- valueChanged(field.oldValue, newValue);
- field.oldValue = newValue;
- if (field.fields!=null) {
- for (TristateCheckboxFieldEditor f : field.fields) {
- f.setValue(newValue);
- }
- }
- updateCheckState();
- }
- });
- }
-
- protected void doLoad() {
- if (getCheckbox() != null) {
- if (fields==null) {
- super.doLoad();
- }
- else {
- int value = getPreferenceStore().getInt(getPreferenceName());
- setValue(value);
- oldValue = value;
- }
- }
- }
- protected void doLoadDefault() {
- if (getCheckbox() != null) {
- if (fields==null) {
- super.doLoad();
- }
- else {
- int value = getPreferenceStore().getDefaultInt(getPreferenceName());
- setValue(value);
- oldValue = value;
- }
- }
- }
- protected void doStore() {
- if (fields==null) {
- super.doStore();
- }
- else {
- getPreferenceStore().setValue(getPreferenceName(), getValue());
- }
- }
-
- protected void setValue(int newValue) {
- if (fields==null) {
- getCheckbox().setSelection(newValue==0 ? false : true);
- }
- else {
- int oldValue = value;
- if (newValue==0) {
- getCheckbox().setSelection(false);
- getCheckbox().setGrayed(false);
- value = 0;
- }
- else if (newValue==1) {
- getCheckbox().setSelection(true);
- getCheckbox().setGrayed(true);
- value = 1;
- }
- else if (newValue==2) {
- getCheckbox().setSelection(true);
- getCheckbox().setGrayed(false);
- value = 2;
- }
- valueChanged(oldValue,newValue);
- }
- }
-
- protected void valueChanged(int oldValue, int newValue) {
- if (fields==null) {
- super.valueChanged(oldValue==0 ? false : true, newValue==0 ? false : true);
- }
- else {
- setPresentsDefaultValue(false);
- if (oldValue != newValue) {
- fireValueChanged(VALUE, oldValue, newValue);
- value = newValue;
- }
- }
- }
-
- public void updateCheckState() {
- int trueCount = 0;
- for (TristateCheckboxFieldEditor field : fields) {
- if (field.getBooleanValue())
- ++trueCount;
- }
-
- if (trueCount == fields.size()) {
- setValue(2);
- }
- else if (trueCount == 0) {
- setValue(0);
- }
- else {
- setValue(1);
- }
- }
-
- public int getValue() {
- return value;
- }
+package org.eclipse.bpmn2.modeler.core.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+public class TristateCheckboxFieldEditor extends BooleanFieldEditor {
+
+ private List<TristateCheckboxFieldEditor> fields = null;
+ private Composite parent;
+ private int value = 0;
+ private int oldValue = 0;
+ private SelectionListener selectionListener = null;
+
+ public TristateCheckboxFieldEditor(String name, String label, Composite parent) {
+ super(name, label, parent);
+ this.parent = parent;
+ }
+
+ public Button getCheckbox() {
+ return getChangeControl(parent);
+ }
+
+ protected List<TristateCheckboxFieldEditor> getFields() {
+ if (fields==null)
+ fields = new ArrayList<TristateCheckboxFieldEditor>();
+ return fields;
+ }
+
+ public void addField(final TristateCheckboxFieldEditor field) {
+ getFields().add(field);
+ if (selectionListener==null) {
+ selectionListener = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int newValue = getCheckbox().getSelection() ? 1 : 0;
+ if (getCheckbox().getGrayed()) {
+ newValue = 2;
+ }
+ valueChanged(oldValue, newValue);
+ oldValue = newValue;
+ for (TristateCheckboxFieldEditor field : fields) {
+ field.setValue(newValue);
+ }
+ updateCheckState();
+ }
+ };
+ getCheckbox().addSelectionListener(selectionListener);
+ }
+
+ field.getCheckbox().addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int newValue = getCheckbox().getSelection() ? 2 : 0;
+ valueChanged(field.oldValue, newValue);
+ field.oldValue = newValue;
+ if (field.fields!=null) {
+ for (TristateCheckboxFieldEditor f : field.fields) {
+ f.setValue(newValue);
+ }
+ }
+ updateCheckState();
+ }
+ });
+ }
+
+ protected void doLoad() {
+ if (getCheckbox() != null) {
+ if (fields==null) {
+ super.doLoad();
+ }
+ else {
+ int value = getPreferenceStore().getInt(getPreferenceName());
+ setValue(value);
+ oldValue = value;
+ }
+ }
+ }
+ protected void doLoadDefault() {
+ if (getCheckbox() != null) {
+ if (fields==null) {
+ super.doLoad();
+ }
+ else {
+ int value = getPreferenceStore().getDefaultInt(getPreferenceName());
+ setValue(value);
+ oldValue = value;
+ }
+ }
+ }
+ protected void doStore() {
+ if (fields==null) {
+ super.doStore();
+ }
+ else {
+ getPreferenceStore().setValue(getPreferenceName(), getValue());
+ }
+ }
+
+ protected void setValue(int newValue) {
+ if (fields==null) {
+ getCheckbox().setSelection(newValue==0 ? false : true);
+ }
+ else {
+ int oldValue = value;
+ if (newValue==0) {
+ getCheckbox().setSelection(false);
+ getCheckbox().setGrayed(false);
+ value = 0;
+ }
+ else if (newValue==1) {
+ getCheckbox().setSelection(true);
+ getCheckbox().setGrayed(true);
+ value = 1;
+ }
+ else if (newValue==2) {
+ getCheckbox().setSelection(true);
+ getCheckbox().setGrayed(false);
+ value = 2;
+ }
+ valueChanged(oldValue,newValue);
+ }
+ }
+
+ protected void valueChanged(int oldValue, int newValue) {
+ if (fields==null) {
+ super.valueChanged(oldValue==0 ? false : true, newValue==0 ? false : true);
+ }
+ else {
+ setPresentsDefaultValue(false);
+ if (oldValue != newValue) {
+ fireValueChanged(VALUE, oldValue, newValue);
+ value = newValue;
+ }
+ }
+ }
+
+ public void updateCheckState() {
+ int trueCount = 0;
+ for (TristateCheckboxFieldEditor field : fields) {
+ if (field.getBooleanValue())
+ ++trueCount;
+ }
+
+ if (trueCount == fields.size()) {
+ setValue(2);
+ }
+ else if (trueCount == 0) {
+ setValue(0);
+ }
+ else {
+ setValue(1);
+ }
+ }
+
+ public int getValue() {
+ return value;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/BaseRuntimeDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/BaseRuntimeDescriptor.java
index 2446462..a80dc8f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/BaseRuntimeDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/BaseRuntimeDescriptor.java
@@ -1,42 +1,42 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.emf.ecore.EPackage;
-
-public class BaseRuntimeDescriptor {
-
- protected TargetRuntime targetRuntime;
-
- public BaseRuntimeDescriptor() {
- }
-
- public BaseRuntimeDescriptor(TargetRuntime rt) {
- targetRuntime = rt;
- }
-
- public TargetRuntime getRuntime() {
- return targetRuntime;
- }
-
- public void setRuntime(TargetRuntime targetRuntime) {
- this.targetRuntime = targetRuntime;
- }
-
- EPackage getEPackage() {
- if (targetRuntime.getModelDescriptor()!=null)
- return targetRuntime.getModelDescriptor().getEPackage();
- return Bpmn2Package.eINSTANCE;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.emf.ecore.EPackage;
+
+public class BaseRuntimeDescriptor {
+
+ protected TargetRuntime targetRuntime;
+
+ public BaseRuntimeDescriptor() {
+ }
+
+ public BaseRuntimeDescriptor(TargetRuntime rt) {
+ targetRuntime = rt;
+ }
+
+ public TargetRuntime getRuntime() {
+ return targetRuntime;
+ }
+
+ public void setRuntime(TargetRuntime targetRuntime) {
+ this.targetRuntime = targetRuntime;
+ }
+
+ EPackage getEPackage() {
+ if (targetRuntime.getModelDescriptor()!=null)
+ return targetRuntime.getModelDescriptor().getEPackage();
+ return Bpmn2Package.eINSTANCE;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2SectionDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2SectionDescriptor.java
index 7c812d8..b6d9d5f 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2SectionDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2SectionDescriptor.java
@@ -1,143 +1,143 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.AbstractSectionDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-
-public class Bpmn2SectionDescriptor extends AbstractSectionDescriptor {
-
- protected String id;
- protected String tab;
- protected AbstractPropertySection sectionClass;
- protected Class appliesToClass;
- protected String enablesFor;
- protected String filter;
-
- public Bpmn2SectionDescriptor(Bpmn2TabDescriptor td, IConfigurationElement e) {
- tab = td.getId();
- id = tab + ".section";
-
- try {
- sectionClass = (AbstractPropertySection) e.createExecutableExtension("class");
- filter = e.getAttribute("filter");
- if (filter==null || filter.isEmpty())
- filter = "org.eclipse.bpmn2.modeler.ui.property.Bpmn2PropertyFilter";
- enablesFor = e.getAttribute("enablesFor");
- String type = e.getAttribute("type");
- if (type!=null && !type.isEmpty())
- appliesToClass = Class.forName(type);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
-
- td.getSectionDescriptors().add(this);
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public ISection getSectionClass() {
- return sectionClass;
- }
-
- @Override
- public String getTargetTab() {
- return tab;
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-
- // should we delegate to the section to determine whether it should be included in this tab?
- if (sectionClass instanceof IBpmn2PropertySection) {
- return ((IBpmn2PropertySection)sectionClass).appliesTo(part, selection);
- }
-
- // if an input description was specified, check if the selected business object is of this description.
- if (appliesToClass!=null) {
- PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection(selection);
- // this is a special hack to allow selection of connection decorator labels:
- // the connection decorator does not have a business object linked to it,
- // but its parent (the connection) does.
- if (pe.getLink()==null && pe.eContainer() instanceof PictogramElement)
- pe = (PictogramElement)pe.eContainer();
-
- // check all linked BusinessObjects for a match
- if (pe.getLink()!=null) {
- for (EObject eObj : pe.getLink().getBusinessObjects()){
- if (appliesToClass.isInstance(eObj)) {
- return true;
- }
- }
- }
- return false;
- }
- return true;
- }
-
- @Override
- public int getEnablesFor() {
- try {
- return Integer.parseInt(enablesFor);
- }
- catch (Exception ex) {
-
- }
- return super.getEnablesFor();
- }
-
- @Override
- public IFilter getFilter() {
- return new IFilter() {
-
- @Override
- public boolean select(Object toTest) {
- return false;
- }
-
- };
- }
-
- @Override
- public List getInputTypes() {
- return super.getInputTypes();
- }
-
- /**
- * @param replacedId
- * @param part
- * @param selection
- * @return
- */
- public boolean doReplaceTab(String replacedId, IWorkbenchPart part, ISelection selection) {
- if (sectionClass instanceof IBpmn2PropertySection) {
- return ((IBpmn2PropertySection)sectionClass).doReplaceTab(replacedId, part, selection);
- }
- return appliesTo(part,selection);
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
+import org.eclipse.ui.views.properties.tabbed.AbstractSectionDescriptor;
+import org.eclipse.ui.views.properties.tabbed.ISection;
+
+public class Bpmn2SectionDescriptor extends AbstractSectionDescriptor {
+
+ protected String id;
+ protected String tab;
+ protected AbstractPropertySection sectionClass;
+ protected Class appliesToClass;
+ protected String enablesFor;
+ protected String filter;
+
+ public Bpmn2SectionDescriptor(Bpmn2TabDescriptor td, IConfigurationElement e) {
+ tab = td.getId();
+ id = tab + ".section";
+
+ try {
+ sectionClass = (AbstractPropertySection) e.createExecutableExtension("class");
+ filter = e.getAttribute("filter");
+ if (filter==null || filter.isEmpty())
+ filter = "org.eclipse.bpmn2.modeler.ui.property.Bpmn2PropertyFilter";
+ enablesFor = e.getAttribute("enablesFor");
+ String type = e.getAttribute("type");
+ if (type!=null && !type.isEmpty())
+ appliesToClass = Class.forName(type);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+
+ td.getSectionDescriptors().add(this);
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public ISection getSectionClass() {
+ return sectionClass;
+ }
+
+ @Override
+ public String getTargetTab() {
+ return tab;
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+
+ // should we delegate to the section to determine whether it should be included in this tab?
+ if (sectionClass instanceof IBpmn2PropertySection) {
+ return ((IBpmn2PropertySection)sectionClass).appliesTo(part, selection);
+ }
+
+ // if an input description was specified, check if the selected business object is of this description.
+ if (appliesToClass!=null) {
+ PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection(selection);
+ // this is a special hack to allow selection of connection decorator labels:
+ // the connection decorator does not have a business object linked to it,
+ // but its parent (the connection) does.
+ if (pe.getLink()==null && pe.eContainer() instanceof PictogramElement)
+ pe = (PictogramElement)pe.eContainer();
+
+ // check all linked BusinessObjects for a match
+ if (pe.getLink()!=null) {
+ for (EObject eObj : pe.getLink().getBusinessObjects()){
+ if (appliesToClass.isInstance(eObj)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int getEnablesFor() {
+ try {
+ return Integer.parseInt(enablesFor);
+ }
+ catch (Exception ex) {
+
+ }
+ return super.getEnablesFor();
+ }
+
+ @Override
+ public IFilter getFilter() {
+ return new IFilter() {
+
+ @Override
+ public boolean select(Object toTest) {
+ return false;
+ }
+
+ };
+ }
+
+ @Override
+ public List getInputTypes() {
+ return super.getInputTypes();
+ }
+
+ /**
+ * @param replacedId
+ * @param part
+ * @param selection
+ * @return
+ */
+ public boolean doReplaceTab(String replacedId, IWorkbenchPart part, ISelection selection) {
+ if (sectionClass instanceof IBpmn2PropertySection) {
+ return ((IBpmn2PropertySection)sectionClass).doReplaceTab(replacedId, part, selection);
+ }
+ return appliesTo(part,selection);
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2TabDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2TabDescriptor.java
index c4e9b47..61f61b1 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2TabDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/Bpmn2TabDescriptor.java
@@ -1,149 +1,149 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.AbstractTabDescriptor;
-import org.eclipse.ui.views.properties.tabbed.TabContents;
-
-public class Bpmn2TabDescriptor extends AbstractTabDescriptor {
-
- protected String id;
- protected String category;
- protected String label;
- protected String afterTab = null;
- protected String replaceTab = null;
- protected boolean indented = false;
- protected Image image = null;
- protected boolean popup = true;
-
- public Bpmn2TabDescriptor(IConfigurationElement e) {
- id = e.getAttribute("id");
- category = e.getAttribute("category");
- if (category==null || category.isEmpty())
- category = "BPMN2";
- label = e.getAttribute("label");
- afterTab = e.getAttribute("afterTab");
- replaceTab = e.getAttribute("replaceTab");
- String s = e.getAttribute("indented");
- indented = s!=null && s.trim().equalsIgnoreCase("true");
- s = e.getAttribute("popup");
- if (s!=null && s.trim().equalsIgnoreCase("false"))
- popup = false;
- }
-
- public Bpmn2TabDescriptor(String id, String category, String label) {
- this.id = id;
- if (category==null || category.isEmpty() )
- category = "BPMN2";
- this.category = category;
- this.label = label;
- }
-
- @Override
- public String getCategory() {
- return category;
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public String getLabel() {
- return label;
- }
-
- public boolean isPopup() {
- return popup;
- }
-
- public void setPopup(boolean popup) {
- this.popup = popup;
- }
-
- @Override
- public String getAfterTab() {
- if (afterTab==null || afterTab.trim().length()==0)
- return super.getAfterTab();
- return afterTab;
- }
-
- @Override
- public Image getImage() {
- if (image==null)
- return super.getImage();
- return image;
- }
-
- @Override
- public TabContents createTab() {
- // TODO Auto-generated method stub
- return super.createTab();
- }
-
- @Override
- public boolean isSelected() {
- // TODO Auto-generated method stub
- return super.isSelected();
- }
-
- @Override
- public void setSectionDescriptors(List sectionDescriptors) {
- // TODO Auto-generated method stub
- super.setSectionDescriptors(sectionDescriptors);
- }
-
- @Override
- public boolean isIndented() {
- return indented;
- }
-
- @Override
- public Object clone() {
- Bpmn2TabDescriptor clone = new Bpmn2TabDescriptor(id, category, label);
- clone.afterTab = this.afterTab;
- clone.replaceTab = this.replaceTab;
- if (image!=null)
- clone.image = new Image(Display.getDefault(), this.image, SWT.IMAGE_COPY);
- clone.indented = this.indented;
-// for (Bpmn2SectionDescriptor sd : (List<Bpmn2SectionDescriptor>)getSectionDescriptors()) {
-// clone.getSectionDescriptors().add( new Bpmn2SectionDescriptor(sd) );
-// }
- return clone;
- }
-
- public String getReplaceTab() {
- if (replaceTab==null || replaceTab.trim().length()==0)
- return null;
- return replaceTab;
- }
-
- public boolean isReplacementForTab(String id) {
- String replacements = getReplaceTab();
- if (replacements!=null) {
- String[] rep = replacements.split(" ");
- for (String r : rep) {
- if (r.equals(id))
- return true;
- }
- }
- return false;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.tabbed.AbstractTabDescriptor;
+import org.eclipse.ui.views.properties.tabbed.TabContents;
+
+public class Bpmn2TabDescriptor extends AbstractTabDescriptor {
+
+ protected String id;
+ protected String category;
+ protected String label;
+ protected String afterTab = null;
+ protected String replaceTab = null;
+ protected boolean indented = false;
+ protected Image image = null;
+ protected boolean popup = true;
+
+ public Bpmn2TabDescriptor(IConfigurationElement e) {
+ id = e.getAttribute("id");
+ category = e.getAttribute("category");
+ if (category==null || category.isEmpty())
+ category = "BPMN2";
+ label = e.getAttribute("label");
+ afterTab = e.getAttribute("afterTab");
+ replaceTab = e.getAttribute("replaceTab");
+ String s = e.getAttribute("indented");
+ indented = s!=null && s.trim().equalsIgnoreCase("true");
+ s = e.getAttribute("popup");
+ if (s!=null && s.trim().equalsIgnoreCase("false"))
+ popup = false;
+ }
+
+ public Bpmn2TabDescriptor(String id, String category, String label) {
+ this.id = id;
+ if (category==null || category.isEmpty() )
+ category = "BPMN2";
+ this.category = category;
+ this.label = label;
+ }
+
+ @Override
+ public String getCategory() {
+ return category;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ public boolean isPopup() {
+ return popup;
+ }
+
+ public void setPopup(boolean popup) {
+ this.popup = popup;
+ }
+
+ @Override
+ public String getAfterTab() {
+ if (afterTab==null || afterTab.trim().length()==0)
+ return super.getAfterTab();
+ return afterTab;
+ }
+
+ @Override
+ public Image getImage() {
+ if (image==null)
+ return super.getImage();
+ return image;
+ }
+
+ @Override
+ public TabContents createTab() {
+ // TODO Auto-generated method stub
+ return super.createTab();
+ }
+
+ @Override
+ public boolean isSelected() {
+ // TODO Auto-generated method stub
+ return super.isSelected();
+ }
+
+ @Override
+ public void setSectionDescriptors(List sectionDescriptors) {
+ // TODO Auto-generated method stub
+ super.setSectionDescriptors(sectionDescriptors);
+ }
+
+ @Override
+ public boolean isIndented() {
+ return indented;
+ }
+
+ @Override
+ public Object clone() {
+ Bpmn2TabDescriptor clone = new Bpmn2TabDescriptor(id, category, label);
+ clone.afterTab = this.afterTab;
+ clone.replaceTab = this.replaceTab;
+ if (image!=null)
+ clone.image = new Image(Display.getDefault(), this.image, SWT.IMAGE_COPY);
+ clone.indented = this.indented;
+// for (Bpmn2SectionDescriptor sd : (List<Bpmn2SectionDescriptor>)getSectionDescriptors()) {
+// clone.getSectionDescriptors().add( new Bpmn2SectionDescriptor(sd) );
+// }
+ return clone;
+ }
+
+ public String getReplaceTab() {
+ if (replaceTab==null || replaceTab.trim().length()==0)
+ return null;
+ return replaceTab;
+ }
+
+ public boolean isReplacementForTab(String id) {
+ String replacements = getReplaceTab();
+ if (replacements!=null) {
+ String[] rep = replacements.split(" ");
+ for (String r : rep) {
+ if (r.equals(id))
+ return true;
+ }
+ }
+ return false;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/CustomTaskDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/CustomTaskDescriptor.java
index 8fdf26a..38da498 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/CustomTaskDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/CustomTaskDescriptor.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import org.eclipse.bpmn2.modeler.core.features.activity.task.ICustomTaskFeature;
-
-public class CustomTaskDescriptor extends ModelExtensionDescriptor {
-
- protected ICustomTaskFeature featureContainer;
-
- public CustomTaskDescriptor(String id, String name) {
- super(id,name);
- }
-
- public ICustomTaskFeature getFeatureContainer() {
- return featureContainer;
- }
-
- public void setFeatureContainer(ICustomTaskFeature featureContainer) {
- this.featureContainer = featureContainer;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import org.eclipse.bpmn2.modeler.core.features.activity.task.ICustomTaskFeature;
+
+public class CustomTaskDescriptor extends ModelExtensionDescriptor {
+
+ protected ICustomTaskFeature featureContainer;
+
+ public CustomTaskDescriptor(String id, String name) {
+ super(id,name);
+ }
+
+ public ICustomTaskFeature getFeatureContainer() {
+ return featureContainer;
+ }
+
+ public void setFeatureContainer(ICustomTaskFeature featureContainer) {
+ this.featureContainer = featureContainer;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/FeatureContainerDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/FeatureContainerDescriptor.java
index b3f7e4b..c3a34f2 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/FeatureContainerDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/FeatureContainerDescriptor.java
@@ -1,62 +1,62 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import java.lang.reflect.Constructor;
-
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.features.FeatureContainer;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @author Bob Brodt
- *
- */
-public class FeatureContainerDescriptor extends BaseRuntimeDescriptor {
-
- protected String type;
- protected String containerClassName;
-
- /**
- * @param rt
- */
- public FeatureContainerDescriptor(TargetRuntime rt) {
- super(rt);
- }
-
- public Class getType() {
- ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
- try {
- return Class.forName(containerClassName, true, cl);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public FeatureContainer getFeatureContainer() {
- try {
- ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
- Constructor ctor = null;
- Class adapterClass = Class.forName(containerClassName, true, cl);
- ctor = adapterClass.getConstructor();
- return (FeatureContainer)ctor.newInstance();
- } catch (Exception e) {
- Activator.logError(e);
- }
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import java.lang.reflect.Constructor;
+
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.features.FeatureContainer;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class FeatureContainerDescriptor extends BaseRuntimeDescriptor {
+
+ protected String type;
+ protected String containerClassName;
+
+ /**
+ * @param rt
+ */
+ public FeatureContainerDescriptor(TargetRuntime rt) {
+ super(rt);
+ }
+
+ public Class getType() {
+ ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
+ try {
+ return Class.forName(containerClassName, true, cl);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public FeatureContainer getFeatureContainer() {
+ try {
+ ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
+ Constructor ctor = null;
+ Class adapterClass = Class.forName(containerClassName, true, cl);
+ ctor = adapterClass.getConstructor();
+ return (FeatureContainer)ctor.newInstance();
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/IBpmn2PropertySection.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/IBpmn2PropertySection.java
index ef281c7..035edbd 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/IBpmn2PropertySection.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/IBpmn2PropertySection.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-public interface IBpmn2PropertySection {
-
- /**
- * Checks the project preferences for BPMN2 element enablement.
- *
- * @param part - the BPMN2Editor part
- * @param selection - the currently selected BPMN2 element
- * @return true if the element is enabled and should be displayed in the property section
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection);
-
- /**
- * Asks the Property Section implementation if tab replacement should be
- * processed for the given editor selection.
- *
- * @param id - ID of the tab to be replaced
- * @param part - the BPMN2 Editor
- * @param selection - the selected object in the editor canvas
- * @return true if the tab replacement should be done.
- */
- public boolean doReplaceTab(String id, IWorkbenchPart part, ISelection selection);
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchPart;
+
+public interface IBpmn2PropertySection {
+
+ /**
+ * Checks the project preferences for BPMN2 element enablement.
+ *
+ * @param part - the BPMN2Editor part
+ * @param selection - the currently selected BPMN2 element
+ * @return true if the element is enabled and should be displayed in the property section
+ */
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection);
+
+ /**
+ * Asks the Property Section implementation if tab replacement should be
+ * processed for the given editor selection.
+ *
+ * @param id - ID of the tab to be replaced
+ * @param part - the BPMN2 Editor
+ * @param selection - the selected object in the editor canvas
+ * @return true if the tab replacement should be done.
+ */
+ public boolean doReplaceTab(String id, IWorkbenchPart part, ISelection selection);
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java
index ef9eaf4..cbc381a 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-public class ModelDescriptor extends BaseRuntimeDescriptor {
-
- protected EPackage ePackage;
- protected EFactory eFactory;
- protected ResourceFactoryImpl resourceFactory;
-
- public EFactory getEFactory() {
- return eFactory;
- }
-
- public ResourceFactoryImpl getResourceFactory() {
- return resourceFactory;
- }
-
- public EPackage getEPackage() {
- return ePackage;
- }
-
- public void setEPackage(EPackage ePackage) {
- this.ePackage = ePackage;
- }
-
- public void setEFactory(EFactory eFactory) {
- this.eFactory = eFactory;
- }
-
- public void setResourceFactory(ResourceFactoryImpl resourceFactory) {
- this.resourceFactory = resourceFactory;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+
+public class ModelDescriptor extends BaseRuntimeDescriptor {
+
+ protected EPackage ePackage;
+ protected EFactory eFactory;
+ protected ResourceFactoryImpl resourceFactory;
+
+ public EFactory getEFactory() {
+ return eFactory;
+ }
+
+ public ResourceFactoryImpl getResourceFactory() {
+ return resourceFactory;
+ }
+
+ public EPackage getEPackage() {
+ return ePackage;
+ }
+
+ public void setEPackage(EPackage ePackage) {
+ this.ePackage = ePackage;
+ }
+
+ public void setEFactory(EFactory eFactory) {
+ this.eFactory = eFactory;
+ }
+
+ public void setResourceFactory(ResourceFactoryImpl resourceFactory) {
+ this.resourceFactory = resourceFactory;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelExtensionDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelExtensionDescriptor.java
index 0a2b041..351a4e5 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelExtensionDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelExtensionDescriptor.java
@@ -1,507 +1,507 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EStructuralFeature.Internal;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.util.FeatureMap;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ModelExtensionDescriptor extends BaseRuntimeDescriptor {
-
- // Container class for property values
- public static class Value {
-
- static int ID = 0;
- String id;
- public List<Object>values;
-
- public Value() {
- setDefaultId();
- }
-
- public Value(String id) {
- if (id==null || id.isEmpty())
- setDefaultId();
- else
- this.id = id;
- }
-
- public List<Object> getValues() {
- if (values==null) {
- values = new ArrayList<Object>();
- }
- return values;
- }
-
- private void setDefaultId() {
- id = "V-" + ID++;
- }
- }
-
- // name/value pairs constructed from Custom Task extension point
- public static class Property {
- public String name;
- public String description;
- public List<Object>values;
- public String ref;
- public String type;
-
- public Property() {
- this.name = "unknown";
- }
-
- public Property(String name, String description) {
- this.name = name;
- this.description = description;
- }
-
- public List<Object> getValues() {
- if (values==null) {
- values = new ArrayList<Object>();
- }
- return values;
- }
-
- public String getFirstStringValue() {
-
- if (!this.getValues().isEmpty()) {
- // simple attribute - find a String value for it
- for (Object propValue : this.getValues()) {
- if (propValue instanceof String) {
- return (String)propValue;
- }
- else if (propValue instanceof Property) {
- String s = ((Property)propValue).getFirstStringValue();
- if (s!=null)
- return s;
- }
- }
- }
- return null;
- }
- }
-
- protected String id;
- protected String name;
- protected String type;
- protected String description;
- protected List<Property> properties = new ArrayList<Property>();
- protected Resource containingResource;
- protected EObject modelObject;
-
- public ModelExtensionDescriptor(String id, String name) {
- this.id = id;
- this.name = name;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public String getType() {
- return type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
-
- /**
- * Creates a custom Task object from a definition in the currently selected
- * Target Runtime plugin's "modelExtension" extension point.
- *
- * @param container - the EObject which will eventually contain the new Task.
- * No changes are made to this object, it is only used to
- * locate the EMF Resource which will eventually contain
- * the new Task object.
- * @return an initialized Task object
- */
- public EObject createObject(EObject container) {
- if (container!=null)
- containingResource = container.eResource();
- modelObject = createObject(getType());
- populateObject(modelObject);
- return modelObject;
- }
-
- /**
- * Create and initialize an object of the given EClass name.
- * The runtime's EPackage is searched first for the given ECLass; if not
- * found, the Bpmn2Package is searched.
- *
- * @param className
- * @return an initialized EObject or null if the EClass name was not found
- */
- private EObject createObject(String className) {
- // look in the extension model package for the class name first
- EClass eClass = (EClass) getEPackage().getEClassifier(className);
- if (eClass==null) {
- // if not found, look in BPMN2 package
- eClass = (EClass) Bpmn2Package.eINSTANCE.getEClassifier(className);
- }
- if (eClass!=null)
- return createObject(eClass);
- return null;
- }
-
- /**
- * Create and initialize an object of the given EClass. Initialization consists
- * of assigning an ID and setting a default name if the EClass has those features.
- *
- * @param eClass - type of object to create
- * @return an initialized EObject
- */
- private EObject createObject(EClass eClass) {
- EObject eObject = eClass.getEPackage().getEFactoryInstance().create(eClass);
-
- // if the object has an "id", assign it now.
- String id = ModelUtil.setID(eObject,containingResource);
- // also set a default name
- EStructuralFeature feature = eObject.eClass().getEStructuralFeature("name");
- if (feature!=null) {
- if (id!=null)
- eObject.eSet(feature, ModelUtil.toDisplayName(id));
- else
- eObject.eSet(feature, "New "+ModelUtil.toDisplayName(eObject.eClass().getName()));
- }
-
- return eObject;
- }
-
- /**
- * Search the Target Runtime's EPackage for a structural feature with the specified name.
- * If the feature is not found in the runtime package, search the Bpmn2Package.
- *
- * @param name - name of the feature that specifies both an EClass and an EStructuralFeature
- * in the form "EClassName.EStructuralFeatureName"
- * @return
- */
- private EStructuralFeature getFeature(String name) {
- String[] parts = name.split("\\.");
- EClass eClass = (EClass)getEPackage().getEClassifier(parts[0]);
- if (eClass==null) {
- eClass = (EClass)Bpmn2Package.eINSTANCE.getEClassifier(parts[0]);
- }
- if (eClass!=null) {
- EStructuralFeature feature = eClass.getEStructuralFeature(parts[1]);
- if (ExtendedMetaData.INSTANCE.getFeatureKind(feature) == ExtendedMetaData.UNSPECIFIED_FEATURE) {
- if (feature instanceof EAttribute) {
- ExtendedMetaData.INSTANCE.setFeatureKind(feature,ExtendedMetaData.ATTRIBUTE_FEATURE);
- }
- else {
- ExtendedMetaData.INSTANCE.setFeatureKind(feature,ExtendedMetaData.ELEMENT_FEATURE);
- }
- ExtendedMetaData.INSTANCE.setNamespace(feature, eClass.getEPackage().getNsURI());
- ExtendedMetaData.INSTANCE.setName(feature, feature.getName());
- }
-
- return feature;
- }
- return null;
- }
-
- /**
- * Search the Target Runtime's EPackage for a structural feature with the specified name.
- * If the feature is not found in the runtime package, search the Bpmn2Package.
- *
- * @param type - the feature type, either EAttribute or EReference
- * @param name - name of the feature
- * @return an EStructuralFeature or null if not found
- */
- private EStructuralFeature getFeature(Class type, String name) {
- EStructuralFeature feature = getFeature(getEPackage(), type, name);
- if (feature==null) {
- // try the bpmn2 package
- feature = getFeature(Bpmn2Package.eINSTANCE, type, name);
- }
- return feature;
- }
-
- /**
- * Search the given EPackage for a structural feature with the specified name.
- *
- * @param pkg - the EPackage to search
- * @param type - the feature type, either EAttribute or EReference
- * @param name - name of the feature
- * @return an EStructuralFeature or null if not found
- */
- private EStructuralFeature getFeature(EPackage pkg, Class type, String name) {
- TreeIterator<EObject> it = pkg.eAllContents();
- while (it.hasNext()) {
- EObject o = it.next();
- if (type.isInstance(o)) {
- EStructuralFeature fName = o.eClass().getEStructuralFeature("name");
- if (fName!=null && o.eGet(fName)!=null && o.eGet(fName).equals(name)) {
- return (EStructuralFeature)o;
- }
- }
- }
- return null;
- }
-
- /**
- * Populate the given EObject with a list of values which must be Property objects.
- *
- * @param object - the object to initialize
- * @param values - list of Property values
- */
- public void populateObjectFromValues(EObject object, List<Object> values) {
-
- for (Object value : values) {
- if (value instanceof Property)
- populateObject(object,(Property)value);
- }
- }
-
- public EObject populateObject(EObject object, Resource resource) {
- containingResource = resource;
- modelObject = object;
- populateObject(modelObject);
- return modelObject;
- }
-
- public void populateObject(EObject object) {
- populateObject(object, getProperties());
- }
-
- /**
- * Populate the given EObject with a list of Property objects.
- *
- * @param object - the object to initialize
- * @param values - list of Property objects
- */
- public void populateObject(EObject object, List<Property> properties) {
-
- for (Property prop : properties) {
- populateObject(object,prop);
- }
- }
-
- protected EPackage getEPackage(EStructuralFeature feature) {
- EObject o = feature;
- while ( o.eContainer()!=null ) {
- o = o.eContainer();
- if (o instanceof EPackage) {
- return (EPackage)o;
- }
- }
- return null;
- }
-
- /**
- * Set the value of the structural feature. If the feature is a list,
- * the value is added to the list.
- *
- * @param object
- * @param feature
- * @param value
- */
- private void setValue(EObject object, EStructuralFeature feature, Object value) {
- // should not set null value features
- if (value == null) {
- return;
- }
-
- if (feature.isMany()) {
- ((EList)object.eGet(feature)).add(value);
- }
- else {
- if (value instanceof String) {
- EDataType eDataType = (EDataType)feature.getEType();
- try {
- // TODO: figure out why feature.eClass().getEPackage().getEFactoryInstance() doesn't
- // return the correct factory!
- EFactory factory = getEPackage(feature).getEFactoryInstance();
- value = factory.createFromString(eDataType, (String)value);
- }
- catch (Exception e)
- {
- EFactory factory = EcorePackage.eINSTANCE.getEFactoryInstance();
- value = factory.createFromString(eDataType, (String)value);
- }
- }
-
- object.eSet(feature, value);
- }
- }
-
- /**
- * Return the value of the specified feature from the given EObject.
- * If the feature is a list, return the indexed value.
- *
- * @param object
- * @param feature
- * @param index
- * @return the feature's value
- */
- private Object getValue(EObject object, EStructuralFeature feature, int index) {
- if (feature.isMany()) {
- return ((EList)object.eGet(feature)).get(index<0 ? 0 : index);
- }
- return object.eGet(feature);
- }
-
- /**
- * Populate the given EObject from the Property tree defined in this runtime
- * plugin's "modelObject" extension point.
- *
- * @param object
- * @param property
- */
- public void populateObject(EObject object, Property property) {
-
- EObject childObject = null;
- EStructuralFeature childFeature = null;
- EStructuralFeature feature = object.eClass().getEStructuralFeature(property.name);
-
- Object firstValue = property.getValues().isEmpty() ? null : property.getValues().get(0);
-
- if (feature==null) {
- // determine the type of feature, either an EAttribute or an EReference,
- // from the give Property's characteristics
- Class type = EAttribute.class;
- // if the Property has a "ref" or if its value is a Property
- // then this must be an EReference
- if (property.ref!=null || firstValue instanceof Property)
- type = EReference.class;
- // get the feature from the runtime package or from Bpmn2Package,
- // wherever it's found first
- feature = getFeature(type,property.name);
- }
-
- if (feature==null) {
- EPackage pkg = getEPackage();
- feature = ModelUtil.createDynamicAttribute(pkg, object, property.name, property.type);
- }
-
- if (feature instanceof EAttribute) {
- if ( feature.getEType().getInstanceClass() == FeatureMap.Entry.class ) {
- // special handling for FeatureMaps
- for (Object value : property.getValues()) {
- if (value instanceof Property) {
- Property p = (Property)value;
- childFeature = getFeature(p.name);
- if (childFeature instanceof EAttribute) {
- childObject = createObject(((EReference) childFeature));
- setValue(childObject, childFeature, firstValue);
- }
- else if (childFeature instanceof EReference) {
- childObject = createObject(((EReference) childFeature).getEReferenceType());
- FeatureMap.Entry entry = new SimpleFeatureMapEntry((Internal)childFeature, childObject);
- setValue(object, feature, entry);
- populateObjectFromValues(childObject,p.getValues());
- }
- }
- }
- }
- else
- setValue(object, feature, firstValue);
- }
- else if (feature instanceof EReference) {
- EReference ref = (EReference)feature;
- if (property.ref!=null) {
- // navigate down the newly created custom task to find the object reference
- childObject = modelObject;
- String[] segments = property.ref.split("/");
- for (String s : segments) {
- // is the feature an Elist?
- int index = s.indexOf('#');
- if (index>0) {
- index = Integer.parseInt(s.substring(index+1));
- s = s.split("#")[0];
- }
- childFeature = childObject.eClass().getEStructuralFeature(s);
- childObject = (EObject)getValue(childObject, childFeature, index);
- }
- setValue(object, feature, childObject);
- }
- else
- {
- childObject = createObject(ref.getEReferenceType());
- object.eResource();
- setValue(object, feature, childObject);
- populateObjectFromValues(childObject,property.getValues());
- }
- }
- }
-
- /**
- * Return the value of the given root Property name.
- *
- * @param name
- * @return
- */
- public Object getProperty(String name) {
-
- for (Property prop : getProperties()) {
- if (prop.name.equals(name)) {
- if (!prop.getValues().isEmpty()) {
- return prop.getValues().get(0);
- }
- }
- }
- return null;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public void setProperties(List<Property> properties) {
- this.properties = properties;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Internal;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ModelExtensionDescriptor extends BaseRuntimeDescriptor {
+
+ // Container class for property values
+ public static class Value {
+
+ static int ID = 0;
+ String id;
+ public List<Object>values;
+
+ public Value() {
+ setDefaultId();
+ }
+
+ public Value(String id) {
+ if (id==null || id.isEmpty())
+ setDefaultId();
+ else
+ this.id = id;
+ }
+
+ public List<Object> getValues() {
+ if (values==null) {
+ values = new ArrayList<Object>();
+ }
+ return values;
+ }
+
+ private void setDefaultId() {
+ id = "V-" + ID++;
+ }
+ }
+
+ // name/value pairs constructed from Custom Task extension point
+ public static class Property {
+ public String name;
+ public String description;
+ public List<Object>values;
+ public String ref;
+ public String type;
+
+ public Property() {
+ this.name = "unknown";
+ }
+
+ public Property(String name, String description) {
+ this.name = name;
+ this.description = description;
+ }
+
+ public List<Object> getValues() {
+ if (values==null) {
+ values = new ArrayList<Object>();
+ }
+ return values;
+ }
+
+ public String getFirstStringValue() {
+
+ if (!this.getValues().isEmpty()) {
+ // simple attribute - find a String value for it
+ for (Object propValue : this.getValues()) {
+ if (propValue instanceof String) {
+ return (String)propValue;
+ }
+ else if (propValue instanceof Property) {
+ String s = ((Property)propValue).getFirstStringValue();
+ if (s!=null)
+ return s;
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+ protected String id;
+ protected String name;
+ protected String type;
+ protected String description;
+ protected List<Property> properties = new ArrayList<Property>();
+ protected Resource containingResource;
+ protected EObject modelObject;
+
+ public ModelExtensionDescriptor(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+
+ /**
+ * Creates a custom Task object from a definition in the currently selected
+ * Target Runtime plugin's "modelExtension" extension point.
+ *
+ * @param container - the EObject which will eventually contain the new Task.
+ * No changes are made to this object, it is only used to
+ * locate the EMF Resource which will eventually contain
+ * the new Task object.
+ * @return an initialized Task object
+ */
+ public EObject createObject(EObject container) {
+ if (container!=null)
+ containingResource = container.eResource();
+ modelObject = createObject(getType());
+ populateObject(modelObject);
+ return modelObject;
+ }
+
+ /**
+ * Create and initialize an object of the given EClass name.
+ * The runtime's EPackage is searched first for the given ECLass; if not
+ * found, the Bpmn2Package is searched.
+ *
+ * @param className
+ * @return an initialized EObject or null if the EClass name was not found
+ */
+ private EObject createObject(String className) {
+ // look in the extension model package for the class name first
+ EClass eClass = (EClass) getEPackage().getEClassifier(className);
+ if (eClass==null) {
+ // if not found, look in BPMN2 package
+ eClass = (EClass) Bpmn2Package.eINSTANCE.getEClassifier(className);
+ }
+ if (eClass!=null)
+ return createObject(eClass);
+ return null;
+ }
+
+ /**
+ * Create and initialize an object of the given EClass. Initialization consists
+ * of assigning an ID and setting a default name if the EClass has those features.
+ *
+ * @param eClass - type of object to create
+ * @return an initialized EObject
+ */
+ private EObject createObject(EClass eClass) {
+ EObject eObject = eClass.getEPackage().getEFactoryInstance().create(eClass);
+
+ // if the object has an "id", assign it now.
+ String id = ModelUtil.setID(eObject,containingResource);
+ // also set a default name
+ EStructuralFeature feature = eObject.eClass().getEStructuralFeature("name");
+ if (feature!=null) {
+ if (id!=null)
+ eObject.eSet(feature, ModelUtil.toDisplayName(id));
+ else
+ eObject.eSet(feature, "New "+ModelUtil.toDisplayName(eObject.eClass().getName()));
+ }
+
+ return eObject;
+ }
+
+ /**
+ * Search the Target Runtime's EPackage for a structural feature with the specified name.
+ * If the feature is not found in the runtime package, search the Bpmn2Package.
+ *
+ * @param name - name of the feature that specifies both an EClass and an EStructuralFeature
+ * in the form "EClassName.EStructuralFeatureName"
+ * @return
+ */
+ private EStructuralFeature getFeature(String name) {
+ String[] parts = name.split("\\.");
+ EClass eClass = (EClass)getEPackage().getEClassifier(parts[0]);
+ if (eClass==null) {
+ eClass = (EClass)Bpmn2Package.eINSTANCE.getEClassifier(parts[0]);
+ }
+ if (eClass!=null) {
+ EStructuralFeature feature = eClass.getEStructuralFeature(parts[1]);
+ if (ExtendedMetaData.INSTANCE.getFeatureKind(feature) == ExtendedMetaData.UNSPECIFIED_FEATURE) {
+ if (feature instanceof EAttribute) {
+ ExtendedMetaData.INSTANCE.setFeatureKind(feature,ExtendedMetaData.ATTRIBUTE_FEATURE);
+ }
+ else {
+ ExtendedMetaData.INSTANCE.setFeatureKind(feature,ExtendedMetaData.ELEMENT_FEATURE);
+ }
+ ExtendedMetaData.INSTANCE.setNamespace(feature, eClass.getEPackage().getNsURI());
+ ExtendedMetaData.INSTANCE.setName(feature, feature.getName());
+ }
+
+ return feature;
+ }
+ return null;
+ }
+
+ /**
+ * Search the Target Runtime's EPackage for a structural feature with the specified name.
+ * If the feature is not found in the runtime package, search the Bpmn2Package.
+ *
+ * @param type - the feature type, either EAttribute or EReference
+ * @param name - name of the feature
+ * @return an EStructuralFeature or null if not found
+ */
+ private EStructuralFeature getFeature(Class type, String name) {
+ EStructuralFeature feature = getFeature(getEPackage(), type, name);
+ if (feature==null) {
+ // try the bpmn2 package
+ feature = getFeature(Bpmn2Package.eINSTANCE, type, name);
+ }
+ return feature;
+ }
+
+ /**
+ * Search the given EPackage for a structural feature with the specified name.
+ *
+ * @param pkg - the EPackage to search
+ * @param type - the feature type, either EAttribute or EReference
+ * @param name - name of the feature
+ * @return an EStructuralFeature or null if not found
+ */
+ private EStructuralFeature getFeature(EPackage pkg, Class type, String name) {
+ TreeIterator<EObject> it = pkg.eAllContents();
+ while (it.hasNext()) {
+ EObject o = it.next();
+ if (type.isInstance(o)) {
+ EStructuralFeature fName = o.eClass().getEStructuralFeature("name");
+ if (fName!=null && o.eGet(fName)!=null && o.eGet(fName).equals(name)) {
+ return (EStructuralFeature)o;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Populate the given EObject with a list of values which must be Property objects.
+ *
+ * @param object - the object to initialize
+ * @param values - list of Property values
+ */
+ public void populateObjectFromValues(EObject object, List<Object> values) {
+
+ for (Object value : values) {
+ if (value instanceof Property)
+ populateObject(object,(Property)value);
+ }
+ }
+
+ public EObject populateObject(EObject object, Resource resource) {
+ containingResource = resource;
+ modelObject = object;
+ populateObject(modelObject);
+ return modelObject;
+ }
+
+ public void populateObject(EObject object) {
+ populateObject(object, getProperties());
+ }
+
+ /**
+ * Populate the given EObject with a list of Property objects.
+ *
+ * @param object - the object to initialize
+ * @param values - list of Property objects
+ */
+ public void populateObject(EObject object, List<Property> properties) {
+
+ for (Property prop : properties) {
+ populateObject(object,prop);
+ }
+ }
+
+ protected EPackage getEPackage(EStructuralFeature feature) {
+ EObject o = feature;
+ while ( o.eContainer()!=null ) {
+ o = o.eContainer();
+ if (o instanceof EPackage) {
+ return (EPackage)o;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Set the value of the structural feature. If the feature is a list,
+ * the value is added to the list.
+ *
+ * @param object
+ * @param feature
+ * @param value
+ */
+ private void setValue(EObject object, EStructuralFeature feature, Object value) {
+ // should not set null value features
+ if (value == null) {
+ return;
+ }
+
+ if (feature.isMany()) {
+ ((EList)object.eGet(feature)).add(value);
+ }
+ else {
+ if (value instanceof String) {
+ EDataType eDataType = (EDataType)feature.getEType();
+ try {
+ // TODO: figure out why feature.eClass().getEPackage().getEFactoryInstance() doesn't
+ // return the correct factory!
+ EFactory factory = getEPackage(feature).getEFactoryInstance();
+ value = factory.createFromString(eDataType, (String)value);
+ }
+ catch (Exception e)
+ {
+ EFactory factory = EcorePackage.eINSTANCE.getEFactoryInstance();
+ value = factory.createFromString(eDataType, (String)value);
+ }
+ }
+
+ object.eSet(feature, value);
+ }
+ }
+
+ /**
+ * Return the value of the specified feature from the given EObject.
+ * If the feature is a list, return the indexed value.
+ *
+ * @param object
+ * @param feature
+ * @param index
+ * @return the feature's value
+ */
+ private Object getValue(EObject object, EStructuralFeature feature, int index) {
+ if (feature.isMany()) {
+ return ((EList)object.eGet(feature)).get(index<0 ? 0 : index);
+ }
+ return object.eGet(feature);
+ }
+
+ /**
+ * Populate the given EObject from the Property tree defined in this runtime
+ * plugin's "modelObject" extension point.
+ *
+ * @param object
+ * @param property
+ */
+ public void populateObject(EObject object, Property property) {
+
+ EObject childObject = null;
+ EStructuralFeature childFeature = null;
+ EStructuralFeature feature = object.eClass().getEStructuralFeature(property.name);
+
+ Object firstValue = property.getValues().isEmpty() ? null : property.getValues().get(0);
+
+ if (feature==null) {
+ // determine the type of feature, either an EAttribute or an EReference,
+ // from the give Property's characteristics
+ Class type = EAttribute.class;
+ // if the Property has a "ref" or if its value is a Property
+ // then this must be an EReference
+ if (property.ref!=null || firstValue instanceof Property)
+ type = EReference.class;
+ // get the feature from the runtime package or from Bpmn2Package,
+ // wherever it's found first
+ feature = getFeature(type,property.name);
+ }
+
+ if (feature==null) {
+ EPackage pkg = getEPackage();
+ feature = ModelUtil.createDynamicAttribute(pkg, object, property.name, property.type);
+ }
+
+ if (feature instanceof EAttribute) {
+ if ( feature.getEType().getInstanceClass() == FeatureMap.Entry.class ) {
+ // special handling for FeatureMaps
+ for (Object value : property.getValues()) {
+ if (value instanceof Property) {
+ Property p = (Property)value;
+ childFeature = getFeature(p.name);
+ if (childFeature instanceof EAttribute) {
+ childObject = createObject(((EReference) childFeature));
+ setValue(childObject, childFeature, firstValue);
+ }
+ else if (childFeature instanceof EReference) {
+ childObject = createObject(((EReference) childFeature).getEReferenceType());
+ FeatureMap.Entry entry = new SimpleFeatureMapEntry((Internal)childFeature, childObject);
+ setValue(object, feature, entry);
+ populateObjectFromValues(childObject,p.getValues());
+ }
+ }
+ }
+ }
+ else
+ setValue(object, feature, firstValue);
+ }
+ else if (feature instanceof EReference) {
+ EReference ref = (EReference)feature;
+ if (property.ref!=null) {
+ // navigate down the newly created custom task to find the object reference
+ childObject = modelObject;
+ String[] segments = property.ref.split("/");
+ for (String s : segments) {
+ // is the feature an Elist?
+ int index = s.indexOf('#');
+ if (index>0) {
+ index = Integer.parseInt(s.substring(index+1));
+ s = s.split("#")[0];
+ }
+ childFeature = childObject.eClass().getEStructuralFeature(s);
+ childObject = (EObject)getValue(childObject, childFeature, index);
+ }
+ setValue(object, feature, childObject);
+ }
+ else
+ {
+ childObject = createObject(ref.getEReferenceType());
+ object.eResource();
+ setValue(object, feature, childObject);
+ populateObjectFromValues(childObject,property.getValues());
+ }
+ }
+ }
+
+ /**
+ * Return the value of the given root Property name.
+ *
+ * @param name
+ * @return
+ */
+ public Object getProperty(String name) {
+
+ for (Property prop : getProperties()) {
+ if (prop.name.equals(name)) {
+ if (!prop.getValues().isEmpty()) {
+ return prop.getValues().get(0);
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setProperties(List<Property> properties) {
+ this.properties = properties;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/PropertyExtensionDescriptor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/PropertyExtensionDescriptor.java
index 73b81a4..9bf9293 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/PropertyExtensionDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/PropertyExtensionDescriptor.java
@@ -1,74 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.runtime;
-
-import java.lang.reflect.Constructor;
-
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class PropertyExtensionDescriptor extends BaseRuntimeDescriptor {
-
- protected String type;
- protected String adapterClassName;
-
- /**
- * @param rt
- */
- public PropertyExtensionDescriptor(TargetRuntime rt) {
- super(rt);
- }
-
- public Class getInstanceClass() {
- try {
- ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
- Constructor ctor = null;
- return Class.forName(type, true, cl);
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- public ExtendedPropertiesAdapter getAdapter(AdapterFactory adapterFactory, EObject object) {
- try {
- ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
- Constructor ctor = null;
- Class adapterClass = Class.forName(adapterClassName, true, cl);
- EClass eclass = null;
- if (object instanceof EClass) {
- eclass = (EClass)object;
- object = ModelUtil.getDummyObject(eclass);
- }
- else {
- eclass = object.eClass();
- }
- ctor = adapterClass.getConstructor(AdapterFactory.class, eclass.getInstanceClass());
- return (ExtendedPropertiesAdapter)ctor.newInstance(adapterFactory, object);
- } catch (Exception e) {
- Activator.logError(e);
- }
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.runtime;
+
+import java.lang.reflect.Constructor;
+
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class PropertyExtensionDescriptor extends BaseRuntimeDescriptor {
+
+ protected String type;
+ protected String adapterClassName;
+
+ /**
+ * @param rt
+ */
+ public PropertyExtensionDescriptor(TargetRuntime rt) {
+ super(rt);
+ }
+
+ public Class getInstanceClass() {
+ try {
+ ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
+ Constructor ctor = null;
+ return Class.forName(type, true, cl);
+ } catch (ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public ExtendedPropertiesAdapter getAdapter(AdapterFactory adapterFactory, EObject object) {
+ try {
+ ClassLoader cl = this.getRuntime().getRuntimeExtension().getClass().getClassLoader();
+ Constructor ctor = null;
+ Class adapterClass = Class.forName(adapterClassName, true, cl);
+ EClass eclass = null;
+ if (object instanceof EClass) {
+ eclass = (EClass)object;
+ object = ModelUtil.getDummyObject(eclass);
+ }
+ else {
+ eclass = object.eClass();
+ }
+ ctor = adapterClass.getConstructor(AdapterFactory.class, eclass.getInstanceClass());
+ return (ExtendedPropertiesAdapter)ctor.newInstance(adapterFactory, object);
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java
index 54650dc..a4008d2 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java
@@ -1,694 +1,694 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.bpmn2.di.BPMNEdge;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.IAddBendpointFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IRemoveBendpointFeature;
-import org.eclipse.graphiti.features.context.IAddBendpointContext;
-import org.eclipse.graphiti.features.context.IRemoveBendpointContext;
-import org.eclipse.graphiti.features.context.impl.AddBendpointContext;
-import org.eclipse.graphiti.features.context.impl.RemoveBendpointContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.ICreateService;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.ILayoutService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class AnchorUtil {
-
- public static final String BOUNDARY_FIXPOINT_ANCHOR = "boundary.fixpoint.anchor";
-
- // values for connection points
- public static final String CONNECTION_POINT = "connection.point"; //$NON-NLS-1$
- public static final String CONNECTION_POINT_KEY = "connection.point.key"; //$NON-NLS-1$
- public static final int CONNECTION_POINT_SIZE = 4;
-
- private static final IPeService peService = Graphiti.getPeService();
- private static final IGaService gaService = Graphiti.getGaService();
- private static final ICreateService createService = Graphiti.getCreateService();
- private static final ILayoutService layoutService = Graphiti.getLayoutService();
-
- public enum AnchorLocation {
- TOP("anchor.top"), BOTTOM("anchor.bottom"), LEFT("anchor.left"), RIGHT("anchor.right");
-
- private final String key;
-
- private AnchorLocation(String key) {
- this.key = key;
- }
-
- public String getKey() {
- return key;
- }
-
- public static AnchorLocation getLocation(String key) {
- for (AnchorLocation l : values()) {
- if (l.getKey().equals(key)) {
- return l;
- }
- }
- return null;
- }
- }
-
- public static class AnchorTuple {
- public FixPointAnchor sourceAnchor;
- public FixPointAnchor targetAnchor;
- }
-
- public static class BoundaryAnchor {
- public FixPointAnchor anchor;
- public AnchorLocation locationType;
- public ILocation location;
- }
-
- public static FixPointAnchor createAnchor(AnchorContainer ac, AnchorLocation loc, int x, int y) {
- IGaService gaService = Graphiti.getGaService();
- IPeService peService = Graphiti.getPeService();
-
- FixPointAnchor anchor = peService.createFixPointAnchor(ac);
- peService.setPropertyValue(anchor, BOUNDARY_FIXPOINT_ANCHOR, loc.getKey());
- anchor.setLocation(gaService.createPoint(x, y));
- gaService.createInvisibleRectangle(anchor);
-
- return anchor;
- }
-
- public static Map<AnchorLocation, BoundaryAnchor> getConnectionBoundaryAnchors(Shape connectionPointShape) {
- Map<AnchorLocation, BoundaryAnchor> map = new HashMap<AnchorLocation, BoundaryAnchor>(4);
- BoundaryAnchor a = new BoundaryAnchor();
- a.anchor = getConnectionPointAnchor(connectionPointShape);
- for (AnchorLocation al : AnchorLocation.values() ) {
- a.locationType = al;
- a.location = getConnectionPointLocation(connectionPointShape);
- map.put(a.locationType, a);
- }
- return map;
- }
-
- public static Map<AnchorLocation, BoundaryAnchor> getBoundaryAnchors(AnchorContainer ac) {
- Map<AnchorLocation, BoundaryAnchor> map = new HashMap<AnchorLocation, BoundaryAnchor>(4);
-
- if (ac instanceof FreeFormConnection) {
- // the anchor container is a Connection which does not have any predefined BoundaryAnchors
- // so we have to synthesize these by looking for connection point shapes owned by the connection
- for (Shape connectionPointShape : getConnectionPoints((FreeFormConnection)ac)) {
- // TODO: if there are multiple connection points, figure out which one to use
- return getConnectionBoundaryAnchors(connectionPointShape);
- }
- }
- else if (AnchorUtil.isConnectionPoint(ac)) {
- return getConnectionBoundaryAnchors((Shape)ac);
- }
- else {
- // anchor container is a ContainerShape - these already have predefined BoundaryAnchors
- Iterator<Anchor> iterator = ac.getAnchors().iterator();
- while (iterator.hasNext()) {
- Anchor anchor = iterator.next();
- String property = Graphiti.getPeService().getPropertyValue(anchor, BOUNDARY_FIXPOINT_ANCHOR);
- if (property != null && anchor instanceof FixPointAnchor) {
- BoundaryAnchor a = new BoundaryAnchor();
- a.anchor = (FixPointAnchor) anchor;
- a.locationType = AnchorLocation.getLocation(property);
- a.location = peService.getLocationRelativeToDiagram(anchor);
- map.put(a.locationType, a);
- }
- }
- }
- return map;
- }
-
- public static Point getCenterPoint(Shape s) {
- GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
- ILocation loc = peService.getLocationRelativeToDiagram(s);
- return gaService.createPoint(loc.getX() + (ga.getWidth() / 2), loc.getY() + (ga.getHeight() / 2));
- }
-
- @SuppressWarnings("restriction")
- public static Tuple<FixPointAnchor, FixPointAnchor> getSourceAndTargetBoundaryAnchors(AnchorContainer source, AnchorContainer target,
- Connection connection) {
- Map<AnchorLocation, BoundaryAnchor> sourceBoundaryAnchors = getBoundaryAnchors(source);
- Map<AnchorLocation, BoundaryAnchor> targetBoundaryAnchors = getBoundaryAnchors(target);
-
- if (connection instanceof FreeFormConnection) {
- EList<Point> bendpoints = ((FreeFormConnection) connection).getBendpoints();
- if (bendpoints.size() > 0) {
- FixPointAnchor sourceAnchor = getCorrectAnchor(sourceBoundaryAnchors, bendpoints.get(0));
- FixPointAnchor targetAnchor = getCorrectAnchor(targetBoundaryAnchors,
- bendpoints.get(bendpoints.size() - 1));
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceAnchor, targetAnchor);
- }
- }
-
- BoundaryAnchor sourceTop = sourceBoundaryAnchors.get(AnchorLocation.TOP);
- BoundaryAnchor sourceBottom = sourceBoundaryAnchors.get(AnchorLocation.BOTTOM);
- BoundaryAnchor sourceLeft = sourceBoundaryAnchors.get(AnchorLocation.LEFT);
- BoundaryAnchor sourceRight = sourceBoundaryAnchors.get(AnchorLocation.RIGHT);
- BoundaryAnchor targetBottom = targetBoundaryAnchors.get(AnchorLocation.BOTTOM);
- BoundaryAnchor targetTop = targetBoundaryAnchors.get(AnchorLocation.TOP);
- BoundaryAnchor targetRight = targetBoundaryAnchors.get(AnchorLocation.RIGHT);
- BoundaryAnchor targetLeft = targetBoundaryAnchors.get(AnchorLocation.LEFT);
-
- boolean sLower = sourceTop.location.getY() > targetBottom.location.getY();
- boolean sHigher = sourceBottom.location.getY() < targetTop.location.getY();
- boolean sRight = sourceLeft.location.getX() > targetRight.location.getX();
- boolean sLeft = sourceRight.location.getX() < targetLeft.location.getX();
-
- if (sLower) {
- if (!sLeft && !sRight) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, targetBottom.anchor);
- } else if (sLeft) {
- FixPointAnchor fromTopAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceTop.anchor));
- FixPointAnchor fromRightAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceRight.anchor));
-
- double topLength = getLength(peService.getLocationRelativeToDiagram(fromTopAnchor),
- peService.getLocationRelativeToDiagram(sourceTop.anchor));
- double rightLength = getLength(peService.getLocationRelativeToDiagram(fromRightAnchor),
- peService.getLocationRelativeToDiagram(sourceRight.anchor));
-
- if (topLength < rightLength) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, fromTopAnchor);
- } else {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceRight.anchor, fromRightAnchor);
- }
- } else {
- FixPointAnchor fromTopAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceTop.anchor));
- FixPointAnchor fromLeftAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceLeft.anchor));
-
- double topLength = getLength(peService.getLocationRelativeToDiagram(fromTopAnchor),
- peService.getLocationRelativeToDiagram(sourceTop.anchor));
- double leftLength = getLength(peService.getLocationRelativeToDiagram(fromLeftAnchor),
- peService.getLocationRelativeToDiagram(sourceLeft.anchor));
- if (topLength < leftLength) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, fromTopAnchor);
- } else {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceLeft.anchor, fromLeftAnchor);
- }
- }
-
- }
-
- if (sHigher) {
- if (!sLeft && !sRight) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceBottom.anchor, targetTop.anchor);
- } else if (sLeft) {
- FixPointAnchor fromBottomAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceBottom.anchor));
- FixPointAnchor fromRightAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceRight.anchor));
-
- double bottomLength = getLength(peService.getLocationRelativeToDiagram(fromBottomAnchor),
- peService.getLocationRelativeToDiagram(sourceBottom.anchor));
- double rightLength = getLength(peService.getLocationRelativeToDiagram(fromRightAnchor),
- peService.getLocationRelativeToDiagram(sourceRight.anchor));
-
- if (bottomLength < rightLength) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceBottom.anchor, fromBottomAnchor);
- } else {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceRight.anchor, fromRightAnchor);
- }
- } else {
- FixPointAnchor fromBottomAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceBottom.anchor));
- FixPointAnchor fromLeftAnchor = getCorrectAnchor(targetBoundaryAnchors,
- peService.getLocationRelativeToDiagram(sourceLeft.anchor));
-
- double bottomLength = getLength(peService.getLocationRelativeToDiagram(fromBottomAnchor),
- peService.getLocationRelativeToDiagram(sourceBottom.anchor));
- double leftLength = getLength(peService.getLocationRelativeToDiagram(fromLeftAnchor),
- peService.getLocationRelativeToDiagram(sourceLeft.anchor));
- if (bottomLength < leftLength) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceBottom.anchor, fromBottomAnchor);
- } else {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceLeft.anchor, fromLeftAnchor);
- }
- }
- }
-
- // if source left is further than target right then use source left and target right
- if (sRight) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceLeft.anchor, targetRight.anchor);
- }
-
- // if source right is smaller than target left then use source right and target left
- if (sLeft) {
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceRight.anchor, targetLeft.anchor);
- }
-
- return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, targetTop.anchor);
- }
-
- private static FixPointAnchor getCorrectAnchor(Map<AnchorLocation, BoundaryAnchor> targetBoundaryAnchors,
- ILocation loc) {
- return getCorrectAnchor(targetBoundaryAnchors, gaService.createPoint(loc.getX(), loc.getY()));
- }
-
- private static double getLength(ILocation start, ILocation end) {
- return Math.sqrt(Math.pow(start.getX() - end.getX(), 2) + Math.pow(start.getY() - end.getY(), 2));
- }
-
- private static FixPointAnchor getCorrectAnchor(Map<AnchorLocation, BoundaryAnchor> boundaryAnchors, Point point) {
-
- BoundaryAnchor bottom = boundaryAnchors.get(AnchorLocation.BOTTOM);
- BoundaryAnchor top = boundaryAnchors.get(AnchorLocation.TOP);
- BoundaryAnchor right = boundaryAnchors.get(AnchorLocation.RIGHT);
- BoundaryAnchor left = boundaryAnchors.get(AnchorLocation.LEFT);
-
- boolean pointLower = point.getY() > bottom.location.getY();
- boolean pointHigher = point.getY() < top.location.getY();
- boolean pointRight = point.getX() > right.location.getX();
- boolean pointLeft = point.getX() < left.location.getX();
-
- // Find the best connector.
- if (pointLower) {
- if (!pointLeft && !pointRight) {
- // bendpoint is straight below the shape
- return bottom.anchor;
- } else if (pointLeft) {
-
- int deltaX = left.location.getX() - point.getX();
- int deltaY = point.getY() - bottom.location.getY();
- if (deltaX > deltaY) {
- return left.anchor;
- } else {
- return bottom.anchor;
- }
- } else {
- int deltaX = point.getX() - right.location.getX();
- int deltaY = point.getY() - bottom.location.getY();
- if (deltaX > deltaY) {
- return right.anchor;
- } else {
- return bottom.anchor;
- }
- }
- }
-
- if (pointHigher) {
- if (!pointLeft && !pointRight) {
- // bendpoint is straight above the shape
- return top.anchor;
- } else if (pointLeft) {
- int deltaX = left.location.getX() - point.getX();
- int deltaY = top.location.getY() - point.getY();
- if (deltaX > deltaY) {
- return left.anchor;
- } else {
- return top.anchor;
- }
- } else {
- int deltaX = point.getX() - right.location.getX();
- int deltaY = top.location.getY() - point.getY();
- if (deltaX > deltaY) {
- return right.anchor;
- } else {
- return top.anchor;
- }
- }
-
- }
-
- // if we reach here, then the point is neither above or below the shape and we only need to determine if we need
- // to connect to the left or right part of the shape
- if (pointRight) {
- return right.anchor;
- }
-
- if (pointLeft) {
- return left.anchor;
- }
-
- return top.anchor;
- }
-
- public static void reConnect(DiagramElement element, Diagram diagram) {
- try {
- ModelHandler handler = ModelHandler.getInstance(diagram);
- for (BPMNEdge bpmnEdge : handler.getAll(BPMNEdge.class)) {
- DiagramElement sourceElement = bpmnEdge.getSourceElement();
- DiagramElement targetElement = bpmnEdge.getTargetElement();
- if (sourceElement != null && targetElement != null) {
- boolean sourceMatches = sourceElement.getId().equals(element.getId());
- boolean targetMatches = targetElement.getId().equals(element.getId());
- if (sourceMatches || targetMatches) {
- updateEdge(bpmnEdge, diagram);
- }
- }
- }
- } catch (Exception e) {
- Activator.logError(e);
- }
- }
-
- private static void updateEdge(BPMNEdge edge, Diagram diagram) {
- List<PictogramElement> elements;
- elements = Graphiti.getLinkService().getPictogramElements(diagram, edge.getSourceElement());
- if (elements.size()==0 || !(elements.get(0) instanceof AnchorContainer))
- return;
- AnchorContainer source = (AnchorContainer) elements.get(0);
-
- elements = Graphiti.getLinkService().getPictogramElements(diagram, edge.getTargetElement());
- if (elements.size()==0 || !(elements.get(0) instanceof AnchorContainer))
- return;
- AnchorContainer target = (AnchorContainer) elements.get(0);
-
- elements = Graphiti.getLinkService().getPictogramElements(diagram, edge);
- if (elements.size()==0)
- return;
- Connection connection = (Connection) elements.get(0);
- Tuple<FixPointAnchor, FixPointAnchor> anchors = getSourceAndTargetBoundaryAnchors(source, target, connection);
-
- ILocation loc = peService.getLocationRelativeToDiagram(anchors.getFirst());
- org.eclipse.dd.dc.Point p = edge.getWaypoint().get(0);
- p.setX(loc.getX());
- p.setY(loc.getY());
-
- loc = peService.getLocationRelativeToDiagram(anchors.getSecond());
- p = edge.getWaypoint().get(edge.getWaypoint().size() - 1);
- p.setX(loc.getX());
- p.setY(loc.getY());
-
- relocateConnection(source.getAnchors(), anchors, target);
- deleteEmptyAdHocAnchors(source);
- deleteEmptyAdHocAnchors(target);
- }
-
- private static void relocateConnection(EList<Anchor> anchors, Tuple<FixPointAnchor, FixPointAnchor> newAnchors,
- AnchorContainer target) {
-
- List<Connection> connectionsToBeUpdated = new ArrayList<Connection>();
-
- for (Anchor anchor : anchors) {
- if (!(anchor instanceof FixPointAnchor)) {
- continue;
- }
-
- for (Connection connection : anchor.getOutgoingConnections()) {
- if (connection.getEnd().eContainer().equals(target)) {
- connectionsToBeUpdated.add(connection);
- }
- }
- }
-
- for (Connection c : connectionsToBeUpdated) {
- c.setStart(newAnchors.getFirst());
- c.setEnd(newAnchors.getSecond());
- }
- }
-
- private static void deleteEmptyAdHocAnchors(AnchorContainer target) {
- List<Integer> indexes = new ArrayList<Integer>();
-
- for (int i = target.getAnchors().size()-1; i>=0; --i) {
- Anchor a = target.getAnchors().get(i);
- if (!(a instanceof FixPointAnchor)) {
- continue;
- }
-
- if (peService.getProperty(a, BOUNDARY_FIXPOINT_ANCHOR) == null && a.getIncomingConnections().isEmpty()
- && a.getOutgoingConnections().isEmpty()) {
- indexes.add(i);
- }
- }
-
- for (int i : indexes) {
- peService.deletePictogramElement(target.getAnchors().get(i));
- }
- }
-
- public static void addFixedPointAnchors(Shape shape, GraphicsAlgorithm ga) {
- IDimension size = gaService.calculateSize(ga);
- int w = size.getWidth();
- int h = size.getHeight();
- createAnchor(shape, AnchorLocation.TOP, w / 2, 0);
- createAnchor(shape, AnchorLocation.RIGHT, w, h / 2);
- createAnchor(shape, AnchorLocation.BOTTOM, w / 2, h);
- createAnchor(shape, AnchorLocation.LEFT, 0, h / 2);
- }
-
- public static void relocateFixPointAnchors(Shape shape, int w, int h) {
- Map<AnchorLocation, BoundaryAnchor> anchors = getBoundaryAnchors(shape);
-
- FixPointAnchor anchor = anchors.get(AnchorLocation.TOP).anchor;
- anchor.setLocation(gaService.createPoint(w / 2, 0));
-
- anchor = anchors.get(AnchorLocation.RIGHT).anchor;
- anchor.setLocation(gaService.createPoint(w, h / 2));
-
- anchor = anchors.get(AnchorLocation.BOTTOM).anchor;
- anchor.setLocation(gaService.createPoint(w / 2, h));
-
- anchor = anchors.get(AnchorLocation.LEFT).anchor;
- anchor.setLocation(gaService.createPoint(0, h / 2));
- }
-
- // Connection points allow creation of anchors on FreeFormConnections
-
- public static Shape createConnectionPoint(IFeatureProvider fp,
- FreeFormConnection connection, ILocation location) {
-
- Shape connectionPointShape = null;
-
- Point bendPoint = null;
- Diagram diagram = fp.getDiagramTypeProvider().getDiagram();
-
- // TODO: fix this
- for (Point p : connection.getBendpoints()) {
- int px = p.getX();
- int py = p.getY();
- if (GraphicsUtil.isPointNear(p, location, 20)) {
- bendPoint = p;
- location.setX(px);
- location.setY(py);
- }
-
- for (Shape s : diagram.getChildren()) {
- if (isConnectionPointNear(s, location, 0)) {
- // this is the connection point on the target connection line
- // reuse this connection point if it's "close enough" to
- // target location otherwise create a new connection point
- if (isConnectionPointNear(s, location, 20)) {
- bendPoint = p;
- connectionPointShape = s;
- location.setX(px);
- location.setY(py);
- }
- break;
- }
- }
- }
-
- if (connectionPointShape == null) {
- connectionPointShape = createConnectionPoint(location, diagram);
- fp.link(connectionPointShape, connection);
- connection.getLink().getBusinessObjects().add(connectionPointShape);
-
- if (bendPoint == null) {
- bendPoint = createService.createPoint(location.getX(),
- location.getY());
-
- IAddBendpointContext addBpContext = new AddBendpointContext(connection, bendPoint.getX(), bendPoint.getY(), 0);
- IAddBendpointFeature addBpFeature = fp.getAddBendpointFeature(addBpContext);
- addBpFeature.addBendpoint(addBpContext);
- }
- }
- return connectionPointShape;
- }
-
- public static Shape createConnectionPoint(ILocation location, ContainerShape cs) {
-
- // create a circle for the connection point shape
- Shape connectionPointShape = createService.createShape(cs, true);
- peService.setPropertyValue(connectionPointShape, CONNECTION_POINT_KEY, CONNECTION_POINT);
- Ellipse ellipse = createService.createEllipse(connectionPointShape);
- int x = 0, y = 0;
- if (location != null) {
- x = location.getX();
- y = location.getY();
- }
- ellipse.setFilled(true);
- Diagram diagram = peService.getDiagramForPictogramElement(connectionPointShape);
- ellipse.setForeground(Graphiti.getGaService().manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
-
- // create the anchor
- getConnectionPointAnchor(connectionPointShape);
-
- // set the location
- setConnectionPointLocation(connectionPointShape, x, y);
-
- return connectionPointShape;
- }
-
- public static boolean deleteConnectionPointIfPossible(IFeatureProvider fp,Shape connectionPointShape) {
- if (isConnectionPoint(connectionPointShape)) {
- Anchor anchor = getConnectionPointAnchor(connectionPointShape);
- List<Connection> allConnections = Graphiti.getPeService().getAllConnections(anchor);
- if (allConnections.size()==0) {
- // remove the bendpoint from target connection if there are no other connections going to it
- FreeFormConnection oldTargetConnection = (FreeFormConnection) connectionPointShape.getLink().getBusinessObjects().get(0);
-
- Point bp = null;
- for (Point p : oldTargetConnection.getBendpoints()) {
- if (AnchorUtil.isConnectionPointNear(connectionPointShape, p, 0)) {
- bp = p;
- break;
- }
- }
-
- if (bp!=null) {
- IRemoveBendpointContext removeBpContext = new RemoveBendpointContext(oldTargetConnection, bp);
- IRemoveBendpointFeature removeBpFeature = fp.getRemoveBendpointFeature(removeBpContext);
- removeBpFeature.removeBendpoint(removeBpContext);
- }
-
- RemoveContext ctx = new RemoveContext(connectionPointShape);
- fp.getRemoveFeature(ctx).remove(ctx);
- }
- }
- return false;
- }
-
- public static FixPointAnchor getConnectionPointAnchor(Shape connectionPointShape) {
- if (connectionPointShape.getAnchors().size()==0) {
- FixPointAnchor anchor = createService.createFixPointAnchor(connectionPointShape);
- peService.setPropertyValue(anchor, CONNECTION_POINT_KEY, CONNECTION_POINT);
-
- // if the anchor doesn't have a GraphicsAlgorithm, GEF will throw a fit
- // so create an invisible rectangle for it
- createService.createInvisibleRectangle(anchor);
- }
- return (FixPointAnchor)connectionPointShape.getAnchors().get(0);
- }
-
- public static ILocation getConnectionPointLocation(Shape connectionPointShape) {
- ILocation location = GraphicsUtil.peService.getLocationRelativeToDiagram(connectionPointShape);
- int x = location.getX() + CONNECTION_POINT_SIZE / 2;
- int y = location.getY() + CONNECTION_POINT_SIZE / 2;
- location.setX(x);
- location.setY(y);
- return location;
- }
-
- public static void setConnectionPointLocation(Shape connectionPointShape, int x, int y) {
-
- if (connectionPointShape.getAnchors().size()==0) {
- // anchor has not been created yet - need to set both location AND size
- layoutService.setLocationAndSize(
- connectionPointShape.getGraphicsAlgorithm(),
- x - CONNECTION_POINT_SIZE / 2, y - CONNECTION_POINT_SIZE / 2,
- CONNECTION_POINT_SIZE, CONNECTION_POINT_SIZE);
- }
- else {
- // already created - just set the location
- layoutService.setLocation(
- connectionPointShape.getGraphicsAlgorithm(),
- x - CONNECTION_POINT_SIZE / 2, y - CONNECTION_POINT_SIZE / 2);
- }
-
- FixPointAnchor anchor = getConnectionPointAnchor(connectionPointShape);
- anchor.setLocation( Graphiti.getCreateService().createPoint(CONNECTION_POINT_SIZE / 2,CONNECTION_POINT_SIZE / 2) );
- layoutService.setLocation(
- anchor.getGraphicsAlgorithm(),
- CONNECTION_POINT_SIZE / 2,CONNECTION_POINT_SIZE / 2);
- }
-
- public static List<Shape> getConnectionPoints(FreeFormConnection connection) {
- ArrayList<Shape> list = new ArrayList<Shape>();
-
- for (Object o : connection.getLink().getBusinessObjects()) {
- if ( o instanceof AnchorContainer ) {
- AnchorContainer c = (AnchorContainer)o;
- if (AnchorUtil.isConnectionPoint(c)) {
- list.add((Shape)c);
- }
- }
- }
-
- return list;
- }
-
- public static Shape getConnectionPointAt(FreeFormConnection connection, Point point) {
- for (Shape connectionPointShape : getConnectionPoints(connection)) {
- if (AnchorUtil.isConnectionPointNear(connectionPointShape, point, 0)) {
- return connectionPointShape;
- }
- }
- return null;
- }
-
-
- public static boolean isConnectionPoint(PictogramElement pe) {
- String value = Graphiti.getPeService().getPropertyValue(pe, CONNECTION_POINT_KEY);
- return CONNECTION_POINT.equals(value);
- }
-
- public static boolean isConnectionPointNear(PictogramElement pe, ILocation loc, int dist) {
- if (isConnectionPoint(pe)) {
- int x = pe.getGraphicsAlgorithm().getX() + CONNECTION_POINT_SIZE / 2;
- int y = pe.getGraphicsAlgorithm().getY() + CONNECTION_POINT_SIZE / 2;
- int lx = loc.getX();
- int ly = loc.getY();
- return lx-dist <= x && x <= lx+dist && ly-dist <= y && y <= ly+dist;
- }
- return false;
- }
-
- public static boolean isConnectionPointNear(PictogramElement pe, Point loc, int dist) {
- if (isConnectionPoint(pe)) {
- int x = pe.getGraphicsAlgorithm().getX() + CONNECTION_POINT_SIZE / 2;
- int y = pe.getGraphicsAlgorithm().getY() + CONNECTION_POINT_SIZE / 2;
- int lx = loc.getX();
- int ly = loc.getY();
- return lx-dist <= x && x <= lx+dist && ly-dist <= y && y <= ly+dist;
- }
- return false;
- }
-
- public static FreeFormConnection getConnectionPointOwner(Shape connectionPointShape) {
- if (isConnectionPoint(connectionPointShape)) {
- return (FreeFormConnection)connectionPointShape.getLink().getBusinessObjects().get(0);
- }
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.bpmn2.di.BPMNEdge;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.graphiti.datatypes.IDimension;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.IAddBendpointFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IRemoveBendpointFeature;
+import org.eclipse.graphiti.features.context.IAddBendpointContext;
+import org.eclipse.graphiti.features.context.IRemoveBendpointContext;
+import org.eclipse.graphiti.features.context.impl.AddBendpointContext;
+import org.eclipse.graphiti.features.context.impl.RemoveBendpointContext;
+import org.eclipse.graphiti.features.context.impl.RemoveContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.ICreateService;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.ILayoutService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class AnchorUtil {
+
+ public static final String BOUNDARY_FIXPOINT_ANCHOR = "boundary.fixpoint.anchor";
+
+ // values for connection points
+ public static final String CONNECTION_POINT = "connection.point"; //$NON-NLS-1$
+ public static final String CONNECTION_POINT_KEY = "connection.point.key"; //$NON-NLS-1$
+ public static final int CONNECTION_POINT_SIZE = 4;
+
+ private static final IPeService peService = Graphiti.getPeService();
+ private static final IGaService gaService = Graphiti.getGaService();
+ private static final ICreateService createService = Graphiti.getCreateService();
+ private static final ILayoutService layoutService = Graphiti.getLayoutService();
+
+ public enum AnchorLocation {
+ TOP("anchor.top"), BOTTOM("anchor.bottom"), LEFT("anchor.left"), RIGHT("anchor.right");
+
+ private final String key;
+
+ private AnchorLocation(String key) {
+ this.key = key;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public static AnchorLocation getLocation(String key) {
+ for (AnchorLocation l : values()) {
+ if (l.getKey().equals(key)) {
+ return l;
+ }
+ }
+ return null;
+ }
+ }
+
+ public static class AnchorTuple {
+ public FixPointAnchor sourceAnchor;
+ public FixPointAnchor targetAnchor;
+ }
+
+ public static class BoundaryAnchor {
+ public FixPointAnchor anchor;
+ public AnchorLocation locationType;
+ public ILocation location;
+ }
+
+ public static FixPointAnchor createAnchor(AnchorContainer ac, AnchorLocation loc, int x, int y) {
+ IGaService gaService = Graphiti.getGaService();
+ IPeService peService = Graphiti.getPeService();
+
+ FixPointAnchor anchor = peService.createFixPointAnchor(ac);
+ peService.setPropertyValue(anchor, BOUNDARY_FIXPOINT_ANCHOR, loc.getKey());
+ anchor.setLocation(gaService.createPoint(x, y));
+ gaService.createInvisibleRectangle(anchor);
+
+ return anchor;
+ }
+
+ public static Map<AnchorLocation, BoundaryAnchor> getConnectionBoundaryAnchors(Shape connectionPointShape) {
+ Map<AnchorLocation, BoundaryAnchor> map = new HashMap<AnchorLocation, BoundaryAnchor>(4);
+ BoundaryAnchor a = new BoundaryAnchor();
+ a.anchor = getConnectionPointAnchor(connectionPointShape);
+ for (AnchorLocation al : AnchorLocation.values() ) {
+ a.locationType = al;
+ a.location = getConnectionPointLocation(connectionPointShape);
+ map.put(a.locationType, a);
+ }
+ return map;
+ }
+
+ public static Map<AnchorLocation, BoundaryAnchor> getBoundaryAnchors(AnchorContainer ac) {
+ Map<AnchorLocation, BoundaryAnchor> map = new HashMap<AnchorLocation, BoundaryAnchor>(4);
+
+ if (ac instanceof FreeFormConnection) {
+ // the anchor container is a Connection which does not have any predefined BoundaryAnchors
+ // so we have to synthesize these by looking for connection point shapes owned by the connection
+ for (Shape connectionPointShape : getConnectionPoints((FreeFormConnection)ac)) {
+ // TODO: if there are multiple connection points, figure out which one to use
+ return getConnectionBoundaryAnchors(connectionPointShape);
+ }
+ }
+ else if (AnchorUtil.isConnectionPoint(ac)) {
+ return getConnectionBoundaryAnchors((Shape)ac);
+ }
+ else {
+ // anchor container is a ContainerShape - these already have predefined BoundaryAnchors
+ Iterator<Anchor> iterator = ac.getAnchors().iterator();
+ while (iterator.hasNext()) {
+ Anchor anchor = iterator.next();
+ String property = Graphiti.getPeService().getPropertyValue(anchor, BOUNDARY_FIXPOINT_ANCHOR);
+ if (property != null && anchor instanceof FixPointAnchor) {
+ BoundaryAnchor a = new BoundaryAnchor();
+ a.anchor = (FixPointAnchor) anchor;
+ a.locationType = AnchorLocation.getLocation(property);
+ a.location = peService.getLocationRelativeToDiagram(anchor);
+ map.put(a.locationType, a);
+ }
+ }
+ }
+ return map;
+ }
+
+ public static Point getCenterPoint(Shape s) {
+ GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
+ ILocation loc = peService.getLocationRelativeToDiagram(s);
+ return gaService.createPoint(loc.getX() + (ga.getWidth() / 2), loc.getY() + (ga.getHeight() / 2));
+ }
+
+ @SuppressWarnings("restriction")
+ public static Tuple<FixPointAnchor, FixPointAnchor> getSourceAndTargetBoundaryAnchors(AnchorContainer source, AnchorContainer target,
+ Connection connection) {
+ Map<AnchorLocation, BoundaryAnchor> sourceBoundaryAnchors = getBoundaryAnchors(source);
+ Map<AnchorLocation, BoundaryAnchor> targetBoundaryAnchors = getBoundaryAnchors(target);
+
+ if (connection instanceof FreeFormConnection) {
+ EList<Point> bendpoints = ((FreeFormConnection) connection).getBendpoints();
+ if (bendpoints.size() > 0) {
+ FixPointAnchor sourceAnchor = getCorrectAnchor(sourceBoundaryAnchors, bendpoints.get(0));
+ FixPointAnchor targetAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ bendpoints.get(bendpoints.size() - 1));
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceAnchor, targetAnchor);
+ }
+ }
+
+ BoundaryAnchor sourceTop = sourceBoundaryAnchors.get(AnchorLocation.TOP);
+ BoundaryAnchor sourceBottom = sourceBoundaryAnchors.get(AnchorLocation.BOTTOM);
+ BoundaryAnchor sourceLeft = sourceBoundaryAnchors.get(AnchorLocation.LEFT);
+ BoundaryAnchor sourceRight = sourceBoundaryAnchors.get(AnchorLocation.RIGHT);
+ BoundaryAnchor targetBottom = targetBoundaryAnchors.get(AnchorLocation.BOTTOM);
+ BoundaryAnchor targetTop = targetBoundaryAnchors.get(AnchorLocation.TOP);
+ BoundaryAnchor targetRight = targetBoundaryAnchors.get(AnchorLocation.RIGHT);
+ BoundaryAnchor targetLeft = targetBoundaryAnchors.get(AnchorLocation.LEFT);
+
+ boolean sLower = sourceTop.location.getY() > targetBottom.location.getY();
+ boolean sHigher = sourceBottom.location.getY() < targetTop.location.getY();
+ boolean sRight = sourceLeft.location.getX() > targetRight.location.getX();
+ boolean sLeft = sourceRight.location.getX() < targetLeft.location.getX();
+
+ if (sLower) {
+ if (!sLeft && !sRight) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, targetBottom.anchor);
+ } else if (sLeft) {
+ FixPointAnchor fromTopAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceTop.anchor));
+ FixPointAnchor fromRightAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceRight.anchor));
+
+ double topLength = getLength(peService.getLocationRelativeToDiagram(fromTopAnchor),
+ peService.getLocationRelativeToDiagram(sourceTop.anchor));
+ double rightLength = getLength(peService.getLocationRelativeToDiagram(fromRightAnchor),
+ peService.getLocationRelativeToDiagram(sourceRight.anchor));
+
+ if (topLength < rightLength) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, fromTopAnchor);
+ } else {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceRight.anchor, fromRightAnchor);
+ }
+ } else {
+ FixPointAnchor fromTopAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceTop.anchor));
+ FixPointAnchor fromLeftAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceLeft.anchor));
+
+ double topLength = getLength(peService.getLocationRelativeToDiagram(fromTopAnchor),
+ peService.getLocationRelativeToDiagram(sourceTop.anchor));
+ double leftLength = getLength(peService.getLocationRelativeToDiagram(fromLeftAnchor),
+ peService.getLocationRelativeToDiagram(sourceLeft.anchor));
+ if (topLength < leftLength) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, fromTopAnchor);
+ } else {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceLeft.anchor, fromLeftAnchor);
+ }
+ }
+
+ }
+
+ if (sHigher) {
+ if (!sLeft && !sRight) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceBottom.anchor, targetTop.anchor);
+ } else if (sLeft) {
+ FixPointAnchor fromBottomAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceBottom.anchor));
+ FixPointAnchor fromRightAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceRight.anchor));
+
+ double bottomLength = getLength(peService.getLocationRelativeToDiagram(fromBottomAnchor),
+ peService.getLocationRelativeToDiagram(sourceBottom.anchor));
+ double rightLength = getLength(peService.getLocationRelativeToDiagram(fromRightAnchor),
+ peService.getLocationRelativeToDiagram(sourceRight.anchor));
+
+ if (bottomLength < rightLength) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceBottom.anchor, fromBottomAnchor);
+ } else {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceRight.anchor, fromRightAnchor);
+ }
+ } else {
+ FixPointAnchor fromBottomAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceBottom.anchor));
+ FixPointAnchor fromLeftAnchor = getCorrectAnchor(targetBoundaryAnchors,
+ peService.getLocationRelativeToDiagram(sourceLeft.anchor));
+
+ double bottomLength = getLength(peService.getLocationRelativeToDiagram(fromBottomAnchor),
+ peService.getLocationRelativeToDiagram(sourceBottom.anchor));
+ double leftLength = getLength(peService.getLocationRelativeToDiagram(fromLeftAnchor),
+ peService.getLocationRelativeToDiagram(sourceLeft.anchor));
+ if (bottomLength < leftLength) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceBottom.anchor, fromBottomAnchor);
+ } else {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceLeft.anchor, fromLeftAnchor);
+ }
+ }
+ }
+
+ // if source left is further than target right then use source left and target right
+ if (sRight) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceLeft.anchor, targetRight.anchor);
+ }
+
+ // if source right is smaller than target left then use source right and target left
+ if (sLeft) {
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceRight.anchor, targetLeft.anchor);
+ }
+
+ return new Tuple<FixPointAnchor, FixPointAnchor>(sourceTop.anchor, targetTop.anchor);
+ }
+
+ private static FixPointAnchor getCorrectAnchor(Map<AnchorLocation, BoundaryAnchor> targetBoundaryAnchors,
+ ILocation loc) {
+ return getCorrectAnchor(targetBoundaryAnchors, gaService.createPoint(loc.getX(), loc.getY()));
+ }
+
+ private static double getLength(ILocation start, ILocation end) {
+ return Math.sqrt(Math.pow(start.getX() - end.getX(), 2) + Math.pow(start.getY() - end.getY(), 2));
+ }
+
+ private static FixPointAnchor getCorrectAnchor(Map<AnchorLocation, BoundaryAnchor> boundaryAnchors, Point point) {
+
+ BoundaryAnchor bottom = boundaryAnchors.get(AnchorLocation.BOTTOM);
+ BoundaryAnchor top = boundaryAnchors.get(AnchorLocation.TOP);
+ BoundaryAnchor right = boundaryAnchors.get(AnchorLocation.RIGHT);
+ BoundaryAnchor left = boundaryAnchors.get(AnchorLocation.LEFT);
+
+ boolean pointLower = point.getY() > bottom.location.getY();
+ boolean pointHigher = point.getY() < top.location.getY();
+ boolean pointRight = point.getX() > right.location.getX();
+ boolean pointLeft = point.getX() < left.location.getX();
+
+ // Find the best connector.
+ if (pointLower) {
+ if (!pointLeft && !pointRight) {
+ // bendpoint is straight below the shape
+ return bottom.anchor;
+ } else if (pointLeft) {
+
+ int deltaX = left.location.getX() - point.getX();
+ int deltaY = point.getY() - bottom.location.getY();
+ if (deltaX > deltaY) {
+ return left.anchor;
+ } else {
+ return bottom.anchor;
+ }
+ } else {
+ int deltaX = point.getX() - right.location.getX();
+ int deltaY = point.getY() - bottom.location.getY();
+ if (deltaX > deltaY) {
+ return right.anchor;
+ } else {
+ return bottom.anchor;
+ }
+ }
+ }
+
+ if (pointHigher) {
+ if (!pointLeft && !pointRight) {
+ // bendpoint is straight above the shape
+ return top.anchor;
+ } else if (pointLeft) {
+ int deltaX = left.location.getX() - point.getX();
+ int deltaY = top.location.getY() - point.getY();
+ if (deltaX > deltaY) {
+ return left.anchor;
+ } else {
+ return top.anchor;
+ }
+ } else {
+ int deltaX = point.getX() - right.location.getX();
+ int deltaY = top.location.getY() - point.getY();
+ if (deltaX > deltaY) {
+ return right.anchor;
+ } else {
+ return top.anchor;
+ }
+ }
+
+ }
+
+ // if we reach here, then the point is neither above or below the shape and we only need to determine if we need
+ // to connect to the left or right part of the shape
+ if (pointRight) {
+ return right.anchor;
+ }
+
+ if (pointLeft) {
+ return left.anchor;
+ }
+
+ return top.anchor;
+ }
+
+ public static void reConnect(DiagramElement element, Diagram diagram) {
+ try {
+ ModelHandler handler = ModelHandler.getInstance(diagram);
+ for (BPMNEdge bpmnEdge : handler.getAll(BPMNEdge.class)) {
+ DiagramElement sourceElement = bpmnEdge.getSourceElement();
+ DiagramElement targetElement = bpmnEdge.getTargetElement();
+ if (sourceElement != null && targetElement != null) {
+ boolean sourceMatches = sourceElement.getId().equals(element.getId());
+ boolean targetMatches = targetElement.getId().equals(element.getId());
+ if (sourceMatches || targetMatches) {
+ updateEdge(bpmnEdge, diagram);
+ }
+ }
+ }
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ }
+
+ private static void updateEdge(BPMNEdge edge, Diagram diagram) {
+ List<PictogramElement> elements;
+ elements = Graphiti.getLinkService().getPictogramElements(diagram, edge.getSourceElement());
+ if (elements.size()==0 || !(elements.get(0) instanceof AnchorContainer))
+ return;
+ AnchorContainer source = (AnchorContainer) elements.get(0);
+
+ elements = Graphiti.getLinkService().getPictogramElements(diagram, edge.getTargetElement());
+ if (elements.size()==0 || !(elements.get(0) instanceof AnchorContainer))
+ return;
+ AnchorContainer target = (AnchorContainer) elements.get(0);
+
+ elements = Graphiti.getLinkService().getPictogramElements(diagram, edge);
+ if (elements.size()==0)
+ return;
+ Connection connection = (Connection) elements.get(0);
+ Tuple<FixPointAnchor, FixPointAnchor> anchors = getSourceAndTargetBoundaryAnchors(source, target, connection);
+
+ ILocation loc = peService.getLocationRelativeToDiagram(anchors.getFirst());
+ org.eclipse.dd.dc.Point p = edge.getWaypoint().get(0);
+ p.setX(loc.getX());
+ p.setY(loc.getY());
+
+ loc = peService.getLocationRelativeToDiagram(anchors.getSecond());
+ p = edge.getWaypoint().get(edge.getWaypoint().size() - 1);
+ p.setX(loc.getX());
+ p.setY(loc.getY());
+
+ relocateConnection(source.getAnchors(), anchors, target);
+ deleteEmptyAdHocAnchors(source);
+ deleteEmptyAdHocAnchors(target);
+ }
+
+ private static void relocateConnection(EList<Anchor> anchors, Tuple<FixPointAnchor, FixPointAnchor> newAnchors,
+ AnchorContainer target) {
+
+ List<Connection> connectionsToBeUpdated = new ArrayList<Connection>();
+
+ for (Anchor anchor : anchors) {
+ if (!(anchor instanceof FixPointAnchor)) {
+ continue;
+ }
+
+ for (Connection connection : anchor.getOutgoingConnections()) {
+ if (connection.getEnd().eContainer().equals(target)) {
+ connectionsToBeUpdated.add(connection);
+ }
+ }
+ }
+
+ for (Connection c : connectionsToBeUpdated) {
+ c.setStart(newAnchors.getFirst());
+ c.setEnd(newAnchors.getSecond());
+ }
+ }
+
+ private static void deleteEmptyAdHocAnchors(AnchorContainer target) {
+ List<Integer> indexes = new ArrayList<Integer>();
+
+ for (int i = target.getAnchors().size()-1; i>=0; --i) {
+ Anchor a = target.getAnchors().get(i);
+ if (!(a instanceof FixPointAnchor)) {
+ continue;
+ }
+
+ if (peService.getProperty(a, BOUNDARY_FIXPOINT_ANCHOR) == null && a.getIncomingConnections().isEmpty()
+ && a.getOutgoingConnections().isEmpty()) {
+ indexes.add(i);
+ }
+ }
+
+ for (int i : indexes) {
+ peService.deletePictogramElement(target.getAnchors().get(i));
+ }
+ }
+
+ public static void addFixedPointAnchors(Shape shape, GraphicsAlgorithm ga) {
+ IDimension size = gaService.calculateSize(ga);
+ int w = size.getWidth();
+ int h = size.getHeight();
+ createAnchor(shape, AnchorLocation.TOP, w / 2, 0);
+ createAnchor(shape, AnchorLocation.RIGHT, w, h / 2);
+ createAnchor(shape, AnchorLocation.BOTTOM, w / 2, h);
+ createAnchor(shape, AnchorLocation.LEFT, 0, h / 2);
+ }
+
+ public static void relocateFixPointAnchors(Shape shape, int w, int h) {
+ Map<AnchorLocation, BoundaryAnchor> anchors = getBoundaryAnchors(shape);
+
+ FixPointAnchor anchor = anchors.get(AnchorLocation.TOP).anchor;
+ anchor.setLocation(gaService.createPoint(w / 2, 0));
+
+ anchor = anchors.get(AnchorLocation.RIGHT).anchor;
+ anchor.setLocation(gaService.createPoint(w, h / 2));
+
+ anchor = anchors.get(AnchorLocation.BOTTOM).anchor;
+ anchor.setLocation(gaService.createPoint(w / 2, h));
+
+ anchor = anchors.get(AnchorLocation.LEFT).anchor;
+ anchor.setLocation(gaService.createPoint(0, h / 2));
+ }
+
+ // Connection points allow creation of anchors on FreeFormConnections
+
+ public static Shape createConnectionPoint(IFeatureProvider fp,
+ FreeFormConnection connection, ILocation location) {
+
+ Shape connectionPointShape = null;
+
+ Point bendPoint = null;
+ Diagram diagram = fp.getDiagramTypeProvider().getDiagram();
+
+ // TODO: fix this
+ for (Point p : connection.getBendpoints()) {
+ int px = p.getX();
+ int py = p.getY();
+ if (GraphicsUtil.isPointNear(p, location, 20)) {
+ bendPoint = p;
+ location.setX(px);
+ location.setY(py);
+ }
+
+ for (Shape s : diagram.getChildren()) {
+ if (isConnectionPointNear(s, location, 0)) {
+ // this is the connection point on the target connection line
+ // reuse this connection point if it's "close enough" to
+ // target location otherwise create a new connection point
+ if (isConnectionPointNear(s, location, 20)) {
+ bendPoint = p;
+ connectionPointShape = s;
+ location.setX(px);
+ location.setY(py);
+ }
+ break;
+ }
+ }
+ }
+
+ if (connectionPointShape == null) {
+ connectionPointShape = createConnectionPoint(location, diagram);
+ fp.link(connectionPointShape, connection);
+ connection.getLink().getBusinessObjects().add(connectionPointShape);
+
+ if (bendPoint == null) {
+ bendPoint = createService.createPoint(location.getX(),
+ location.getY());
+
+ IAddBendpointContext addBpContext = new AddBendpointContext(connection, bendPoint.getX(), bendPoint.getY(), 0);
+ IAddBendpointFeature addBpFeature = fp.getAddBendpointFeature(addBpContext);
+ addBpFeature.addBendpoint(addBpContext);
+ }
+ }
+ return connectionPointShape;
+ }
+
+ public static Shape createConnectionPoint(ILocation location, ContainerShape cs) {
+
+ // create a circle for the connection point shape
+ Shape connectionPointShape = createService.createShape(cs, true);
+ peService.setPropertyValue(connectionPointShape, CONNECTION_POINT_KEY, CONNECTION_POINT);
+ Ellipse ellipse = createService.createEllipse(connectionPointShape);
+ int x = 0, y = 0;
+ if (location != null) {
+ x = location.getX();
+ y = location.getY();
+ }
+ ellipse.setFilled(true);
+ Diagram diagram = peService.getDiagramForPictogramElement(connectionPointShape);
+ ellipse.setForeground(Graphiti.getGaService().manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+
+ // create the anchor
+ getConnectionPointAnchor(connectionPointShape);
+
+ // set the location
+ setConnectionPointLocation(connectionPointShape, x, y);
+
+ return connectionPointShape;
+ }
+
+ public static boolean deleteConnectionPointIfPossible(IFeatureProvider fp,Shape connectionPointShape) {
+ if (isConnectionPoint(connectionPointShape)) {
+ Anchor anchor = getConnectionPointAnchor(connectionPointShape);
+ List<Connection> allConnections = Graphiti.getPeService().getAllConnections(anchor);
+ if (allConnections.size()==0) {
+ // remove the bendpoint from target connection if there are no other connections going to it
+ FreeFormConnection oldTargetConnection = (FreeFormConnection) connectionPointShape.getLink().getBusinessObjects().get(0);
+
+ Point bp = null;
+ for (Point p : oldTargetConnection.getBendpoints()) {
+ if (AnchorUtil.isConnectionPointNear(connectionPointShape, p, 0)) {
+ bp = p;
+ break;
+ }
+ }
+
+ if (bp!=null) {
+ IRemoveBendpointContext removeBpContext = new RemoveBendpointContext(oldTargetConnection, bp);
+ IRemoveBendpointFeature removeBpFeature = fp.getRemoveBendpointFeature(removeBpContext);
+ removeBpFeature.removeBendpoint(removeBpContext);
+ }
+
+ RemoveContext ctx = new RemoveContext(connectionPointShape);
+ fp.getRemoveFeature(ctx).remove(ctx);
+ }
+ }
+ return false;
+ }
+
+ public static FixPointAnchor getConnectionPointAnchor(Shape connectionPointShape) {
+ if (connectionPointShape.getAnchors().size()==0) {
+ FixPointAnchor anchor = createService.createFixPointAnchor(connectionPointShape);
+ peService.setPropertyValue(anchor, CONNECTION_POINT_KEY, CONNECTION_POINT);
+
+ // if the anchor doesn't have a GraphicsAlgorithm, GEF will throw a fit
+ // so create an invisible rectangle for it
+ createService.createInvisibleRectangle(anchor);
+ }
+ return (FixPointAnchor)connectionPointShape.getAnchors().get(0);
+ }
+
+ public static ILocation getConnectionPointLocation(Shape connectionPointShape) {
+ ILocation location = GraphicsUtil.peService.getLocationRelativeToDiagram(connectionPointShape);
+ int x = location.getX() + CONNECTION_POINT_SIZE / 2;
+ int y = location.getY() + CONNECTION_POINT_SIZE / 2;
+ location.setX(x);
+ location.setY(y);
+ return location;
+ }
+
+ public static void setConnectionPointLocation(Shape connectionPointShape, int x, int y) {
+
+ if (connectionPointShape.getAnchors().size()==0) {
+ // anchor has not been created yet - need to set both location AND size
+ layoutService.setLocationAndSize(
+ connectionPointShape.getGraphicsAlgorithm(),
+ x - CONNECTION_POINT_SIZE / 2, y - CONNECTION_POINT_SIZE / 2,
+ CONNECTION_POINT_SIZE, CONNECTION_POINT_SIZE);
+ }
+ else {
+ // already created - just set the location
+ layoutService.setLocation(
+ connectionPointShape.getGraphicsAlgorithm(),
+ x - CONNECTION_POINT_SIZE / 2, y - CONNECTION_POINT_SIZE / 2);
+ }
+
+ FixPointAnchor anchor = getConnectionPointAnchor(connectionPointShape);
+ anchor.setLocation( Graphiti.getCreateService().createPoint(CONNECTION_POINT_SIZE / 2,CONNECTION_POINT_SIZE / 2) );
+ layoutService.setLocation(
+ anchor.getGraphicsAlgorithm(),
+ CONNECTION_POINT_SIZE / 2,CONNECTION_POINT_SIZE / 2);
+ }
+
+ public static List<Shape> getConnectionPoints(FreeFormConnection connection) {
+ ArrayList<Shape> list = new ArrayList<Shape>();
+
+ for (Object o : connection.getLink().getBusinessObjects()) {
+ if ( o instanceof AnchorContainer ) {
+ AnchorContainer c = (AnchorContainer)o;
+ if (AnchorUtil.isConnectionPoint(c)) {
+ list.add((Shape)c);
+ }
+ }
+ }
+
+ return list;
+ }
+
+ public static Shape getConnectionPointAt(FreeFormConnection connection, Point point) {
+ for (Shape connectionPointShape : getConnectionPoints(connection)) {
+ if (AnchorUtil.isConnectionPointNear(connectionPointShape, point, 0)) {
+ return connectionPointShape;
+ }
+ }
+ return null;
+ }
+
+
+ public static boolean isConnectionPoint(PictogramElement pe) {
+ String value = Graphiti.getPeService().getPropertyValue(pe, CONNECTION_POINT_KEY);
+ return CONNECTION_POINT.equals(value);
+ }
+
+ public static boolean isConnectionPointNear(PictogramElement pe, ILocation loc, int dist) {
+ if (isConnectionPoint(pe)) {
+ int x = pe.getGraphicsAlgorithm().getX() + CONNECTION_POINT_SIZE / 2;
+ int y = pe.getGraphicsAlgorithm().getY() + CONNECTION_POINT_SIZE / 2;
+ int lx = loc.getX();
+ int ly = loc.getY();
+ return lx-dist <= x && x <= lx+dist && ly-dist <= y && y <= ly+dist;
+ }
+ return false;
+ }
+
+ public static boolean isConnectionPointNear(PictogramElement pe, Point loc, int dist) {
+ if (isConnectionPoint(pe)) {
+ int x = pe.getGraphicsAlgorithm().getX() + CONNECTION_POINT_SIZE / 2;
+ int y = pe.getGraphicsAlgorithm().getY() + CONNECTION_POINT_SIZE / 2;
+ int lx = loc.getX();
+ int ly = loc.getY();
+ return lx-dist <= x && x <= lx+dist && ly-dist <= y && y <= ly+dist;
+ }
+ return false;
+ }
+
+ public static FreeFormConnection getConnectionPointOwner(Shape connectionPointShape) {
+ if (isConnectionPoint(connectionPointShape)) {
+ return (FreeFormConnection)connectionPointShape.getLink().getBusinessObjects().get(0);
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/BusinessObjectUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/BusinessObjectUtil.java
index 8e9626c..5aeeb72 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/BusinessObjectUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/BusinessObjectUtil.java
@@ -1,191 +1,191 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.util.Collection;
-
-import org.eclipse.bpmn2.Association;
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Conversation;
-import org.eclipse.bpmn2.DataInputAssociation;
-import org.eclipse.bpmn2.DataOutputAssociation;
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-public class BusinessObjectUtil {
-
- @SuppressWarnings("rawtypes")
- public static boolean containsElementOfType(PictogramElement elem, Class clazz) {
- if (elem.getLink() == null) {
- return false;
- }
- // if this is a connection point, look at business objects of the connection
- if (AnchorUtil.isConnectionPoint(elem)) {
- elem = AnchorUtil.getConnectionPointOwner((Shape)elem);
- }
- EList<EObject> businessObjs = elem.getLink().getBusinessObjects();
- for (EObject eObject : businessObjs) {
- if (clazz.isInstance(eObject)) {
- return true;
- }
- }
- return false;
- }
-
- @SuppressWarnings("rawtypes")
- public static boolean containsChildElementOfType(PictogramElement root, Class clazz) {
- if (AnchorUtil.isConnectionPoint(root)) {
- root = AnchorUtil.getConnectionPointOwner((Shape)root);
- }
- if (root instanceof ContainerShape) {
- ContainerShape rootContainer = (ContainerShape) root;
- for (Shape currentShape : rootContainer.getChildren()) {
- if (containsElementOfType(currentShape, clazz)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static <T extends EObject> T getFirstElementOfType(PictogramElement elem, Class<T> clazz) {
- return getFirstElementOfType(elem,clazz,false);
- }
-
- @SuppressWarnings("unchecked")
- public static <T extends EObject> T getFirstElementOfType(PictogramElement elem, Class<T> clazz, boolean searchParents) {
- if (elem.getLink() == null) {
- if (searchParents) {
- while (elem!=null && elem.getLink()==null && elem.eContainer() instanceof PictogramElement)
- elem = (PictogramElement)elem.eContainer();
- }
- if (elem==null || elem.getLink() == null)
- return null;
- }
- // if this is a connection point, look at business objects of the connection
- if (AnchorUtil.isConnectionPoint(elem)) {
- elem = AnchorUtil.getConnectionPointOwner((Shape)elem);
- }
- EList<EObject> businessObjs = elem.getLink().getBusinessObjects();
- for (EObject eObject : businessObjs) {
- if (clazz.isInstance(eObject)) {
- return (T) eObject;
- }
- }
- return null;
- }
-
- public static BaseElement getFirstBaseElement(PictogramElement pe) {
- return BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class);
- }
-
- public static PictogramElement getFirstBaseElementFromDiagram(Diagram diagram, BaseElement e) {
- PictogramElement foundElem = null;
-
- IPeService peService = Graphiti.getPeService();
- Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
- for (PictogramElement pe : elements) {
- BaseElement be = getFirstElementOfType(pe, e.getClass());
- if (be != null && be.equals(e)) {
- foundElem = pe;
- break;
- }
- }
-
- return foundElem;
- }
-
- public static PictogramElement getPictogramElementFromDiagram(Diagram diagram, BPMNShape bpmnShape) {
- PictogramElement foundElem = null;
-
- IPeService peService = Graphiti.getPeService();
- Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
- for (PictogramElement pe : elements) {
- BPMNShape s = getFirstElementOfType(pe, BPMNShape.class);
- if (s != null && s.equals(bpmnShape)) {
- foundElem = pe;
- break;
- }
- }
-
- return foundElem;
- }
-
- public static PictogramElement getPictogramElementForSelection(ISelection selection) {
- EditPart editPart = getEditPartForSelection(selection);
- if (editPart != null && editPart.getModel() instanceof PictogramElement) {
- return (PictogramElement) editPart.getModel();
- }
- if (selection instanceof IStructuredSelection) {
- Object o = ((IStructuredSelection)selection).getFirstElement();
- if (o instanceof PictogramElement)
- return (PictogramElement)o;
- }
- return null;
- }
-
- public static EObject getBusinessObjectForSelection(ISelection selection) {
- PictogramElement pe = getPictogramElementForSelection(selection);
- if (pe!=null)
- return getFirstElementOfType(pe, EObject.class);
- return null;
- }
-
- public static EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- if (pe!=null) {
- Object be = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
- if (be instanceof EObject)
- return (EObject) be;
- }
- return null;
- }
-
- public static EditPart getEditPartForSelection(ISelection selection) {
- if (selection instanceof IStructuredSelection &&
- ((IStructuredSelection) selection).isEmpty()==false) {
-
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- EditPart editPart = null;
- if (firstElement instanceof EditPart) {
- editPart = (EditPart) firstElement;
- } else if (firstElement instanceof IAdaptable) {
- editPart = (EditPart) ((IAdaptable) firstElement).getAdapter(EditPart.class);
- }
- return editPart;
- }
- return null;
- }
-
- public static boolean isConnection(Class be) {
- return
- be == SequenceFlow.class ||
- be == Association.class ||
- be == MessageFlow.class ||
- be == DataInputAssociation.class ||
- be == DataOutputAssociation.class ||
- be == Conversation.class;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.util.Collection;
+
+import org.eclipse.bpmn2.Association;
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Conversation;
+import org.eclipse.bpmn2.DataInputAssociation;
+import org.eclipse.bpmn2.DataOutputAssociation;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+public class BusinessObjectUtil {
+
+ @SuppressWarnings("rawtypes")
+ public static boolean containsElementOfType(PictogramElement elem, Class clazz) {
+ if (elem.getLink() == null) {
+ return false;
+ }
+ // if this is a connection point, look at business objects of the connection
+ if (AnchorUtil.isConnectionPoint(elem)) {
+ elem = AnchorUtil.getConnectionPointOwner((Shape)elem);
+ }
+ EList<EObject> businessObjs = elem.getLink().getBusinessObjects();
+ for (EObject eObject : businessObjs) {
+ if (clazz.isInstance(eObject)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public static boolean containsChildElementOfType(PictogramElement root, Class clazz) {
+ if (AnchorUtil.isConnectionPoint(root)) {
+ root = AnchorUtil.getConnectionPointOwner((Shape)root);
+ }
+ if (root instanceof ContainerShape) {
+ ContainerShape rootContainer = (ContainerShape) root;
+ for (Shape currentShape : rootContainer.getChildren()) {
+ if (containsElementOfType(currentShape, clazz)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static <T extends EObject> T getFirstElementOfType(PictogramElement elem, Class<T> clazz) {
+ return getFirstElementOfType(elem,clazz,false);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T extends EObject> T getFirstElementOfType(PictogramElement elem, Class<T> clazz, boolean searchParents) {
+ if (elem.getLink() == null) {
+ if (searchParents) {
+ while (elem!=null && elem.getLink()==null && elem.eContainer() instanceof PictogramElement)
+ elem = (PictogramElement)elem.eContainer();
+ }
+ if (elem==null || elem.getLink() == null)
+ return null;
+ }
+ // if this is a connection point, look at business objects of the connection
+ if (AnchorUtil.isConnectionPoint(elem)) {
+ elem = AnchorUtil.getConnectionPointOwner((Shape)elem);
+ }
+ EList<EObject> businessObjs = elem.getLink().getBusinessObjects();
+ for (EObject eObject : businessObjs) {
+ if (clazz.isInstance(eObject)) {
+ return (T) eObject;
+ }
+ }
+ return null;
+ }
+
+ public static BaseElement getFirstBaseElement(PictogramElement pe) {
+ return BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class);
+ }
+
+ public static PictogramElement getFirstBaseElementFromDiagram(Diagram diagram, BaseElement e) {
+ PictogramElement foundElem = null;
+
+ IPeService peService = Graphiti.getPeService();
+ Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
+ for (PictogramElement pe : elements) {
+ BaseElement be = getFirstElementOfType(pe, e.getClass());
+ if (be != null && be.equals(e)) {
+ foundElem = pe;
+ break;
+ }
+ }
+
+ return foundElem;
+ }
+
+ public static PictogramElement getPictogramElementFromDiagram(Diagram diagram, BPMNShape bpmnShape) {
+ PictogramElement foundElem = null;
+
+ IPeService peService = Graphiti.getPeService();
+ Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
+ for (PictogramElement pe : elements) {
+ BPMNShape s = getFirstElementOfType(pe, BPMNShape.class);
+ if (s != null && s.equals(bpmnShape)) {
+ foundElem = pe;
+ break;
+ }
+ }
+
+ return foundElem;
+ }
+
+ public static PictogramElement getPictogramElementForSelection(ISelection selection) {
+ EditPart editPart = getEditPartForSelection(selection);
+ if (editPart != null && editPart.getModel() instanceof PictogramElement) {
+ return (PictogramElement) editPart.getModel();
+ }
+ if (selection instanceof IStructuredSelection) {
+ Object o = ((IStructuredSelection)selection).getFirstElement();
+ if (o instanceof PictogramElement)
+ return (PictogramElement)o;
+ }
+ return null;
+ }
+
+ public static EObject getBusinessObjectForSelection(ISelection selection) {
+ PictogramElement pe = getPictogramElementForSelection(selection);
+ if (pe!=null)
+ return getFirstElementOfType(pe, EObject.class);
+ return null;
+ }
+
+ public static EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ if (pe!=null) {
+ Object be = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
+ if (be instanceof EObject)
+ return (EObject) be;
+ }
+ return null;
+ }
+
+ public static EditPart getEditPartForSelection(ISelection selection) {
+ if (selection instanceof IStructuredSelection &&
+ ((IStructuredSelection) selection).isEmpty()==false) {
+
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ EditPart editPart = null;
+ if (firstElement instanceof EditPart) {
+ editPart = (EditPart) firstElement;
+ } else if (firstElement instanceof IAdaptable) {
+ editPart = (EditPart) ((IAdaptable) firstElement).getAdapter(EditPart.class);
+ }
+ return editPart;
+ }
+ return null;
+ }
+
+ public static boolean isConnection(Class be) {
+ return
+ be == SequenceFlow.class ||
+ be == Association.class ||
+ be == MessageFlow.class ||
+ be == DataInputAssociation.class ||
+ be == DataOutputAssociation.class ||
+ be == Conversation.class;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/DiagramEditorAdapter.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/DiagramEditorAdapter.java
index dfb3503..e54e9e3 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/DiagramEditorAdapter.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/DiagramEditorAdapter.java
@@ -1,34 +1,34 @@
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-
-public class DiagramEditorAdapter implements Adapter {
- /**
- *
- */
- private final DiagramEditor diagramEditor;
-
- /**
- * @param diagramEditor
- */
- public DiagramEditorAdapter(DiagramEditor bpmn2Editor) {
- this.diagramEditor = bpmn2Editor;
- }
- public Notifier getTarget() {
- return null;
- }
- public void setTarget(Notifier newTarget) {
- }
- public boolean isAdapterForType(Object type) {
- return type == DiagramEditorAdapter.class ||
- type == DiagramEditor.class;
- }
- public void notifyChanged(Notification notification) {
- }
- public DiagramEditor getDiagramEditor() {
- return this.diagramEditor;
- }
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+
+public class DiagramEditorAdapter implements Adapter {
+ /**
+ *
+ */
+ private final DiagramEditor diagramEditor;
+
+ /**
+ * @param diagramEditor
+ */
+ public DiagramEditorAdapter(DiagramEditor bpmn2Editor) {
+ this.diagramEditor = bpmn2Editor;
+ }
+ public Notifier getTarget() {
+ return null;
+ }
+ public void setTarget(Notifier newTarget) {
+ }
+ public boolean isAdapterForType(Object type) {
+ return type == DiagramEditorAdapter.class ||
+ type == DiagramEditor.class;
+ }
+ public void notifyChanged(Notification notification) {
+ }
+ public DiagramEditor getDiagramEditor() {
+ return this.diagramEditor;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java
index 3f01c64..1cfa2e3 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java
@@ -1,673 +1,673 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import static org.eclipse.bpmn2.modeler.core.features.activity.AbstractAddActivityFeature.ACTIVITY_DECORATOR;
-
-import java.awt.Dimension;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.emf.common.util.ECollections;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.context.ITargetContext;
-import org.eclipse.graphiti.mm.algorithms.AbstractText;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class FeatureSupport {
- public static final String IS_HORIZONTAL_PROPERTY = "isHorizontal";
-
- public static boolean isTargetSubProcess(ITargetContext context) {
- return BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), SubProcess.class);
- }
-
- public static boolean isTargetLane(ITargetContext context) {
- return isLane(context.getTargetContainer());
- }
-
- public static boolean isLane(PictogramElement element) {
- return BusinessObjectUtil.containsElementOfType(element, Lane.class);
- }
-
- public static Lane getTargetLane(ITargetContext context) {
- PictogramElement element = context.getTargetContainer();
- return BusinessObjectUtil.getFirstElementOfType(element, Lane.class);
- }
-
- public static boolean isTargetParticipant(ITargetContext context) {
- return isParticipant(context.getTargetContainer());
- }
-
- public static boolean isParticipant(PictogramElement element) {
- return BusinessObjectUtil.containsElementOfType(element, Participant.class);
- }
-
- public static Participant getTargetParticipant(ITargetContext context) {
- PictogramElement element = context.getTargetContainer();
- return BusinessObjectUtil.getFirstElementOfType(element, Participant.class);
- }
-
- public static boolean isLaneOnTop(Lane lane) {
- return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
- }
-
- public static boolean isTargetLaneOnTop(ITargetContext context) {
- Lane lane = BusinessObjectUtil.getFirstElementOfType(context.getTargetContainer(), Lane.class);
- return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
- }
-
- public static boolean isHorizontal(ContainerShape container) {
- EObject parent = container.eContainer();
- if (parent instanceof PictogramElement) {
- // participant bands are always "vertical" so that
- // the label is drawn horizontally by the LayoutFeature
- if (BusinessObjectUtil.getFirstElementOfType((PictogramElement)parent, ChoreographyTask.class) != null)
- return false;
- }
- String v = Graphiti.getPeService().getPropertyValue(container, IS_HORIZONTAL_PROPERTY);
- if (v==null) {
- return Bpmn2Preferences.getInstance().isHorizontalDefault();
- }
- return Boolean.parseBoolean(v);
- }
-
- public static void setHorizontal(ContainerShape container, boolean isHorizontal) {
- Graphiti.getPeService().setPropertyValue(container, IS_HORIZONTAL_PROPERTY, Boolean.toString(isHorizontal));
- BPMNShape bs = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
- if (bs!=null)
- bs.setIsHorizontal(isHorizontal);
- }
-
- public static boolean isHorizontal(IContext context) {
- Object v = context.getProperty(IS_HORIZONTAL_PROPERTY);
- if (v==null) {
- // TODO: get default orientation from preferences
- return true;
- }
- return (Boolean)v;
- }
-
- public static void setHorizontal(IContext context, boolean isHorizontal) {
- context.putProperty(IS_HORIZONTAL_PROPERTY, isHorizontal);
- }
-
- public static List<PictogramElement> getContainerChildren(ContainerShape container) {
- List<PictogramElement> list = new ArrayList<PictogramElement>();
- for (PictogramElement pe : container.getChildren()) {
- String value = Graphiti.getPeService().getPropertyValue(pe, ACTIVITY_DECORATOR);
- if (value!=null && "true".equals(value))
- continue;
- list.add(pe);
- }
- return list;
- }
-
- public static List<PictogramElement> getContainerDecorators(ContainerShape container) {
- List<PictogramElement> list = new ArrayList<PictogramElement>();
- for (PictogramElement pe : container.getChildren()) {
- String value = Graphiti.getPeService().getPropertyValue(pe, ACTIVITY_DECORATOR);
- if (value!=null && "true".equals(value))
- list.add(pe);
- }
- return list;
- }
-
- public static void setContainerChildrenVisible(ContainerShape container, boolean visible) {
- for (PictogramElement pe : getContainerChildren(container)) {
- pe.setVisible(visible);
- if (pe instanceof AnchorContainer) {
- AnchorContainer ac = (AnchorContainer)pe;
- for (Anchor a : ac.getAnchors()) {
- for (Connection c : a.getOutgoingConnections()) {
- c.setVisible(visible);
- for (ConnectionDecorator decorator : c.getConnectionDecorators()) {
- decorator.setVisible(visible);
- }
- }
- }
- }
- }
- }
-
- /**
- * Use ModelHandler.getInstance(diagram) instead
- *
- * @param diagram
- * @return
- * @throws IOException
- */
- @Deprecated
- public static ModelHandler getModelHanderInstance(Diagram diagram) throws IOException {
- return ModelHandlerLocator.getModelHandler(diagram.eResource());
- }
-
- public static void redraw(ContainerShape container) {
- ContainerShape root = getRootContainer(container);
- resizeRecursively(root);
- postResizeFixLenghts(root);
- updateDI(root);
- }
-
- private static void updateDI(ContainerShape root) {
- Diagram diagram = Graphiti.getPeService().getDiagramForPictogramElement(root);
-
- Class<?> instanceClass = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class).eClass()
- .getInstanceClass();
- DIUtils.updateDIShape(root);
- }
-
- public static ContainerShape getRootContainer(ContainerShape container) {
- ContainerShape parent = container.getContainer();
- EObject bo = BusinessObjectUtil.getFirstElementOfType(parent, BaseElement.class);
- if (bo != null && (bo instanceof Lane || bo instanceof Participant)) {
- return getRootContainer(parent);
- }
- return container;
- }
-
- private static Dimension resize(ContainerShape container) {
- EObject elem = BusinessObjectUtil.getFirstElementOfType(container, BaseElement.class);
- IGaService service = Graphiti.getGaService();
- int height = 0;
- int width = container.getGraphicsAlgorithm().getWidth() - 30;
- boolean horz = isHorizontal(container);
- if (horz) {
- height = 0;
- width = container.getGraphicsAlgorithm().getWidth() - 30;
- }
- else {
- width = 0;
- height = container.getGraphicsAlgorithm().getHeight() - 30;
- }
-
- EList<Shape> children = container.getChildren();
- ECollections.sort(children, new SiblingLaneComparator());
- for (Shape s : children) {
- Object bo = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
- if (bo != null && (bo instanceof Lane || bo instanceof Participant) && !bo.equals(elem)) {
- GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
- if (horz) {
- service.setLocation(ga, 30, height);
- height += ga.getHeight() - 1;
- if (ga.getWidth() >= width) {
- width = ga.getWidth();
- } else {
- service.setSize(ga, width, ga.getHeight());
- }
- }
- else {
- service.setLocation(ga, width, 30);
- width += ga.getWidth() - 1;
- if (ga.getHeight() >= height) {
- height = ga.getHeight();
- } else {
- service.setSize(ga, ga.getWidth(), height);
- }
- }
- }
- }
-
- GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
-
- if (horz) {
- if (height == 0) {
- return new Dimension(ga.getWidth(), ga.getHeight());
- } else {
- int newWidth = width + 30;
- int newHeight = height + 1;
- service.setSize(ga, newWidth, newHeight);
-
- for (Shape s : children) {
- GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
- if (childGa instanceof Text) {
- Text text = (Text)childGa;
- text.setAngle(-90);
- service.setLocationAndSize(text, 5, 0, 15, newHeight);
- } else if (childGa instanceof Polyline) {
- Polyline line = (Polyline) childGa;
- Point p0 = line.getPoints().get(0);
- Point p1 = line.getPoints().get(1);
- p0.setX(30); p0.setY(0);
- p1.setX(30); p1.setY(newHeight);
- }
- }
-
- return new Dimension(newWidth, newHeight);
- }
- }
- else {
- if (width == 0) {
- return new Dimension(ga.getWidth(), ga.getHeight());
- } else {
- int newWidth = width + 1;
- int newHeight = height + 30;
- service.setSize(ga, newWidth, newHeight);
-
- for (Shape s : children) {
- GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
- if (childGa instanceof Text) {
- Text text = (Text)childGa;
- text.setAngle(0);
- service.setLocationAndSize(text, 0, 5, newWidth, 15);
- } else if (childGa instanceof Polyline) {
- Polyline line = (Polyline) childGa;
- Point p0 = line.getPoints().get(0);
- Point p1 = line.getPoints().get(1);
- p0.setX(0); p0.setY(30);
- p1.setX(newWidth); p1.setY(30);
- }
- }
-
- return new Dimension(newWidth, newHeight);
- }
- }
- }
-
- private static Dimension resizeRecursively(ContainerShape root) {
- BaseElement elem = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class);
- List<Dimension> dimensions = new ArrayList<Dimension>();
- IGaService service = Graphiti.getGaService();
- int foundContainers = 0;
- boolean horz = isHorizontal(root);
-
- for (Shape s : root.getChildren()) {
- Object bo = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
- if (checkForResize(elem, s, bo)) {
- foundContainers += 1;
- Dimension d = resizeRecursively((ContainerShape) s);
- if (d != null) {
- dimensions.add(d);
- }
- }
- }
-
- if (dimensions.isEmpty()) {
- GraphicsAlgorithm ga = root.getGraphicsAlgorithm();
- for (Shape s : root.getChildren()) {
- GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
- if (childGa instanceof Text) {
- if (horz) {
- Text text = (Text)childGa;
- text.setAngle(-90);
- service.setLocationAndSize(text, 5, 0, 15, ga.getHeight());
- }
- else {
- Text text = (Text)childGa;
- text.setAngle(0);
- service.setLocationAndSize(text, 0, 5, ga.getWidth(), 15);
- }
- } else if (childGa instanceof Polyline) {
- Polyline line = (Polyline) childGa;
- Point p0 = line.getPoints().get(0);
- Point p1 = line.getPoints().get(1);
- if (horz) {
- p0.setX(30); p0.setY(0);
- p1.setX(30); p1.setY(ga.getHeight());
- }
- else {
- p0.setX(0); p0.setY(30);
- p1.setX(ga.getWidth()); p1.setY(30);
- }
- }
- }
- return new Dimension(ga.getWidth(), ga.getHeight());
- }
-
- if (foundContainers > 0) {
- return resize(root);
- }
-
- return getMaxDimension(horz, dimensions);
- }
-
- /**
- * One can only resize lanes and participants
- */
- private static boolean checkForResize(BaseElement currentBo, Shape s, Object bo) {
- if (!(s instanceof ContainerShape)) {
- return false;
- }
- if (bo == null) {
- return false;
- }
- if (!(bo instanceof Lane || bo instanceof Participant)) {
- return false;
- }
- return !bo.equals(currentBo);
- }
-
- private static Dimension getMaxDimension(boolean horz, List<Dimension> dimensions) {
- if (dimensions.isEmpty()) {
- return null;
- }
- int height = 0;
- int width = 0;
-
- if (horz) {
- for (Dimension d : dimensions) {
- height += d.height;
- if (d.width > width) {
- width = d.width;
- }
- }
- }
- else {
- for (Dimension d : dimensions) {
- width += d.width;
- if (d.height > height) {
- height = d.height;
- }
- }
- }
- return new Dimension(width, height);
- }
-
- private static void postResizeFixLenghts(ContainerShape root) {
- IGaService service = Graphiti.getGaService();
- BaseElement elem = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class);
- GraphicsAlgorithm ga = root.getGraphicsAlgorithm();
- int width = ga.getWidth() - 30;
- int height = ga.getHeight() - 30;
- boolean horz = isHorizontal(root);
-
- for (Shape s : root.getChildren()) {
- Object o = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
- if (checkForResize(elem, s, o)) {
- GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
- if (horz)
- service.setSize(childGa, width, childGa.getHeight());
- else
- service.setSize(childGa, childGa.getWidth(), height);
- postResizeFixLenghts((ContainerShape) s);
- }
- }
- }
-
- public static String getShapeValue(IPictogramElementContext context) {
- String value = null;
-
- PictogramElement pe = context.getPictogramElement();
- if (pe instanceof ContainerShape) {
- ContainerShape cs = (ContainerShape) pe;
- for (Shape shape : cs.getChildren()) {
- if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
- AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
- value = text.getValue();
- }
- }
- }
- return value;
- }
-
- public static String getBusinessValue(IPictogramElementContext context) {
- Object o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
- if (o instanceof FlowElement) {
- FlowElement e = (FlowElement) o;
- return e.getName();
- } else if (o instanceof TextAnnotation) {
- TextAnnotation a = (TextAnnotation) o;
- return a.getText();
- } else if (o instanceof Participant) {
- Participant p = (Participant) o;
- return p.getName();
- } else if (o instanceof Lane) {
- Lane l = (Lane) o;
- return l.getName();
- }
- return null;
- }
-
- public static Participant getTargetParticipant(ITargetContext context, ModelHandler handler) {
- if (context.getTargetContainer() instanceof Diagram) {
- return handler.getInternalParticipant();
- }
-
- Object bo = BusinessObjectUtil.getFirstElementOfType(context.getTargetContainer(), BaseElement.class);
-
- if (bo instanceof Participant) {
- return (Participant) bo;
- }
-
- return handler.getParticipant(bo);
- }
-
- public static Shape getShape(ContainerShape container, String property, String expectedValue) {
- IPeService peService = Graphiti.getPeService();
- Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
- while (iterator.hasNext()) {
- Shape shape = iterator.next();
- String value = peService.getPropertyValue(shape, property);
- if (value != null && value.equals(expectedValue)) {
- return shape;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public static <T extends EObject> T getChildElementOfType(PictogramElement container, String property, String expectedValue, Class<T> clazz) {
- IPeService peService = Graphiti.getPeService();
- Iterator<PictogramElement> iterator = peService.getAllContainedPictogramElements(container).iterator();
- while (iterator.hasNext()) {
- PictogramElement pe = iterator.next();
- String value = peService.getPropertyValue(pe, property);
- if (value != null && value.equals(expectedValue) && clazz.isInstance(pe)) {
- return (T) pe;
- }
- }
- return null;
- }
-
- /**
- * Returns a list of {@link PictogramElement}s which contains an element to the
- * assigned businessObjectClazz, i.e. the list contains {@link PictogramElement}s
- * which meet the following constraint:<br>
- * <code>
- * foreach child of root:<br>
- * BusinessObjectUtil.containsChildElementOfType(child, businessObjectClazz) == true
- * </code>
- * @param root
- * @param businessObjectClazz
- * @return
- */
- @SuppressWarnings("rawtypes")
- public static List<PictogramElement> getChildsOfBusinessObjectType(ContainerShape root, Class businessObjectClazz) {
- List<PictogramElement> result = new ArrayList<PictogramElement>();
- for (Shape currentShape : root.getChildren()) {
- if (BusinessObjectUtil.containsChildElementOfType(currentShape, businessObjectClazz)) {
- result.add(currentShape);
- }
- }
- return result;
- }
-
- public static Shape getFirstLaneInContainer(ContainerShape root) {
- List<PictogramElement> laneShapes = getChildsOfBusinessObjectType(root, Lane.class);
- if (!laneShapes.isEmpty()) {
- Iterator<PictogramElement> iterator = laneShapes.iterator();
- PictogramElement result = iterator.next();
- GraphicsAlgorithm ga = result.getGraphicsAlgorithm();
- if (isHorizontal(root)) {
- while (iterator.hasNext()) {
- PictogramElement currentShape = iterator.next();
- if (currentShape.getGraphicsAlgorithm().getY() < ga.getY()) {
- result = currentShape;
- }
- }
- } else {
- while (iterator.hasNext()) {
- PictogramElement currentShape = iterator.next();
- if (currentShape.getGraphicsAlgorithm().getX() < ga.getX()) {
- result = currentShape;
- }
- }
- }
- return (Shape) result;
- }
- return root;
- }
-
- public static Shape getLastLaneInContainer(ContainerShape root) {
- List<PictogramElement> laneShapes = getChildsOfBusinessObjectType(root, Lane.class);
- if (!laneShapes.isEmpty()) {
- Iterator<PictogramElement> iterator = laneShapes.iterator();
- PictogramElement result = iterator.next();
- GraphicsAlgorithm ga = result.getGraphicsAlgorithm();
- if (isHorizontal(root)) {
- while (iterator.hasNext()) {
- PictogramElement currentShape = iterator.next();
- if (currentShape.getGraphicsAlgorithm().getY() > ga.getY()) {
- result = currentShape;
- }
- }
- } else {
- while (iterator.hasNext()) {
- PictogramElement currentShape = iterator.next();
- if (currentShape.getGraphicsAlgorithm().getX() > ga.getX()) {
- result = currentShape;
- }
- }
- }
- return (Shape) result;
- }
- return root;
- }
-
- public static ContainerShape getLaneBefore(ContainerShape container) {
- if (!BusinessObjectUtil.containsElementOfType(container, Lane.class)) {
- return null;
- }
-
- ContainerShape parentContainerShape = container.getContainer();
- if (parentContainerShape == null) {
- return null;
- }
-
- GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
- int x = ga.getX();
- int y = ga.getY();
- boolean isHorizontal = isHorizontal(container);
-
- ContainerShape result = null;
- for (PictogramElement picElem : getChildsOfBusinessObjectType(parentContainerShape, Lane.class)) {
- if (picElem instanceof ContainerShape && !picElem.equals(container)) {
- ContainerShape currentContainerShape = (ContainerShape) picElem;
- GraphicsAlgorithm currentGA = currentContainerShape.getGraphicsAlgorithm();
- if (isHorizontal) {
- if (currentGA.getY() < y) {
- if (result != null) {
- GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
- if (resultGA.getY() < currentGA.getY()) {
- result = currentContainerShape;
- }
- } else {
- result = currentContainerShape;
- }
- }
- } else {
- if (currentGA.getX() < x) {
- if (result != null) {
- GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
- if (resultGA.getX() < currentGA.getX()) {
- result = currentContainerShape;
- }
- } else {
- result = currentContainerShape;
- }
- }
- }
- }
- }
- return result;
- }
-
- public static ContainerShape getLaneAfter(ContainerShape container) {
- if (!BusinessObjectUtil.containsElementOfType(container, Lane.class)) {
- return null;
- }
-
- ContainerShape parentContainerShape = container.getContainer();
- if (parentContainerShape == null) {
- return null;
- }
-
- GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
- int x = ga.getX();
- int y = ga.getY();
- boolean isHorizontal = isHorizontal(container);
-
- ContainerShape result = null;
- for (PictogramElement picElem : getChildsOfBusinessObjectType(parentContainerShape, Lane.class)) {
- if (picElem instanceof ContainerShape && !picElem.equals(container)) {
- ContainerShape currentContainerShape = (ContainerShape) picElem;
- GraphicsAlgorithm currentGA = currentContainerShape.getGraphicsAlgorithm();
- if (isHorizontal) {
- if (currentGA.getY() > y) {
- if (result != null) {
- GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
- if (resultGA.getY() > currentGA.getY()) {
- result = currentContainerShape;
- }
- } else {
- result = currentContainerShape;
- }
- }
- } else {
- if (currentGA.getX() > x) {
- if (result != null) {
- GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
- if (resultGA.getX() > currentGA.getX()) {
- result = currentContainerShape;
- }
- } else {
- result = currentContainerShape;
- }
- }
- }
- }
- }
- return result;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import static org.eclipse.bpmn2.modeler.core.features.activity.AbstractAddActivityFeature.ACTIVITY_DECORATOR;
+
+import java.awt.Dimension;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.emf.common.util.ECollections;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.context.ITargetContext;
+import org.eclipse.graphiti.mm.algorithms.AbstractText;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class FeatureSupport {
+ public static final String IS_HORIZONTAL_PROPERTY = "isHorizontal";
+
+ public static boolean isTargetSubProcess(ITargetContext context) {
+ return BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), SubProcess.class);
+ }
+
+ public static boolean isTargetLane(ITargetContext context) {
+ return isLane(context.getTargetContainer());
+ }
+
+ public static boolean isLane(PictogramElement element) {
+ return BusinessObjectUtil.containsElementOfType(element, Lane.class);
+ }
+
+ public static Lane getTargetLane(ITargetContext context) {
+ PictogramElement element = context.getTargetContainer();
+ return BusinessObjectUtil.getFirstElementOfType(element, Lane.class);
+ }
+
+ public static boolean isTargetParticipant(ITargetContext context) {
+ return isParticipant(context.getTargetContainer());
+ }
+
+ public static boolean isParticipant(PictogramElement element) {
+ return BusinessObjectUtil.containsElementOfType(element, Participant.class);
+ }
+
+ public static Participant getTargetParticipant(ITargetContext context) {
+ PictogramElement element = context.getTargetContainer();
+ return BusinessObjectUtil.getFirstElementOfType(element, Participant.class);
+ }
+
+ public static boolean isLaneOnTop(Lane lane) {
+ return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
+ }
+
+ public static boolean isTargetLaneOnTop(ITargetContext context) {
+ Lane lane = BusinessObjectUtil.getFirstElementOfType(context.getTargetContainer(), Lane.class);
+ return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
+ }
+
+ public static boolean isHorizontal(ContainerShape container) {
+ EObject parent = container.eContainer();
+ if (parent instanceof PictogramElement) {
+ // participant bands are always "vertical" so that
+ // the label is drawn horizontally by the LayoutFeature
+ if (BusinessObjectUtil.getFirstElementOfType((PictogramElement)parent, ChoreographyTask.class) != null)
+ return false;
+ }
+ String v = Graphiti.getPeService().getPropertyValue(container, IS_HORIZONTAL_PROPERTY);
+ if (v==null) {
+ return Bpmn2Preferences.getInstance().isHorizontalDefault();
+ }
+ return Boolean.parseBoolean(v);
+ }
+
+ public static void setHorizontal(ContainerShape container, boolean isHorizontal) {
+ Graphiti.getPeService().setPropertyValue(container, IS_HORIZONTAL_PROPERTY, Boolean.toString(isHorizontal));
+ BPMNShape bs = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
+ if (bs!=null)
+ bs.setIsHorizontal(isHorizontal);
+ }
+
+ public static boolean isHorizontal(IContext context) {
+ Object v = context.getProperty(IS_HORIZONTAL_PROPERTY);
+ if (v==null) {
+ // TODO: get default orientation from preferences
+ return true;
+ }
+ return (Boolean)v;
+ }
+
+ public static void setHorizontal(IContext context, boolean isHorizontal) {
+ context.putProperty(IS_HORIZONTAL_PROPERTY, isHorizontal);
+ }
+
+ public static List<PictogramElement> getContainerChildren(ContainerShape container) {
+ List<PictogramElement> list = new ArrayList<PictogramElement>();
+ for (PictogramElement pe : container.getChildren()) {
+ String value = Graphiti.getPeService().getPropertyValue(pe, ACTIVITY_DECORATOR);
+ if (value!=null && "true".equals(value))
+ continue;
+ list.add(pe);
+ }
+ return list;
+ }
+
+ public static List<PictogramElement> getContainerDecorators(ContainerShape container) {
+ List<PictogramElement> list = new ArrayList<PictogramElement>();
+ for (PictogramElement pe : container.getChildren()) {
+ String value = Graphiti.getPeService().getPropertyValue(pe, ACTIVITY_DECORATOR);
+ if (value!=null && "true".equals(value))
+ list.add(pe);
+ }
+ return list;
+ }
+
+ public static void setContainerChildrenVisible(ContainerShape container, boolean visible) {
+ for (PictogramElement pe : getContainerChildren(container)) {
+ pe.setVisible(visible);
+ if (pe instanceof AnchorContainer) {
+ AnchorContainer ac = (AnchorContainer)pe;
+ for (Anchor a : ac.getAnchors()) {
+ for (Connection c : a.getOutgoingConnections()) {
+ c.setVisible(visible);
+ for (ConnectionDecorator decorator : c.getConnectionDecorators()) {
+ decorator.setVisible(visible);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Use ModelHandler.getInstance(diagram) instead
+ *
+ * @param diagram
+ * @return
+ * @throws IOException
+ */
+ @Deprecated
+ public static ModelHandler getModelHanderInstance(Diagram diagram) throws IOException {
+ return ModelHandlerLocator.getModelHandler(diagram.eResource());
+ }
+
+ public static void redraw(ContainerShape container) {
+ ContainerShape root = getRootContainer(container);
+ resizeRecursively(root);
+ postResizeFixLenghts(root);
+ updateDI(root);
+ }
+
+ private static void updateDI(ContainerShape root) {
+ Diagram diagram = Graphiti.getPeService().getDiagramForPictogramElement(root);
+
+ Class<?> instanceClass = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class).eClass()
+ .getInstanceClass();
+ DIUtils.updateDIShape(root);
+ }
+
+ public static ContainerShape getRootContainer(ContainerShape container) {
+ ContainerShape parent = container.getContainer();
+ EObject bo = BusinessObjectUtil.getFirstElementOfType(parent, BaseElement.class);
+ if (bo != null && (bo instanceof Lane || bo instanceof Participant)) {
+ return getRootContainer(parent);
+ }
+ return container;
+ }
+
+ private static Dimension resize(ContainerShape container) {
+ EObject elem = BusinessObjectUtil.getFirstElementOfType(container, BaseElement.class);
+ IGaService service = Graphiti.getGaService();
+ int height = 0;
+ int width = container.getGraphicsAlgorithm().getWidth() - 30;
+ boolean horz = isHorizontal(container);
+ if (horz) {
+ height = 0;
+ width = container.getGraphicsAlgorithm().getWidth() - 30;
+ }
+ else {
+ width = 0;
+ height = container.getGraphicsAlgorithm().getHeight() - 30;
+ }
+
+ EList<Shape> children = container.getChildren();
+ ECollections.sort(children, new SiblingLaneComparator());
+ for (Shape s : children) {
+ Object bo = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
+ if (bo != null && (bo instanceof Lane || bo instanceof Participant) && !bo.equals(elem)) {
+ GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
+ if (horz) {
+ service.setLocation(ga, 30, height);
+ height += ga.getHeight() - 1;
+ if (ga.getWidth() >= width) {
+ width = ga.getWidth();
+ } else {
+ service.setSize(ga, width, ga.getHeight());
+ }
+ }
+ else {
+ service.setLocation(ga, width, 30);
+ width += ga.getWidth() - 1;
+ if (ga.getHeight() >= height) {
+ height = ga.getHeight();
+ } else {
+ service.setSize(ga, ga.getWidth(), height);
+ }
+ }
+ }
+ }
+
+ GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
+
+ if (horz) {
+ if (height == 0) {
+ return new Dimension(ga.getWidth(), ga.getHeight());
+ } else {
+ int newWidth = width + 30;
+ int newHeight = height + 1;
+ service.setSize(ga, newWidth, newHeight);
+
+ for (Shape s : children) {
+ GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
+ if (childGa instanceof Text) {
+ Text text = (Text)childGa;
+ text.setAngle(-90);
+ service.setLocationAndSize(text, 5, 0, 15, newHeight);
+ } else if (childGa instanceof Polyline) {
+ Polyline line = (Polyline) childGa;
+ Point p0 = line.getPoints().get(0);
+ Point p1 = line.getPoints().get(1);
+ p0.setX(30); p0.setY(0);
+ p1.setX(30); p1.setY(newHeight);
+ }
+ }
+
+ return new Dimension(newWidth, newHeight);
+ }
+ }
+ else {
+ if (width == 0) {
+ return new Dimension(ga.getWidth(), ga.getHeight());
+ } else {
+ int newWidth = width + 1;
+ int newHeight = height + 30;
+ service.setSize(ga, newWidth, newHeight);
+
+ for (Shape s : children) {
+ GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
+ if (childGa instanceof Text) {
+ Text text = (Text)childGa;
+ text.setAngle(0);
+ service.setLocationAndSize(text, 0, 5, newWidth, 15);
+ } else if (childGa instanceof Polyline) {
+ Polyline line = (Polyline) childGa;
+ Point p0 = line.getPoints().get(0);
+ Point p1 = line.getPoints().get(1);
+ p0.setX(0); p0.setY(30);
+ p1.setX(newWidth); p1.setY(30);
+ }
+ }
+
+ return new Dimension(newWidth, newHeight);
+ }
+ }
+ }
+
+ private static Dimension resizeRecursively(ContainerShape root) {
+ BaseElement elem = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class);
+ List<Dimension> dimensions = new ArrayList<Dimension>();
+ IGaService service = Graphiti.getGaService();
+ int foundContainers = 0;
+ boolean horz = isHorizontal(root);
+
+ for (Shape s : root.getChildren()) {
+ Object bo = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
+ if (checkForResize(elem, s, bo)) {
+ foundContainers += 1;
+ Dimension d = resizeRecursively((ContainerShape) s);
+ if (d != null) {
+ dimensions.add(d);
+ }
+ }
+ }
+
+ if (dimensions.isEmpty()) {
+ GraphicsAlgorithm ga = root.getGraphicsAlgorithm();
+ for (Shape s : root.getChildren()) {
+ GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
+ if (childGa instanceof Text) {
+ if (horz) {
+ Text text = (Text)childGa;
+ text.setAngle(-90);
+ service.setLocationAndSize(text, 5, 0, 15, ga.getHeight());
+ }
+ else {
+ Text text = (Text)childGa;
+ text.setAngle(0);
+ service.setLocationAndSize(text, 0, 5, ga.getWidth(), 15);
+ }
+ } else if (childGa instanceof Polyline) {
+ Polyline line = (Polyline) childGa;
+ Point p0 = line.getPoints().get(0);
+ Point p1 = line.getPoints().get(1);
+ if (horz) {
+ p0.setX(30); p0.setY(0);
+ p1.setX(30); p1.setY(ga.getHeight());
+ }
+ else {
+ p0.setX(0); p0.setY(30);
+ p1.setX(ga.getWidth()); p1.setY(30);
+ }
+ }
+ }
+ return new Dimension(ga.getWidth(), ga.getHeight());
+ }
+
+ if (foundContainers > 0) {
+ return resize(root);
+ }
+
+ return getMaxDimension(horz, dimensions);
+ }
+
+ /**
+ * One can only resize lanes and participants
+ */
+ private static boolean checkForResize(BaseElement currentBo, Shape s, Object bo) {
+ if (!(s instanceof ContainerShape)) {
+ return false;
+ }
+ if (bo == null) {
+ return false;
+ }
+ if (!(bo instanceof Lane || bo instanceof Participant)) {
+ return false;
+ }
+ return !bo.equals(currentBo);
+ }
+
+ private static Dimension getMaxDimension(boolean horz, List<Dimension> dimensions) {
+ if (dimensions.isEmpty()) {
+ return null;
+ }
+ int height = 0;
+ int width = 0;
+
+ if (horz) {
+ for (Dimension d : dimensions) {
+ height += d.height;
+ if (d.width > width) {
+ width = d.width;
+ }
+ }
+ }
+ else {
+ for (Dimension d : dimensions) {
+ width += d.width;
+ if (d.height > height) {
+ height = d.height;
+ }
+ }
+ }
+ return new Dimension(width, height);
+ }
+
+ private static void postResizeFixLenghts(ContainerShape root) {
+ IGaService service = Graphiti.getGaService();
+ BaseElement elem = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class);
+ GraphicsAlgorithm ga = root.getGraphicsAlgorithm();
+ int width = ga.getWidth() - 30;
+ int height = ga.getHeight() - 30;
+ boolean horz = isHorizontal(root);
+
+ for (Shape s : root.getChildren()) {
+ Object o = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
+ if (checkForResize(elem, s, o)) {
+ GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
+ if (horz)
+ service.setSize(childGa, width, childGa.getHeight());
+ else
+ service.setSize(childGa, childGa.getWidth(), height);
+ postResizeFixLenghts((ContainerShape) s);
+ }
+ }
+ }
+
+ public static String getShapeValue(IPictogramElementContext context) {
+ String value = null;
+
+ PictogramElement pe = context.getPictogramElement();
+ if (pe instanceof ContainerShape) {
+ ContainerShape cs = (ContainerShape) pe;
+ for (Shape shape : cs.getChildren()) {
+ if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
+ AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
+ value = text.getValue();
+ }
+ }
+ }
+ return value;
+ }
+
+ public static String getBusinessValue(IPictogramElementContext context) {
+ Object o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
+ if (o instanceof FlowElement) {
+ FlowElement e = (FlowElement) o;
+ return e.getName();
+ } else if (o instanceof TextAnnotation) {
+ TextAnnotation a = (TextAnnotation) o;
+ return a.getText();
+ } else if (o instanceof Participant) {
+ Participant p = (Participant) o;
+ return p.getName();
+ } else if (o instanceof Lane) {
+ Lane l = (Lane) o;
+ return l.getName();
+ }
+ return null;
+ }
+
+ public static Participant getTargetParticipant(ITargetContext context, ModelHandler handler) {
+ if (context.getTargetContainer() instanceof Diagram) {
+ return handler.getInternalParticipant();
+ }
+
+ Object bo = BusinessObjectUtil.getFirstElementOfType(context.getTargetContainer(), BaseElement.class);
+
+ if (bo instanceof Participant) {
+ return (Participant) bo;
+ }
+
+ return handler.getParticipant(bo);
+ }
+
+ public static Shape getShape(ContainerShape container, String property, String expectedValue) {
+ IPeService peService = Graphiti.getPeService();
+ Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
+ while (iterator.hasNext()) {
+ Shape shape = iterator.next();
+ String value = peService.getPropertyValue(shape, property);
+ if (value != null && value.equals(expectedValue)) {
+ return shape;
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T extends EObject> T getChildElementOfType(PictogramElement container, String property, String expectedValue, Class<T> clazz) {
+ IPeService peService = Graphiti.getPeService();
+ Iterator<PictogramElement> iterator = peService.getAllContainedPictogramElements(container).iterator();
+ while (iterator.hasNext()) {
+ PictogramElement pe = iterator.next();
+ String value = peService.getPropertyValue(pe, property);
+ if (value != null && value.equals(expectedValue) && clazz.isInstance(pe)) {
+ return (T) pe;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns a list of {@link PictogramElement}s which contains an element to the
+ * assigned businessObjectClazz, i.e. the list contains {@link PictogramElement}s
+ * which meet the following constraint:<br>
+ * <code>
+ * foreach child of root:<br>
+ * BusinessObjectUtil.containsChildElementOfType(child, businessObjectClazz) == true
+ * </code>
+ * @param root
+ * @param businessObjectClazz
+ * @return
+ */
+ @SuppressWarnings("rawtypes")
+ public static List<PictogramElement> getChildsOfBusinessObjectType(ContainerShape root, Class businessObjectClazz) {
+ List<PictogramElement> result = new ArrayList<PictogramElement>();
+ for (Shape currentShape : root.getChildren()) {
+ if (BusinessObjectUtil.containsChildElementOfType(currentShape, businessObjectClazz)) {
+ result.add(currentShape);
+ }
+ }
+ return result;
+ }
+
+ public static Shape getFirstLaneInContainer(ContainerShape root) {
+ List<PictogramElement> laneShapes = getChildsOfBusinessObjectType(root, Lane.class);
+ if (!laneShapes.isEmpty()) {
+ Iterator<PictogramElement> iterator = laneShapes.iterator();
+ PictogramElement result = iterator.next();
+ GraphicsAlgorithm ga = result.getGraphicsAlgorithm();
+ if (isHorizontal(root)) {
+ while (iterator.hasNext()) {
+ PictogramElement currentShape = iterator.next();
+ if (currentShape.getGraphicsAlgorithm().getY() < ga.getY()) {
+ result = currentShape;
+ }
+ }
+ } else {
+ while (iterator.hasNext()) {
+ PictogramElement currentShape = iterator.next();
+ if (currentShape.getGraphicsAlgorithm().getX() < ga.getX()) {
+ result = currentShape;
+ }
+ }
+ }
+ return (Shape) result;
+ }
+ return root;
+ }
+
+ public static Shape getLastLaneInContainer(ContainerShape root) {
+ List<PictogramElement> laneShapes = getChildsOfBusinessObjectType(root, Lane.class);
+ if (!laneShapes.isEmpty()) {
+ Iterator<PictogramElement> iterator = laneShapes.iterator();
+ PictogramElement result = iterator.next();
+ GraphicsAlgorithm ga = result.getGraphicsAlgorithm();
+ if (isHorizontal(root)) {
+ while (iterator.hasNext()) {
+ PictogramElement currentShape = iterator.next();
+ if (currentShape.getGraphicsAlgorithm().getY() > ga.getY()) {
+ result = currentShape;
+ }
+ }
+ } else {
+ while (iterator.hasNext()) {
+ PictogramElement currentShape = iterator.next();
+ if (currentShape.getGraphicsAlgorithm().getX() > ga.getX()) {
+ result = currentShape;
+ }
+ }
+ }
+ return (Shape) result;
+ }
+ return root;
+ }
+
+ public static ContainerShape getLaneBefore(ContainerShape container) {
+ if (!BusinessObjectUtil.containsElementOfType(container, Lane.class)) {
+ return null;
+ }
+
+ ContainerShape parentContainerShape = container.getContainer();
+ if (parentContainerShape == null) {
+ return null;
+ }
+
+ GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
+ int x = ga.getX();
+ int y = ga.getY();
+ boolean isHorizontal = isHorizontal(container);
+
+ ContainerShape result = null;
+ for (PictogramElement picElem : getChildsOfBusinessObjectType(parentContainerShape, Lane.class)) {
+ if (picElem instanceof ContainerShape && !picElem.equals(container)) {
+ ContainerShape currentContainerShape = (ContainerShape) picElem;
+ GraphicsAlgorithm currentGA = currentContainerShape.getGraphicsAlgorithm();
+ if (isHorizontal) {
+ if (currentGA.getY() < y) {
+ if (result != null) {
+ GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
+ if (resultGA.getY() < currentGA.getY()) {
+ result = currentContainerShape;
+ }
+ } else {
+ result = currentContainerShape;
+ }
+ }
+ } else {
+ if (currentGA.getX() < x) {
+ if (result != null) {
+ GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
+ if (resultGA.getX() < currentGA.getX()) {
+ result = currentContainerShape;
+ }
+ } else {
+ result = currentContainerShape;
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ public static ContainerShape getLaneAfter(ContainerShape container) {
+ if (!BusinessObjectUtil.containsElementOfType(container, Lane.class)) {
+ return null;
+ }
+
+ ContainerShape parentContainerShape = container.getContainer();
+ if (parentContainerShape == null) {
+ return null;
+ }
+
+ GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
+ int x = ga.getX();
+ int y = ga.getY();
+ boolean isHorizontal = isHorizontal(container);
+
+ ContainerShape result = null;
+ for (PictogramElement picElem : getChildsOfBusinessObjectType(parentContainerShape, Lane.class)) {
+ if (picElem instanceof ContainerShape && !picElem.equals(container)) {
+ ContainerShape currentContainerShape = (ContainerShape) picElem;
+ GraphicsAlgorithm currentGA = currentContainerShape.getGraphicsAlgorithm();
+ if (isHorizontal) {
+ if (currentGA.getY() > y) {
+ if (result != null) {
+ GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
+ if (resultGA.getY() > currentGA.getY()) {
+ result = currentContainerShape;
+ }
+ } else {
+ result = currentContainerShape;
+ }
+ }
+ } else {
+ if (currentGA.getX() > x) {
+ if (result != null) {
+ GraphicsAlgorithm resultGA = result.getGraphicsAlgorithm();
+ if (resultGA.getX() > currentGA.getX()) {
+ result = currentContainerShape;
+ }
+ } else {
+ result = currentContainerShape;
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ImportUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ImportUtil.java
index d5f994c..a9e8f03 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ImportUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ImportUtil.java
@@ -1,644 +1,644 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Import;
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.ItemKind;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.util.Bpmn2Resource;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ImportUtil {
-
- /**
- * Convenience method for <code>addImport(Resource,Object)</code>
- *
- * @param modelObject - an EObject that is currently contained in a Resource
- * @param importObject - the import model object. This can be any of the following:
- * WSDL Definition object
- * XSDSchema object
- * BPMN2.0 Definitions object
- * Java Class object
- * @return the newly constructed Import
- */
- public static Import addImport(EObject modelObject, Object importObject) {
- Resource resource = modelObject.eResource();
- return ImportUtil.addImport(resource,importObject);
- }
-
- /**
- * Create and add an Import object to the given BPMN2 Resource. This will also create
- * all of the defined ItemDefinition, Message, Operation and Interface objects as
- * defined in the imported resource "importObject".
- *
- * @param resource - the target Resource. The new Import will be added to the RootElements in
- * the Definitions object.
- * @param importObject - the import model object. This can be any of the following:
- * WSDL Definition object
- * XSDSchema object
- * BPMN2.0 Definitions object
- * Java Class object
- * @return the newly constructed Import
- */
- public static Import addImport(Resource resource, final Object importObject) {
- Import imp = null;
- if (resource instanceof Bpmn2Resource) {
- final Definitions definitions = (Definitions) resource.getContents().get(0).eContents().get(0);
-
- if (importObject instanceof org.eclipse.wst.wsdl.Definition) {
- // WSDL Definition
- Definition wsdlDefinition = (Definition)importObject;
-
- imp = Bpmn2ModelerFactory.create(Import.class);
- imp.setImportType("http://schemas.xmlsoap.org/wsdl/");
- imp.setLocation(wsdlDefinition.getLocation());
- imp.setNamespace(wsdlDefinition.getTargetNamespace());
- }
- else if (importObject instanceof XSDSchema){
- // XSD Schema
- XSDSchema schema = (XSDSchema)importObject;
-
- imp = Bpmn2ModelerFactory.create(Import.class);
- imp.setImportType("http://www.w3.org/2001/XMLSchema");
- imp.setLocation(schema.getSchemaLocation());
- imp.setNamespace(schema.getTargetNamespace());
- }
- else if (importObject instanceof Class) {
- // Java class
- Class clazz = (Class)importObject;
- // TODO: create a location URI for the class file
-// ClassLoader cl = clazz.getClassLoader();
-// String name = clazz.getName().replaceAll("\\.", "/").concat(".class");
-// java.net.URL url = cl.getResource(name);
-// URI uri = URI.createPlatformPluginURI(url.getPath(), true);
- imp = Bpmn2ModelerFactory.create(Import.class);
- imp.setImportType("http://www.java.com/javaTypes");
- imp.setLocation(clazz.getName());
- imp.setNamespace("http://" + clazz.getPackage().getName());
- }
- else if (importObject instanceof org.eclipse.bpmn2.Definitions) {
- // BPMN 2.0 Diagram file
- Definitions defs = (Definitions)importObject;
-
- imp = Bpmn2ModelerFactory.create(Import.class);
- imp.setImportType("http://www.omg.org/spec/BPMN/20100524/MODEL");
- imp.setLocation(defs.eResource().getURI().toString());
- imp.setNamespace(defs.getTargetNamespace());
- }
-
- if (imp!=null) {
- // make sure this is a new one!
- for (Import i : definitions.getImports()) {
- String location = i.getLocation();
- if (location!=null && location.equals(imp.getLocation())) {
- imp = null;
- break;
- }
- }
- }
-
- if (imp!=null) {
- definitions.getImports().add(imp);
- NamespaceUtil.addNamespace(imp.eResource(), imp.getNamespace());
-
- if (importObject instanceof org.eclipse.wst.wsdl.Definition) {
- // WSDL Definition
- Definition wsdlDefinition = (Definition)importObject;
-
- for (Binding b :(List<Binding>)wsdlDefinition.getEBindings()) {
- createInterface(definitions, imp, b.getEPortType());
- }
- }
- else if (importObject instanceof XSDSchema){
- XSDSchema schema = (XSDSchema)importObject;
-
- for (XSDElementDeclaration elem : schema.getElementDeclarations()) {
- createItemDefinition(definitions, imp, elem, ItemKind.INFORMATION);
- }
- }
- else if (importObject instanceof Class) {
- Class clazz = (Class)importObject;
-
- createItemDefinition(definitions, imp, clazz);
- }
- else if (importObject instanceof org.eclipse.bpmn2.Definitions) {
- // what to do here?
- }
- }
- }
- return imp;
- }
-
- /**
- * Remove the given Import object and delete all of its associated elements (i.e. ItemDefinition,
- * Message, Operation and Interface) that were defined in the Import.
- *
- * @param imp - the Import to remove
- * @return true if the Import object was removed, false if not
- */
- public static boolean removeImport(Import imp) {
- Definitions definitions = ModelUtil.getDefinitions(imp);
- boolean canRemove = true;
- boolean canRemoveNamespace = true;
- String location = imp.getLocation();
- String namespace = imp.getNamespace();
- for (Import i : definitions.getImports()) {
- if (i!=imp) {
- String loc1 = i.getLocation();
- String ns1 = i.getNamespace();
- // different import locations, same namespace?
- if (loc1!=null && location!=null && !loc1.equals(location) &&
- ns1!=null && namespace!=null && ns1.equals(namespace)) {
- // this namespace is still in use by another import!
- canRemoveNamespace = false;
- break;
- }
- }
- }
-
- if (canRemoveNamespace)
- NamespaceUtil.removeNamespace(imp.eResource(), namespace);
-
- if (canRemove) {
- String type = imp.getImportType();
- String loc = imp.getLocation();
-
- if ("http://schemas.xmlsoap.org/wsdl/".equals(type)) {
- List<Interface> list = ModelUtil.getAllRootElements(definitions, Interface.class);
- for (Interface intf : list) {
- Object ref = intf.getImplementationRef();
- if (ref instanceof EObject) {
- URI uri = EcoreUtil.getURI((EObject)ref);
- String uriString = uri.trimFragment().toString();
- if (loc.equals(uriString))
- deleteInterface(definitions, intf);
- }
- }
- }
- else if ("http://www.w3.org/2001/XMLSchema".equals(type)) {
- List<ItemDefinition> list = ModelUtil.getAllRootElements(definitions, ItemDefinition.class);
- for (ItemDefinition itemDef : list) {
- Object ref = itemDef.getStructureRef();
- if (ref instanceof EObject) {
- URI uri = EcoreUtil.getURI((EObject)ref);
- String uriString = uri.trimFragment().toString();
- if (loc.equals(uriString))
- EcoreUtil.delete(itemDef);
- }
- }
- }
- else if ("http://www.java.com/javaTypes".equals(type)) {
- String className = imp.getLocation();
- boolean deleted = false;
- IJavaProject[] projects = JavaProjectClassLoader.findProject(className);
- for (int i=0; i<projects.length; ++i) {
- JavaProjectClassLoader loader = new JavaProjectClassLoader(projects[i]);
- Class clazz = loader.findClass(className);
- if (clazz!=null) {
- deleteItemDefinition(definitions, imp, clazz);
- deleted = true;
- }
- }
- if (!deleted)
- deleteItemDefinition(definitions, imp, className);
- }
- else if ("http://www.omg.org/spec/BPMN/20100524/MODEL".equals(type)) {
-
- }
- definitions.getImports().remove(imp);
- }
- return canRemove;
- }
-
- /**
- * Create a new Interface object. If an identical Interface already exists, a new one is not created.
- * This also creates all of the Operations, Messages and ItemDefinitions that are defined in the
- * "portType" element.
- *
- * @param definitions - the BPMN2 Definitions parent object; the new Interface is added to its rootElements
- * @param imp - the Import object where the WSDL Port Type is defined
- * @param portType - the WSDL Port Type that corresponds to this Interface
- * @return the newly created object, or an existing Interface with the same name and implementation reference
- */
- public static Interface createInterface(Definitions definitions, Import imp, PortType portType) {
- Interface intf = Bpmn2ModelerFactory.create(Interface.class);
- intf.setName(portType.getQName().getLocalPart());
- intf.setImplementationRef(portType);
- Interface i = findInterface(definitions,intf);
- if (i!=null)
- return i;
-
- definitions.getRootElements().add(intf);
- ModelUtil.setID(intf);
- createOperations(definitions, imp, intf, portType);
-
- return intf;
- }
-
- /**
- * Delete an existing Interface object. This also deletes all of the Operations, Messages and ItemDefinitions
- * that are referenced by the Interface.
- *
- * @param definitions - the BPMN2 Definitions parent object that contains the Interface
- * @param intf - the Interface object to remove
- */
- public static void deleteInterface(Definitions definitions, Interface intf) {
- deleteOperations(definitions,intf);
- EcoreUtil.delete(intf);
- }
-
- /**
- * Search for an existing Interface object that is identical to the one specified.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param intf - an Interface to search for
- * @return the Interface if it already exists, null if not
- */
- public static Interface findInterface(Definitions definitions, Interface intf) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(intf, ExtendedPropertiesAdapter.class);
- if (adapter!=null) {
- List <Interface> list = ModelUtil.getAllRootElements(definitions, Interface.class);
- for (Interface i : list) {
- if (adapter.getObjectDescriptor().equals(i))
- return i;
- }
- }
- return null;
- }
-
- /**
- * Create a new Operation object and add it to the given Interface.
- * This also creates all of the Messages, Errors and ItemDefinitions that are defined in the
- * "portType" element.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the Interface is defined
- * @param intf - the Interface to which this Operation will be added
- * @param portType - the WSDL Port Type that corresponds to this Interface
- */
- public static void createOperations(Definitions definitions, Import imp, Interface intf, PortType portType) {
- for (Operation wsdlop : (List<Operation>)portType.getEOperations()) {
- org.eclipse.bpmn2.Operation bpmn2op = Bpmn2ModelerFactory.create(org.eclipse.bpmn2.Operation.class);
- bpmn2op.setImplementationRef(wsdlop);
- bpmn2op.setName(wsdlop.getName());
-
- Input input = wsdlop.getEInput();
- if (input!=null) {
- org.eclipse.bpmn2.Message bpmn2msg = createMessage(definitions, imp, input.getEMessage());
- bpmn2op.setInMessageRef(bpmn2msg);
- }
-
- Output output = wsdlop.getEOutput();
- if (output!=null) {
- org.eclipse.bpmn2.Message bpmn2msg = createMessage(definitions, imp, output.getEMessage());
- bpmn2op.setOutMessageRef(bpmn2msg);
- }
-
- for (Fault fault : (List<Fault>)wsdlop.getEFaults()) {
- bpmn2op.getErrorRefs().add(createError(definitions, imp, fault));
- }
-
- if (findOperation(definitions, bpmn2op)==null) {
- intf.getOperations().add(bpmn2op);
- ModelUtil.setID(bpmn2op);
- }
- }
- }
-
- /**
- * Remove all Operations from the given Interface.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param intf - the Interface from which Operations will be removed
- */
- public static void deleteOperations(Definitions definitions, Interface intf) {
- List<org.eclipse.bpmn2.Operation> opList = new ArrayList<org.eclipse.bpmn2.Operation>();
- for (org.eclipse.bpmn2.Operation bpmn2op : intf.getOperations()) {
- opList.add(bpmn2op);
- }
- for (org.eclipse.bpmn2.Operation bpmn2op : opList) {
- org.eclipse.bpmn2.Message m;
- m = bpmn2op.getInMessageRef();
- if (m!=null) {
- deleteMessage(definitions,m);
- }
- m = bpmn2op.getOutMessageRef();
- if (m!=null) {
- deleteMessage(definitions,m);
- }
-
- List<org.eclipse.bpmn2.Error> errorList = new ArrayList<org.eclipse.bpmn2.Error>();
- errorList.addAll(bpmn2op.getErrorRefs());
- for (org.eclipse.bpmn2.Error e : errorList) {
- ItemDefinition itemDef = e.getStructureRef();
- if (itemDef!=null)
- EcoreUtil.delete(itemDef);
- EcoreUtil.delete(e);
- }
- EcoreUtil.delete(bpmn2op);
- }
- }
-
- /**
- * Search for an existing Operation object that is identical to the one specified.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param bpmn2op - an Operation to search for
- * @return the Operation if it already exists, null if not
- */
- public static org.eclipse.bpmn2.Operation findOperation(Definitions definitions, org.eclipse.bpmn2.Operation bpmn2op) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(bpmn2op, ExtendedPropertiesAdapter.class);
- if (adapter!=null) {
- List<org.eclipse.bpmn2.Operation> list = ModelUtil.getAllRootElements(definitions, org.eclipse.bpmn2.Operation.class);
- for (org.eclipse.bpmn2.Operation o : list) {
- if (adapter.getObjectDescriptor().equals(o))
- return (org.eclipse.bpmn2.Operation)o;
- }
- }
- return null;
- }
- /**
- * Create a new Message object and add it to the rootElements in the given Definitions.
- * This also creates all of the ItemDefinitions that are defined in the "wsdlmsg" element.
- * If a Message that matches the new one already exists, it is returned instead.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the WSDL Message is defined
- * @param wsdlmsg - a WSDL Message object used to create the BPMN2 Message
- * @return the newly created object, or an existing Message that is identical to the given WSDL Message
- */
- public static org.eclipse.bpmn2.Message createMessage(Definitions definitions, Import imp, Message wsdlmsg) {
- org.eclipse.bpmn2.Message bpmn2msg = Bpmn2ModelerFactory.create(org.eclipse.bpmn2.Message.class);
- ItemDefinition itemDef = createItemDefinition(definitions, imp, wsdlmsg);
- bpmn2msg.setItemRef(itemDef);
- bpmn2msg.setName(wsdlmsg.getQName().getLocalPart());
-
- org.eclipse.bpmn2.Message m = findMessage(definitions, bpmn2msg);
- if (m!=null)
- return m;
-
- definitions.getRootElements().add(bpmn2msg);
- ModelUtil.setID(bpmn2msg);
-
- return bpmn2msg;
- }
-
- /**
- * Remove the given Message and its related ItemDefinitions.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param msg - the Message object to be removed
- */
- public static void deleteMessage(Definitions definitions, org.eclipse.bpmn2.Message msg) {
- ItemDefinition itemDef = msg.getItemRef();
- if (itemDef!=null)
- EcoreUtil.delete(itemDef);
- EcoreUtil.delete(msg);
- }
-
- /**
- * Search for an existing Message object that is identical to the one specified.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param msg - a Message to search for
- * @return the Operation if it already exists, null if not
- */
- public static org.eclipse.bpmn2.Message findMessage(Definitions definitions, org.eclipse.bpmn2.Message msg) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(msg, ExtendedPropertiesAdapter.class);
- if (adapter!=null) {
- List<org.eclipse.bpmn2.Message> list = ModelUtil.getAllRootElements(definitions, org.eclipse.bpmn2.Message.class);
- for (org.eclipse.bpmn2.Message m : list) {
- if (adapter.getObjectDescriptor().equals(m))
- return (org.eclipse.bpmn2.Message)m;
- }
- }
- return null;
- }
-
- /**
- * Create a new Error object and add it to the rootElements in the given Definitions.
- * This also creates all of the ItemDefinitions that are defined in the WSDL "fault" element.
- * If an Error that matches the new one already exists, it is returned instead.
- * WSDL Fault types always create "INFORMATION" ItemDefinitions.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the WSDL Fault is defined
- * @param fault - a WSDL Fault object used to create the new BPMN2 Error
- * @return the newly created object, or an existing Error that is identical to the given WSDL Fault
- */
- public static org.eclipse.bpmn2.Error createError(Definitions definitions, Import imp, Fault fault) {
- org.eclipse.bpmn2.Error error = Bpmn2ModelerFactory.create(org.eclipse.bpmn2.Error.class);
- ItemDefinition itemDef = createItemDefinition(definitions, imp, fault, ItemKind.INFORMATION);
- error.setName(fault.getName());
- error.setStructureRef(itemDef);
- org.eclipse.bpmn2.Error e = findError(definitions, error);
- if (e!=null)
- return e;
-
- definitions.getRootElements().add(error);
- ModelUtil.setID(error);
-
- return error;
- }
-
- /**
- * Search for an existing Error object that is identical to the one specified.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param error - an Error to search for
- * @return the Error if it already exists, null if not
- */
- public static org.eclipse.bpmn2.Error findError(Definitions definitions, org.eclipse.bpmn2.Error error) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(error, ExtendedPropertiesAdapter.class);
- if (adapter!=null) {
- List<org.eclipse.bpmn2.Error> list = ModelUtil.getAllRootElements(definitions, org.eclipse.bpmn2.Error.class);
- for (org.eclipse.bpmn2.Error e : list) {
- if (adapter.getObjectDescriptor().equals(e))
- return (org.eclipse.bpmn2.Error)e;
- }
- }
- return null;
- }
-
- /**
- * Create a new ItemDefinition for the given WSDL Message. The WSDL Message becomes the target of the
- * ItemDefinition's structureRef. WSDL Message types always create "INFORMATION" ItemDefinitions.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the WSDL Message is defined
- * @param wsdlmsg - a WSDL Message object that defines the structure of the ItemDefinition
- * @return the newly created object, or an existing ItemDefinition that is identical to the given WSDL Message
- */
- public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, Message wsdlmsg) {
- return createItemDefinition(definitions, imp, wsdlmsg, ItemKind.INFORMATION);
- }
-
- /**
- * Create a new ItemDefinition for the given Java type. This also creates ItemDefinitions for any
- * internal Classes or Interfaces that are defined in the given Class. Java types always create
- * "PHYSICAL" ItemDefinitions.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the Java type is defined
- * @param clazz - the Java Class object that defines the structure of the ItemDefinition
- * @return the newly created object, or an existing ItemDefinition that is identical to the given Java type
- */
- public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, Class clazz) {
- for (Class c : clazz.getDeclaredClasses()) {
- createItemDefinition(definitions, imp, c);
- }
- return createItemDefinition(definitions, imp, clazz.getName(), ItemKind.PHYSICAL);
- }
-
- /**
- * Create a new ItemDefinition for an arbitrary String type. The String is wrapped in a DynamicEObjectImpl
- * (a.k.a. "String Wrapper") so that it can be handled as a proxy EObject
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the String type is defined
- * @param structName - the type string that defines the structure of the ItemDefinition
- * @param kind - the ItemKind, either PHYSICAL or INFORMATION
- * @return the newly created object, or an existing ItemDefinition that is identical to the given String type
- */
- public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, String structName, ItemKind kind) {
- EObject structureRef = ModelUtil.createStringWrapper(structName);
- return createItemDefinition(definitions, imp, structureRef, kind);
- }
-
-
- /**
- * Create a new ItemDefinition for an arbitrary String type. The String is wrapped in a DynamicEObjectImpl
- * (a.k.a. "String Wrapper") so that it can be handled as a proxy EObject
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the EObject is defined
- * @param structureRef - the EObject that defines the structure of the ItemDefinition
- * @param kind - the ItemKind, either PHYSICAL or INFORMATION
- * @return the newly created object, or an existing ItemDefinition that is identical to the given String type
- */
- public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, EObject structureRef, ItemKind kind) {
- ItemDefinition itemDef = Bpmn2ModelerFactory.create(ItemDefinition.class);
- itemDef.setImport(imp);
- itemDef.setItemKind(kind);
- itemDef.setStructureRef(structureRef);
- ItemDefinition i = findItemDefinition(definitions, itemDef);
- if (i!=null)
- return i;
-
- definitions.getRootElements().add(itemDef);
- ModelUtil.setID(itemDef);
-
- return itemDef;
- }
-
- /**
- * Convenience method for findItemDefinition(Definitions,ItemDefinition)
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the EObject is defined
- * @param structureRef - the EObject that defines the structure of the ItemDefinition
- * @param kind - the ItemKind, either PHYSICAL or INFORMATION
- * @return the ItemDefinition object if found, or null
- */
- public static ItemDefinition findItemDefinition(Definitions definitions, Import imp, EObject structureRef, ItemKind kind) {
- ItemDefinition itemDef = Bpmn2ModelerFactory.create(ItemDefinition.class);
- itemDef.setImport(imp);
- itemDef.setItemKind(kind);
- itemDef.setStructureRef(structureRef);
- return findItemDefinition(definitions, itemDef);
- }
-
- /**
- * Search for an existing ItemDefinition object that is identical to the one specified.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param itemDef - an ItemDefinition to search for
- * @return the ItemDefinition if it already exists, null if not
- */
- public static ItemDefinition findItemDefinition(Definitions definitions, ItemDefinition itemDef) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(itemDef, ExtendedPropertiesAdapter.class);
- if (adapter!=null) {
- List<ItemDefinition> list = ModelUtil.getAllRootElements(definitions, ItemDefinition.class);
- for (ItemDefinition i : list) {
- if (adapter.getObjectDescriptor().equals(i))
- return (ItemDefinition)i;
- }
- }
- return null;
- }
-
- /**
- * Remove an ItemDefinition for the given Java type. This also removes the ItemDefinitions for
- * all inner classes and interfaces.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the Java type is defined
- * @param clazz - the Java Class object that defines the structure of the ItemDefinition
- */
- public static void deleteItemDefinition(Definitions definitions, Import imp, Class clazz) {
- for (Class c : clazz.getDeclaredClasses()) {
- deleteItemDefinition(definitions, imp, c);
- }
- EObject structureRef = ModelUtil.createStringWrapper(clazz.getName());
- ItemDefinition itemDef = findItemDefinition(definitions, imp, structureRef, ItemKind.PHYSICAL);
- if (itemDef!=null) {
- EcoreUtil.delete(itemDef);
- }
- }
-
- /**
- * Remove an ItemDefinition for the given String type. This will search for both PHYSICAL and
- * INFORMATION definitions.
- *
- * @param definitions - the BPMN2 Definitions parent object
- * @param imp - the Import object where the String type is defined
- * @param structName - the type string that defines the structure of the ItemDefinition
- */
- public static void deleteItemDefinition(Definitions definitions, Import imp, String structName) {
- EObject structureRef = ModelUtil.createStringWrapper(structName);
- ItemDefinition itemDef = findItemDefinition(definitions, imp, structureRef, ItemKind.PHYSICAL);
- if (itemDef==null)
- itemDef = findItemDefinition(definitions, imp, structureRef, ItemKind.INFORMATION);
-
- if (itemDef!=null) {
- EcoreUtil.delete(itemDef);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Import;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.ItemKind;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.util.Bpmn2Resource;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.wst.wsdl.Binding;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.Fault;
+import org.eclipse.wst.wsdl.Input;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Operation;
+import org.eclipse.wst.wsdl.Output;
+import org.eclipse.wst.wsdl.PortType;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ImportUtil {
+
+ /**
+ * Convenience method for <code>addImport(Resource,Object)</code>
+ *
+ * @param modelObject - an EObject that is currently contained in a Resource
+ * @param importObject - the import model object. This can be any of the following:
+ * WSDL Definition object
+ * XSDSchema object
+ * BPMN2.0 Definitions object
+ * Java Class object
+ * @return the newly constructed Import
+ */
+ public static Import addImport(EObject modelObject, Object importObject) {
+ Resource resource = modelObject.eResource();
+ return ImportUtil.addImport(resource,importObject);
+ }
+
+ /**
+ * Create and add an Import object to the given BPMN2 Resource. This will also create
+ * all of the defined ItemDefinition, Message, Operation and Interface objects as
+ * defined in the imported resource "importObject".
+ *
+ * @param resource - the target Resource. The new Import will be added to the RootElements in
+ * the Definitions object.
+ * @param importObject - the import model object. This can be any of the following:
+ * WSDL Definition object
+ * XSDSchema object
+ * BPMN2.0 Definitions object
+ * Java Class object
+ * @return the newly constructed Import
+ */
+ public static Import addImport(Resource resource, final Object importObject) {
+ Import imp = null;
+ if (resource instanceof Bpmn2Resource) {
+ final Definitions definitions = (Definitions) resource.getContents().get(0).eContents().get(0);
+
+ if (importObject instanceof org.eclipse.wst.wsdl.Definition) {
+ // WSDL Definition
+ Definition wsdlDefinition = (Definition)importObject;
+
+ imp = Bpmn2ModelerFactory.create(Import.class);
+ imp.setImportType("http://schemas.xmlsoap.org/wsdl/");
+ imp.setLocation(wsdlDefinition.getLocation());
+ imp.setNamespace(wsdlDefinition.getTargetNamespace());
+ }
+ else if (importObject instanceof XSDSchema){
+ // XSD Schema
+ XSDSchema schema = (XSDSchema)importObject;
+
+ imp = Bpmn2ModelerFactory.create(Import.class);
+ imp.setImportType("http://www.w3.org/2001/XMLSchema");
+ imp.setLocation(schema.getSchemaLocation());
+ imp.setNamespace(schema.getTargetNamespace());
+ }
+ else if (importObject instanceof Class) {
+ // Java class
+ Class clazz = (Class)importObject;
+ // TODO: create a location URI for the class file
+// ClassLoader cl = clazz.getClassLoader();
+// String name = clazz.getName().replaceAll("\\.", "/").concat(".class");
+// java.net.URL url = cl.getResource(name);
+// URI uri = URI.createPlatformPluginURI(url.getPath(), true);
+ imp = Bpmn2ModelerFactory.create(Import.class);
+ imp.setImportType("http://www.java.com/javaTypes");
+ imp.setLocation(clazz.getName());
+ imp.setNamespace("http://" + clazz.getPackage().getName());
+ }
+ else if (importObject instanceof org.eclipse.bpmn2.Definitions) {
+ // BPMN 2.0 Diagram file
+ Definitions defs = (Definitions)importObject;
+
+ imp = Bpmn2ModelerFactory.create(Import.class);
+ imp.setImportType("http://www.omg.org/spec/BPMN/20100524/MODEL");
+ imp.setLocation(defs.eResource().getURI().toString());
+ imp.setNamespace(defs.getTargetNamespace());
+ }
+
+ if (imp!=null) {
+ // make sure this is a new one!
+ for (Import i : definitions.getImports()) {
+ String location = i.getLocation();
+ if (location!=null && location.equals(imp.getLocation())) {
+ imp = null;
+ break;
+ }
+ }
+ }
+
+ if (imp!=null) {
+ definitions.getImports().add(imp);
+ NamespaceUtil.addNamespace(imp.eResource(), imp.getNamespace());
+
+ if (importObject instanceof org.eclipse.wst.wsdl.Definition) {
+ // WSDL Definition
+ Definition wsdlDefinition = (Definition)importObject;
+
+ for (Binding b :(List<Binding>)wsdlDefinition.getEBindings()) {
+ createInterface(definitions, imp, b.getEPortType());
+ }
+ }
+ else if (importObject instanceof XSDSchema){
+ XSDSchema schema = (XSDSchema)importObject;
+
+ for (XSDElementDeclaration elem : schema.getElementDeclarations()) {
+ createItemDefinition(definitions, imp, elem, ItemKind.INFORMATION);
+ }
+ }
+ else if (importObject instanceof Class) {
+ Class clazz = (Class)importObject;
+
+ createItemDefinition(definitions, imp, clazz);
+ }
+ else if (importObject instanceof org.eclipse.bpmn2.Definitions) {
+ // what to do here?
+ }
+ }
+ }
+ return imp;
+ }
+
+ /**
+ * Remove the given Import object and delete all of its associated elements (i.e. ItemDefinition,
+ * Message, Operation and Interface) that were defined in the Import.
+ *
+ * @param imp - the Import to remove
+ * @return true if the Import object was removed, false if not
+ */
+ public static boolean removeImport(Import imp) {
+ Definitions definitions = ModelUtil.getDefinitions(imp);
+ boolean canRemove = true;
+ boolean canRemoveNamespace = true;
+ String location = imp.getLocation();
+ String namespace = imp.getNamespace();
+ for (Import i : definitions.getImports()) {
+ if (i!=imp) {
+ String loc1 = i.getLocation();
+ String ns1 = i.getNamespace();
+ // different import locations, same namespace?
+ if (loc1!=null && location!=null && !loc1.equals(location) &&
+ ns1!=null && namespace!=null && ns1.equals(namespace)) {
+ // this namespace is still in use by another import!
+ canRemoveNamespace = false;
+ break;
+ }
+ }
+ }
+
+ if (canRemoveNamespace)
+ NamespaceUtil.removeNamespace(imp.eResource(), namespace);
+
+ if (canRemove) {
+ String type = imp.getImportType();
+ String loc = imp.getLocation();
+
+ if ("http://schemas.xmlsoap.org/wsdl/".equals(type)) {
+ List<Interface> list = ModelUtil.getAllRootElements(definitions, Interface.class);
+ for (Interface intf : list) {
+ Object ref = intf.getImplementationRef();
+ if (ref instanceof EObject) {
+ URI uri = EcoreUtil.getURI((EObject)ref);
+ String uriString = uri.trimFragment().toString();
+ if (loc.equals(uriString))
+ deleteInterface(definitions, intf);
+ }
+ }
+ }
+ else if ("http://www.w3.org/2001/XMLSchema".equals(type)) {
+ List<ItemDefinition> list = ModelUtil.getAllRootElements(definitions, ItemDefinition.class);
+ for (ItemDefinition itemDef : list) {
+ Object ref = itemDef.getStructureRef();
+ if (ref instanceof EObject) {
+ URI uri = EcoreUtil.getURI((EObject)ref);
+ String uriString = uri.trimFragment().toString();
+ if (loc.equals(uriString))
+ EcoreUtil.delete(itemDef);
+ }
+ }
+ }
+ else if ("http://www.java.com/javaTypes".equals(type)) {
+ String className = imp.getLocation();
+ boolean deleted = false;
+ IJavaProject[] projects = JavaProjectClassLoader.findProject(className);
+ for (int i=0; i<projects.length; ++i) {
+ JavaProjectClassLoader loader = new JavaProjectClassLoader(projects[i]);
+ Class clazz = loader.findClass(className);
+ if (clazz!=null) {
+ deleteItemDefinition(definitions, imp, clazz);
+ deleted = true;
+ }
+ }
+ if (!deleted)
+ deleteItemDefinition(definitions, imp, className);
+ }
+ else if ("http://www.omg.org/spec/BPMN/20100524/MODEL".equals(type)) {
+
+ }
+ definitions.getImports().remove(imp);
+ }
+ return canRemove;
+ }
+
+ /**
+ * Create a new Interface object. If an identical Interface already exists, a new one is not created.
+ * This also creates all of the Operations, Messages and ItemDefinitions that are defined in the
+ * "portType" element.
+ *
+ * @param definitions - the BPMN2 Definitions parent object; the new Interface is added to its rootElements
+ * @param imp - the Import object where the WSDL Port Type is defined
+ * @param portType - the WSDL Port Type that corresponds to this Interface
+ * @return the newly created object, or an existing Interface with the same name and implementation reference
+ */
+ public static Interface createInterface(Definitions definitions, Import imp, PortType portType) {
+ Interface intf = Bpmn2ModelerFactory.create(Interface.class);
+ intf.setName(portType.getQName().getLocalPart());
+ intf.setImplementationRef(portType);
+ Interface i = findInterface(definitions,intf);
+ if (i!=null)
+ return i;
+
+ definitions.getRootElements().add(intf);
+ ModelUtil.setID(intf);
+ createOperations(definitions, imp, intf, portType);
+
+ return intf;
+ }
+
+ /**
+ * Delete an existing Interface object. This also deletes all of the Operations, Messages and ItemDefinitions
+ * that are referenced by the Interface.
+ *
+ * @param definitions - the BPMN2 Definitions parent object that contains the Interface
+ * @param intf - the Interface object to remove
+ */
+ public static void deleteInterface(Definitions definitions, Interface intf) {
+ deleteOperations(definitions,intf);
+ EcoreUtil.delete(intf);
+ }
+
+ /**
+ * Search for an existing Interface object that is identical to the one specified.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param intf - an Interface to search for
+ * @return the Interface if it already exists, null if not
+ */
+ public static Interface findInterface(Definitions definitions, Interface intf) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(intf, ExtendedPropertiesAdapter.class);
+ if (adapter!=null) {
+ List <Interface> list = ModelUtil.getAllRootElements(definitions, Interface.class);
+ for (Interface i : list) {
+ if (adapter.getObjectDescriptor().equals(i))
+ return i;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create a new Operation object and add it to the given Interface.
+ * This also creates all of the Messages, Errors and ItemDefinitions that are defined in the
+ * "portType" element.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the Interface is defined
+ * @param intf - the Interface to which this Operation will be added
+ * @param portType - the WSDL Port Type that corresponds to this Interface
+ */
+ public static void createOperations(Definitions definitions, Import imp, Interface intf, PortType portType) {
+ for (Operation wsdlop : (List<Operation>)portType.getEOperations()) {
+ org.eclipse.bpmn2.Operation bpmn2op = Bpmn2ModelerFactory.create(org.eclipse.bpmn2.Operation.class);
+ bpmn2op.setImplementationRef(wsdlop);
+ bpmn2op.setName(wsdlop.getName());
+
+ Input input = wsdlop.getEInput();
+ if (input!=null) {
+ org.eclipse.bpmn2.Message bpmn2msg = createMessage(definitions, imp, input.getEMessage());
+ bpmn2op.setInMessageRef(bpmn2msg);
+ }
+
+ Output output = wsdlop.getEOutput();
+ if (output!=null) {
+ org.eclipse.bpmn2.Message bpmn2msg = createMessage(definitions, imp, output.getEMessage());
+ bpmn2op.setOutMessageRef(bpmn2msg);
+ }
+
+ for (Fault fault : (List<Fault>)wsdlop.getEFaults()) {
+ bpmn2op.getErrorRefs().add(createError(definitions, imp, fault));
+ }
+
+ if (findOperation(definitions, bpmn2op)==null) {
+ intf.getOperations().add(bpmn2op);
+ ModelUtil.setID(bpmn2op);
+ }
+ }
+ }
+
+ /**
+ * Remove all Operations from the given Interface.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param intf - the Interface from which Operations will be removed
+ */
+ public static void deleteOperations(Definitions definitions, Interface intf) {
+ List<org.eclipse.bpmn2.Operation> opList = new ArrayList<org.eclipse.bpmn2.Operation>();
+ for (org.eclipse.bpmn2.Operation bpmn2op : intf.getOperations()) {
+ opList.add(bpmn2op);
+ }
+ for (org.eclipse.bpmn2.Operation bpmn2op : opList) {
+ org.eclipse.bpmn2.Message m;
+ m = bpmn2op.getInMessageRef();
+ if (m!=null) {
+ deleteMessage(definitions,m);
+ }
+ m = bpmn2op.getOutMessageRef();
+ if (m!=null) {
+ deleteMessage(definitions,m);
+ }
+
+ List<org.eclipse.bpmn2.Error> errorList = new ArrayList<org.eclipse.bpmn2.Error>();
+ errorList.addAll(bpmn2op.getErrorRefs());
+ for (org.eclipse.bpmn2.Error e : errorList) {
+ ItemDefinition itemDef = e.getStructureRef();
+ if (itemDef!=null)
+ EcoreUtil.delete(itemDef);
+ EcoreUtil.delete(e);
+ }
+ EcoreUtil.delete(bpmn2op);
+ }
+ }
+
+ /**
+ * Search for an existing Operation object that is identical to the one specified.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param bpmn2op - an Operation to search for
+ * @return the Operation if it already exists, null if not
+ */
+ public static org.eclipse.bpmn2.Operation findOperation(Definitions definitions, org.eclipse.bpmn2.Operation bpmn2op) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(bpmn2op, ExtendedPropertiesAdapter.class);
+ if (adapter!=null) {
+ List<org.eclipse.bpmn2.Operation> list = ModelUtil.getAllRootElements(definitions, org.eclipse.bpmn2.Operation.class);
+ for (org.eclipse.bpmn2.Operation o : list) {
+ if (adapter.getObjectDescriptor().equals(o))
+ return (org.eclipse.bpmn2.Operation)o;
+ }
+ }
+ return null;
+ }
+ /**
+ * Create a new Message object and add it to the rootElements in the given Definitions.
+ * This also creates all of the ItemDefinitions that are defined in the "wsdlmsg" element.
+ * If a Message that matches the new one already exists, it is returned instead.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the WSDL Message is defined
+ * @param wsdlmsg - a WSDL Message object used to create the BPMN2 Message
+ * @return the newly created object, or an existing Message that is identical to the given WSDL Message
+ */
+ public static org.eclipse.bpmn2.Message createMessage(Definitions definitions, Import imp, Message wsdlmsg) {
+ org.eclipse.bpmn2.Message bpmn2msg = Bpmn2ModelerFactory.create(org.eclipse.bpmn2.Message.class);
+ ItemDefinition itemDef = createItemDefinition(definitions, imp, wsdlmsg);
+ bpmn2msg.setItemRef(itemDef);
+ bpmn2msg.setName(wsdlmsg.getQName().getLocalPart());
+
+ org.eclipse.bpmn2.Message m = findMessage(definitions, bpmn2msg);
+ if (m!=null)
+ return m;
+
+ definitions.getRootElements().add(bpmn2msg);
+ ModelUtil.setID(bpmn2msg);
+
+ return bpmn2msg;
+ }
+
+ /**
+ * Remove the given Message and its related ItemDefinitions.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param msg - the Message object to be removed
+ */
+ public static void deleteMessage(Definitions definitions, org.eclipse.bpmn2.Message msg) {
+ ItemDefinition itemDef = msg.getItemRef();
+ if (itemDef!=null)
+ EcoreUtil.delete(itemDef);
+ EcoreUtil.delete(msg);
+ }
+
+ /**
+ * Search for an existing Message object that is identical to the one specified.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param msg - a Message to search for
+ * @return the Operation if it already exists, null if not
+ */
+ public static org.eclipse.bpmn2.Message findMessage(Definitions definitions, org.eclipse.bpmn2.Message msg) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(msg, ExtendedPropertiesAdapter.class);
+ if (adapter!=null) {
+ List<org.eclipse.bpmn2.Message> list = ModelUtil.getAllRootElements(definitions, org.eclipse.bpmn2.Message.class);
+ for (org.eclipse.bpmn2.Message m : list) {
+ if (adapter.getObjectDescriptor().equals(m))
+ return (org.eclipse.bpmn2.Message)m;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create a new Error object and add it to the rootElements in the given Definitions.
+ * This also creates all of the ItemDefinitions that are defined in the WSDL "fault" element.
+ * If an Error that matches the new one already exists, it is returned instead.
+ * WSDL Fault types always create "INFORMATION" ItemDefinitions.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the WSDL Fault is defined
+ * @param fault - a WSDL Fault object used to create the new BPMN2 Error
+ * @return the newly created object, or an existing Error that is identical to the given WSDL Fault
+ */
+ public static org.eclipse.bpmn2.Error createError(Definitions definitions, Import imp, Fault fault) {
+ org.eclipse.bpmn2.Error error = Bpmn2ModelerFactory.create(org.eclipse.bpmn2.Error.class);
+ ItemDefinition itemDef = createItemDefinition(definitions, imp, fault, ItemKind.INFORMATION);
+ error.setName(fault.getName());
+ error.setStructureRef(itemDef);
+ org.eclipse.bpmn2.Error e = findError(definitions, error);
+ if (e!=null)
+ return e;
+
+ definitions.getRootElements().add(error);
+ ModelUtil.setID(error);
+
+ return error;
+ }
+
+ /**
+ * Search for an existing Error object that is identical to the one specified.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param error - an Error to search for
+ * @return the Error if it already exists, null if not
+ */
+ public static org.eclipse.bpmn2.Error findError(Definitions definitions, org.eclipse.bpmn2.Error error) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(error, ExtendedPropertiesAdapter.class);
+ if (adapter!=null) {
+ List<org.eclipse.bpmn2.Error> list = ModelUtil.getAllRootElements(definitions, org.eclipse.bpmn2.Error.class);
+ for (org.eclipse.bpmn2.Error e : list) {
+ if (adapter.getObjectDescriptor().equals(e))
+ return (org.eclipse.bpmn2.Error)e;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create a new ItemDefinition for the given WSDL Message. The WSDL Message becomes the target of the
+ * ItemDefinition's structureRef. WSDL Message types always create "INFORMATION" ItemDefinitions.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the WSDL Message is defined
+ * @param wsdlmsg - a WSDL Message object that defines the structure of the ItemDefinition
+ * @return the newly created object, or an existing ItemDefinition that is identical to the given WSDL Message
+ */
+ public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, Message wsdlmsg) {
+ return createItemDefinition(definitions, imp, wsdlmsg, ItemKind.INFORMATION);
+ }
+
+ /**
+ * Create a new ItemDefinition for the given Java type. This also creates ItemDefinitions for any
+ * internal Classes or Interfaces that are defined in the given Class. Java types always create
+ * "PHYSICAL" ItemDefinitions.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the Java type is defined
+ * @param clazz - the Java Class object that defines the structure of the ItemDefinition
+ * @return the newly created object, or an existing ItemDefinition that is identical to the given Java type
+ */
+ public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, Class clazz) {
+ for (Class c : clazz.getDeclaredClasses()) {
+ createItemDefinition(definitions, imp, c);
+ }
+ return createItemDefinition(definitions, imp, clazz.getName(), ItemKind.PHYSICAL);
+ }
+
+ /**
+ * Create a new ItemDefinition for an arbitrary String type. The String is wrapped in a DynamicEObjectImpl
+ * (a.k.a. "String Wrapper") so that it can be handled as a proxy EObject
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the String type is defined
+ * @param structName - the type string that defines the structure of the ItemDefinition
+ * @param kind - the ItemKind, either PHYSICAL or INFORMATION
+ * @return the newly created object, or an existing ItemDefinition that is identical to the given String type
+ */
+ public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, String structName, ItemKind kind) {
+ EObject structureRef = ModelUtil.createStringWrapper(structName);
+ return createItemDefinition(definitions, imp, structureRef, kind);
+ }
+
+
+ /**
+ * Create a new ItemDefinition for an arbitrary String type. The String is wrapped in a DynamicEObjectImpl
+ * (a.k.a. "String Wrapper") so that it can be handled as a proxy EObject
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the EObject is defined
+ * @param structureRef - the EObject that defines the structure of the ItemDefinition
+ * @param kind - the ItemKind, either PHYSICAL or INFORMATION
+ * @return the newly created object, or an existing ItemDefinition that is identical to the given String type
+ */
+ public static ItemDefinition createItemDefinition(Definitions definitions, Import imp, EObject structureRef, ItemKind kind) {
+ ItemDefinition itemDef = Bpmn2ModelerFactory.create(ItemDefinition.class);
+ itemDef.setImport(imp);
+ itemDef.setItemKind(kind);
+ itemDef.setStructureRef(structureRef);
+ ItemDefinition i = findItemDefinition(definitions, itemDef);
+ if (i!=null)
+ return i;
+
+ definitions.getRootElements().add(itemDef);
+ ModelUtil.setID(itemDef);
+
+ return itemDef;
+ }
+
+ /**
+ * Convenience method for findItemDefinition(Definitions,ItemDefinition)
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the EObject is defined
+ * @param structureRef - the EObject that defines the structure of the ItemDefinition
+ * @param kind - the ItemKind, either PHYSICAL or INFORMATION
+ * @return the ItemDefinition object if found, or null
+ */
+ public static ItemDefinition findItemDefinition(Definitions definitions, Import imp, EObject structureRef, ItemKind kind) {
+ ItemDefinition itemDef = Bpmn2ModelerFactory.create(ItemDefinition.class);
+ itemDef.setImport(imp);
+ itemDef.setItemKind(kind);
+ itemDef.setStructureRef(structureRef);
+ return findItemDefinition(definitions, itemDef);
+ }
+
+ /**
+ * Search for an existing ItemDefinition object that is identical to the one specified.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param itemDef - an ItemDefinition to search for
+ * @return the ItemDefinition if it already exists, null if not
+ */
+ public static ItemDefinition findItemDefinition(Definitions definitions, ItemDefinition itemDef) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(itemDef, ExtendedPropertiesAdapter.class);
+ if (adapter!=null) {
+ List<ItemDefinition> list = ModelUtil.getAllRootElements(definitions, ItemDefinition.class);
+ for (ItemDefinition i : list) {
+ if (adapter.getObjectDescriptor().equals(i))
+ return (ItemDefinition)i;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Remove an ItemDefinition for the given Java type. This also removes the ItemDefinitions for
+ * all inner classes and interfaces.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the Java type is defined
+ * @param clazz - the Java Class object that defines the structure of the ItemDefinition
+ */
+ public static void deleteItemDefinition(Definitions definitions, Import imp, Class clazz) {
+ for (Class c : clazz.getDeclaredClasses()) {
+ deleteItemDefinition(definitions, imp, c);
+ }
+ EObject structureRef = ModelUtil.createStringWrapper(clazz.getName());
+ ItemDefinition itemDef = findItemDefinition(definitions, imp, structureRef, ItemKind.PHYSICAL);
+ if (itemDef!=null) {
+ EcoreUtil.delete(itemDef);
+ }
+ }
+
+ /**
+ * Remove an ItemDefinition for the given String type. This will search for both PHYSICAL and
+ * INFORMATION definitions.
+ *
+ * @param definitions - the BPMN2 Definitions parent object
+ * @param imp - the Import object where the String type is defined
+ * @param structName - the type string that defines the structure of the ItemDefinition
+ */
+ public static void deleteItemDefinition(Definitions definitions, Import imp, String structName) {
+ EObject structureRef = ModelUtil.createStringWrapper(structName);
+ ItemDefinition itemDef = findItemDefinition(definitions, imp, structureRef, ItemKind.PHYSICAL);
+ if (itemDef==null)
+ itemDef = findItemDefinition(definitions, imp, structureRef, ItemKind.INFORMATION);
+
+ if (itemDef!=null) {
+ EcoreUtil.delete(itemDef);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaProjectClassLoader.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaProjectClassLoader.java
index 4fad099..cd4b999 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaProjectClassLoader.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaProjectClassLoader.java
@@ -1,170 +1,170 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.io.File;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jdt.internal.core.JavaProject;
-import org.eclipse.jdt.launching.JavaRuntime;
-
-public class JavaProjectClassLoader extends ClassLoader {
- private IJavaProject javaProject;
- private static final String PROTOCOL_PREFIX = "file:///";
-
- public JavaProjectClassLoader(IJavaProject project) {
- super();
- if (project == null || !project.exists())
- throw new IllegalArgumentException("Invalid javaProject");
- this.javaProject = project;
- }
-
- public Class findClass(String className) {
- try {
- String[] classPaths = JavaRuntime.computeDefaultRuntimeClassPath(javaProject);
- URL[] urls = new URL[classPaths.length];
- for (int i = 0; i < classPaths.length; i++)
- urls[i] = new URL(PROTOCOL_PREFIX + computeForURLClassLoader(classPaths[i]));
- ClassLoader loader = new URLClassLoader(urls);
- Class classObject = loader.loadClass(className);
- return classObject;
-
- } catch (Exception e) {
- }
- return null;
- }
-
- public List<Class> findClasses(String classNamePattern) {
- final List<Class> results = new ArrayList<Class>();
- if (classNamePattern.endsWith(".java")) {
- classNamePattern = classNamePattern.substring(0,classNamePattern.lastIndexOf("."));
- }
- // find exact matches first
- findClasses(classNamePattern, results);
- // and then everything else
- if (!classNamePattern.endsWith("*")) {
- classNamePattern += "*";
- findClasses(classNamePattern, results);
- }
- return results;
- }
-
- public void findClasses(String classNamePattern, final List<Class> results) {
- SearchPattern pattern = SearchPattern.createPattern(classNamePattern,
- IJavaSearchConstants.TYPE, IJavaSearchConstants.TYPE,
- SearchPattern.R_PATTERN_MATCH);
- SearchEngine searchEngine = new SearchEngine();
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope((IJavaElement[]) new IJavaProject[] {javaProject});
- SearchRequestor requestor = new SearchRequestor() {
- public void acceptSearchMatch(SearchMatch match) {
- IJavaElement e = (IJavaElement) match.getElement();
- String elementName = e.getElementName();
- while (e!=null) {
- if (e instanceof IPackageFragment) {
- IPackageFragment pf = (IPackageFragment)e;
- String className = pf.getElementName() + "." + elementName;
- Class c = findClass(className);
- if (c!=null) {
- boolean found = false;
- for (Class cr : results) {
- if (cr.getName().equals(c.getName())) {
- found = true;
- break;
- }
- }
- if (!found)
- results.add(c);
- }
- }
- e = e.getParent();
- }
- }
- };
- try {
- searchEngine.search(
- pattern,
- new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
- scope,
- requestor,
- null);
- } catch (CoreException e) {
- }
- }
-
- public static IJavaProject[] findProject(final String className) {
- SearchPattern pattern = SearchPattern.createPattern(className,
- IJavaSearchConstants.TYPE, IJavaSearchConstants.TYPE,
- SearchPattern.R_EXACT_MATCH);
- final List<IJavaProject> results = new ArrayList<IJavaProject>();
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (IProject p : projects) {
- try {
- if (p.isOpen() && p.hasNature(JavaCore.NATURE_ID)) {
- final IJavaProject javaProject = JavaCore.create(p);
- SearchEngine searchEngine = new SearchEngine();
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope((IJavaElement[]) new IJavaProject[] {javaProject});
- SearchRequestor requestor = new SearchRequestor() {
- public void acceptSearchMatch(SearchMatch match) {
- IJavaElement e = (IJavaElement) match.getElement();
- String elementName = e.getElementName();
- while (e!=null) {
- if (e instanceof IPackageFragment) {
- IPackageFragment pf = (IPackageFragment)e;
- String n = pf.getElementName() + "." + elementName;
- if (className.equals(n))
- results.add(javaProject);
- }
- e = e.getParent();
- }
- }
- };
- searchEngine.search(
- pattern,
- new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
- scope,
- requestor,
- null);
- }
- } catch (Exception e) {
- }
- }
- return (IJavaProject[]) results.toArray(new IJavaProject[results.size()]);
- }
-
- private static String computeForURLClassLoader(String classpath) {
- if (!classpath.endsWith("/")) {
- File file = new File(classpath);
- if (file.exists() && file.isDirectory())
- classpath = classpath.concat("/");
- }
- return classpath;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jdt.launching.JavaRuntime;
+
+public class JavaProjectClassLoader extends ClassLoader {
+ private IJavaProject javaProject;
+ private static final String PROTOCOL_PREFIX = "file:///";
+
+ public JavaProjectClassLoader(IJavaProject project) {
+ super();
+ if (project == null || !project.exists())
+ throw new IllegalArgumentException("Invalid javaProject");
+ this.javaProject = project;
+ }
+
+ public Class findClass(String className) {
+ try {
+ String[] classPaths = JavaRuntime.computeDefaultRuntimeClassPath(javaProject);
+ URL[] urls = new URL[classPaths.length];
+ for (int i = 0; i < classPaths.length; i++)
+ urls[i] = new URL(PROTOCOL_PREFIX + computeForURLClassLoader(classPaths[i]));
+ ClassLoader loader = new URLClassLoader(urls);
+ Class classObject = loader.loadClass(className);
+ return classObject;
+
+ } catch (Exception e) {
+ }
+ return null;
+ }
+
+ public List<Class> findClasses(String classNamePattern) {
+ final List<Class> results = new ArrayList<Class>();
+ if (classNamePattern.endsWith(".java")) {
+ classNamePattern = classNamePattern.substring(0,classNamePattern.lastIndexOf("."));
+ }
+ // find exact matches first
+ findClasses(classNamePattern, results);
+ // and then everything else
+ if (!classNamePattern.endsWith("*")) {
+ classNamePattern += "*";
+ findClasses(classNamePattern, results);
+ }
+ return results;
+ }
+
+ public void findClasses(String classNamePattern, final List<Class> results) {
+ SearchPattern pattern = SearchPattern.createPattern(classNamePattern,
+ IJavaSearchConstants.TYPE, IJavaSearchConstants.TYPE,
+ SearchPattern.R_PATTERN_MATCH);
+ SearchEngine searchEngine = new SearchEngine();
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope((IJavaElement[]) new IJavaProject[] {javaProject});
+ SearchRequestor requestor = new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match) {
+ IJavaElement e = (IJavaElement) match.getElement();
+ String elementName = e.getElementName();
+ while (e!=null) {
+ if (e instanceof IPackageFragment) {
+ IPackageFragment pf = (IPackageFragment)e;
+ String className = pf.getElementName() + "." + elementName;
+ Class c = findClass(className);
+ if (c!=null) {
+ boolean found = false;
+ for (Class cr : results) {
+ if (cr.getName().equals(c.getName())) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ results.add(c);
+ }
+ }
+ e = e.getParent();
+ }
+ }
+ };
+ try {
+ searchEngine.search(
+ pattern,
+ new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
+ scope,
+ requestor,
+ null);
+ } catch (CoreException e) {
+ }
+ }
+
+ public static IJavaProject[] findProject(final String className) {
+ SearchPattern pattern = SearchPattern.createPattern(className,
+ IJavaSearchConstants.TYPE, IJavaSearchConstants.TYPE,
+ SearchPattern.R_EXACT_MATCH);
+ final List<IJavaProject> results = new ArrayList<IJavaProject>();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (IProject p : projects) {
+ try {
+ if (p.isOpen() && p.hasNature(JavaCore.NATURE_ID)) {
+ final IJavaProject javaProject = JavaCore.create(p);
+ SearchEngine searchEngine = new SearchEngine();
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope((IJavaElement[]) new IJavaProject[] {javaProject});
+ SearchRequestor requestor = new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match) {
+ IJavaElement e = (IJavaElement) match.getElement();
+ String elementName = e.getElementName();
+ while (e!=null) {
+ if (e instanceof IPackageFragment) {
+ IPackageFragment pf = (IPackageFragment)e;
+ String n = pf.getElementName() + "." + elementName;
+ if (className.equals(n))
+ results.add(javaProject);
+ }
+ e = e.getParent();
+ }
+ }
+ };
+ searchEngine.search(
+ pattern,
+ new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
+ scope,
+ requestor,
+ null);
+ }
+ } catch (Exception e) {
+ }
+ }
+ return (IJavaProject[]) results.toArray(new IJavaProject[results.size()]);
+ }
+
+ private static String computeForURLClassLoader(String classpath) {
+ if (!classpath.endsWith("/")) {
+ File file = new File(classpath);
+ if (file.exists() && file.isDirectory())
+ classpath = classpath.concat("/");
+ }
+ return classpath;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaReflectionUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaReflectionUtil.java
index a64dbc4..f31de1c 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaReflectionUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/JavaReflectionUtil.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-/**
- * As the name implies, this is a static class of java reflection utilities
- * @author Bob Brodt
- */
-public class JavaReflectionUtil {
-
- /**
- * Find the class with the given simple name in a package hierarchy.
- * The object is used as the starting point (deepest level)
- * and the search continues up the package hierarchy.
- *
- * @param object - any object in a package
- * @param simpleName - simple (non-qualified) class name to search for
- * @return - the class or null if not found
- */
- public static Class findClass(Object object, String simpleName) {
- ClassLoader cl = object.getClass().getClassLoader();
- String packageName = object.getClass().getPackage().getName();
- int index;
- while ((index = packageName.lastIndexOf(".")) != -1) {
- String className = packageName + "." + simpleName;
- try {
- return Class.forName(className, true, cl);
- } catch (ClassNotFoundException e) {
- }
- packageName = packageName.substring(0, index);
- }
- return null;
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+/**
+ * As the name implies, this is a static class of java reflection utilities
+ * @author Bob Brodt
+ */
+public class JavaReflectionUtil {
+
+ /**
+ * Find the class with the given simple name in a package hierarchy.
+ * The object is used as the starting point (deepest level)
+ * and the search continues up the package hierarchy.
+ *
+ * @param object - any object in a package
+ * @param simpleName - simple (non-qualified) class name to search for
+ * @return - the class or null if not found
+ */
+ public static Class findClass(Object object, String simpleName) {
+ ClassLoader cl = object.getClass().getClassLoader();
+ String packageName = object.getClass().getPackage().getName();
+ int index;
+ while ((index = packageName.lastIndexOf(".")) != -1) {
+ String className = packageName + "." + simpleName;
+ try {
+ return Class.forName(className, true, cl);
+ } catch (ClassNotFoundException e) {
+ }
+ packageName = packageName.substring(0, index);
+ }
+ return null;
+
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/NamespaceUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/NamespaceUtil.java
index 120e3ba..2c2c227 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/NamespaceUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/NamespaceUtil.java
@@ -1,176 +1,176 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.bpmn2.DocumentRoot;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-
-/**
- * @author Bob Brodt
- *
- */
-public class NamespaceUtil {
-
- public static Map<String,String> getXMLNSPrefixMap(Resource resource) {
- if (resource!=null) {
- EList<EObject> contents = resource.getContents();
- if (!contents.isEmpty() && contents.get(0) instanceof DocumentRoot) {
- return ((DocumentRoot)contents.get(0)).getXMLNSPrefixMap();
- }
- }
- return null;
- }
-
- public static String getNamespaceForPrefix(Resource resource, String prefix) {
- Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null)
- return map.get(prefix);
- return null;
- }
-
- public static String getPrefixForNamespace(Resource resource, String namespace) {
- Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null) {
- for (Entry<String, String> e : map.entrySet()) {
- String value = e.getValue();
- if (value!=null && value.equals(namespace))
- return e.getKey();
- }
- }
- return null;
- }
-
- public static boolean hasNamespace(Resource resource, String namespace) {
- Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null) {
- for (Entry<String, String> e : map.entrySet()) {
- String value = e.getValue();
- if (value!=null && value.equals(namespace))
- return true;
- }
- }
- return false;
- }
-
- public static boolean hasPrefix(Resource resource, String prefix) {
- Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null) {
- return map.containsKey(prefix);
- }
- return false;
- }
-
- public static String addNamespace(Resource resource, String namespace) {
- if (hasNamespace(resource,namespace))
- return null;
- // generate a prefix
- String prefix = null;
- Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null) {
- prefix = "ns";
- int index = 1;
- while (map.containsKey(prefix+index))
- ++index;
- prefix = addNamespace(resource, prefix+index, namespace);
- }
- return prefix;
- }
-
- public static String addNamespace(final Resource resource, final String prefix, final String namespace) {
- final Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null) {
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
- if (domain != null) {
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- map.put(prefix, namespace);
- }
- });
- }
- return prefix;
- }
- return null;
- }
-
- /**
- * Remove the namespace prefix mapping for a given namespace.
- *
- * @param object - any EObject in the BPMN2 Resource
- * @param namespace - the namespace to be removed
- * @return the namespace prefix if the mapping was successfully removed
- * or null otherwise
- */
- public static String removeNamespace(final Resource resource, final String namespace) {
- final Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null) {
- String prefix = null;
- for (Entry<String, String> e : map.entrySet()) {
- String value = e.getValue();
- if (value!=null && value.equals(namespace)) {
- prefix = e.getKey();
- break;
- }
- }
- if (prefix!=null && map.containsKey(prefix)) {
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
- if (domain != null) {
- final String p = prefix;
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- map.remove(p);
- }
- });
- }
- return prefix;
- }
- }
- return null;
- }
-
- /**
- * Remove the namespace prefix mapping for a given prefix.
- *
- * @param object - any EObject in the BPMN2 Resource
- * @param prefix - the namespace prefix to be removed
- * @return the namespace if the mapping was successfully removed
- * or null otherwise
- */
- public static String removeNamespaceForPrefix(final Resource resource, final String prefix) {
- final Map<String,String> map = getXMLNSPrefixMap(resource);
- if (map!=null && map.containsKey(prefix)) {
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
- if (domain != null) {
- String ns = map.get(prefix);
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- map.remove(prefix);
- }
- });
- return ns;
- }
- }
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.bpmn2.DocumentRoot;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class NamespaceUtil {
+
+ public static Map<String,String> getXMLNSPrefixMap(Resource resource) {
+ if (resource!=null) {
+ EList<EObject> contents = resource.getContents();
+ if (!contents.isEmpty() && contents.get(0) instanceof DocumentRoot) {
+ return ((DocumentRoot)contents.get(0)).getXMLNSPrefixMap();
+ }
+ }
+ return null;
+ }
+
+ public static String getNamespaceForPrefix(Resource resource, String prefix) {
+ Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null)
+ return map.get(prefix);
+ return null;
+ }
+
+ public static String getPrefixForNamespace(Resource resource, String namespace) {
+ Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null) {
+ for (Entry<String, String> e : map.entrySet()) {
+ String value = e.getValue();
+ if (value!=null && value.equals(namespace))
+ return e.getKey();
+ }
+ }
+ return null;
+ }
+
+ public static boolean hasNamespace(Resource resource, String namespace) {
+ Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null) {
+ for (Entry<String, String> e : map.entrySet()) {
+ String value = e.getValue();
+ if (value!=null && value.equals(namespace))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean hasPrefix(Resource resource, String prefix) {
+ Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null) {
+ return map.containsKey(prefix);
+ }
+ return false;
+ }
+
+ public static String addNamespace(Resource resource, String namespace) {
+ if (hasNamespace(resource,namespace))
+ return null;
+ // generate a prefix
+ String prefix = null;
+ Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null) {
+ prefix = "ns";
+ int index = 1;
+ while (map.containsKey(prefix+index))
+ ++index;
+ prefix = addNamespace(resource, prefix+index, namespace);
+ }
+ return prefix;
+ }
+
+ public static String addNamespace(final Resource resource, final String prefix, final String namespace) {
+ final Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null) {
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
+ if (domain != null) {
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ map.put(prefix, namespace);
+ }
+ });
+ }
+ return prefix;
+ }
+ return null;
+ }
+
+ /**
+ * Remove the namespace prefix mapping for a given namespace.
+ *
+ * @param object - any EObject in the BPMN2 Resource
+ * @param namespace - the namespace to be removed
+ * @return the namespace prefix if the mapping was successfully removed
+ * or null otherwise
+ */
+ public static String removeNamespace(final Resource resource, final String namespace) {
+ final Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null) {
+ String prefix = null;
+ for (Entry<String, String> e : map.entrySet()) {
+ String value = e.getValue();
+ if (value!=null && value.equals(namespace)) {
+ prefix = e.getKey();
+ break;
+ }
+ }
+ if (prefix!=null && map.containsKey(prefix)) {
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
+ if (domain != null) {
+ final String p = prefix;
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ map.remove(p);
+ }
+ });
+ }
+ return prefix;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Remove the namespace prefix mapping for a given prefix.
+ *
+ * @param object - any EObject in the BPMN2 Resource
+ * @param prefix - the namespace prefix to be removed
+ * @return the namespace if the mapping was successfully removed
+ * or null otherwise
+ */
+ public static String removeNamespaceForPrefix(final Resource resource, final String prefix) {
+ final Map<String,String> map = getXMLNSPrefixMap(resource);
+ if (map!=null && map.containsKey(prefix)) {
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
+ if (domain != null) {
+ String ns = map.get(prefix);
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ map.remove(prefix);
+ }
+ });
+ return ns;
+ }
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/SiblingLaneComparator.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/SiblingLaneComparator.java
index 18f3724..5138ede 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/SiblingLaneComparator.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/SiblingLaneComparator.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.utils;
-
-import java.util.Comparator;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-final class SiblingLaneComparator implements Comparator<Shape> {
- @Override
- public int compare(Shape o1, Shape o2) {
- Lane l1 = BusinessObjectUtil.getFirstElementOfType(o1, Lane.class);
- Lane l2 = BusinessObjectUtil.getFirstElementOfType(o2, Lane.class);
-
- if (l1 != null && l2 != null && l1.eContainer().equals(l2.eContainer())) {
- int y1 = o1.getGraphicsAlgorithm().getY();
- int y2 = o2.getGraphicsAlgorithm().getY();
- return new Integer(y1).compareTo(y2);
- }
- return 0;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.utils;
+
+import java.util.Comparator;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+final class SiblingLaneComparator implements Comparator<Shape> {
+ @Override
+ public int compare(Shape o1, Shape o2) {
+ Lane l1 = BusinessObjectUtil.getFirstElementOfType(o1, Lane.class);
+ Lane l2 = BusinessObjectUtil.getFirstElementOfType(o2, Lane.class);
+
+ if (l1 != null && l2 != null && l1.eContainer().equals(l2.eContainer())) {
+ int y1 = o1.getGraphicsAlgorithm().getY();
+ int y2 = o2.getGraphicsAlgorithm().getY();
+ return new Integer(y1).compareTo(y2);
+ }
+ return 0;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/Tuple.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/Tuple.java
index ccc0139..61d59f8 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/Tuple.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/Tuple.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Ivar Meikas
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.core.utils;
-
-public class Tuple<A extends Object, B extends Object> {
-
- private A first;
- private B second;
-
- public Tuple(A first, B second) {
- this.first = first;
- this.second = second;
- }
-
- public A getFirst() {
- return first;
- };
-
- public B getSecond() {
- return second;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Ivar Meikas
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.core.utils;
+
+public class Tuple<A extends Object, B extends Object> {
+
+ private A first;
+ private B second;
+
+ public Tuple(A first, B second) {
+ this.first = first;
+ this.second = second;
+ }
+
+ public A getFirst() {
+ return first;
+ };
+
+ public B getSecond() {
+ return second;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.core/util/enablements2xml.awk b/org.eclipse.bpmn2.modeler.core/util/enablements2xml.awk
index 43af590..b63ee75 100644
--- a/org.eclipse.bpmn2.modeler.core/util/enablements2xml.awk
+++ b/org.eclipse.bpmn2.modeler.core/util/enablements2xml.awk
@@ -1,30 +1,30 @@
-# Simple awk script to convert Tool Enablement settings to something more suitable for inclusion in plugin.xml
-BEGIN {
- FS = "[\\.=]";
- OFS = "";
- skip = "";
-}
-
-{
- if (NF==2)
- {
- # start of a new object
- if ($2 ~ "false")
- {
- skip = $1;
- }
- else
- {
- print "\t\t\t<enable object=\"", $1, "\"/>"
- skip = "";
- }
- }
- else if (NF==3)
- {
- if (skip=="" && $3 ~ "false")
- {
- # some feature of current object
- print "\t\t\t<disable object=\"", $1, "\" feature=\"", $2, "\"/>"
- }
- }
-}
+# Simple awk script to convert Tool Enablement settings to something more suitable for inclusion in plugin.xml
+BEGIN {
+ FS = "[\\.=]";
+ OFS = "";
+ skip = "";
+}
+
+{
+ if (NF==2)
+ {
+ # start of a new object
+ if ($2 ~ "false")
+ {
+ skip = $1;
+ }
+ else
+ {
+ print "\t\t\t<enable object=\"", $1, "\"/>"
+ skip = "";
+ }
+ }
+ else if (NF==3)
+ {
+ if (skip=="" && $3 ~ "false")
+ {
+ # some feature of current object
+ print "\t\t\t<disable object=\"", $1, "\" feature=\"", $2, "\"/>"
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.feature/.project b/org.eclipse.bpmn2.modeler.feature/.project
index b5441df..3fb2d3d 100644
--- a/org.eclipse.bpmn2.modeler.feature/.project
+++ b/org.eclipse.bpmn2.modeler.feature/.project
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.bpmn2.modeler.feature/about.html b/org.eclipse.bpmn2.modeler.feature/about.html
index dd1a159..3408ea2 100644
--- a/org.eclipse.bpmn2.modeler.feature/about.html
+++ b/org.eclipse.bpmn2.modeler.feature/about.html
@@ -1,26 +1,26 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.feature/build.properties b/org.eclipse.bpmn2.modeler.feature/build.properties
index df81db8..e89c172 100644
--- a/org.eclipse.bpmn2.modeler.feature/build.properties
+++ b/org.eclipse.bpmn2.modeler.feature/build.properties
@@ -1,5 +1,5 @@
-bin.includes = feature.xml,\
- license.html,\
- epl-v10.html,\
- about.html,\
- feature.properties
+bin.includes = feature.xml,\
+ license.html,\
+ epl-v10.html,\
+ about.html,\
+ feature.properties
diff --git a/org.eclipse.bpmn2.modeler.feature/epl-v10.html b/org.eclipse.bpmn2.modeler.feature/epl-v10.html
index 1107453..b398acc 100644
--- a/org.eclipse.bpmn2.modeler.feature/epl-v10.html
+++ b/org.eclipse.bpmn2.modeler.feature/epl-v10.html
@@ -1,259 +1,259 @@
-<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Eclipse Public License - Version 1.0</title>
-<style type="text/css">
- body {
- size: 8.5in 11.0in;
- margin: 0.25in 0.5in 0.25in 0.5in;
- tab-interval: 0.5in;
- }
- p {
- margin-left: auto;
- margin-top: 0.5em;
- margin-bottom: 0.5em;
- }
- p.list {
- margin-left: 0.5in;
- margin-top: 0.05em;
- margin-bottom: 0.05em;
- }
- </style>
-
-</head>
-
-<body lang="EN-US">
-
-<h2>Eclipse Public License - v 1.0</h2>
-
-<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
-AGREEMENT.</p>
-
-<p><b>1. DEFINITIONS</b></p>
-
-<p>"Contribution" means:</p>
-
-<p class="list">a) in the case of the initial Contributor, the initial
-code and documentation distributed under this Agreement, and</p>
-<p class="list">b) in the case of each subsequent Contributor:</p>
-<p class="list">i) changes to the Program, and</p>
-<p class="list">ii) additions to the Program;</p>
-<p class="list">where such changes and/or additions to the Program
-originate from and are distributed by that particular Contributor. A
-Contribution 'originates' from a Contributor if it was added to the
-Program by such Contributor itself or anyone acting on such
-Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in
-conjunction with the Program under their own license agreement, and (ii)
-are not derivative works of the Program.</p>
-
-<p>"Contributor" means any person or entity that distributes
-the Program.</p>
-
-<p>"Licensed Patents" mean patent claims licensable by a
-Contributor which are necessarily infringed by the use or sale of its
-Contribution alone or when combined with the Program.</p>
-
-<p>"Program" means the Contributions distributed in accordance
-with this Agreement.</p>
-
-<p>"Recipient" means anyone who receives the Program under
-this Agreement, including all Contributors.</p>
-
-<p><b>2. GRANT OF RIGHTS</b></p>
-
-<p class="list">a) Subject to the terms of this Agreement, each
-Contributor hereby grants Recipient a non-exclusive, worldwide,
-royalty-free copyright license to reproduce, prepare derivative works
-of, publicly display, publicly perform, distribute and sublicense the
-Contribution of such Contributor, if any, and such derivative works, in
-source code and object code form.</p>
-
-<p class="list">b) Subject to the terms of this Agreement, each
-Contributor hereby grants Recipient a non-exclusive, worldwide,
-royalty-free patent license under Licensed Patents to make, use, sell,
-offer to sell, import and otherwise transfer the Contribution of such
-Contributor, if any, in source code and object code form. This patent
-license shall apply to the combination of the Contribution and the
-Program if, at the time the Contribution is added by the Contributor,
-such addition of the Contribution causes such combination to be covered
-by the Licensed Patents. The patent license shall not apply to any other
-combinations which include the Contribution. No hardware per se is
-licensed hereunder.</p>
-
-<p class="list">c) Recipient understands that although each Contributor
-grants the licenses to its Contributions set forth herein, no assurances
-are provided by any Contributor that the Program does not infringe the
-patent or other intellectual property rights of any other entity. Each
-Contributor disclaims any liability to Recipient for claims brought by
-any other entity based on infringement of intellectual property rights
-or otherwise. As a condition to exercising the rights and licenses
-granted hereunder, each Recipient hereby assumes sole responsibility to
-secure any other intellectual property rights needed, if any. For
-example, if a third party patent license is required to allow Recipient
-to distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.</p>
-
-<p class="list">d) Each Contributor represents that to its knowledge it
-has sufficient copyright rights in its Contribution, if any, to grant
-the copyright license set forth in this Agreement.</p>
-
-<p><b>3. REQUIREMENTS</b></p>
-
-<p>A Contributor may choose to distribute the Program in object code
-form under its own license agreement, provided that:</p>
-
-<p class="list">a) it complies with the terms and conditions of this
-Agreement; and</p>
-
-<p class="list">b) its license agreement:</p>
-
-<p class="list">i) effectively disclaims on behalf of all Contributors
-all warranties and conditions, express and implied, including warranties
-or conditions of title and non-infringement, and implied warranties or
-conditions of merchantability and fitness for a particular purpose;</p>
-
-<p class="list">ii) effectively excludes on behalf of all Contributors
-all liability for damages, including direct, indirect, special,
-incidental and consequential damages, such as lost profits;</p>
-
-<p class="list">iii) states that any provisions which differ from this
-Agreement are offered by that Contributor alone and not by any other
-party; and</p>
-
-<p class="list">iv) states that source code for the Program is available
-from such Contributor, and informs licensees how to obtain it in a
-reasonable manner on or through a medium customarily used for software
-exchange.</p>
-
-<p>When the Program is made available in source code form:</p>
-
-<p class="list">a) it must be made available under this Agreement; and</p>
-
-<p class="list">b) a copy of this Agreement must be included with each
-copy of the Program.</p>
-
-<p>Contributors may not remove or alter any copyright notices contained
-within the Program.</p>
-
-<p>Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.</p>
-
-<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
-
-<p>Commercial distributors of software may accept certain
-responsibilities with respect to end users, business partners and the
-like. While this license is intended to facilitate the commercial use of
-the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create
-potential liability for other Contributors. Therefore, if a Contributor
-includes the Program in a commercial product offering, such Contributor
-("Commercial Contributor") hereby agrees to defend and
-indemnify every other Contributor ("Indemnified Contributor")
-against any losses, damages and costs (collectively "Losses")
-arising from claims, lawsuits and other legal actions brought by a third
-party against the Indemnified Contributor to the extent caused by the
-acts or omissions of such Commercial Contributor in connection with its
-distribution of the Program in a commercial product offering. The
-obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In
-order to qualify, an Indemnified Contributor must: a) promptly notify
-the Commercial Contributor in writing of such claim, and b) allow the
-Commercial Contributor to control, and cooperate with the Commercial
-Contributor in, the defense and any related settlement negotiations. The
-Indemnified Contributor may participate in any such claim at its own
-expense.</p>
-
-<p>For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.</p>
-
-<p><b>5. NO WARRANTY</b></p>
-
-<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
-ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with its
-exercise of rights under this Agreement , including but not limited to
-the risks and costs of program errors, compliance with applicable laws,
-damage to or loss of data, programs or equipment, and unavailability or
-interruption of operations.</p>
-
-<p><b>6. DISCLAIMER OF LIABILITY</b></p>
-
-<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
-NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
-
-<p><b>7. GENERAL</b></p>
-
-<p>If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further action
-by the parties hereto, such provision shall be reformed to the minimum
-extent necessary to make such provision valid and enforceable.</p>
-
-<p>If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging that the
-Program itself (excluding combinations of the Program with other
-software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the
-date such litigation is filed.</p>
-
-<p>All Recipient's rights under this Agreement shall terminate if it
-fails to comply with any of the material terms or conditions of this
-Agreement and does not cure such failure in a reasonable period of time
-after becoming aware of such noncompliance. If all Recipient's rights
-under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive.</p>
-
-<p>Everyone is permitted to copy and distribute copies of this
-Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The
-Agreement Steward reserves the right to publish new versions (including
-revisions) of this Agreement from time to time. No one other than the
-Agreement Steward has the right to modify this Agreement. The Eclipse
-Foundation is the initial Agreement Steward. The Eclipse Foundation may
-assign the responsibility to serve as the Agreement Steward to a
-suitable separate entity. Each new version of the Agreement will be
-given a distinguishing version number. The Program (including
-Contributions) may always be distributed subject to the version of the
-Agreement under which it was received. In addition, after a new version
-of the Agreement is published, Contributor may elect to distribute the
-Program (including its Contributions) under the new version. Except as
-expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
-rights or licenses to the intellectual property of any Contributor under
-this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under this
-Agreement are reserved.</p>
-
-<p>This Agreement is governed by the laws of the State of New York and
-the intellectual property laws of the United States of America. No party
-to this Agreement will bring a legal action under this Agreement more
-than one year after the cause of action arose. Each party waives its
-rights to a jury trial in any resulting litigation.</p>
-
-
-
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.feature/feature.properties b/org.eclipse.bpmn2.modeler.feature/feature.properties
index 704ede0..026d2fe 100644
--- a/org.eclipse.bpmn2.modeler.feature/feature.properties
+++ b/org.eclipse.bpmn2.modeler.feature/feature.properties
@@ -1,131 +1,131 @@
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-Eclipse Foundation Software User Agreement\n\
-February 1, 2011\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the\n\
-Eclipse Foundation is provided to you under the terms and conditions of\n\
-the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
-provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse Foundation source code\n\
-repository ("Repository") in software modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
-Update License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties" found within a Feature.\n\
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
-terms and conditions (or references to such terms and conditions) that\n\
-govern your use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-\n\Use of Provisioning Technology\n\
-\n\
-The Eclipse Foundation makes available provisioning software, examples of which include,\n\
-but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
-the purpose of allowing users to install software, documentation, information and/or\n\
-other materials (collectively "Installable Software"). This capability is provided with\n\
-the intent of allowing such users to install, extend and update Eclipse-based products.\n\
-Information about packaging Installable Software is available at\n\
-http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
-\n\
-You may use Provisioning Technology to allow other parties to install Installable Software.\n\
-You shall be responsible for enabling the applicable license agreements relating to the\n\
-Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
-in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
-making it available in accordance with the Specification, you further acknowledge your\n\
-agreement to, and the acquisition of all necessary rights to permit the following:\n\
-\n\
- 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
- the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
- extending or updating the functionality of an Eclipse-based product.\n\
- 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
- Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
- 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
- govern the use of the Installable Software ("Installable Software Agreement") and such\n\
- Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
- with the Specification. Such Installable Software Agreement must inform the user of the\n\
- terms and conditions that govern the Installable Software and must solicit acceptance by\n\
- the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
- indication of agreement by the user, the provisioning Technology will complete installation\n\
- of the Installable Software.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use, and\n\
-re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
-########### end of license property ##########################################
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+February 1, 2011\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/org.eclipse.bpmn2.modeler.feature/feature.xml b/org.eclipse.bpmn2.modeler.feature/feature.xml
index 100b56d..68c9189 100644
--- a/org.eclipse.bpmn2.modeler.feature/feature.xml
+++ b/org.eclipse.bpmn2.modeler.feature/feature.xml
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.bpmn2.modeler.feature"
- label="BPMN2 Editor"
- version="0.0.1.qualifier"
- provider-name="Eclipse.org">
-
- <copyright>
- Copyright (c) 2011 Red Hat, Inc.
- All rights reserved.
-This program is made available under the terms of the
-Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
-Contributors:
-Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.bpmn2.modeler.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.bpmn2.modeler.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.bpmn2.modeler.feature"
+ label="BPMN2 Editor"
+ version="0.0.1.qualifier"
+ provider-name="Eclipse.org">
+
+ <copyright>
+ Copyright (c) 2011 Red Hat, Inc.
+ All rights reserved.
+This program is made available under the terms of the
+Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+Contributors:
+Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="license.html">
+ %license
+ </license>
+
+ <plugin
+ id="org.eclipse.bpmn2.modeler.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.bpmn2.modeler.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.eclipse.bpmn2.modeler.feature/license.html b/org.eclipse.bpmn2.modeler.feature/license.html
index b8b0438..6e579a5 100644
--- a/org.eclipse.bpmn2.modeler.feature/license.html
+++ b/org.eclipse.bpmn2.modeler.feature/license.html
@@ -1,164 +1,164 @@
-<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>February 1, 2011</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse
- Foundation is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also
- available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse Foundation
-source code
- repository ("Repository") in software modules ("Modules") and made
-available as downloadable archives ("Downloads").</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to
-facilitate delivering, extending, and upgrading the Content. Typical
-modules may include plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or
-Fragments and associated material. Each Feature may be packaged as a
-sub-directory in a directory named "features". Within a Feature, files
-named "feature.xml" may contain a list of the names and version numbers
-of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features ("Included
-Features"). Within a Feature, files named "feature.xml" may contain a
-list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be
-contained in files named "about.html" ("Abouts"). The terms and
-conditions governing Features and
-Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
- directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is
-installed using the Provisioning Technology (as defined below), you must
- agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the
-Feature Update License should either provide you with the terms and
-conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be
-found in the "license" property of files named "feature.properties"
-found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the
-terms and conditions (or references to such terms and conditions) that
-govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
- SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
-CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
-or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions
-govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software,
-examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager ("Provisioning Technology") for the purpose of
-allowing users to install software, documentation, information and/or
- other materials (collectively "Installable Software"). This
-capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about
-packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- ("Specification").</p>
-
-<p>You may use Provisioning Technology to allow other parties to install
- Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to
- be presented to, and accepted by, the users of the Provisioning
-Technology
- in accordance with the Specification. By using Provisioning
-Technology in such a manner and making it available in accordance with
-the
- Specification, you further acknowledge your agreement to, and the
-acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur ("Provisioning Process") in
-which a user may execute the Provisioning Technology
- on a machine ("Target Machine") with the intent of installing,
-extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology
-may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user
-the terms and conditions that govern the use of the Installable
- Software ("Installable Software Agreement") and such Installable
-Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable
-Software Agreement must inform the user of the terms and conditions that
- govern
- the Installable Software and must solicit acceptance by the end
-user in the manner prescribed in such Installable Software Agreement.
-Upon such
- indication of agreement by the user, the provisioning Technology
-will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are
- currently may have restrictions on the import, possession, and use,
-and/or re-export to
- another country, of encryption software. BEFORE using any encryption
-software, please check the country's laws, regulations and policies
-concerning the import,
- possession, or use, and re-export of encryption software, to see if
-this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-
-
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse
+ Foundation is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also
+ available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code,
+documentation and other files maintained in the Eclipse Foundation
+source code
+ repository ("Repository") in software modules ("Modules") and made
+available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to
+facilitate delivering, extending, and upgrading the Content. Typical
+modules may include plug-ins ("Plug-ins"), plug-in fragments
+("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or
+Fragments and associated material. Each Feature may be packaged as a
+sub-directory in a directory named "features". Within a Feature, files
+named "feature.xml" may contain a list of the names and version numbers
+of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included
+Features"). Within a Feature, files named "feature.xml" may contain a
+list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be
+contained in files named "about.html" ("Abouts"). The terms and
+conditions governing Features and
+Included Features should be contained in files named "license.html"
+("Feature Licenses"). Abouts and Feature Licenses may be located in any
+ directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is
+installed using the Provisioning Technology (as defined below), you must
+ agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the
+Feature Update License should either provide you with the terms and
+conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be
+found in the "license" property of files named "feature.properties"
+found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the
+terms and conditions (or references to such terms and conditions) that
+govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
+ SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
+CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
+or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions
+govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software,
+examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of
+allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This
+capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about
+packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install
+ Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to
+ be presented to, and accepted by, the users of the Provisioning
+Technology
+ in accordance with the Specification. By using Provisioning
+Technology in such a manner and making it available in accordance with
+the
+ Specification, you further acknowledge your agreement to, and the
+acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur ("Provisioning Process") in
+which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing,
+extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology
+may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user
+the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable
+Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable
+Software Agreement must inform the user of the terms and conditions that
+ govern
+ the Installable Software and must solicit acceptance by the end
+user in the manner prescribed in such Installable Software Agreement.
+Upon such
+ indication of agreement by the user, the provisioning Technology
+will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are
+ currently may have restrictions on the import, possession, and use,
+and/or re-export to
+ another country, of encryption software. BEFORE using any encryption
+software, please check the country's laws, regulations and policies
+concerning the import,
+ possession, or use, and re-export of encryption software, to see if
+this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.feature/pom.xml b/org.eclipse.bpmn2.modeler.feature/pom.xml
index 656e106..c4feba9 100644
--- a/org.eclipse.bpmn2.modeler.feature/pom.xml
+++ b/org.eclipse.bpmn2.modeler.feature/pom.xml
@@ -1,16 +1,16 @@
-<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>
- <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <artifactId>org.eclipse.bpmn2.modeler.feature</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>eclipse-feature</packaging>
- <name>BPMN2 Modeler Feature</name>
- <description>Editor Feature for BPMN2 Modeler</description>
+<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>
+ <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <artifactId>org.eclipse.bpmn2.modeler.feature</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+ <name>BPMN2 Modeler Feature</name>
+ <description>Editor Feature for BPMN2 Modeler</description>
</project>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.runtime.example/.project b/org.eclipse.bpmn2.modeler.runtime.example/.project
index 800ae7f..13420e9 100644
--- a/org.eclipse.bpmn2.modeler.runtime.example/.project
+++ b/org.eclipse.bpmn2.modeler.runtime.example/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.runtime.example</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>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.runtime.example</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/org.eclipse.bpmn2.modeler.runtime.example/build.properties b/org.eclipse.bpmn2.modeler.runtime.example/build.properties
index 6f20375..e9863e2 100644
--- a/org.eclipse.bpmn2.modeler.runtime.example/build.properties
+++ b/org.eclipse.bpmn2.modeler.runtime.example/build.properties
@@ -1,5 +1,5 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.ecore b/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.ecore
index 76e6e40..58818bd 100644
--- a/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.ecore
+++ b/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.ecore
@@ -1,20 +1,20 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="SampleModel"
- nsURI="http://org.eclipse.bpmn2.modeler.runtime.example" nsPrefix="tns">
- <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot" eSuperTypes="../../org.eclipse.bpmn2/model/BPMN20.ecore#//DocumentRoot">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="mixed"/>
- <details key="name" value=""/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="sampleCustomTaskId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="sampleCustomTaskId"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
-</ecore:EPackage>
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="SampleModel"
+ nsURI="http://org.eclipse.bpmn2.modeler.runtime.example" nsPrefix="tns">
+ <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot" eSuperTypes="../../org.eclipse.bpmn2/model/BPMN20.ecore#//DocumentRoot">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="mixed"/>
+ <details key="name" value=""/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="sampleCustomTaskId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="sampleCustomTaskId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.genmodel b/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.genmodel
index 404f6a5..d082a08 100644
--- a/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.genmodel
+++ b/org.eclipse.bpmn2.modeler.runtime.example/model/SampleModel.genmodel
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.bpmn2.modeler.runtime.example/src"
- modelPluginID="org.eclipse.bpmn2.modeler.runtime.example.model" forceOverwrite="true"
- modelName="SampleModel" modelPluginClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="6.0" copyrightFields="false" usedGenPackages="../../org.eclipse.bpmn2/model/BPMN20.genmodel#//bpmn2 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di.1 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//dc">
- <foreignModel>SampleModel.ecore</foreignModel>
- <genPackages prefix="SampleModel" basePackage="org.eclipse.bpmn2.modeler.runtime.example"
- resource="XML" disposableProviderFactory="true" ecorePackage="SampleModel.ecore#/">
- <genClasses ecoreClass="SampleModel.ecore#//DocumentRoot">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute SampleModel.ecore#//DocumentRoot/sampleCustomTaskId"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.bpmn2.modeler.runtime.example/src"
+ modelPluginID="org.eclipse.bpmn2.modeler.runtime.example.model" forceOverwrite="true"
+ modelName="SampleModel" modelPluginClass="" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="6.0" copyrightFields="false" usedGenPackages="../../org.eclipse.bpmn2/model/BPMN20.genmodel#//bpmn2 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di.1 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//dc">
+ <foreignModel>SampleModel.ecore</foreignModel>
+ <genPackages prefix="SampleModel" basePackage="org.eclipse.bpmn2.modeler.runtime.example"
+ resource="XML" disposableProviderFactory="true" ecorePackage="SampleModel.ecore#/">
+ <genClasses ecoreClass="SampleModel.ecore#//DocumentRoot">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute SampleModel.ecore#//DocumentRoot/sampleCustomTaskId"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/Activator.java b/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/Activator.java
index 6190e10..dc0967e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/Activator.java
+++ b/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/Activator.java
@@ -1,30 +1,30 @@
-package org.eclipse.bpmn2.modeler.runtime.example;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static BundleContext context;
-
- static BundleContext getContext() {
- return context;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
-}
+package org.eclipse.bpmn2.modeler.runtime.example;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/SampleRuntimeExtension.java b/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/SampleRuntimeExtension.java
index 071f374..e50f0b3 100644
--- a/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/SampleRuntimeExtension.java
+++ b/org.eclipse.bpmn2.modeler.runtime.example/src/org/eclipse/bpmn2/modeler/runtime/example/SampleRuntimeExtension.java
@@ -1,61 +1,61 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.example;
-
-import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SampleRuntimeExtension implements IBpmn2RuntimeExtension {
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#getTargetNamespace(org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType)
- */
- @Override
- public String getTargetNamespace(Bpmn2DiagramType diagramType) {
- return "http://org.eclipse.bpmn2.modeler.runtime.example";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#initialize()
- */
- @Override
- public void initialize() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#isContentForRuntime(org.eclipse.bpmn2.modeler.core.IFile)
- */
- @Override
- public boolean isContentForRuntime(IFile file) {
- // IMPORTANT: The plugin is responsible for inspecting the file contents!
- // Unless you are absolutely sure that the file is targeted for this runtime
- // (by, e.g. looking at the targetNamespace or some other feature) then this
- // method must return FALSE.
- return false;
- }
-
- @Override
- public Composite getPreferencesComposite(Composite parent,
- Bpmn2Preferences preferences) {
- return null;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.example;
+
+import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SampleRuntimeExtension implements IBpmn2RuntimeExtension {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#getTargetNamespace(org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType)
+ */
+ @Override
+ public String getTargetNamespace(Bpmn2DiagramType diagramType) {
+ return "http://org.eclipse.bpmn2.modeler.runtime.example";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#initialize()
+ */
+ @Override
+ public void initialize() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#isContentForRuntime(org.eclipse.bpmn2.modeler.core.IFile)
+ */
+ @Override
+ public boolean isContentForRuntime(IFile file) {
+ // IMPORTANT: The plugin is responsible for inspecting the file contents!
+ // Unless you are absolutely sure that the file is targeted for this runtime
+ // (by, e.g. looking at the targetNamespace or some other feature) then this
+ // method must return FALSE.
+ return false;
+ }
+
+ @Override
+ public Composite getPreferencesComposite(Composite parent,
+ Bpmn2Preferences preferences) {
+ return null;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.classpath b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.classpath
index ed2bc12..121e527 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.classpath
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.project b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.project
index f42c8a5..c8937e4 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.project
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5</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>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5</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/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/about.html b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/about.html
index dd1a159..3408ea2 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/about.html
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/about.html
@@ -1,26 +1,26 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/build.properties b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/build.properties
index 9e49f28..994727e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/build.properties
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/build.properties
@@ -1,8 +1,8 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- model/,\
- about.html,\
- plugin.properties
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ model/,\
+ about.html,\
+ plugin.properties
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.ecore b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.ecore
index 82a7a03..abb8522 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.ecore
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.ecore
@@ -1,211 +1,211 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
- nsURI="http://www.jboss.org/drools" nsPrefix="tns">
- <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot" eSuperTypes="../../org.eclipse.bpmn2/model/BPMN20.ecore#//DocumentRoot">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value=""/>
- <details key="kind" value="mixed"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="global" upperBound="-2"
- eType="#//GlobalType" volatile="true" transient="true" derived="true" containment="true"
- resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="global"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="importType" upperBound="-2"
- eType="#//ImportType" volatile="true" transient="true" derived="true" containment="true"
- resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="import"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="onEntryScript" upperBound="-2"
- eType="#//OnEntryScriptType" volatile="true" transient="true" derived="true"
- containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="onEntry-script"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="onExitScript" upperBound="-2"
- eType="#//OnExitScriptType" volatile="true" transient="true" derived="true"
- containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="onExit-script"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="packageName" eType="#//PackageNameType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="packageName"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="#//PriorityType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="priority"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="ruleFlowGroup" eType="#//RuleFlowGroupType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="ruleFlowGroup"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="taskName" eType="#//TaskNameType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="taskName"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="#//VersionType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="version"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="waitForCompletion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="waitForCompletion"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="independent" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="independent"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="GlobalType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="global_._type"/>
- <details key="kind" value="element"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="identifier" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="identifier"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="type"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ImportType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="import_._type"/>
- <details key="kind" value="element"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="OnEntryScriptType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="onEntry-script_._type"/>
- <details key="kind" value="elementOnly"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="script" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="script"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="scriptFormat" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="scriptFormat"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="OnExitScriptType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="onExit-script_._type"/>
- <details key="kind" value="elementOnly"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="script" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="script"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="scriptFormat" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="scriptFormat"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="PackageNameType" instanceClassName="java.lang.String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="packageName_._type"/>
- <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
- </eAnnotations>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="PriorityType" instanceClassName="java.math.BigInteger">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="priority_._type"/>
- <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#integer"/>
- <details key="minInclusive" value="1"/>
- </eAnnotations>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="RuleFlowGroupType" instanceClassName="java.lang.String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="ruleFlowGroup_._type"/>
- <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
- </eAnnotations>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="TaskNameType" instanceClassName="java.lang.String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="taskName_._type"/>
- <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
- </eAnnotations>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="VersionType" instanceClassName="java.math.BigInteger">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="version_._type"/>
- <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#integer"/>
- <details key="minInclusive" value="0"/>
- </eAnnotations>
- </eClassifiers>
-</ecore:EPackage>
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
+ nsURI="http://www.jboss.org/drools" nsPrefix="tns">
+ <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot" eSuperTypes="../../org.eclipse.bpmn2/model/BPMN20.ecore#//DocumentRoot">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value=""/>
+ <details key="kind" value="mixed"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="global" upperBound="-2"
+ eType="#//GlobalType" volatile="true" transient="true" derived="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="global"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="importType" upperBound="-2"
+ eType="#//ImportType" volatile="true" transient="true" derived="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="import"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="onEntryScript" upperBound="-2"
+ eType="#//OnEntryScriptType" volatile="true" transient="true" derived="true"
+ containment="true" resolveProxies="false">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="onEntry-script"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="onExitScript" upperBound="-2"
+ eType="#//OnExitScriptType" volatile="true" transient="true" derived="true"
+ containment="true" resolveProxies="false">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="onExit-script"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="packageName" eType="#//PackageNameType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="packageName"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="#//PriorityType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="priority"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="ruleFlowGroup" eType="#//RuleFlowGroupType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="ruleFlowGroup"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="taskName" eType="#//TaskNameType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="taskName"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="#//VersionType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="waitForCompletion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="waitForCompletion"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="independent" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="independent"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="GlobalType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="global_._type"/>
+ <details key="kind" value="element"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="identifier" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="identifier"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="type"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ImportType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="import_._type"/>
+ <details key="kind" value="element"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="name"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OnEntryScriptType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="onEntry-script_._type"/>
+ <details key="kind" value="elementOnly"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="script" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="script"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="scriptFormat" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="scriptFormat"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OnExitScriptType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="onExit-script_._type"/>
+ <details key="kind" value="elementOnly"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="script" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="script"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="scriptFormat" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="scriptFormat"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="PackageNameType" instanceClassName="java.lang.String">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="packageName_._type"/>
+ <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="PriorityType" instanceClassName="java.math.BigInteger">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="priority_._type"/>
+ <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#integer"/>
+ <details key="minInclusive" value="1"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="RuleFlowGroupType" instanceClassName="java.lang.String">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="ruleFlowGroup_._type"/>
+ <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="TaskNameType" instanceClassName="java.lang.String">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="taskName_._type"/>
+ <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="VersionType" instanceClassName="java.math.BigInteger">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="version_._type"/>
+ <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#integer"/>
+ <details key="minInclusive" value="0"/>
+ </eAnnotations>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.genmodel b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.genmodel
index cc6d2ae..9bcfc44 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.genmodel
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/jBPM5Extensions.genmodel
@@ -1,55 +1,55 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src"
- modelPluginID="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model" redirection=""
- forceOverwrite="true" modelName="JBPM5Extensions" modelPluginClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="6.0" copyrightFields="false" usedGenPackages="../../org.eclipse.bpmn2/model/BPMN20.genmodel#//bpmn2 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di.1 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//dc">
- <foreignModel>jBPM5Extensions.ecore</foreignModel>
- <genPackages prefix="Model" basePackage="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5"
- resource="XML" disposableProviderFactory="true" ecorePackage="jBPM5Extensions.ecore#/">
- <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//PackageNameType"/>
- <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//PriorityType"/>
- <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//RuleFlowGroupType"/>
- <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//TaskNameType"/>
- <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//VersionType"/>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//DocumentRoot">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/global"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/import2"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/onEntryScript"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/onExitScript"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/packageName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/priority"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/ruleFlowGroup"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/taskName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/version"/>
- </genClasses>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//GlobalType">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//GlobalType/identifier"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//GlobalType/type"/>
- </genClasses>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//ImportType">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//ImportType/name"/>
- </genClasses>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//OnEntryScriptType">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnEntryScriptType/script"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnEntryScriptType/scriptFormat"/>
- </genClasses>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//OnExitScriptType">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnExitScriptType/script"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnExitScriptType/scriptFormat"/>
- </genClasses>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//Task">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Task/taskName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Task/displayName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Task/icon"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//Task/parameters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//Task/results"/>
- </genClasses>
- <genClasses ecoreClass="jBPM5Extensions.ecore#//Parameter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Parameter/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Parameter/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Parameter/value"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src"
+ modelPluginID="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model" redirection=""
+ forceOverwrite="true" modelName="JBPM5Extensions" modelPluginClass="" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="6.0" copyrightFields="false" usedGenPackages="../../org.eclipse.bpmn2/model/BPMN20.genmodel#//bpmn2 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//di.1 ../../org.eclipse.bpmn2/model/BPMN20.genmodel#//dc">
+ <foreignModel>jBPM5Extensions.ecore</foreignModel>
+ <genPackages prefix="Model" basePackage="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5"
+ resource="XML" disposableProviderFactory="true" ecorePackage="jBPM5Extensions.ecore#/">
+ <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//PackageNameType"/>
+ <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//PriorityType"/>
+ <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//RuleFlowGroupType"/>
+ <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//TaskNameType"/>
+ <genDataTypes ecoreDataType="jBPM5Extensions.ecore#//VersionType"/>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//DocumentRoot">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/global"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/import2"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/onEntryScript"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//DocumentRoot/onExitScript"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/packageName"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/priority"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/ruleFlowGroup"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/taskName"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//DocumentRoot/version"/>
+ </genClasses>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//GlobalType">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//GlobalType/identifier"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//GlobalType/type"/>
+ </genClasses>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//ImportType">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//ImportType/name"/>
+ </genClasses>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//OnEntryScriptType">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnEntryScriptType/script"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnEntryScriptType/scriptFormat"/>
+ </genClasses>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//OnExitScriptType">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnExitScriptType/script"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//OnExitScriptType/scriptFormat"/>
+ </genClasses>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//Task">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Task/taskName"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Task/displayName"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Task/icon"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//Task/parameters"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jBPM5Extensions.ecore#//Task/results"/>
+ </genClasses>
+ <genClasses ecoreClass="jBPM5Extensions.ecore#//Parameter">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Parameter/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Parameter/type"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jBPM5Extensions.ecore#//Parameter/value"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
index 04dd8c7..34e5871 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
@@ -1,8 +1,8 @@
-
-# <copyright>
-# </copyright>
-#
-# $Id$
-
-pluginName = JBPM5Extensions Model
-providerName = www.example.org
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+pluginName = JBPM5Extensions Model
+providerName = www.example.org
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/pom.xml b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/pom.xml
index 60ca188..cae9816 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/pom.xml
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/pom.xml
@@ -1,16 +1,16 @@
-<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>
- <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <artifactId>org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
- <name>BPMN2 Modeler jBPM5 Runtime</name>
- <description>BPMN2 Modeler Runtime Specialization for JBoss jBPM5</description>
-</project>
+<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>
+ <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <artifactId>org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>BPMN2 Modeler jBPM5 Runtime</name>
+ <description>BPMN2 Modeler Runtime Specialization for JBoss jBPM5</description>
+</project>
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/Activator.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/Activator.java
index 1611c8f..0a2ae7e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/Activator.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/Activator.java
@@ -1,97 +1,97 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- public static void logStatus(IStatus status) {
- Platform.getLog(plugin.getBundle()).log(status);
- }
-
- public static void logError(Exception e) {
- logStatus(createStatus(e));
- }
-
- private static Status createStatus(Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- }
-
- public static void showErrorWithLogging(Exception e){
- Status s = createStatus(e);
- logStatus(s);
- ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "An error occured", null, s);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static void logStatus(IStatus status) {
+ Platform.getLog(plugin.getBundle()).log(status);
+ }
+
+ public static void logError(Exception e) {
+ logStatus(createStatus(e));
+ }
+
+ private static Status createStatus(Exception e) {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+
+ public static void showErrorWithLogging(Exception e){
+ Status s = createStatus(e);
+ logStatus(s);
+ ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "An error occured", null, s);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5ImageProvider.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5ImageProvider.java
index 2c5afce..b359622 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5ImageProvider.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5ImageProvider.java
@@ -1,19 +1,19 @@
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
-
-import org.eclipse.graphiti.ui.platform.AbstractImageProvider;
-
-public class JBPM5ImageProvider extends AbstractImageProvider {
-
- @Override
- protected void addAvailableImages() {
- // does nothing - we do it at load time
- }
-
- /* This method publishes needed protected method 'addImageFilePath' */
- public void addImageFilePathLazy(String imageId, String imageFilePath){
- /** Check if its not already registered */
- if(getImageFilePath( imageId ) == null){
- addImageFilePath( imageId, imageFilePath );
- }
- }
-}
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
+
+import org.eclipse.graphiti.ui.platform.AbstractImageProvider;
+
+public class JBPM5ImageProvider extends AbstractImageProvider {
+
+ @Override
+ protected void addAvailableImages() {
+ // does nothing - we do it at load time
+ }
+
+ /* This method publishes needed protected method 'addImageFilePath' */
+ public void addImageFilePathLazy(String imageId, String imageFilePath){
+ /** Check if its not already registered */
+ if(getImageFilePath( imageId ) == null){
+ addImageFilePath( imageId, imageFilePath );
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java
index fc3a652..6e6d32d 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java
@@ -1,490 +1,490 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Scanner;
-
-import org.apache.xerces.parsers.SAXParser;
-import org.apache.xerces.xni.Augmentations;
-import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLAttributes;
-import org.apache.xerces.xni.XNIException;
-import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskDescriptor;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.Property;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features.JbpmCustomTaskFeatureContainer;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDException;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDHandler;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.graphiti.ui.internal.GraphitiUIPlugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.widgets.Composite;
-import org.xml.sax.InputSource;
-
-@SuppressWarnings("restriction")
-public class JBPM5RuntimeExtension implements IBpmn2RuntimeExtension {
-
- private static final String BPMN2_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL"; //$NON-NLS-1$
- private static final String DROOLS_NAMESPACE = "http://www.jboss.org/drools";
- private static final String ROOT_ELEMENT = "definitions"; //$NON-NLS-1$
-
- private RootElementParser parser;
- private List<WorkItemDefinition> workItemDefinitions;
-
- /* (non-Javadoc)
- * Check if the given input file is a drools-generated (jBPM) process file.
- *
- * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#isContentForRuntime(org.eclipse.core.resources.IFile)
- */
- @Override
- public boolean isContentForRuntime(IFile file) {
- try {
- InputSource source = new InputSource(file.getContents());
- parser = new RootElementParser();
- parser.parse(source);
- } catch (AcceptedException e) {
- return true;
- } catch (Exception e) {
- } finally {
- parser = null;
- }
-
- return false;
- }
-
- public String getTargetNamespace(Bpmn2DiagramType diagramType){
- return DROOLS_NAMESPACE;
- }
-
- public List<WorkItemDefinition> getWorkItemDefinitions() {
- if (workItemDefinitions==null)
- workItemDefinitions = new ArrayList<WorkItemDefinition>();
- return workItemDefinitions;
- }
-
- public WorkItemDefinition getWorkItemDefinition(String taskName) {
- List<WorkItemDefinition> wids = getWorkItemDefinitions();
- for (WorkItemDefinition wid : wids) {
- if (taskName.equals(wid.getName())) {
- return wid;
- }
- }
- return null;
- }
-
- /**
- * Initialize in this case finds all the *.wid/*.conf files in the project
- * and creates CustomTaskDescriptors for each task included
- * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#initialize()
- */
- public void initialize() {
- IProject project = Bpmn2Preferences.getActiveProject();
- if (project != null) {
- getWorkItemDefinitions();
- workItemDefinitions.clear();
- try {
- WIDResourceVisitor visitor = new WIDResourceVisitor();
- project.accept(visitor, IResource.DEPTH_INFINITE, false);
- if (visitor.getWIDResources().size() > 0) {
- Iterator<IResource> resourceIter = visitor.getWIDResources().iterator();
- while (resourceIter.hasNext()) {
- IResource resource = resourceIter.next();
- HashMap<String, WorkItemDefinition> widMap =
- new LinkedHashMap<String, WorkItemDefinition>();
- String content = getFile(resource);
- WIDHandler.evaluateWorkDefinitions(widMap, content);
- workItemDefinitions.addAll(widMap.values());
- }
- }
- if (!workItemDefinitions.isEmpty()) {
- TargetRuntime.getCurrentRuntime().getCustomTasks().clear();
-
- java.util.Iterator<WorkItemDefinition> widIterator = workItemDefinitions.iterator();
- while(widIterator.hasNext()) {
- WorkItemDefinition wid = widIterator.next();
- CustomTaskDescriptor ctd = convertWIDtoCT(wid);
- if (ctd != null) {
- if (!TargetRuntime.getCurrentRuntime().customTaskExists(ctd.getId()))
- TargetRuntime.getCurrentRuntime().addCustomTask(ctd);
- }
- }
- }
- } catch (CoreException e) {
- e.printStackTrace();
- } catch (WIDException e) {
- e.printStackTrace();
- }
- }
- }
-
- /*
- * Convert a WID to a CustomTaskDescriptor
- * @param wid
- * @return
- */
- private CustomTaskDescriptor convertWIDtoCT ( WorkItemDefinition wid ) {
- if (wid != null) {
- String id = wid.getName();
- String name = wid.getName();
- CustomTaskDescriptor ct = new CustomTaskDescriptor(id,name);
- ct.setType("Task");
- ct.setDescription(wid.getName());
- ct.setFeatureContainer(new JbpmCustomTaskFeatureContainer());
- ct.getFeatureContainer().setCustomTaskDescriptor(ct);
- ct.getFeatureContainer().setId(id);
-
- // process basic properties here
- setBasicProps ( ct, wid);
-
- // push the icon into the image registry
- IProject project = Bpmn2Preferences.getActiveProject();
- String iconPath = getWIDPropertyValue("icon", wid);
- if (iconPath != null) {
- Path tempPath = new Path(iconPath);
- String iconName = tempPath.lastSegment();
- IconResourceVisitor visitor = new IconResourceVisitor(iconName);
- try {
- project.accept(visitor, IResource.DEPTH_INFINITE, false);
- if (visitor.getIconResources() != null && visitor.getIconResources().size() > 0) {
- ArrayList<IResource> icons = visitor.getIconResources();
- IResource icon = icons.get(0);
- URL url = icon.getLocationURI().toURL();
- ImageDescriptor image = ImageDescriptor.createFromURL(url);
-
- ImageRegistry imageRegistry = GraphitiUIPlugin.getDefault().getImageRegistry();
- if (imageRegistry.get(iconPath) == null)
- imageRegistry.put(iconPath, image);
- }
- } catch (CoreException e1) {
- e1.printStackTrace();
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- }
-
- // process xml properties here - i.e. task variables
- Property ioSpecification = createIOSpecificationSection(ct, wid);
- createDataAssociations(ioSpecification, ct);
-
- return ct;
- }
- return null;
- }
-
- /*
- * Process the high-level props
- * @param propName
- * @param wid
- * @return
- */
- private String getWIDPropertyValue ( String propName, WorkItemDefinition wid) {
- if (propName.equalsIgnoreCase("taskname")) {
- return wid.getName();
- }
- if (propName.equalsIgnoreCase("displayName")) {
- return wid.getDisplayName();
- }
- if (propName.equalsIgnoreCase("icon")) {
- return wid.getIcon();
- }
- if (propName.equalsIgnoreCase("customEditor")) {
- return wid.getCustomEditor();
- }
- if (propName.equalsIgnoreCase("eclipse:customEditor")) {
- return wid.getEclipseCustomEditor();
- }
- return null;
- }
-
- /*
- * Get the high-level prop from the WID
- * @param propName
- * @param wid
- * @return
- */
- private Property getPropertyFromWID ( String propName, WorkItemDefinition wid ) {
- String name = propName;
- String value = getWIDPropertyValue(propName, wid);
- String description = null;
- String type = "EString";
- Property prop = new Property(name, description);
- prop.type = type;
- if (value == null && propName.equalsIgnoreCase("icon")) {
- value = "task.png";
- }
- if (value!=null)
- prop.getValues().add(value);
- return prop;
- }
-
- /*
- * Create the input and output data associations
- * @param ioSpecification
- * @param ct
- */
- private void createDataAssociations ( Property ioSpecification, CustomTaskDescriptor ct) {
- Object[] values = ioSpecification.getValues().toArray();
- int inputCounter = -1;
-// int outputCounter = -1;
- for (int i = 0; i < values.length; i++) {
- if (values[i] instanceof Property) {
- Property prop = (Property) values[i];
- if (prop.name.equals("dataInputs")) {
- inputCounter++;
- Property dataInputAssociations = new Property ( "dataInputAssociations", null);
- Property targetRef = new Property ("targetRef", null);
- targetRef.ref = "ioSpecification/dataInputs#" + inputCounter;
- dataInputAssociations.getValues().add(targetRef);
- ct.getProperties().add(dataInputAssociations);
- }
-// } else if (prop.name.equals("dataOutputs")) {
-// outputCounter++;
-// Property dataOutputAssociations = new Property ( "dataOutputAssociations", null);
-// Property sourceRef = new Property ("sourceRef", null);
-// sourceRef.ref = "ioSpecification/dataOutputs#" + outputCounter;
-// dataOutputAssociations.getValues().add(sourceRef);
-//// Property targetRef = new Property ("targetRef", null);
-//// dataOutputAssociations.getValues().add(targetRef);
-// ct.getProperties().add(dataOutputAssociations);
-// }
-
- }
- }
- }
-
- /*
- * Handle creating the ioSpecification from the WID/CT
- * @param ct
- * @param wid
- */
- private Property createIOSpecificationSection ( CustomTaskDescriptor ct, WorkItemDefinition wid ) {
- Property ioSpecification = new Property ( "ioSpecification", null);
-
- for (Entry<String, String> entry : wid.getParameters().entrySet()) {
- Property dataInputs = new Property("dataInputs", null);
- Property dataInputsName = new Property("name", null);
- dataInputsName.getValues().add(entry.getKey());
- dataInputs.getValues().add(dataInputsName);
- ioSpecification.getValues().add(dataInputs);
- }
-
- // this code if enabled will create a default output variable
-
-// if (wid.getResults().isEmpty()) {
-// Property dataOutputs = new Property("dataOutputs", null);
-// Property dataOutputsName = new Property("name", null);
-// dataOutputsName.getValues().add("result");
-// dataOutputs.getValues().add(dataOutputsName);
-// ioSpecification.getValues().add(dataOutputs);
-// } else {
- for (Entry<String, String> entry : wid.getResults().entrySet()) {
- Property dataOutputs = new Property("dataOutputs", null);
- Property dataOutputsName = new Property("name", null);
- dataOutputsName.getValues().add(entry.getKey());
- dataOutputs.getValues().add(dataOutputsName);
- ioSpecification.getValues().add(dataOutputs);
- }
-// }
-
- Object[] values = ioSpecification.getValues().toArray();
- int inputCounter = -1;
- int outputCounter = -1;
- Property inputSets = new Property("inputSets", null);
- Property outputSets = new Property("outputSets", null);
- for (int i = 0; i < values.length; i++) {
- if (values[i] instanceof Property) {
- Property prop = (Property) values[i];
- if (prop.name.equals("dataInputs")) {
- inputCounter++;
- Property inputSetsRef = new Property ("dataInputRefs", null);
- inputSetsRef.ref = "ioSpecification/dataInputs#" + inputCounter;
- inputSets.getValues().add(inputSetsRef);
- } else if (prop.name.equals("dataOutputs")) {
- outputCounter++;
- Property outputSetsRef = new Property ("dataOutputRefs", null);
- outputSetsRef.ref = "ioSpecification/dataOutputs#" + outputCounter;
- outputSets.getValues().add(outputSetsRef);
- }
- }
- }
- if (inputSets.getValues().size() > 0)
- ioSpecification.getValues().add(inputSets);
- if (outputSets.getValues().size() > 0)
- ioSpecification.getValues().add(outputSets);
-
- ct.getProperties().add(ioSpecification);
- return ioSpecification;
- }
-
- /*
- * Handle the top-level props
- * @param ct
- * @param wid
- */
- private void setBasicProps ( CustomTaskDescriptor ct, WorkItemDefinition wid) {
- String[] basicProps = new String[] { "taskName", "displayName", "icon" };
- for (int i = 0; i < basicProps.length; i++) {
- Property prop = getPropertyFromWID(basicProps[i], wid);
- ct.getProperties().add(prop);
- }
- }
-
- /*
- * Get the contents of the file
- * @param resource
- * @return
- */
- private String getFile( IResource resource ) {
- String filepath = null;
- if (resource != null) {
- IPath path = resource.getLocation().makeAbsolute();
- filepath = path.toOSString();
- }
-
- StringBuilder text = new StringBuilder();
- String NL = System.getProperty("line.separator");
- Scanner scanner = null;
- try {
- scanner = new Scanner(new FileInputStream(filepath), "UTF-8");
- while (scanner.hasNextLine()){
- text.append(scanner.nextLine() + NL);
- }
- return text.toString();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } finally {
- if (scanner != null)
- scanner.close();
- }
- return null;
- }
-
- /*
- * Class: Visits each file in the project to see if it's a *.conf/*.wid
- * @author bfitzpat
- *
- */
- private class WIDResourceVisitor implements IResourceVisitor {
-
- private ArrayList<IResource> widResources = new ArrayList<IResource>();
-
- public boolean visit (IResource resource) throws CoreException {
- if (resource.getType() == IResource.FILE) {
- if ("conf".equalsIgnoreCase(((IFile)resource).getFileExtension()) ||
- "wid".equalsIgnoreCase(((IFile)resource).getFileExtension())) {
- widResources.add(resource);
- return true;
- }
- }
- return true;
- }
-
- public ArrayList<IResource> getWIDResources() {
- return widResources;
- }
- }
-
- /*
- * Class: Visits each file in the project looking for the icon
- * @author bfitzpat
- *
- */
- private class IconResourceVisitor implements IResourceVisitor {
-
- private ArrayList<IResource> iconResources = new ArrayList<IResource>();
- private String iconName;
-
- public IconResourceVisitor ( String iconName ) {
- this.iconName = iconName;
- }
-
- public boolean visit (IResource resource) throws CoreException {
- if (resource.getType() == IResource.FILE) {
- if (((IFile)resource).getName().equalsIgnoreCase(iconName)) {
- iconResources.add(resource);
- return true;
- }
- }
- return true;
- }
-
- public ArrayList<IResource> getIconResources() {
- return iconResources;
- }
- }
-
- private class RootElementParser extends SAXParser {
- @Override
- public void startElement(QName qName, XMLAttributes attributes, Augmentations augmentations)
- throws XNIException {
-
- super.startElement(qName, attributes, augmentations);
-
- // search the "definitions" for a drools namespace
- if (ROOT_ELEMENT.equals(qName.localpart)) {
- Enumeration<?> e = fNamespaceContext.getAllPrefixes();
- while (e.hasMoreElements()) {
- String prefix = (String)e.nextElement();
- String namespace = fNamespaceContext.getURI(prefix);
- if (DROOLS_NAMESPACE.equals(namespace))
- throw new AcceptedException(qName.localpart);
- }
- throw new RejectedException();
- } else {
- throw new RejectedException();
- }
- }
- }
-
- private class AcceptedException extends RuntimeException {
- public String acceptedRootElement;
-
- public AcceptedException(String acceptedRootElement) {
- this.acceptedRootElement = acceptedRootElement;
- }
-
- private static final long serialVersionUID = 1L;
- }
-
- private class RejectedException extends RuntimeException {
- private static final long serialVersionUID = 1L;
- }
-
- @Override
- public Composite getPreferencesComposite(Composite parent, Bpmn2Preferences preferences) {
- return null;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Scanner;
+
+import org.apache.xerces.parsers.SAXParser;
+import org.apache.xerces.xni.Augmentations;
+import org.apache.xerces.xni.QName;
+import org.apache.xerces.xni.XMLAttributes;
+import org.apache.xerces.xni.XNIException;
+import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskDescriptor;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.Property;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features.JbpmCustomTaskFeatureContainer;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDException;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDHandler;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.graphiti.ui.internal.GraphitiUIPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.widgets.Composite;
+import org.xml.sax.InputSource;
+
+@SuppressWarnings("restriction")
+public class JBPM5RuntimeExtension implements IBpmn2RuntimeExtension {
+
+ private static final String BPMN2_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL"; //$NON-NLS-1$
+ private static final String DROOLS_NAMESPACE = "http://www.jboss.org/drools";
+ private static final String ROOT_ELEMENT = "definitions"; //$NON-NLS-1$
+
+ private RootElementParser parser;
+ private List<WorkItemDefinition> workItemDefinitions;
+
+ /* (non-Javadoc)
+ * Check if the given input file is a drools-generated (jBPM) process file.
+ *
+ * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#isContentForRuntime(org.eclipse.core.resources.IFile)
+ */
+ @Override
+ public boolean isContentForRuntime(IFile file) {
+ try {
+ InputSource source = new InputSource(file.getContents());
+ parser = new RootElementParser();
+ parser.parse(source);
+ } catch (AcceptedException e) {
+ return true;
+ } catch (Exception e) {
+ } finally {
+ parser = null;
+ }
+
+ return false;
+ }
+
+ public String getTargetNamespace(Bpmn2DiagramType diagramType){
+ return DROOLS_NAMESPACE;
+ }
+
+ public List<WorkItemDefinition> getWorkItemDefinitions() {
+ if (workItemDefinitions==null)
+ workItemDefinitions = new ArrayList<WorkItemDefinition>();
+ return workItemDefinitions;
+ }
+
+ public WorkItemDefinition getWorkItemDefinition(String taskName) {
+ List<WorkItemDefinition> wids = getWorkItemDefinitions();
+ for (WorkItemDefinition wid : wids) {
+ if (taskName.equals(wid.getName())) {
+ return wid;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Initialize in this case finds all the *.wid/*.conf files in the project
+ * and creates CustomTaskDescriptors for each task included
+ * @see org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension#initialize()
+ */
+ public void initialize() {
+ IProject project = Bpmn2Preferences.getActiveProject();
+ if (project != null) {
+ getWorkItemDefinitions();
+ workItemDefinitions.clear();
+ try {
+ WIDResourceVisitor visitor = new WIDResourceVisitor();
+ project.accept(visitor, IResource.DEPTH_INFINITE, false);
+ if (visitor.getWIDResources().size() > 0) {
+ Iterator<IResource> resourceIter = visitor.getWIDResources().iterator();
+ while (resourceIter.hasNext()) {
+ IResource resource = resourceIter.next();
+ HashMap<String, WorkItemDefinition> widMap =
+ new LinkedHashMap<String, WorkItemDefinition>();
+ String content = getFile(resource);
+ WIDHandler.evaluateWorkDefinitions(widMap, content);
+ workItemDefinitions.addAll(widMap.values());
+ }
+ }
+ if (!workItemDefinitions.isEmpty()) {
+ TargetRuntime.getCurrentRuntime().getCustomTasks().clear();
+
+ java.util.Iterator<WorkItemDefinition> widIterator = workItemDefinitions.iterator();
+ while(widIterator.hasNext()) {
+ WorkItemDefinition wid = widIterator.next();
+ CustomTaskDescriptor ctd = convertWIDtoCT(wid);
+ if (ctd != null) {
+ if (!TargetRuntime.getCurrentRuntime().customTaskExists(ctd.getId()))
+ TargetRuntime.getCurrentRuntime().addCustomTask(ctd);
+ }
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } catch (WIDException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*
+ * Convert a WID to a CustomTaskDescriptor
+ * @param wid
+ * @return
+ */
+ private CustomTaskDescriptor convertWIDtoCT ( WorkItemDefinition wid ) {
+ if (wid != null) {
+ String id = wid.getName();
+ String name = wid.getName();
+ CustomTaskDescriptor ct = new CustomTaskDescriptor(id,name);
+ ct.setType("Task");
+ ct.setDescription(wid.getName());
+ ct.setFeatureContainer(new JbpmCustomTaskFeatureContainer());
+ ct.getFeatureContainer().setCustomTaskDescriptor(ct);
+ ct.getFeatureContainer().setId(id);
+
+ // process basic properties here
+ setBasicProps ( ct, wid);
+
+ // push the icon into the image registry
+ IProject project = Bpmn2Preferences.getActiveProject();
+ String iconPath = getWIDPropertyValue("icon", wid);
+ if (iconPath != null) {
+ Path tempPath = new Path(iconPath);
+ String iconName = tempPath.lastSegment();
+ IconResourceVisitor visitor = new IconResourceVisitor(iconName);
+ try {
+ project.accept(visitor, IResource.DEPTH_INFINITE, false);
+ if (visitor.getIconResources() != null && visitor.getIconResources().size() > 0) {
+ ArrayList<IResource> icons = visitor.getIconResources();
+ IResource icon = icons.get(0);
+ URL url = icon.getLocationURI().toURL();
+ ImageDescriptor image = ImageDescriptor.createFromURL(url);
+
+ ImageRegistry imageRegistry = GraphitiUIPlugin.getDefault().getImageRegistry();
+ if (imageRegistry.get(iconPath) == null)
+ imageRegistry.put(iconPath, image);
+ }
+ } catch (CoreException e1) {
+ e1.printStackTrace();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // process xml properties here - i.e. task variables
+ Property ioSpecification = createIOSpecificationSection(ct, wid);
+ createDataAssociations(ioSpecification, ct);
+
+ return ct;
+ }
+ return null;
+ }
+
+ /*
+ * Process the high-level props
+ * @param propName
+ * @param wid
+ * @return
+ */
+ private String getWIDPropertyValue ( String propName, WorkItemDefinition wid) {
+ if (propName.equalsIgnoreCase("taskname")) {
+ return wid.getName();
+ }
+ if (propName.equalsIgnoreCase("displayName")) {
+ return wid.getDisplayName();
+ }
+ if (propName.equalsIgnoreCase("icon")) {
+ return wid.getIcon();
+ }
+ if (propName.equalsIgnoreCase("customEditor")) {
+ return wid.getCustomEditor();
+ }
+ if (propName.equalsIgnoreCase("eclipse:customEditor")) {
+ return wid.getEclipseCustomEditor();
+ }
+ return null;
+ }
+
+ /*
+ * Get the high-level prop from the WID
+ * @param propName
+ * @param wid
+ * @return
+ */
+ private Property getPropertyFromWID ( String propName, WorkItemDefinition wid ) {
+ String name = propName;
+ String value = getWIDPropertyValue(propName, wid);
+ String description = null;
+ String type = "EString";
+ Property prop = new Property(name, description);
+ prop.type = type;
+ if (value == null && propName.equalsIgnoreCase("icon")) {
+ value = "task.png";
+ }
+ if (value!=null)
+ prop.getValues().add(value);
+ return prop;
+ }
+
+ /*
+ * Create the input and output data associations
+ * @param ioSpecification
+ * @param ct
+ */
+ private void createDataAssociations ( Property ioSpecification, CustomTaskDescriptor ct) {
+ Object[] values = ioSpecification.getValues().toArray();
+ int inputCounter = -1;
+// int outputCounter = -1;
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] instanceof Property) {
+ Property prop = (Property) values[i];
+ if (prop.name.equals("dataInputs")) {
+ inputCounter++;
+ Property dataInputAssociations = new Property ( "dataInputAssociations", null);
+ Property targetRef = new Property ("targetRef", null);
+ targetRef.ref = "ioSpecification/dataInputs#" + inputCounter;
+ dataInputAssociations.getValues().add(targetRef);
+ ct.getProperties().add(dataInputAssociations);
+ }
+// } else if (prop.name.equals("dataOutputs")) {
+// outputCounter++;
+// Property dataOutputAssociations = new Property ( "dataOutputAssociations", null);
+// Property sourceRef = new Property ("sourceRef", null);
+// sourceRef.ref = "ioSpecification/dataOutputs#" + outputCounter;
+// dataOutputAssociations.getValues().add(sourceRef);
+//// Property targetRef = new Property ("targetRef", null);
+//// dataOutputAssociations.getValues().add(targetRef);
+// ct.getProperties().add(dataOutputAssociations);
+// }
+
+ }
+ }
+ }
+
+ /*
+ * Handle creating the ioSpecification from the WID/CT
+ * @param ct
+ * @param wid
+ */
+ private Property createIOSpecificationSection ( CustomTaskDescriptor ct, WorkItemDefinition wid ) {
+ Property ioSpecification = new Property ( "ioSpecification", null);
+
+ for (Entry<String, String> entry : wid.getParameters().entrySet()) {
+ Property dataInputs = new Property("dataInputs", null);
+ Property dataInputsName = new Property("name", null);
+ dataInputsName.getValues().add(entry.getKey());
+ dataInputs.getValues().add(dataInputsName);
+ ioSpecification.getValues().add(dataInputs);
+ }
+
+ // this code if enabled will create a default output variable
+
+// if (wid.getResults().isEmpty()) {
+// Property dataOutputs = new Property("dataOutputs", null);
+// Property dataOutputsName = new Property("name", null);
+// dataOutputsName.getValues().add("result");
+// dataOutputs.getValues().add(dataOutputsName);
+// ioSpecification.getValues().add(dataOutputs);
+// } else {
+ for (Entry<String, String> entry : wid.getResults().entrySet()) {
+ Property dataOutputs = new Property("dataOutputs", null);
+ Property dataOutputsName = new Property("name", null);
+ dataOutputsName.getValues().add(entry.getKey());
+ dataOutputs.getValues().add(dataOutputsName);
+ ioSpecification.getValues().add(dataOutputs);
+ }
+// }
+
+ Object[] values = ioSpecification.getValues().toArray();
+ int inputCounter = -1;
+ int outputCounter = -1;
+ Property inputSets = new Property("inputSets", null);
+ Property outputSets = new Property("outputSets", null);
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] instanceof Property) {
+ Property prop = (Property) values[i];
+ if (prop.name.equals("dataInputs")) {
+ inputCounter++;
+ Property inputSetsRef = new Property ("dataInputRefs", null);
+ inputSetsRef.ref = "ioSpecification/dataInputs#" + inputCounter;
+ inputSets.getValues().add(inputSetsRef);
+ } else if (prop.name.equals("dataOutputs")) {
+ outputCounter++;
+ Property outputSetsRef = new Property ("dataOutputRefs", null);
+ outputSetsRef.ref = "ioSpecification/dataOutputs#" + outputCounter;
+ outputSets.getValues().add(outputSetsRef);
+ }
+ }
+ }
+ if (inputSets.getValues().size() > 0)
+ ioSpecification.getValues().add(inputSets);
+ if (outputSets.getValues().size() > 0)
+ ioSpecification.getValues().add(outputSets);
+
+ ct.getProperties().add(ioSpecification);
+ return ioSpecification;
+ }
+
+ /*
+ * Handle the top-level props
+ * @param ct
+ * @param wid
+ */
+ private void setBasicProps ( CustomTaskDescriptor ct, WorkItemDefinition wid) {
+ String[] basicProps = new String[] { "taskName", "displayName", "icon" };
+ for (int i = 0; i < basicProps.length; i++) {
+ Property prop = getPropertyFromWID(basicProps[i], wid);
+ ct.getProperties().add(prop);
+ }
+ }
+
+ /*
+ * Get the contents of the file
+ * @param resource
+ * @return
+ */
+ private String getFile( IResource resource ) {
+ String filepath = null;
+ if (resource != null) {
+ IPath path = resource.getLocation().makeAbsolute();
+ filepath = path.toOSString();
+ }
+
+ StringBuilder text = new StringBuilder();
+ String NL = System.getProperty("line.separator");
+ Scanner scanner = null;
+ try {
+ scanner = new Scanner(new FileInputStream(filepath), "UTF-8");
+ while (scanner.hasNextLine()){
+ text.append(scanner.nextLine() + NL);
+ }
+ return text.toString();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } finally {
+ if (scanner != null)
+ scanner.close();
+ }
+ return null;
+ }
+
+ /*
+ * Class: Visits each file in the project to see if it's a *.conf/*.wid
+ * @author bfitzpat
+ *
+ */
+ private class WIDResourceVisitor implements IResourceVisitor {
+
+ private ArrayList<IResource> widResources = new ArrayList<IResource>();
+
+ public boolean visit (IResource resource) throws CoreException {
+ if (resource.getType() == IResource.FILE) {
+ if ("conf".equalsIgnoreCase(((IFile)resource).getFileExtension()) ||
+ "wid".equalsIgnoreCase(((IFile)resource).getFileExtension())) {
+ widResources.add(resource);
+ return true;
+ }
+ }
+ return true;
+ }
+
+ public ArrayList<IResource> getWIDResources() {
+ return widResources;
+ }
+ }
+
+ /*
+ * Class: Visits each file in the project looking for the icon
+ * @author bfitzpat
+ *
+ */
+ private class IconResourceVisitor implements IResourceVisitor {
+
+ private ArrayList<IResource> iconResources = new ArrayList<IResource>();
+ private String iconName;
+
+ public IconResourceVisitor ( String iconName ) {
+ this.iconName = iconName;
+ }
+
+ public boolean visit (IResource resource) throws CoreException {
+ if (resource.getType() == IResource.FILE) {
+ if (((IFile)resource).getName().equalsIgnoreCase(iconName)) {
+ iconResources.add(resource);
+ return true;
+ }
+ }
+ return true;
+ }
+
+ public ArrayList<IResource> getIconResources() {
+ return iconResources;
+ }
+ }
+
+ private class RootElementParser extends SAXParser {
+ @Override
+ public void startElement(QName qName, XMLAttributes attributes, Augmentations augmentations)
+ throws XNIException {
+
+ super.startElement(qName, attributes, augmentations);
+
+ // search the "definitions" for a drools namespace
+ if (ROOT_ELEMENT.equals(qName.localpart)) {
+ Enumeration<?> e = fNamespaceContext.getAllPrefixes();
+ while (e.hasMoreElements()) {
+ String prefix = (String)e.nextElement();
+ String namespace = fNamespaceContext.getURI(prefix);
+ if (DROOLS_NAMESPACE.equals(namespace))
+ throw new AcceptedException(qName.localpart);
+ }
+ throw new RejectedException();
+ } else {
+ throw new RejectedException();
+ }
+ }
+ }
+
+ private class AcceptedException extends RuntimeException {
+ public String acceptedRootElement;
+
+ public AcceptedException(String acceptedRootElement) {
+ this.acceptedRootElement = acceptedRootElement;
+ }
+
+ private static final long serialVersionUID = 1L;
+ }
+
+ private class RejectedException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+ }
+
+ @Override
+ public Composite getPreferencesComposite(Composite parent, Bpmn2Preferences preferences) {
+ return null;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/EditBeanDialog.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/EditBeanDialog.java
index 3718057..10dbe82 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/EditBeanDialog.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/EditBeanDialog.java
@@ -1,73 +1,73 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.customeditor;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.Activator;
-import org.eclipse.bpmn2.modeler.ui.util.PropertyUtil;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Dialog for editing a JavaBean.
- */
-public abstract class EditBeanDialog<T> extends Dialog {
-
- private String title;
- private T value;
-
- protected EditBeanDialog(Shell parentShell, String title) {
- super(parentShell);
- this.title = title;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(title);
- }
-
- public T getValue() {
- return value;
- }
-
- protected void okPressed() {
- try {
- value = updateValue(value);
- super.okPressed();
- } catch (IllegalArgumentException e) {
- showError(e.getMessage());
- // value could not be set, ignoring ok
- }
- }
-
- protected abstract T updateValue(T value);
-
- public void setValue(T value) {
- this.value = value;
- }
-
- protected void showError(String error) {
- MessageDialog.openError(getShell(), "Error", error);
- }
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.customeditor;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.Activator;
+import org.eclipse.bpmn2.modeler.ui.util.PropertyUtil;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Dialog for editing a JavaBean.
+ */
+public abstract class EditBeanDialog<T> extends Dialog {
+
+ private String title;
+ private T value;
+
+ protected EditBeanDialog(Shell parentShell, String title) {
+ super(parentShell);
+ this.title = title;
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(title);
+ }
+
+ public T getValue() {
+ return value;
+ }
+
+ protected void okPressed() {
+ try {
+ value = updateValue(value);
+ super.okPressed();
+ } catch (IllegalArgumentException e) {
+ showError(e.getMessage());
+ // value could not be set, ignoring ok
+ }
+ }
+
+ protected abstract T updateValue(T value);
+
+ public void setValue(T value) {
+ this.value = value;
+ }
+
+ protected void showError(String error) {
+ MessageDialog.openError(getShell(), "Error", error);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/SampleCustomEditor.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/SampleCustomEditor.java
index 0e977b2..26ec03e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/SampleCustomEditor.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/customeditor/SampleCustomEditor.java
@@ -1,143 +1,143 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.customeditor;
-
-/**
- * @author Bob Brodt
- *
- */
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.Work;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkDefinition;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkEditor;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.WorkImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Custom Work editor that can handle work definitions that only have
- * String parameters.
- */
-public class SampleCustomEditor extends EditBeanDialog<Work> implements WorkEditor {
-
- private WorkDefinition workDefinition;
- private Map<String, Text> texts = new HashMap<String, Text>();
-
- public SampleCustomEditor(Shell parentShell) {
- super(parentShell, "Custom Work Editor");
- setBlockOnOpen(true);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- Work work = (Work) getValue();
-
- Label nameLabel = new Label(composite, SWT.NONE);
- nameLabel.setText("Name: ");
- nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
-
- Text nameText = new Text(composite, SWT.NONE);
- nameText.setEditable(false);
- nameText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
- String name = work.getName();
- nameText.setText(name == null ? "" : name);
-
- Set<ParameterDefinition> parameters = workDefinition.getParameters();
- for (ParameterDefinition param: parameters) {
- Label label = new Label(composite, SWT.NONE);
- label.setText(param.getName() + ": ");
- label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
-
- Text text = new Text(composite, SWT.BORDER);
- text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
- texts.put(param.getName(), text);
- Object value = work.getParameter(param.getName());
- text.setText(value == null ? "" : value.toString());
- }
-
- return composite;
- }
-
- protected Work updateValue(Work value) {
- Work work = new WorkImpl();
- work.setName(((Work) value).getName());
- for (Map.Entry<String, Text> entry: texts.entrySet()) {
- String text = entry.getValue().getText();
- ParameterDefinition pd = value.getParameterDefinition(entry.getKey());
- DataType type = pd.getType();
- try {
- type.readValue(text);
- }
- catch (Exception e) {
- throw new IllegalArgumentException(
- "The value \""+text+"\" "+
- "for parameter \""+entry.getKey()+"\" "+
- "does not conform to the "+pd.getType().getStringType()+" "+
- "data type.");
- }
- work.setParameter(entry.getKey(), "".equals(text) ? null : text);
- }
- work.setParameterDefinitions(((Work) value).getParameterDefinitions());
- return work;
- }
-
- public Work getWork() {
- return (Work) getValue();
- }
-
- public void setWork(Work work) {
- setValue(work);
- }
-
- public void setWorkDefinition(WorkDefinition workDefinition) {
- this.workDefinition = workDefinition;
- }
-
- public boolean show() {
- int result = open();
- return result == OK;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.customeditor;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.Work;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkDefinition;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkEditor;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.WorkImpl;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Custom Work editor that can handle work definitions that only have
+ * String parameters.
+ */
+public class SampleCustomEditor extends EditBeanDialog<Work> implements WorkEditor {
+
+ private WorkDefinition workDefinition;
+ private Map<String, Text> texts = new HashMap<String, Text>();
+
+ public SampleCustomEditor(Shell parentShell) {
+ super(parentShell, "Custom Work Editor");
+ setBlockOnOpen(true);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite) super.createDialogArea(parent);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+
+ Work work = (Work) getValue();
+
+ Label nameLabel = new Label(composite, SWT.NONE);
+ nameLabel.setText("Name: ");
+ nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+
+ Text nameText = new Text(composite, SWT.NONE);
+ nameText.setEditable(false);
+ nameText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ String name = work.getName();
+ nameText.setText(name == null ? "" : name);
+
+ Set<ParameterDefinition> parameters = workDefinition.getParameters();
+ for (ParameterDefinition param: parameters) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(param.getName() + ": ");
+ label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+
+ Text text = new Text(composite, SWT.BORDER);
+ text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ texts.put(param.getName(), text);
+ Object value = work.getParameter(param.getName());
+ text.setText(value == null ? "" : value.toString());
+ }
+
+ return composite;
+ }
+
+ protected Work updateValue(Work value) {
+ Work work = new WorkImpl();
+ work.setName(((Work) value).getName());
+ for (Map.Entry<String, Text> entry: texts.entrySet()) {
+ String text = entry.getValue().getText();
+ ParameterDefinition pd = value.getParameterDefinition(entry.getKey());
+ DataType type = pd.getType();
+ try {
+ type.readValue(text);
+ }
+ catch (Exception e) {
+ throw new IllegalArgumentException(
+ "The value \""+text+"\" "+
+ "for parameter \""+entry.getKey()+"\" "+
+ "does not conform to the "+pd.getType().getStringType()+" "+
+ "data type.");
+ }
+ work.setParameter(entry.getKey(), "".equals(text) ? null : text);
+ }
+ work.setParameterDefinitions(((Work) value).getParameterDefinitions());
+ return work;
+ }
+
+ public Work getWork() {
+ return (Work) getValue();
+ }
+
+ public void setWork(Work work) {
+ setValue(work);
+ }
+
+ public void setWorkDefinition(WorkDefinition workDefinition) {
+ this.workDefinition = workDefinition;
+ }
+
+ public boolean show() {
+ int result = open();
+ return result == OK;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/ParameterDefinition.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/ParameterDefinition.java
index 6a9b134..ccf3757 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/ParameterDefinition.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/ParameterDefinition.java
@@ -1,25 +1,25 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
-
-
-public interface ParameterDefinition extends TypeObject {
-
- String getName();
- void setName(String name);
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
+
+
+public interface ParameterDefinition extends TypeObject {
+
+ String getName();
+ void setName(String name);
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/TypeObject.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/TypeObject.java
index e8c6553..4acfb94 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/TypeObject.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/TypeObject.java
@@ -1,26 +1,26 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-public interface TypeObject {
-
- DataType getType();
- void setType(DataType type);
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+public interface TypeObject {
+
+ DataType getType();
+ void setType(DataType type);
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/Work.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/Work.java
index f8d07f1..d5dfca3 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/Work.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/Work.java
@@ -1,38 +1,38 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
-
-import java.util.Map;
-import java.util.Set;
-
-public interface Work {
-
- void setName(String name);
- String getName();
-
- void setParameter(String name, Object value);
- void setParameters(Map<String, Object> parameters);
- Object getParameter(String name);
- Map<String, Object> getParameters();
-
- void addParameterDefinition(ParameterDefinition parameterDefinition);
- void setParameterDefinitions(Set<ParameterDefinition> parameterDefinitions);
- Set<ParameterDefinition> getParameterDefinitions();
- String[] getParameterNames();
- ParameterDefinition getParameterDefinition(String name);
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
+
+import java.util.Map;
+import java.util.Set;
+
+public interface Work {
+
+ void setName(String name);
+ String getName();
+
+ void setParameter(String name, Object value);
+ void setParameters(Map<String, Object> parameters);
+ Object getParameter(String name);
+ Map<String, Object> getParameters();
+
+ void addParameterDefinition(ParameterDefinition parameterDefinition);
+ void setParameterDefinitions(Set<ParameterDefinition> parameterDefinitions);
+ Set<ParameterDefinition> getParameterDefinitions();
+ String[] getParameterNames();
+ ParameterDefinition getParameterDefinition(String name);
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinition.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinition.java
index 3fd8f44..296d982 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinition.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinition.java
@@ -1,33 +1,33 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
-
-import java.util.Set;
-
-public interface WorkDefinition {
-
- String getName();
-
- Set<ParameterDefinition> getParameters();
- String[] getParameterNames();
- ParameterDefinition getParameter(String name);
-
- Set<ParameterDefinition> getResults();
- String[] getResultNames();
- ParameterDefinition getResult(String name);
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
+
+import java.util.Set;
+
+public interface WorkDefinition {
+
+ String getName();
+
+ Set<ParameterDefinition> getParameters();
+ String[] getParameterNames();
+ ParameterDefinition getParameter(String name);
+
+ Set<ParameterDefinition> getResults();
+ String[] getResultNames();
+ ParameterDefinition getResult(String name);
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinitionExtension.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinitionExtension.java
index 6fd6f3c..e7a281f 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinitionExtension.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkDefinitionExtension.java
@@ -1,29 +1,29 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
-
-public interface WorkDefinitionExtension {
-
- String getDisplayName();
-
- String getExplanationText();
-
- String getIcon();
-
- String getCustomEditor();
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
+
+public interface WorkDefinitionExtension {
+
+ String getDisplayName();
+
+ String getExplanationText();
+
+ String getIcon();
+
+ String getCustomEditor();
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkEditor.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkEditor.java
index 3ddcbf9..37ae9ca 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkEditor.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/WorkEditor.java
@@ -1,29 +1,29 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
-
-public interface WorkEditor {
-
- void setWorkDefinition(WorkDefinition definition);
-
- void setWork(Work work);
-
- boolean show();
-
- Work getWork();
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core;
+
+public interface WorkEditor {
+
+ void setWorkDefinition(WorkDefinition definition);
+
+ void setWork(Work work);
+
+ boolean show();
+
+ Work getWork();
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataType.java
index d7be02a..e55caad 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataType.java
@@ -1,40 +1,40 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype;
-
-import java.io.Externalizable;
-
-/**
- * Abstract representation of a datatype.
- */
-public interface DataType extends Externalizable {
-
- /**
- * Returns true if the given value is a valid value of this data type.
- */
- boolean verifyDataType(Object value);
-
- String writeValue(Object value);
-
- Object readValue(String value);
-
- /**
- * Returns the corresponding Java type of this datatype
- */
- String getStringType();
-
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype;
+
+import java.io.Externalizable;
+
+/**
+ * Abstract representation of a datatype.
+ */
+public interface DataType extends Externalizable {
+
+ /**
+ * Returns true if the given value is a valid value of this data type.
+ */
+ boolean verifyDataType(Object value);
+
+ String writeValue(Object value);
+
+ Object readValue(String value);
+
+ /**
+ * Returns the corresponding Java type of this datatype
+ */
+ String getStringType();
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeFactory.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeFactory.java
index d91a8fb..aeff7b7 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeFactory.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeFactory.java
@@ -1,29 +1,29 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype;
-
-import java.io.Serializable;
-
-
-/**
- * A factory for creating a datatype.
- */
-public interface DataTypeFactory extends Serializable {
-
- DataType createDataType();
-
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype;
+
+import java.io.Serializable;
+
+
+/**
+ * A factory for creating a datatype.
+ */
+public interface DataTypeFactory extends Serializable {
+
+ DataType createDataType();
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeRegistry.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeRegistry.java
index 92f5f7d..f0b2d09 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeRegistry.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/DataTypeRegistry.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype;
-
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.NewInstanceDataTypeFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.BooleanDataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.EnumDataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.FloatDataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.IntegerDataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.StringDataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.UndefinedDataType;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataTypeRegistry {
-
- public static Hashtable<String,DataTypeFactory> instance = null;
-
- public static DataTypeFactory getFactory(String type) {
- assert(type!=null && !type.isEmpty());
-
- if (instance==null) {
- instance = new Hashtable<String,DataTypeFactory>();
- instance.put("BooleanDataType", new NewInstanceDataTypeFactory(BooleanDataType.class));
- instance.put("EnumDataType", new NewInstanceDataTypeFactory(EnumDataType.class));
- instance.put("FloatDataType", new NewInstanceDataTypeFactory(FloatDataType.class));
- instance.put("IntegerDataType", new NewInstanceDataTypeFactory(IntegerDataType.class));
- instance.put("StringDataType", new NewInstanceDataTypeFactory(StringDataType.class));
- instance.put("UndefinedDataType", new NewInstanceDataTypeFactory(UndefinedDataType.class));
- }
- DataTypeFactory factory = instance.get(type);
- if (factory==null)
- factory = instance.get("UndefinedDataType");
- return factory;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype;
+
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.NewInstanceDataTypeFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.BooleanDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.EnumDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.FloatDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.IntegerDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.StringDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type.UndefinedDataType;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataTypeRegistry {
+
+ public static Hashtable<String,DataTypeFactory> instance = null;
+
+ public static DataTypeFactory getFactory(String type) {
+ assert(type!=null && !type.isEmpty());
+
+ if (instance==null) {
+ instance = new Hashtable<String,DataTypeFactory>();
+ instance.put("BooleanDataType", new NewInstanceDataTypeFactory(BooleanDataType.class));
+ instance.put("EnumDataType", new NewInstanceDataTypeFactory(EnumDataType.class));
+ instance.put("FloatDataType", new NewInstanceDataTypeFactory(FloatDataType.class));
+ instance.put("IntegerDataType", new NewInstanceDataTypeFactory(IntegerDataType.class));
+ instance.put("StringDataType", new NewInstanceDataTypeFactory(StringDataType.class));
+ instance.put("UndefinedDataType", new NewInstanceDataTypeFactory(UndefinedDataType.class));
+ }
+ DataTypeFactory factory = instance.get(type);
+ if (factory==null)
+ factory = instance.get("UndefinedDataType");
+ return factory;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/InstanceDataTypeFactory.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/InstanceDataTypeFactory.java
index c989276..9467138 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/InstanceDataTypeFactory.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/InstanceDataTypeFactory.java
@@ -1,53 +1,53 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeFactory;
-
-/**
- * A data type factory that always returns the same instance of a given class.
- */
-public class InstanceDataTypeFactory implements DataTypeFactory {
-
- private static final long serialVersionUID = 510l;
-
- private Class<?> dataTypeClass;
- private DataType instance;
-
- public InstanceDataTypeFactory(final Class<?> dataTypeClass) {
- this.dataTypeClass = dataTypeClass;
- }
-
- public DataType createDataType() {
- if (this.instance == null) {
- try {
- this.instance = (DataType) this.dataTypeClass.newInstance();
- } catch (final IllegalAccessException e) {
- throw new RuntimeException(
- "Could not create data type for class "
- + this.dataTypeClass, e);
- } catch (final InstantiationException e) {
- throw new RuntimeException(
- "Could not create data type for class "
- + this.dataTypeClass, e);
- }
- }
- return this.instance;
- }
-
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeFactory;
+
+/**
+ * A data type factory that always returns the same instance of a given class.
+ */
+public class InstanceDataTypeFactory implements DataTypeFactory {
+
+ private static final long serialVersionUID = 510l;
+
+ private Class<?> dataTypeClass;
+ private DataType instance;
+
+ public InstanceDataTypeFactory(final Class<?> dataTypeClass) {
+ this.dataTypeClass = dataTypeClass;
+ }
+
+ public DataType createDataType() {
+ if (this.instance == null) {
+ try {
+ this.instance = (DataType) this.dataTypeClass.newInstance();
+ } catch (final IllegalAccessException e) {
+ throw new RuntimeException(
+ "Could not create data type for class "
+ + this.dataTypeClass, e);
+ } catch (final InstantiationException e) {
+ throw new RuntimeException(
+ "Could not create data type for class "
+ + this.dataTypeClass, e);
+ }
+ }
+ return this.instance;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/NewInstanceDataTypeFactory.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/NewInstanceDataTypeFactory.java
index b813c0a..831ff2c 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/NewInstanceDataTypeFactory.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/NewInstanceDataTypeFactory.java
@@ -1,47 +1,47 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeFactory;
-
-/**
- * A data type factory that always returns a new instance of a given class.
- */
-public class NewInstanceDataTypeFactory implements DataTypeFactory {
-
- private static final long serialVersionUID = 510l;
-
- private Class<? extends DataType> dataTypeClass;
-
- public NewInstanceDataTypeFactory(final Class<? extends DataType> dataTypeClass) {
- this.dataTypeClass = dataTypeClass;
- }
-
- public DataType createDataType() {
- try {
- return this.dataTypeClass.newInstance();
- } catch (final IllegalAccessException e) {
- throw new RuntimeException("Could not create data type for class "
- + this.dataTypeClass, e);
- } catch (final InstantiationException e) {
- throw new RuntimeException("Could not create data type for class "
- + this.dataTypeClass, e);
- }
- }
-
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeFactory;
+
+/**
+ * A data type factory that always returns a new instance of a given class.
+ */
+public class NewInstanceDataTypeFactory implements DataTypeFactory {
+
+ private static final long serialVersionUID = 510l;
+
+ private Class<? extends DataType> dataTypeClass;
+
+ public NewInstanceDataTypeFactory(final Class<? extends DataType> dataTypeClass) {
+ this.dataTypeClass = dataTypeClass;
+ }
+
+ public DataType createDataType() {
+ try {
+ return this.dataTypeClass.newInstance();
+ } catch (final IllegalAccessException e) {
+ throw new RuntimeException("Could not create data type for class "
+ + this.dataTypeClass, e);
+ } catch (final InstantiationException e) {
+ throw new RuntimeException("Could not create data type for class "
+ + this.dataTypeClass, e);
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/BooleanDataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/BooleanDataType.java
index 03820fc..7058f79 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/BooleanDataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/BooleanDataType.java
@@ -1,59 +1,59 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-
-/**
- * Representation of a boolean datatype.
- */
-public final class BooleanDataType
- implements
- DataType {
-
- private static final long serialVersionUID = 510l;
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- }
-
- public boolean verifyDataType(final Object value) {
- if ( value instanceof Boolean ) {
- return true;
- }
- return false;
- }
-
- public Object readValue(String value) {
- return new Boolean(value);
- }
-
- public String writeValue(Object value) {
- return (Boolean) value ? "true" : "false";
- }
-
- public String getStringType() {
- return "Boolean";
- }
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+
+/**
+ * Representation of a boolean datatype.
+ */
+public final class BooleanDataType
+ implements
+ DataType {
+
+ private static final long serialVersionUID = 510l;
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ }
+
+ public boolean verifyDataType(final Object value) {
+ if ( value instanceof Boolean ) {
+ return true;
+ }
+ return false;
+ }
+
+ public Object readValue(String value) {
+ return new Boolean(value);
+ }
+
+ public String writeValue(Object value) {
+ return (Boolean) value ? "true" : "false";
+ }
+
+ public String getStringType() {
+ return "Boolean";
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/EnumDataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/EnumDataType.java
index f4a95ca..c1dc6df 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/EnumDataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/EnumDataType.java
@@ -1,119 +1,119 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-/**
- * Representation of an Enum datatype.
- */
-public class EnumDataType implements DataType {
-
- private static final long serialVersionUID = 4L;
-
- private String className;
- private transient Map<String, Object> valueMap;
-
- public EnumDataType() {
- }
-
- public EnumDataType(String className) {
- setClassName(className);
- }
-
- public String getClassName() {
- return className;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- className = (String) in.readObject();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(className);
- }
-
- public boolean verifyDataType(final Object value) {
- if (value == null) {
- return true;
- }
- return getValueMap().containsValue(value);
- }
-
- public Object readValue(String value) {
- return getValueMap().get(value);
- }
-
- public String writeValue(Object value) {
- return value == null ? "" : value.toString();
- }
-
- public String getStringType() {
- return className == null ? "java.lang.Object" : className;
- }
-
- public Object[] getValues() {
- return getValueMap().values().toArray();
- }
-
- public String[] getValueNames() {
- return getValueMap().keySet().toArray(new String[0]);
- }
-
- public Map<String, Object> getValueMap() {
- if (this.valueMap == null) {
- try {
- this.valueMap = new HashMap<String, Object>();
- if (className == null) {
- return null;
- }
- Class<?> clazz = Class.forName(className);
- if (!clazz.isEnum()) {
- return null;
- }
- Object[] values = (Object[]) clazz.getMethod("values", null).invoke(clazz, null);
- for (Object value: values) {
- this.valueMap.put(value.toString(), value);
- }
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(
- "Could not find data type " + className);
- } catch (IllegalAccessException e) {
- throw new IllegalArgumentException(
- "IllegalAccessException " + e);
- } catch (InvocationTargetException e) {
- throw new IllegalArgumentException(
- "InvocationTargetException " + e);
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException(
- "NoSuchMethodException " + e);
- }
-
- }
- return this.valueMap;
- }
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+/**
+ * Representation of an Enum datatype.
+ */
+public class EnumDataType implements DataType {
+
+ private static final long serialVersionUID = 4L;
+
+ private String className;
+ private transient Map<String, Object> valueMap;
+
+ public EnumDataType() {
+ }
+
+ public EnumDataType(String className) {
+ setClassName(className);
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ className = (String) in.readObject();
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeObject(className);
+ }
+
+ public boolean verifyDataType(final Object value) {
+ if (value == null) {
+ return true;
+ }
+ return getValueMap().containsValue(value);
+ }
+
+ public Object readValue(String value) {
+ return getValueMap().get(value);
+ }
+
+ public String writeValue(Object value) {
+ return value == null ? "" : value.toString();
+ }
+
+ public String getStringType() {
+ return className == null ? "java.lang.Object" : className;
+ }
+
+ public Object[] getValues() {
+ return getValueMap().values().toArray();
+ }
+
+ public String[] getValueNames() {
+ return getValueMap().keySet().toArray(new String[0]);
+ }
+
+ public Map<String, Object> getValueMap() {
+ if (this.valueMap == null) {
+ try {
+ this.valueMap = new HashMap<String, Object>();
+ if (className == null) {
+ return null;
+ }
+ Class<?> clazz = Class.forName(className);
+ if (!clazz.isEnum()) {
+ return null;
+ }
+ Object[] values = (Object[]) clazz.getMethod("values", null).invoke(clazz, null);
+ for (Object value: values) {
+ this.valueMap.put(value.toString(), value);
+ }
+ } catch (ClassNotFoundException e) {
+ throw new IllegalArgumentException(
+ "Could not find data type " + className);
+ } catch (IllegalAccessException e) {
+ throw new IllegalArgumentException(
+ "IllegalAccessException " + e);
+ } catch (InvocationTargetException e) {
+ throw new IllegalArgumentException(
+ "InvocationTargetException " + e);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException(
+ "NoSuchMethodException " + e);
+ }
+
+ }
+ return this.valueMap;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/FloatDataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/FloatDataType.java
index cc004f9..ef6dbf6 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/FloatDataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/FloatDataType.java
@@ -1,62 +1,62 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-/**
- * Representation of a float datatype.
- */
-public final class FloatDataType
- implements
- DataType {
-
- private static final long serialVersionUID = 510l;
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- }
-
- public boolean verifyDataType(final Object value) {
- if ( value instanceof Float ) {
- return true;
- } else if ( value == null ) {
- return true;
- } else {
- return false;
- }
- }
-
- public Object readValue(String value) {
- return new Float(value);
- }
-
- public String writeValue(Object value) {
- Float f = (Float) value;
- return f == null ? "" : f.toString();
- }
-
- public String getStringType() {
- return "Float";
- }
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+/**
+ * Representation of a float datatype.
+ */
+public final class FloatDataType
+ implements
+ DataType {
+
+ private static final long serialVersionUID = 510l;
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ }
+
+ public boolean verifyDataType(final Object value) {
+ if ( value instanceof Float ) {
+ return true;
+ } else if ( value == null ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public Object readValue(String value) {
+ return new Float(value);
+ }
+
+ public String writeValue(Object value) {
+ Float f = (Float) value;
+ return f == null ? "" : f.toString();
+ }
+
+ public String getStringType() {
+ return "Float";
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/IntegerDataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/IntegerDataType.java
index b534cb7..52bae48 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/IntegerDataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/IntegerDataType.java
@@ -1,63 +1,63 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-/**
- * Representation of an integer datatype.
- */
-public class IntegerDataType
- implements
- DataType {
-
- private static final long serialVersionUID = 510l;
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- }
-
- public boolean verifyDataType(final Object value) {
- if ( value instanceof Integer ) {
- return true;
- } else if ( value == null ) {
- return true;
- } else {
- return false;
- }
- }
-
- public Object readValue(String value) {
- return new Integer(value);
- }
-
- public String writeValue(Object value) {
- Integer i = (Integer) value;
- return i == null ? "" : i.toString();
- }
-
- public String getStringType() {
- return "Integer";
- }
-
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+/**
+ * Representation of an integer datatype.
+ */
+public class IntegerDataType
+ implements
+ DataType {
+
+ private static final long serialVersionUID = 510l;
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ }
+
+ public boolean verifyDataType(final Object value) {
+ if ( value instanceof Integer ) {
+ return true;
+ } else if ( value == null ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public Object readValue(String value) {
+ return new Integer(value);
+ }
+
+ public String writeValue(Object value) {
+ Integer i = (Integer) value;
+ return i == null ? "" : i.toString();
+ }
+
+ public String getStringType() {
+ return "Integer";
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/StringDataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/StringDataType.java
index 25d6cc1..deca741 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/StringDataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/StringDataType.java
@@ -1,59 +1,59 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-/**
- * Representation of a string datatype.
- */
-public class StringDataType implements DataType {
-
- private static final long serialVersionUID = 510l;
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- }
-
- public boolean verifyDataType(final Object value) {
- if ( value instanceof String ) {
- return true;
- } else if ( value == null ) {
- return true;
- } else {
- return false;
- }
- }
-
- public Object readValue(String value) {
- return value;
- }
-
- public String writeValue(Object value) {
- return (String) value;
- }
-
- public String getStringType() {
- return "String";
- }
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+/**
+ * Representation of a string datatype.
+ */
+public class StringDataType implements DataType {
+
+ private static final long serialVersionUID = 510l;
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ }
+
+ public boolean verifyDataType(final Object value) {
+ if ( value instanceof String ) {
+ return true;
+ } else if ( value == null ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public Object readValue(String value) {
+ return value;
+ }
+
+ public String writeValue(Object value) {
+ return (String) value;
+ }
+
+ public String getStringType() {
+ return "String";
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/UndefinedDataType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/UndefinedDataType.java
index f641a9d..d49f673 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/UndefinedDataType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/datatype/impl/type/UndefinedDataType.java
@@ -1,64 +1,64 @@
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-/**
- * Representation of an undefined datatype.
- */
-public final class UndefinedDataType implements DataType {
-
- private static final long serialVersionUID = 510l;
- private static UndefinedDataType instance;
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- }
-
- public static UndefinedDataType getInstance() {
- if (instance == null) {
- instance = new UndefinedDataType();
- }
- return instance;
- }
-
- public boolean verifyDataType(final Object value) {
- if (value == null) {
- return true;
- }
- return false;
- }
-
- public Object readValue(String value) {
- throw new IllegalArgumentException("Undefined datatype");
- }
-
- public String writeValue(Object value) {
- throw new IllegalArgumentException("Undefined datatype");
- }
-
- public String getStringType() {
- return "Object";
- }
-}
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.impl.type;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+/**
+ * Representation of an undefined datatype.
+ */
+public final class UndefinedDataType implements DataType {
+
+ private static final long serialVersionUID = 510l;
+ private static UndefinedDataType instance;
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ }
+
+ public static UndefinedDataType getInstance() {
+ if (instance == null) {
+ instance = new UndefinedDataType();
+ }
+ return instance;
+ }
+
+ public boolean verifyDataType(final Object value) {
+ if (value == null) {
+ return true;
+ }
+ return false;
+ }
+
+ public Object readValue(String value) {
+ throw new IllegalArgumentException("Undefined datatype");
+ }
+
+ public String writeValue(Object value) {
+ throw new IllegalArgumentException("Undefined datatype");
+ }
+
+ public String getStringType() {
+ return "Object";
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/ParameterDefinitionImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/ParameterDefinitionImpl.java
index e39b89e..ef58bda 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/ParameterDefinitionImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/ParameterDefinitionImpl.java
@@ -1,64 +1,64 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
-
-import java.io.Serializable;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
-
-public class ParameterDefinitionImpl implements ParameterDefinition, Serializable {
-
- private static final long serialVersionUID = 510l;
-
- private String name;
- private DataType type;
-
- public ParameterDefinitionImpl() {
- }
-
- public ParameterDefinitionImpl(String name, DataType type) {
- setName(name);
- setType(type);
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- if (name == null) {
- throw new IllegalArgumentException("Name cannot be null");
- }
- this.name = name;
- }
-
- public DataType getType() {
- return type;
- }
-
- public void setType(DataType type) {
- if (type == null) {
- throw new IllegalArgumentException("Data type cannot be null");
- }
- this.type = type;
- }
-
- public String toString() {
- return name;
- }
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
+
+import java.io.Serializable;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataType;
+
+public class ParameterDefinitionImpl implements ParameterDefinition, Serializable {
+
+ private static final long serialVersionUID = 510l;
+
+ private String name;
+ private DataType type;
+
+ public ParameterDefinitionImpl() {
+ }
+
+ public ParameterDefinitionImpl(String name, DataType type) {
+ setName(name);
+ setType(type);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ if (name == null) {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ this.name = name;
+ }
+
+ public DataType getType() {
+ return type;
+ }
+
+ public void setType(DataType type) {
+ if (type == null) {
+ throw new IllegalArgumentException("Data type cannot be null");
+ }
+ this.type = type;
+ }
+
+ public String toString() {
+ return name;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionExtensionImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionExtensionImpl.java
index 5b57fd6..c00f968 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionExtensionImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionExtensionImpl.java
@@ -1,62 +1,62 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkDefinitionExtension;
-
-public class WorkDefinitionExtensionImpl extends WorkDefinitionImpl implements WorkDefinitionExtension {
-
- private static final long serialVersionUID = 510l;
-
- private String displayName;
- private String explanationText;
- private String icon;
- private String editor;
-
- public String getDisplayName() {
- return displayName;
- }
-
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
-
- public String getExplanationText() {
- return explanationText;
- }
-
- public void setExplanationText(String explanationText) {
- this.explanationText = explanationText;
- }
-
- public String getIcon() {
- return icon;
- }
-
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- public String getCustomEditor() {
- return editor;
- }
-
- public void setCustomEditor(String editor) {
- this.editor = editor;
- }
-
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkDefinitionExtension;
+
+public class WorkDefinitionExtensionImpl extends WorkDefinitionImpl implements WorkDefinitionExtension {
+
+ private static final long serialVersionUID = 510l;
+
+ private String displayName;
+ private String explanationText;
+ private String icon;
+ private String editor;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getExplanationText() {
+ return explanationText;
+ }
+
+ public void setExplanationText(String explanationText) {
+ this.explanationText = explanationText;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getCustomEditor() {
+ return editor;
+ }
+
+ public void setCustomEditor(String editor) {
+ this.editor = editor;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionImpl.java
index 0508d57..622da9c 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkDefinitionImpl.java
@@ -1,104 +1,104 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
-
-import java.io.Serializable;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkDefinition;
-
-public class WorkDefinitionImpl implements WorkDefinition, Serializable {
-
- private static final long serialVersionUID = 510l;
-
- private String name;
- private Map<String, ParameterDefinition> parameters = new LinkedHashMap<String, ParameterDefinition>();
- private Map<String, ParameterDefinition> results = new LinkedHashMap<String, ParameterDefinition>();
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Set<ParameterDefinition> getParameters() {
- return new LinkedHashSet<ParameterDefinition>(parameters.values());
- }
-
- public void setParameters(Set<ParameterDefinition> parameters) {
- this.parameters.clear();
- Iterator<ParameterDefinition> iterator = parameters.iterator();
- while (iterator.hasNext()) {
- addParameter(iterator.next());
- }
- }
-
- public void addParameter(ParameterDefinition parameter) {
- parameters.put(parameter.getName(), parameter);
- }
-
- public void removeParameter(String name) {
- parameters.remove(name);
- }
-
- public String[] getParameterNames() {
- return parameters.keySet().toArray(new String[parameters.size()]);
- }
-
- public ParameterDefinition getParameter(String name) {
- return parameters.get(name);
- }
-
- public Set<ParameterDefinition> getResults() {
- return new LinkedHashSet<ParameterDefinition>(results.values());
- }
-
- public void setResults(Set<ParameterDefinition> results) {
- this.results.clear();
- Iterator<ParameterDefinition> it = results.iterator();
- while (it.hasNext()) {
- addResult(it.next());
- }
- }
-
- public void addResult(ParameterDefinition result) {
- results.put(result.getName(), result);
- }
-
- public void removeResult(String name) {
- results.remove(name);
- }
-
- public String[] getResultNames() {
- return results.keySet().toArray(new String[results.size()]);
- }
-
- public ParameterDefinition getResult(String name) {
- return results.get(name);
- }
-
- public String toString() {
- return name;
- }
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.WorkDefinition;
+
+public class WorkDefinitionImpl implements WorkDefinition, Serializable {
+
+ private static final long serialVersionUID = 510l;
+
+ private String name;
+ private Map<String, ParameterDefinition> parameters = new LinkedHashMap<String, ParameterDefinition>();
+ private Map<String, ParameterDefinition> results = new LinkedHashMap<String, ParameterDefinition>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Set<ParameterDefinition> getParameters() {
+ return new LinkedHashSet<ParameterDefinition>(parameters.values());
+ }
+
+ public void setParameters(Set<ParameterDefinition> parameters) {
+ this.parameters.clear();
+ Iterator<ParameterDefinition> iterator = parameters.iterator();
+ while (iterator.hasNext()) {
+ addParameter(iterator.next());
+ }
+ }
+
+ public void addParameter(ParameterDefinition parameter) {
+ parameters.put(parameter.getName(), parameter);
+ }
+
+ public void removeParameter(String name) {
+ parameters.remove(name);
+ }
+
+ public String[] getParameterNames() {
+ return parameters.keySet().toArray(new String[parameters.size()]);
+ }
+
+ public ParameterDefinition getParameter(String name) {
+ return parameters.get(name);
+ }
+
+ public Set<ParameterDefinition> getResults() {
+ return new LinkedHashSet<ParameterDefinition>(results.values());
+ }
+
+ public void setResults(Set<ParameterDefinition> results) {
+ this.results.clear();
+ Iterator<ParameterDefinition> it = results.iterator();
+ while (it.hasNext()) {
+ addResult(it.next());
+ }
+ }
+
+ public void addResult(ParameterDefinition result) {
+ results.put(result.getName(), result);
+ }
+
+ public void removeResult(String name) {
+ results.remove(name);
+ }
+
+ public String[] getResultNames() {
+ return results.keySet().toArray(new String[results.size()]);
+ }
+
+ public ParameterDefinition getResult(String name) {
+ return results.get(name);
+ }
+
+ public String toString() {
+ return name;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkImpl.java
index b04e1b9..c8d8077 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/drools/process/core/impl/WorkImpl.java
@@ -1,96 +1,96 @@
-/*
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.Work;
-
-public class WorkImpl implements Work, Serializable {
-
- private static final long serialVersionUID = 510l;
-
- private String name;
- private Map<String, Object> parameters = new HashMap<String, Object>();
- private Map<String, ParameterDefinition> parameterDefinitions = new HashMap<String, ParameterDefinition>();
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setParameter(String name, Object value) {
- if (name == null) {
- throw new NullPointerException("Parameter name is null");
- }
- parameters.put(name, value);
- }
-
- public void setParameters(Map<String, Object> parameters) {
- if (parameters == null) {
- throw new NullPointerException();
- }
- this.parameters = new HashMap<String, Object>(parameters);
- }
-
- public Object getParameter(String name) {
- if (name == null) {
- throw new NullPointerException("Parameter name is null");
- }
- return parameters.get(name);
- }
-
- public Map<String, Object> getParameters() {
- return Collections.unmodifiableMap(parameters);
- }
-
- public String toString() {
- return "Work " + name;
- }
-
- public void setParameterDefinitions(Set<ParameterDefinition> parameterDefinitions) {
- this.parameterDefinitions.clear();
- for (ParameterDefinition parameterDefinition: parameterDefinitions) {
- addParameterDefinition(parameterDefinition);
- }
- }
-
- public void addParameterDefinition(ParameterDefinition parameterDefinition) {
- this.parameterDefinitions.put(parameterDefinition.getName(), parameterDefinition);
- }
-
- public Set<ParameterDefinition> getParameterDefinitions() {
- return new HashSet<ParameterDefinition>(parameterDefinitions.values());
- }
-
- public String[] getParameterNames() {
- return parameterDefinitions.keySet().toArray(new String[parameterDefinitions.size()]);
- }
-
- public ParameterDefinition getParameterDefinition(String name) {
- return parameterDefinitions.get(name);
- }
-}
+/*
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.Work;
+
+public class WorkImpl implements Work, Serializable {
+
+ private static final long serialVersionUID = 510l;
+
+ private String name;
+ private Map<String, Object> parameters = new HashMap<String, Object>();
+ private Map<String, ParameterDefinition> parameterDefinitions = new HashMap<String, ParameterDefinition>();
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setParameter(String name, Object value) {
+ if (name == null) {
+ throw new NullPointerException("Parameter name is null");
+ }
+ parameters.put(name, value);
+ }
+
+ public void setParameters(Map<String, Object> parameters) {
+ if (parameters == null) {
+ throw new NullPointerException();
+ }
+ this.parameters = new HashMap<String, Object>(parameters);
+ }
+
+ public Object getParameter(String name) {
+ if (name == null) {
+ throw new NullPointerException("Parameter name is null");
+ }
+ return parameters.get(name);
+ }
+
+ public Map<String, Object> getParameters() {
+ return Collections.unmodifiableMap(parameters);
+ }
+
+ public String toString() {
+ return "Work " + name;
+ }
+
+ public void setParameterDefinitions(Set<ParameterDefinition> parameterDefinitions) {
+ this.parameterDefinitions.clear();
+ for (ParameterDefinition parameterDefinition: parameterDefinitions) {
+ addParameterDefinition(parameterDefinition);
+ }
+ }
+
+ public void addParameterDefinition(ParameterDefinition parameterDefinition) {
+ this.parameterDefinitions.put(parameterDefinition.getName(), parameterDefinition);
+ }
+
+ public Set<ParameterDefinition> getParameterDefinitions() {
+ return new HashSet<ParameterDefinition>(parameterDefinitions.values());
+ }
+
+ public String[] getParameterNames() {
+ return parameterDefinitions.keySet().toArray(new String[parameterDefinitions.size()]);
+ }
+
+ public ParameterDefinition getParameterDefinition(String name) {
+ return parameterDefinitions.get(name);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmCustomTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmCustomTaskFeatureContainer.java
index 102d3ca..0570702 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmCustomTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmCustomTaskFeatureContainer.java
@@ -1,380 +1,380 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataInputAssociation;
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.ItemKind;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.Property;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.JBPM5RuntimeExtension;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.customeditor.SampleCustomEditor;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeRegistry;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.ParameterDefinitionImpl;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.WorkDefinitionImpl;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.WorkImpl;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomTaskFeatureContainer;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class JbpmCustomTaskFeatureContainer extends CustomTaskFeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context instanceof IAddContext) {
- Object obj = ((IAddContext)context).getNewObject();
- if (obj instanceof Task) {
- if ( getId((Task)obj)!=null )
- return obj;
-// Task task = (Task)obj;
-// EAttribute taskNameAttr = ModelPackage.eINSTANCE.getDocumentRoot_TaskName();
-// String taskName = (String)task.eGet(taskNameAttr);
-// String myName = (String)customTaskDescriptor.getProperty("taskName");
-// if (taskName!=null && myName!=null && taskName.equals(myName))
-// return obj;
- }
- }
- else
- return super.getApplyObject(context);
-
- return null;
- }
-
- public String getId(EObject object) {
- if (object==null)
- return null;
-
- List<EStructuralFeature> features = ModelUtil.getAnyAttributes(object);
- for (EStructuralFeature f : features) {
- if ("taskName".equals(f.getName())) {
- Object attrValue = object.eGet(f);
- if (attrValue!=null) {
- // search the extension attributes for a "taskName" and compare it
- // against the new object's taskName value
- for (Property p : customTaskDescriptor.getProperties()) {
- String propValue = p.getFirstStringValue();
- if (attrValue.equals(propValue))
- return getId();
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- String iconPath = (String) customTaskDescriptor.getProperty("icon");
- if (iconPath != null && iconPath.trim().length() > 0) {
- return new JbpmCreateCustomTaskFeature(fp,
- customTaskDescriptor.getName(),
- customTaskDescriptor.getDescription(),
- iconPath);
- }
- return new JbpmCreateCustomTaskFeature(fp,
- customTaskDescriptor.getName(),
- customTaskDescriptor.getDescription());
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- final String iconPath = (String) customTaskDescriptor.getProperty("icon");
- if (iconPath != null && iconPath.trim().length() > 0) {
- return new AddCustomTaskFeature(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, iconPath);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE,
- GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
- return new AddCustomTaskFeature(fp) {
-
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_USER_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE,
- GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- return new ICustomFeature[] {new DoubleClickFeature(fp)};
- }
-
- public class JbpmCreateCustomTaskFeature extends CreateCustomTaskFeature {
-
- private String imagePath = null;
-
- public JbpmCreateCustomTaskFeature(IFeatureProvider fp, String name,
- String description) {
- super(fp, name, description);
- }
-
- public JbpmCreateCustomTaskFeature(IFeatureProvider fp, String name,
- String description, String imagePath) {
- this(fp, name, description);
- this.imagePath = imagePath;
- }
-
- @Override
- public String getCreateImageId() {
- return this.imagePath;
- }
- }
-
- public class DoubleClickFeature implements ICustomFeature {
-
- protected IFeatureProvider fp;
- boolean hasChanges = false;
-
- /**
- * @param fp
- */
- public DoubleClickFeature(IFeatureProvider fp) {
- this.fp = fp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.IFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public boolean isAvailable(IContext context) {
- PictogramElement[] pes = ((ICustomContext)context).getPictogramElements();
- if (pes.length==1) {
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(pes[0]);
- String id = getId(be);
- return id!=null;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.custom.ICustomFeature#canExecute(org.eclipse.graphiti.features.context.ICustomContext)
- */
- @Override
- public boolean canExecute(ICustomContext context) {
- return canExecute((IContext)context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.IFeature#canExecute(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public boolean canExecute(IContext context) {
- BPMN2Editor editor = (BPMN2Editor)getFeatureProvider().getDiagramTypeProvider().getDiagramEditor();
- IBpmn2RuntimeExtension rte = editor.getTargetRuntime().getRuntimeExtension();
- if (rte instanceof JBPM5RuntimeExtension && context instanceof ICustomContext) {
- PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
- if (pes.length==1) {
- Object o = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pes[0]);
- if (o instanceof Task) {
- Task task = (Task)o;
- List<EStructuralFeature> features = ModelUtil.getAnyAttributes(task);
- for (EStructuralFeature f : features) {
- if ("taskName".equals(f.getName())) {
- // make sure the Work Item Definition exists
- String taskName = (String)task.eGet(f);
- return ((JBPM5RuntimeExtension)rte).getWorkItemDefinition(taskName) != null;
- }
- }
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
- */
- @Override
- public void execute(ICustomContext context) {
- execute((IContext)context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.IFeature#execute(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public void execute(IContext context) {
- BPMN2Editor editor = (BPMN2Editor)getFeatureProvider().getDiagramTypeProvider().getDiagramEditor();
- PictogramElement pe = ((ICustomContext) context).getPictogramElements()[0];
- final Task task = (Task)Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
- String taskName = "";
- List<EStructuralFeature> features = ModelUtil.getAnyAttributes(task);
- for (EStructuralFeature f : features) {
- if ("taskName".equals(f.getName())) {
- taskName = (String)task.eGet(f);
- break;
- }
- }
-
- IBpmn2RuntimeExtension rte = editor.getTargetRuntime().getRuntimeExtension();
- WorkItemDefinition workItemDefinition = ((JBPM5RuntimeExtension)rte).getWorkItemDefinition(taskName);
-
- WorkDefinitionImpl wd = new WorkDefinitionImpl();
- for (String name : workItemDefinition.getParameters().keySet()) {
- String type = workItemDefinition.getParameters().get(name);
- DataTypeFactory factory = DataTypeRegistry.getFactory(type);
- wd.addParameter( new ParameterDefinitionImpl(name,factory.createDataType()) );
- }
-
- WorkImpl w = new WorkImpl();
- w.setName(taskName);
- w.setParameterDefinitions(wd.getParameters());
- for (DataInputAssociation dia : task.getDataInputAssociations()) {
- DataInput dataInput = (DataInput)dia.getTargetRef();
- if (dataInput!=null) {
- String name = dataInput.getName();
- ItemDefinition itemDefinition = dataInput.getItemSubjectRef();
- if (itemDefinition!=null) {
- Object structureRef = itemDefinition.getStructureRef();
- if (ModelUtil.isStringWrapper(structureRef)) {
- ParameterDefinition parameterDefinition = w.getParameterDefinition(name);
- try {
- Object value = parameterDefinition.getType().readValue(ModelUtil.getStringWrapperValue(structureRef));
- w.setParameter(name, value);
- }
- catch (Exception e) {
- }
- }
- }
- }
- }
-
- SampleCustomEditor dialog = new SampleCustomEditor(editor.getSite().getShell());
- dialog.setWorkDefinition(wd);
- dialog.setWork(w);
- dialog.show();
-
- hasChanges = dialog.getWork() != w;
- if (hasChanges) {
- w = (WorkImpl) dialog.getWork();
- for (DataInputAssociation dia : task.getDataInputAssociations()) {
- DataInput dataInput = (DataInput)dia.getTargetRef();
- if (dataInput!=null) {
- String name = dataInput.getName();
- ItemDefinition itemDefinition = dataInput.getItemSubjectRef();
- // this always comes back as a String from the SampleCustomEditor dialog
- String value = (String)w.getParameter(name);
- if (value!=null && !value.isEmpty()) {
- EObject structureRef = ModelUtil.createStringWrapper(value);
- if (itemDefinition==null) {
- itemDefinition = Bpmn2ModelerFactory.create(ItemDefinition.class);
- ModelUtil.getDefinitions(task).getRootElements().add(itemDefinition);
- ModelUtil.setID(itemDefinition);
- }
- itemDefinition.setItemKind(ItemKind.PHYSICAL);
- itemDefinition.setStructureRef(structureRef);
- dataInput.setItemSubjectRef(itemDefinition);
- }
- else if (itemDefinition!=null) {
- // TODO: remove Item Definition if it is on longer referenced anywhere
-// ModelUtil.getDefinitions(task).getRootElements().remove(itemDefinition);
- dataInput.setItemSubjectRef(null);
- }
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.IFeature#canUndo(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public boolean canUndo(IContext context) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.IFeature#hasDoneChanges()
- */
- @Override
- public boolean hasDoneChanges() {
- return hasChanges;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.IName#getName()
- */
- @Override
- public String getName() {
- return "Configure Work Item";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.IDescription#getDescription()
- */
- @Override
- public String getDescription() {
- return "Configure the Parameters for this Custom Task";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.IFeatureProviderHolder#getFeatureProvider()
- */
- @Override
- public IFeatureProvider getFeatureProvider() {
- return fp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.custom.ICustomFeature#getImageId()
- */
- @Override
- public String getImageId() {
- return ImageProvider.IMG_16_CONFIGURE;
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataInputAssociation;
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.ItemKind;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.Property;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.JBPM5RuntimeExtension;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.customeditor.SampleCustomEditor;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.ParameterDefinition;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.datatype.DataTypeRegistry;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.ParameterDefinitionImpl;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.WorkDefinitionImpl;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.drools.process.core.impl.WorkImpl;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomTaskFeatureContainer;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class JbpmCustomTaskFeatureContainer extends CustomTaskFeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context instanceof IAddContext) {
+ Object obj = ((IAddContext)context).getNewObject();
+ if (obj instanceof Task) {
+ if ( getId((Task)obj)!=null )
+ return obj;
+// Task task = (Task)obj;
+// EAttribute taskNameAttr = ModelPackage.eINSTANCE.getDocumentRoot_TaskName();
+// String taskName = (String)task.eGet(taskNameAttr);
+// String myName = (String)customTaskDescriptor.getProperty("taskName");
+// if (taskName!=null && myName!=null && taskName.equals(myName))
+// return obj;
+ }
+ }
+ else
+ return super.getApplyObject(context);
+
+ return null;
+ }
+
+ public String getId(EObject object) {
+ if (object==null)
+ return null;
+
+ List<EStructuralFeature> features = ModelUtil.getAnyAttributes(object);
+ for (EStructuralFeature f : features) {
+ if ("taskName".equals(f.getName())) {
+ Object attrValue = object.eGet(f);
+ if (attrValue!=null) {
+ // search the extension attributes for a "taskName" and compare it
+ // against the new object's taskName value
+ for (Property p : customTaskDescriptor.getProperties()) {
+ String propValue = p.getFirstStringValue();
+ if (attrValue.equals(propValue))
+ return getId();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ String iconPath = (String) customTaskDescriptor.getProperty("icon");
+ if (iconPath != null && iconPath.trim().length() > 0) {
+ return new JbpmCreateCustomTaskFeature(fp,
+ customTaskDescriptor.getName(),
+ customTaskDescriptor.getDescription(),
+ iconPath);
+ }
+ return new JbpmCreateCustomTaskFeature(fp,
+ customTaskDescriptor.getName(),
+ customTaskDescriptor.getDescription());
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ final String iconPath = (String) customTaskDescriptor.getProperty("icon");
+ if (iconPath != null && iconPath.trim().length() > 0) {
+ return new AddCustomTaskFeature(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, iconPath);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE,
+ GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+ return new AddCustomTaskFeature(fp) {
+
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_USER_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE,
+ GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ return new ICustomFeature[] {new DoubleClickFeature(fp)};
+ }
+
+ public class JbpmCreateCustomTaskFeature extends CreateCustomTaskFeature {
+
+ private String imagePath = null;
+
+ public JbpmCreateCustomTaskFeature(IFeatureProvider fp, String name,
+ String description) {
+ super(fp, name, description);
+ }
+
+ public JbpmCreateCustomTaskFeature(IFeatureProvider fp, String name,
+ String description, String imagePath) {
+ this(fp, name, description);
+ this.imagePath = imagePath;
+ }
+
+ @Override
+ public String getCreateImageId() {
+ return this.imagePath;
+ }
+ }
+
+ public class DoubleClickFeature implements ICustomFeature {
+
+ protected IFeatureProvider fp;
+ boolean hasChanges = false;
+
+ /**
+ * @param fp
+ */
+ public DoubleClickFeature(IFeatureProvider fp) {
+ this.fp = fp;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.IFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean isAvailable(IContext context) {
+ PictogramElement[] pes = ((ICustomContext)context).getPictogramElements();
+ if (pes.length==1) {
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(pes[0]);
+ String id = getId(be);
+ return id!=null;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#canExecute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public boolean canExecute(ICustomContext context) {
+ return canExecute((IContext)context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.IFeature#canExecute(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean canExecute(IContext context) {
+ BPMN2Editor editor = (BPMN2Editor)getFeatureProvider().getDiagramTypeProvider().getDiagramEditor();
+ IBpmn2RuntimeExtension rte = editor.getTargetRuntime().getRuntimeExtension();
+ if (rte instanceof JBPM5RuntimeExtension && context instanceof ICustomContext) {
+ PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
+ if (pes.length==1) {
+ Object o = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pes[0]);
+ if (o instanceof Task) {
+ Task task = (Task)o;
+ List<EStructuralFeature> features = ModelUtil.getAnyAttributes(task);
+ for (EStructuralFeature f : features) {
+ if ("taskName".equals(f.getName())) {
+ // make sure the Work Item Definition exists
+ String taskName = (String)task.eGet(f);
+ return ((JBPM5RuntimeExtension)rte).getWorkItemDefinition(taskName) != null;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public void execute(ICustomContext context) {
+ execute((IContext)context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.IFeature#execute(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public void execute(IContext context) {
+ BPMN2Editor editor = (BPMN2Editor)getFeatureProvider().getDiagramTypeProvider().getDiagramEditor();
+ PictogramElement pe = ((ICustomContext) context).getPictogramElements()[0];
+ final Task task = (Task)Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
+ String taskName = "";
+ List<EStructuralFeature> features = ModelUtil.getAnyAttributes(task);
+ for (EStructuralFeature f : features) {
+ if ("taskName".equals(f.getName())) {
+ taskName = (String)task.eGet(f);
+ break;
+ }
+ }
+
+ IBpmn2RuntimeExtension rte = editor.getTargetRuntime().getRuntimeExtension();
+ WorkItemDefinition workItemDefinition = ((JBPM5RuntimeExtension)rte).getWorkItemDefinition(taskName);
+
+ WorkDefinitionImpl wd = new WorkDefinitionImpl();
+ for (String name : workItemDefinition.getParameters().keySet()) {
+ String type = workItemDefinition.getParameters().get(name);
+ DataTypeFactory factory = DataTypeRegistry.getFactory(type);
+ wd.addParameter( new ParameterDefinitionImpl(name,factory.createDataType()) );
+ }
+
+ WorkImpl w = new WorkImpl();
+ w.setName(taskName);
+ w.setParameterDefinitions(wd.getParameters());
+ for (DataInputAssociation dia : task.getDataInputAssociations()) {
+ DataInput dataInput = (DataInput)dia.getTargetRef();
+ if (dataInput!=null) {
+ String name = dataInput.getName();
+ ItemDefinition itemDefinition = dataInput.getItemSubjectRef();
+ if (itemDefinition!=null) {
+ Object structureRef = itemDefinition.getStructureRef();
+ if (ModelUtil.isStringWrapper(structureRef)) {
+ ParameterDefinition parameterDefinition = w.getParameterDefinition(name);
+ try {
+ Object value = parameterDefinition.getType().readValue(ModelUtil.getStringWrapperValue(structureRef));
+ w.setParameter(name, value);
+ }
+ catch (Exception e) {
+ }
+ }
+ }
+ }
+ }
+
+ SampleCustomEditor dialog = new SampleCustomEditor(editor.getSite().getShell());
+ dialog.setWorkDefinition(wd);
+ dialog.setWork(w);
+ dialog.show();
+
+ hasChanges = dialog.getWork() != w;
+ if (hasChanges) {
+ w = (WorkImpl) dialog.getWork();
+ for (DataInputAssociation dia : task.getDataInputAssociations()) {
+ DataInput dataInput = (DataInput)dia.getTargetRef();
+ if (dataInput!=null) {
+ String name = dataInput.getName();
+ ItemDefinition itemDefinition = dataInput.getItemSubjectRef();
+ // this always comes back as a String from the SampleCustomEditor dialog
+ String value = (String)w.getParameter(name);
+ if (value!=null && !value.isEmpty()) {
+ EObject structureRef = ModelUtil.createStringWrapper(value);
+ if (itemDefinition==null) {
+ itemDefinition = Bpmn2ModelerFactory.create(ItemDefinition.class);
+ ModelUtil.getDefinitions(task).getRootElements().add(itemDefinition);
+ ModelUtil.setID(itemDefinition);
+ }
+ itemDefinition.setItemKind(ItemKind.PHYSICAL);
+ itemDefinition.setStructureRef(structureRef);
+ dataInput.setItemSubjectRef(itemDefinition);
+ }
+ else if (itemDefinition!=null) {
+ // TODO: remove Item Definition if it is on longer referenced anywhere
+// ModelUtil.getDefinitions(task).getRootElements().remove(itemDefinition);
+ dataInput.setItemSubjectRef(null);
+ }
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.IFeature#canUndo(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public boolean canUndo(IContext context) {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.IFeature#hasDoneChanges()
+ */
+ @Override
+ public boolean hasDoneChanges() {
+ return hasChanges;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.IName#getName()
+ */
+ @Override
+ public String getName() {
+ return "Configure Work Item";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.IDescription#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return "Configure the Parameters for this Custom Task";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.IFeatureProviderHolder#getFeatureProvider()
+ */
+ @Override
+ public IFeatureProvider getFeatureProvider() {
+ return fp;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#getImageId()
+ */
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_CONFIGURE;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmSignalEventDefinitionFeatureContainer.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmSignalEventDefinitionFeatureContainer.java
index 448fdb4..408e179 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmSignalEventDefinitionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmSignalEventDefinitionFeatureContainer.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
-
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.ui.features.event.definitions.SignalEventDefinitionContainer;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmSignalEventDefinitionFeatureContainer extends SignalEventDefinitionContainer {
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateSignalEventDefinition(fp) {
- public boolean canCreate(ICreateContext context) {
- if (super.canCreate(context)) {
- Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
- if (bo instanceof ThrowEvent) {
- ThrowEvent te = (ThrowEvent)bo;
- return te.getEventDefinitions().size()==0;
- }
- if (bo instanceof CatchEvent) {
- CatchEvent ce = (CatchEvent)bo;
- return ce.getEventDefinitions().size()==0;
- }
- }
- return false;
- }
- };
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
+
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.ui.features.event.definitions.SignalEventDefinitionContainer;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmSignalEventDefinitionFeatureContainer extends SignalEventDefinitionContainer {
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateSignalEventDefinition(fp) {
+ public boolean canCreate(ICreateContext context) {
+ if (super.canCreate(context)) {
+ Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
+ if (bo instanceof ThrowEvent) {
+ ThrowEvent te = (ThrowEvent)bo;
+ return te.getEventDefinitions().size()==0;
+ }
+ if (bo instanceof CatchEvent) {
+ CatchEvent ce = (CatchEvent)bo;
+ return ce.getEventDefinitions().size()==0;
+ }
+ }
+ return false;
+ }
+ };
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTerminateEventDefinitionFeatureContainer.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTerminateEventDefinitionFeatureContainer.java
index fdc7eac..9e15e85 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTerminateEventDefinitionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTerminateEventDefinitionFeatureContainer.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
-
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.ui.features.event.definitions.TerminateEventDefinitionFeatureContainer;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmTerminateEventDefinitionFeatureContainer extends TerminateEventDefinitionFeatureContainer {
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateTerminateEventDefinition(fp) {
- public boolean canCreate(ICreateContext context) {
- if (super.canCreate(context)) {
- Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
- if (bo instanceof ThrowEvent) {
- ThrowEvent te = (ThrowEvent)bo;
- return te.getEventDefinitions().size()==0;
- }
- if (bo instanceof CatchEvent) {
- CatchEvent ce = (CatchEvent)bo;
- return ce.getEventDefinitions().size()==0;
- }
- }
- return false;
- }
- };
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
+
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.ui.features.event.definitions.TerminateEventDefinitionFeatureContainer;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmTerminateEventDefinitionFeatureContainer extends TerminateEventDefinitionFeatureContainer {
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateTerminateEventDefinition(fp) {
+ public boolean canCreate(ICreateContext context) {
+ if (super.canCreate(context)) {
+ Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
+ if (bo instanceof ThrowEvent) {
+ ThrowEvent te = (ThrowEvent)bo;
+ return te.getEventDefinitions().size()==0;
+ }
+ if (bo instanceof CatchEvent) {
+ CatchEvent ce = (CatchEvent)bo;
+ return ce.getEventDefinitions().size()==0;
+ }
+ }
+ return false;
+ }
+ };
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTimerEventDefinitionFeatureContainer.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTimerEventDefinitionFeatureContainer.java
index 72dc9c1..37c9eeb 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTimerEventDefinitionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/features/JbpmTimerEventDefinitionFeatureContainer.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
-
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.ui.features.event.definitions.TimerEventDefinitionContainer;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmTimerEventDefinitionFeatureContainer extends TimerEventDefinitionContainer {
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateTimerEventDefinition(fp) {
- public boolean canCreate(ICreateContext context) {
- if (super.canCreate(context)) {
- Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
- if (bo instanceof ThrowEvent) {
- ThrowEvent te = (ThrowEvent)bo;
- return te.getEventDefinitions().size()==0;
- }
- if (bo instanceof CatchEvent) {
- CatchEvent ce = (CatchEvent)bo;
- return ce.getEventDefinitions().size()==0;
- }
- }
- return false;
- }
- };
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features;
+
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.ui.features.event.definitions.TimerEventDefinitionContainer;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmTimerEventDefinitionFeatureContainer extends TimerEventDefinitionContainer {
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateTimerEventDefinition(fp) {
+ public boolean canCreate(ICreateContext context) {
+ if (super.canCreate(context)) {
+ Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
+ if (bo instanceof ThrowEvent) {
+ ThrowEvent te = (ThrowEvent)bo;
+ return te.getEventDefinitions().size()==0;
+ }
+ if (bo instanceof CatchEvent) {
+ CatchEvent ce = (CatchEvent)bo;
+ return ce.getEventDefinitions().size()==0;
+ }
+ }
+ return false;
+ }
+ };
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/DocumentRoot.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/DocumentRoot.java
index 8b70b88..44be489 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/DocumentRoot.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/DocumentRoot.java
@@ -1,333 +1,333 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
-
-import java.math.BigInteger;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Document Root</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getGlobal <em>Global</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getImportType <em>Import Type</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnEntryScript <em>On Entry Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnExitScript <em>On Exit Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPackageName <em>Package Name</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPriority <em>Priority</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getRuleFlowGroup <em>Rule Flow Group</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getTaskName <em>Task Name</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getVersion <em>Version</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isWaitForCompletion <em>Wait For Completion</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isIndependent <em>Independent</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot()
- * @model extendedMetaData="name='' kind='mixed' namespace='##targetNamespace'"
- * @generated
- */
-public interface DocumentRoot extends org.eclipse.bpmn2.DocumentRoot {
- /**
- * Returns the value of the '<em><b>Global</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Global</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Global</em>' containment reference.
- * @see #setGlobal(GlobalType)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Global()
- * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
- * extendedMetaData="kind='element' name='global' namespace='##targetNamespace'"
- * @generated
- */
- GlobalType getGlobal();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getGlobal <em>Global</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Global</em>' containment reference.
- * @see #getGlobal()
- * @generated
- */
- void setGlobal(GlobalType value);
-
- /**
- * Returns the value of the '<em><b>Import Type</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Import Type</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Import Type</em>' containment reference.
- * @see #setImportType(ImportType)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_ImportType()
- * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
- * extendedMetaData="kind='element' name='import' namespace='##targetNamespace'"
- * @generated
- */
- ImportType getImportType();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getImportType <em>Import Type</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Import Type</em>' containment reference.
- * @see #getImportType()
- * @generated
- */
- void setImportType(ImportType value);
-
- /**
- * Returns the value of the '<em><b>On Entry Script</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>On Entry Script</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>On Entry Script</em>' containment reference.
- * @see #setOnEntryScript(OnEntryScriptType)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_OnEntryScript()
- * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
- * extendedMetaData="kind='element' name='onEntry-script' namespace='##targetNamespace'"
- * @generated
- */
- OnEntryScriptType getOnEntryScript();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnEntryScript <em>On Entry Script</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>On Entry Script</em>' containment reference.
- * @see #getOnEntryScript()
- * @generated
- */
- void setOnEntryScript(OnEntryScriptType value);
-
- /**
- * Returns the value of the '<em><b>On Exit Script</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>On Exit Script</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>On Exit Script</em>' containment reference.
- * @see #setOnExitScript(OnExitScriptType)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_OnExitScript()
- * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
- * extendedMetaData="kind='element' name='onExit-script' namespace='##targetNamespace'"
- * @generated
- */
- OnExitScriptType getOnExitScript();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnExitScript <em>On Exit Script</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>On Exit Script</em>' containment reference.
- * @see #getOnExitScript()
- * @generated
- */
- void setOnExitScript(OnExitScriptType value);
-
- /**
- * Returns the value of the '<em><b>Package Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Package Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Package Name</em>' attribute.
- * @see #setPackageName(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_PackageName()
- * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.PackageNameType"
- * extendedMetaData="kind='attribute' name='packageName' namespace='##targetNamespace'"
- * @generated
- */
- String getPackageName();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPackageName <em>Package Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Package Name</em>' attribute.
- * @see #getPackageName()
- * @generated
- */
- void setPackageName(String value);
-
- /**
- * Returns the value of the '<em><b>Priority</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Priority</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Priority</em>' attribute.
- * @see #setPriority(BigInteger)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Priority()
- * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.PriorityType"
- * extendedMetaData="kind='attribute' name='priority' namespace='##targetNamespace'"
- * @generated
- */
- BigInteger getPriority();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPriority <em>Priority</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Priority</em>' attribute.
- * @see #getPriority()
- * @generated
- */
- void setPriority(BigInteger value);
-
- /**
- * Returns the value of the '<em><b>Rule Flow Group</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Rule Flow Group</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Rule Flow Group</em>' attribute.
- * @see #setRuleFlowGroup(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_RuleFlowGroup()
- * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.RuleFlowGroupType"
- * extendedMetaData="kind='attribute' name='ruleFlowGroup' namespace='##targetNamespace'"
- * @generated
- */
- String getRuleFlowGroup();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getRuleFlowGroup <em>Rule Flow Group</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Rule Flow Group</em>' attribute.
- * @see #getRuleFlowGroup()
- * @generated
- */
- void setRuleFlowGroup(String value);
-
- /**
- * Returns the value of the '<em><b>Task Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Task Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Task Name</em>' attribute.
- * @see #setTaskName(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_TaskName()
- * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.TaskNameType"
- * extendedMetaData="kind='attribute' name='taskName' namespace='##targetNamespace'"
- * @generated
- */
- String getTaskName();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getTaskName <em>Task Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Task Name</em>' attribute.
- * @see #getTaskName()
- * @generated
- */
- void setTaskName(String value);
-
- /**
- * Returns the value of the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Version</em>' attribute.
- * @see #setVersion(BigInteger)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Version()
- * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.VersionType"
- * extendedMetaData="kind='attribute' name='version' namespace='##targetNamespace'"
- * @generated
- */
- BigInteger getVersion();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Version</em>' attribute.
- * @see #getVersion()
- * @generated
- */
- void setVersion(BigInteger value);
-
- /**
- * Returns the value of the '<em><b>Wait For Completion</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Wait For Completion</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Wait For Completion</em>' attribute.
- * @see #setWaitForCompletion(boolean)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_WaitForCompletion()
- * @model extendedMetaData="kind='attribute' name='waitForCompletion' namespace='##targetNamespace'"
- * @generated
- */
- boolean isWaitForCompletion();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isWaitForCompletion <em>Wait For Completion</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Wait For Completion</em>' attribute.
- * @see #isWaitForCompletion()
- * @generated
- */
- void setWaitForCompletion(boolean value);
-
- /**
- * Returns the value of the '<em><b>Independent</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Independent</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Independent</em>' attribute.
- * @see #setIndependent(boolean)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Independent()
- * @model extendedMetaData="kind='attribute' name='independent' namespace='##targetNamespace'"
- * @generated
- */
- boolean isIndependent();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isIndependent <em>Independent</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Independent</em>' attribute.
- * @see #isIndependent()
- * @generated
- */
- void setIndependent(boolean value);
-
-} // DocumentRoot
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
+
+import java.math.BigInteger;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Document Root</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getGlobal <em>Global</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getImportType <em>Import Type</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnEntryScript <em>On Entry Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnExitScript <em>On Exit Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPackageName <em>Package Name</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPriority <em>Priority</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getRuleFlowGroup <em>Rule Flow Group</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getTaskName <em>Task Name</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getVersion <em>Version</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isWaitForCompletion <em>Wait For Completion</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isIndependent <em>Independent</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot()
+ * @model extendedMetaData="name='' kind='mixed' namespace='##targetNamespace'"
+ * @generated
+ */
+public interface DocumentRoot extends org.eclipse.bpmn2.DocumentRoot {
+ /**
+ * Returns the value of the '<em><b>Global</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Global</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Global</em>' containment reference.
+ * @see #setGlobal(GlobalType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Global()
+ * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
+ * extendedMetaData="kind='element' name='global' namespace='##targetNamespace'"
+ * @generated
+ */
+ GlobalType getGlobal();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getGlobal <em>Global</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Global</em>' containment reference.
+ * @see #getGlobal()
+ * @generated
+ */
+ void setGlobal(GlobalType value);
+
+ /**
+ * Returns the value of the '<em><b>Import Type</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Import Type</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Import Type</em>' containment reference.
+ * @see #setImportType(ImportType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_ImportType()
+ * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
+ * extendedMetaData="kind='element' name='import' namespace='##targetNamespace'"
+ * @generated
+ */
+ ImportType getImportType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getImportType <em>Import Type</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Import Type</em>' containment reference.
+ * @see #getImportType()
+ * @generated
+ */
+ void setImportType(ImportType value);
+
+ /**
+ * Returns the value of the '<em><b>On Entry Script</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>On Entry Script</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>On Entry Script</em>' containment reference.
+ * @see #setOnEntryScript(OnEntryScriptType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_OnEntryScript()
+ * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
+ * extendedMetaData="kind='element' name='onEntry-script' namespace='##targetNamespace'"
+ * @generated
+ */
+ OnEntryScriptType getOnEntryScript();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnEntryScript <em>On Entry Script</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>On Entry Script</em>' containment reference.
+ * @see #getOnEntryScript()
+ * @generated
+ */
+ void setOnEntryScript(OnEntryScriptType value);
+
+ /**
+ * Returns the value of the '<em><b>On Exit Script</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>On Exit Script</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>On Exit Script</em>' containment reference.
+ * @see #setOnExitScript(OnExitScriptType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_OnExitScript()
+ * @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
+ * extendedMetaData="kind='element' name='onExit-script' namespace='##targetNamespace'"
+ * @generated
+ */
+ OnExitScriptType getOnExitScript();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getOnExitScript <em>On Exit Script</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>On Exit Script</em>' containment reference.
+ * @see #getOnExitScript()
+ * @generated
+ */
+ void setOnExitScript(OnExitScriptType value);
+
+ /**
+ * Returns the value of the '<em><b>Package Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Package Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Package Name</em>' attribute.
+ * @see #setPackageName(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_PackageName()
+ * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.PackageNameType"
+ * extendedMetaData="kind='attribute' name='packageName' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getPackageName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPackageName <em>Package Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Package Name</em>' attribute.
+ * @see #getPackageName()
+ * @generated
+ */
+ void setPackageName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Priority</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Priority</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Priority</em>' attribute.
+ * @see #setPriority(BigInteger)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Priority()
+ * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.PriorityType"
+ * extendedMetaData="kind='attribute' name='priority' namespace='##targetNamespace'"
+ * @generated
+ */
+ BigInteger getPriority();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getPriority <em>Priority</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Priority</em>' attribute.
+ * @see #getPriority()
+ * @generated
+ */
+ void setPriority(BigInteger value);
+
+ /**
+ * Returns the value of the '<em><b>Rule Flow Group</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Rule Flow Group</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Rule Flow Group</em>' attribute.
+ * @see #setRuleFlowGroup(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_RuleFlowGroup()
+ * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.RuleFlowGroupType"
+ * extendedMetaData="kind='attribute' name='ruleFlowGroup' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getRuleFlowGroup();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getRuleFlowGroup <em>Rule Flow Group</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Rule Flow Group</em>' attribute.
+ * @see #getRuleFlowGroup()
+ * @generated
+ */
+ void setRuleFlowGroup(String value);
+
+ /**
+ * Returns the value of the '<em><b>Task Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Task Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Task Name</em>' attribute.
+ * @see #setTaskName(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_TaskName()
+ * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.TaskNameType"
+ * extendedMetaData="kind='attribute' name='taskName' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTaskName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getTaskName <em>Task Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Task Name</em>' attribute.
+ * @see #getTaskName()
+ * @generated
+ */
+ void setTaskName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Version</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(BigInteger)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Version()
+ * @model dataType="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.VersionType"
+ * extendedMetaData="kind='attribute' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ BigInteger getVersion();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#getVersion <em>Version</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(BigInteger value);
+
+ /**
+ * Returns the value of the '<em><b>Wait For Completion</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Wait For Completion</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Wait For Completion</em>' attribute.
+ * @see #setWaitForCompletion(boolean)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_WaitForCompletion()
+ * @model extendedMetaData="kind='attribute' name='waitForCompletion' namespace='##targetNamespace'"
+ * @generated
+ */
+ boolean isWaitForCompletion();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isWaitForCompletion <em>Wait For Completion</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Wait For Completion</em>' attribute.
+ * @see #isWaitForCompletion()
+ * @generated
+ */
+ void setWaitForCompletion(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Independent</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Independent</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Independent</em>' attribute.
+ * @see #setIndependent(boolean)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getDocumentRoot_Independent()
+ * @model extendedMetaData="kind='attribute' name='independent' namespace='##targetNamespace'"
+ * @generated
+ */
+ boolean isIndependent();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot#isIndependent <em>Independent</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Independent</em>' attribute.
+ * @see #isIndependent()
+ * @generated
+ */
+ void setIndependent(boolean value);
+
+} // DocumentRoot
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/GlobalType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/GlobalType.java
index 703999b..0d9069e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/GlobalType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/GlobalType.java
@@ -1,83 +1,83 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Global Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getIdentifier <em>Identifier</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getGlobalType()
- * @model extendedMetaData="name='global_._type' kind='element' namespace='##targetNamespace'"
- * @generated
- */
-public interface GlobalType extends EObject {
- /**
- * Returns the value of the '<em><b>Identifier</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Identifier</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Identifier</em>' attribute.
- * @see #setIdentifier(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getGlobalType_Identifier()
- * @model required="true"
- * extendedMetaData="kind='attribute' name='identifier' namespace='##targetNamespace'"
- * @generated
- */
- String getIdentifier();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getIdentifier <em>Identifier</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Identifier</em>' attribute.
- * @see #getIdentifier()
- * @generated
- */
- void setIdentifier(String value);
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see #setType(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getGlobalType_Type()
- * @model required="true"
- * extendedMetaData="kind='attribute' name='type' namespace='##targetNamespace'"
- * @generated
- */
- String getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see #getType()
- * @generated
- */
- void setType(String value);
-
-} // GlobalType
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Global Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getIdentifier <em>Identifier</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getType <em>Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getGlobalType()
+ * @model extendedMetaData="name='global_._type' kind='element' namespace='##targetNamespace'"
+ * @generated
+ */
+public interface GlobalType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Identifier</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Identifier</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Identifier</em>' attribute.
+ * @see #setIdentifier(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getGlobalType_Identifier()
+ * @model required="true"
+ * extendedMetaData="kind='attribute' name='identifier' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getIdentifier();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getIdentifier <em>Identifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Identifier</em>' attribute.
+ * @see #getIdentifier()
+ * @generated
+ */
+ void setIdentifier(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' attribute.
+ * @see #setType(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getGlobalType_Type()
+ * @model required="true"
+ * extendedMetaData="kind='attribute' name='type' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType#getType <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' attribute.
+ * @see #getType()
+ * @generated
+ */
+ void setType(String value);
+
+} // GlobalType
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ImportType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ImportType.java
index 3f2dd30..4fa3609 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ImportType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ImportType.java
@@ -1,55 +1,55 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Import Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getImportType()
- * @model extendedMetaData="name='import_._type' kind='element' namespace='##targetNamespace'"
- * @generated
- */
-public interface ImportType extends EObject {
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getImportType_Name()
- * @model required="true"
- * extendedMetaData="kind='attribute' name='name'"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // ImportType
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Import Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getImportType()
+ * @model extendedMetaData="name='import_._type' kind='element' namespace='##targetNamespace'"
+ * @generated
+ */
+public interface ImportType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getImportType_Name()
+ * @model required="true"
+ * extendedMetaData="kind='attribute' name='name'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // ImportType
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ModelFactory.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ModelFactory.java
index e94fa9b..d5f665c 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ModelFactory.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/ModelFactory.java
@@ -1,82 +1,82 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage
- * @generated
- */
-public interface ModelFactory extends EFactory {
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- ModelFactory eINSTANCE = org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.ModelFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Document Root</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Document Root</em>'.
- * @generated
- */
- DocumentRoot createDocumentRoot();
-
- /**
- * Returns a new object of class '<em>Global Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Global Type</em>'.
- * @generated
- */
- GlobalType createGlobalType();
-
- /**
- * Returns a new object of class '<em>Import Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Import Type</em>'.
- * @generated
- */
- ImportType createImportType();
-
- /**
- * Returns a new object of class '<em>On Entry Script Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>On Entry Script Type</em>'.
- * @generated
- */
- OnEntryScriptType createOnEntryScriptType();
-
- /**
- * Returns a new object of class '<em>On Exit Script Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>On Exit Script Type</em>'.
- * @generated
- */
- OnExitScriptType createOnExitScriptType();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- ModelPackage getModelPackage();
-
-} //ModelFactory
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage
+ * @generated
+ */
+public interface ModelFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ ModelFactory eINSTANCE = org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.ModelFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Document Root</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Document Root</em>'.
+ * @generated
+ */
+ DocumentRoot createDocumentRoot();
+
+ /**
+ * Returns a new object of class '<em>Global Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Global Type</em>'.
+ * @generated
+ */
+ GlobalType createGlobalType();
+
+ /**
+ * Returns a new object of class '<em>Import Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Import Type</em>'.
+ * @generated
+ */
+ ImportType createImportType();
+
+ /**
+ * Returns a new object of class '<em>On Entry Script Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>On Entry Script Type</em>'.
+ * @generated
+ */
+ OnEntryScriptType createOnEntryScriptType();
+
+ /**
+ * Returns a new object of class '<em>On Exit Script Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>On Exit Script Type</em>'.
+ * @generated
+ */
+ OnExitScriptType createOnExitScriptType();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ ModelPackage getModelPackage();
+
+} //ModelFactory
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnEntryScriptType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnEntryScriptType.java
index e784aad..fb5bbf4 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnEntryScriptType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnEntryScriptType.java
@@ -1,83 +1,83 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>On Entry Script Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScript <em>Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScriptFormat <em>Script Format</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnEntryScriptType()
- * @model extendedMetaData="name='onEntry-script_._type' kind='elementOnly' namespace='##targetNamespace'"
- * @generated
- */
-public interface OnEntryScriptType extends EObject {
- /**
- * Returns the value of the '<em><b>Script</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Script</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Script</em>' attribute.
- * @see #setScript(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnEntryScriptType_Script()
- * @model required="true"
- * extendedMetaData="kind='element' name='script' namespace='##targetNamespace'"
- * @generated
- */
- String getScript();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScript <em>Script</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Script</em>' attribute.
- * @see #getScript()
- * @generated
- */
- void setScript(String value);
-
- /**
- * Returns the value of the '<em><b>Script Format</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Script Format</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Script Format</em>' attribute.
- * @see #setScriptFormat(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnEntryScriptType_ScriptFormat()
- * @model required="true"
- * extendedMetaData="kind='attribute' name='scriptFormat' namespace='##targetNamespace'"
- * @generated
- */
- String getScriptFormat();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScriptFormat <em>Script Format</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Script Format</em>' attribute.
- * @see #getScriptFormat()
- * @generated
- */
- void setScriptFormat(String value);
-
-} // OnEntryScriptType
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>On Entry Script Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScript <em>Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScriptFormat <em>Script Format</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnEntryScriptType()
+ * @model extendedMetaData="name='onEntry-script_._type' kind='elementOnly' namespace='##targetNamespace'"
+ * @generated
+ */
+public interface OnEntryScriptType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Script</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Script</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Script</em>' attribute.
+ * @see #setScript(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnEntryScriptType_Script()
+ * @model required="true"
+ * extendedMetaData="kind='element' name='script' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getScript();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScript <em>Script</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Script</em>' attribute.
+ * @see #getScript()
+ * @generated
+ */
+ void setScript(String value);
+
+ /**
+ * Returns the value of the '<em><b>Script Format</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Script Format</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Script Format</em>' attribute.
+ * @see #setScriptFormat(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnEntryScriptType_ScriptFormat()
+ * @model required="true"
+ * extendedMetaData="kind='attribute' name='scriptFormat' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getScriptFormat();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType#getScriptFormat <em>Script Format</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Script Format</em>' attribute.
+ * @see #getScriptFormat()
+ * @generated
+ */
+ void setScriptFormat(String value);
+
+} // OnEntryScriptType
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnExitScriptType.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnExitScriptType.java
index 17f7efa..ffc7931 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnExitScriptType.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/OnExitScriptType.java
@@ -1,83 +1,83 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>On Exit Script Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScript <em>Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScriptFormat <em>Script Format</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnExitScriptType()
- * @model extendedMetaData="name='onExit-script_._type' kind='elementOnly' namespace='##targetNamespace'"
- * @generated
- */
-public interface OnExitScriptType extends EObject {
- /**
- * Returns the value of the '<em><b>Script</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Script</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Script</em>' attribute.
- * @see #setScript(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnExitScriptType_Script()
- * @model required="true"
- * extendedMetaData="kind='element' name='script' namespace='##targetNamespace'"
- * @generated
- */
- String getScript();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScript <em>Script</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Script</em>' attribute.
- * @see #getScript()
- * @generated
- */
- void setScript(String value);
-
- /**
- * Returns the value of the '<em><b>Script Format</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Script Format</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Script Format</em>' attribute.
- * @see #setScriptFormat(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnExitScriptType_ScriptFormat()
- * @model required="true"
- * extendedMetaData="kind='attribute' name='scriptFormat' namespace='##targetNamespace'"
- * @generated
- */
- String getScriptFormat();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScriptFormat <em>Script Format</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Script Format</em>' attribute.
- * @see #getScriptFormat()
- * @generated
- */
- void setScriptFormat(String value);
-
-} // OnExitScriptType
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>On Exit Script Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScript <em>Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScriptFormat <em>Script Format</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnExitScriptType()
+ * @model extendedMetaData="name='onExit-script_._type' kind='elementOnly' namespace='##targetNamespace'"
+ * @generated
+ */
+public interface OnExitScriptType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Script</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Script</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Script</em>' attribute.
+ * @see #setScript(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnExitScriptType_Script()
+ * @model required="true"
+ * extendedMetaData="kind='element' name='script' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getScript();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScript <em>Script</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Script</em>' attribute.
+ * @see #getScript()
+ * @generated
+ */
+ void setScript(String value);
+
+ /**
+ * Returns the value of the '<em><b>Script Format</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Script Format</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Script Format</em>' attribute.
+ * @see #setScriptFormat(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#getOnExitScriptType_ScriptFormat()
+ * @model required="true"
+ * extendedMetaData="kind='attribute' name='scriptFormat' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getScriptFormat();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType#getScriptFormat <em>Script Format</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Script Format</em>' attribute.
+ * @see #getScriptFormat()
+ * @generated
+ */
+ void setScriptFormat(String value);
+
+} // OnExitScriptType
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/DocumentRootImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/DocumentRootImpl.java
index 48fb007..65d5543 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/DocumentRootImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/DocumentRootImpl.java
@@ -1,669 +1,669 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import java.math.BigInteger;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.FeatureMap;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Document Root</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getGlobal <em>Global</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getImportType <em>Import Type</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getOnEntryScript <em>On Entry Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getOnExitScript <em>On Exit Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getPackageName <em>Package Name</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getPriority <em>Priority</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getRuleFlowGroup <em>Rule Flow Group</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getTaskName <em>Task Name</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getVersion <em>Version</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#isWaitForCompletion <em>Wait For Completion</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#isIndependent <em>Independent</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DocumentRootImpl extends org.eclipse.bpmn2.impl.DocumentRootImpl implements DocumentRoot {
- /**
- * The default value of the '{@link #getPackageName() <em>Package Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPackageName()
- * @generated
- * @ordered
- */
- protected static final String PACKAGE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPackageName() <em>Package Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPackageName()
- * @generated
- * @ordered
- */
- protected String packageName = PACKAGE_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPriority() <em>Priority</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPriority()
- * @generated
- * @ordered
- */
- protected static final BigInteger PRIORITY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPriority() <em>Priority</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPriority()
- * @generated
- * @ordered
- */
- protected BigInteger priority = PRIORITY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getRuleFlowGroup() <em>Rule Flow Group</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRuleFlowGroup()
- * @generated
- * @ordered
- */
- protected static final String RULE_FLOW_GROUP_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getRuleFlowGroup() <em>Rule Flow Group</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRuleFlowGroup()
- * @generated
- * @ordered
- */
- protected String ruleFlowGroup = RULE_FLOW_GROUP_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTaskName() <em>Task Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTaskName()
- * @generated
- * @ordered
- */
- protected static final String TASK_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTaskName() <em>Task Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTaskName()
- * @generated
- * @ordered
- */
- protected String taskName = TASK_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected static final BigInteger VERSION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected BigInteger version = VERSION_EDEFAULT;
-
- /**
- * The default value of the '{@link #isWaitForCompletion() <em>Wait For Completion</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isWaitForCompletion()
- * @generated
- * @ordered
- */
- protected static final boolean WAIT_FOR_COMPLETION_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isWaitForCompletion() <em>Wait For Completion</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isWaitForCompletion()
- * @generated
- * @ordered
- */
- protected boolean waitForCompletion = WAIT_FOR_COMPLETION_EDEFAULT;
-
- /**
- * The default value of the '{@link #isIndependent() <em>Independent</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isIndependent()
- * @generated
- * @ordered
- */
- protected static final boolean INDEPENDENT_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isIndependent() <em>Independent</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isIndependent()
- * @generated
- * @ordered
- */
- protected boolean independent = INDEPENDENT_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected DocumentRootImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return ModelPackage.Literals.DOCUMENT_ROOT;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public GlobalType getGlobal() {
- return (GlobalType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__GLOBAL, true);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetGlobal(GlobalType newGlobal, NotificationChain msgs) {
- return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__GLOBAL, newGlobal, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setGlobal(GlobalType newGlobal) {
- ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__GLOBAL, newGlobal);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ImportType getImportType() {
- return (ImportType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__IMPORT_TYPE, true);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetImportType(ImportType newImportType, NotificationChain msgs) {
- return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__IMPORT_TYPE, newImportType, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setImportType(ImportType newImportType) {
- ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__IMPORT_TYPE, newImportType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OnEntryScriptType getOnEntryScript() {
- return (OnEntryScriptType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, true);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOnEntryScript(OnEntryScriptType newOnEntryScript, NotificationChain msgs) {
- return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, newOnEntryScript, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setOnEntryScript(OnEntryScriptType newOnEntryScript) {
- ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, newOnEntryScript);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OnExitScriptType getOnExitScript() {
- return (OnExitScriptType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, true);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOnExitScript(OnExitScriptType newOnExitScript, NotificationChain msgs) {
- return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, newOnExitScript, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setOnExitScript(OnExitScriptType newOnExitScript) {
- ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, newOnExitScript);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPackageName() {
- return packageName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPackageName(String newPackageName) {
- String oldPackageName = packageName;
- packageName = newPackageName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME, oldPackageName, packageName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public BigInteger getPriority() {
- return priority;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPriority(BigInteger newPriority) {
- BigInteger oldPriority = priority;
- priority = newPriority;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__PRIORITY, oldPriority, priority));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getRuleFlowGroup() {
- return ruleFlowGroup;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setRuleFlowGroup(String newRuleFlowGroup) {
- String oldRuleFlowGroup = ruleFlowGroup;
- ruleFlowGroup = newRuleFlowGroup;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP, oldRuleFlowGroup, ruleFlowGroup));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getTaskName() {
- return taskName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTaskName(String newTaskName) {
- String oldTaskName = taskName;
- taskName = newTaskName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__TASK_NAME, oldTaskName, taskName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public BigInteger getVersion() {
- return version;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setVersion(BigInteger newVersion) {
- BigInteger oldVersion = version;
- version = newVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__VERSION, oldVersion, version));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isWaitForCompletion() {
- return waitForCompletion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setWaitForCompletion(boolean newWaitForCompletion) {
- boolean oldWaitForCompletion = waitForCompletion;
- waitForCompletion = newWaitForCompletion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION, oldWaitForCompletion, waitForCompletion));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isIndependent() {
- return independent;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setIndependent(boolean newIndependent) {
- boolean oldIndependent = independent;
- independent = newIndependent;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__INDEPENDENT, oldIndependent, independent));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case ModelPackage.DOCUMENT_ROOT__GLOBAL:
- return basicSetGlobal(null, msgs);
- case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
- return basicSetImportType(null, msgs);
- case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
- return basicSetOnEntryScript(null, msgs);
- case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
- return basicSetOnExitScript(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ModelPackage.DOCUMENT_ROOT__GLOBAL:
- return getGlobal();
- case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
- return getImportType();
- case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
- return getOnEntryScript();
- case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
- return getOnExitScript();
- case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
- return getPackageName();
- case ModelPackage.DOCUMENT_ROOT__PRIORITY:
- return getPriority();
- case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
- return getRuleFlowGroup();
- case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
- return getTaskName();
- case ModelPackage.DOCUMENT_ROOT__VERSION:
- return getVersion();
- case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
- return isWaitForCompletion();
- case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
- return isIndependent();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ModelPackage.DOCUMENT_ROOT__GLOBAL:
- setGlobal((GlobalType)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
- setImportType((ImportType)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
- setOnEntryScript((OnEntryScriptType)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
- setOnExitScript((OnExitScriptType)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
- setPackageName((String)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__PRIORITY:
- setPriority((BigInteger)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
- setRuleFlowGroup((String)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
- setTaskName((String)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__VERSION:
- setVersion((BigInteger)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
- setWaitForCompletion((Boolean)newValue);
- return;
- case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
- setIndependent((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case ModelPackage.DOCUMENT_ROOT__GLOBAL:
- setGlobal((GlobalType)null);
- return;
- case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
- setImportType((ImportType)null);
- return;
- case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
- setOnEntryScript((OnEntryScriptType)null);
- return;
- case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
- setOnExitScript((OnExitScriptType)null);
- return;
- case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
- setPackageName(PACKAGE_NAME_EDEFAULT);
- return;
- case ModelPackage.DOCUMENT_ROOT__PRIORITY:
- setPriority(PRIORITY_EDEFAULT);
- return;
- case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
- setRuleFlowGroup(RULE_FLOW_GROUP_EDEFAULT);
- return;
- case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
- setTaskName(TASK_NAME_EDEFAULT);
- return;
- case ModelPackage.DOCUMENT_ROOT__VERSION:
- setVersion(VERSION_EDEFAULT);
- return;
- case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
- setWaitForCompletion(WAIT_FOR_COMPLETION_EDEFAULT);
- return;
- case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
- setIndependent(INDEPENDENT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ModelPackage.DOCUMENT_ROOT__GLOBAL:
- return getGlobal() != null;
- case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
- return getImportType() != null;
- case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
- return getOnEntryScript() != null;
- case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
- return getOnExitScript() != null;
- case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
- return PACKAGE_NAME_EDEFAULT == null ? packageName != null : !PACKAGE_NAME_EDEFAULT.equals(packageName);
- case ModelPackage.DOCUMENT_ROOT__PRIORITY:
- return PRIORITY_EDEFAULT == null ? priority != null : !PRIORITY_EDEFAULT.equals(priority);
- case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
- return RULE_FLOW_GROUP_EDEFAULT == null ? ruleFlowGroup != null : !RULE_FLOW_GROUP_EDEFAULT.equals(ruleFlowGroup);
- case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
- return TASK_NAME_EDEFAULT == null ? taskName != null : !TASK_NAME_EDEFAULT.equals(taskName);
- case ModelPackage.DOCUMENT_ROOT__VERSION:
- return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
- case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
- return waitForCompletion != WAIT_FOR_COMPLETION_EDEFAULT;
- case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
- return independent != INDEPENDENT_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (packageName: ");
- result.append(packageName);
- result.append(", priority: ");
- result.append(priority);
- result.append(", ruleFlowGroup: ");
- result.append(ruleFlowGroup);
- result.append(", taskName: ");
- result.append(taskName);
- result.append(", version: ");
- result.append(version);
- result.append(", waitForCompletion: ");
- result.append(waitForCompletion);
- result.append(", independent: ");
- result.append(independent);
- result.append(')');
- return result.toString();
- }
-
-} //DocumentRootImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import java.math.BigInteger;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Document Root</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getGlobal <em>Global</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getImportType <em>Import Type</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getOnEntryScript <em>On Entry Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getOnExitScript <em>On Exit Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getPackageName <em>Package Name</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getPriority <em>Priority</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getRuleFlowGroup <em>Rule Flow Group</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getTaskName <em>Task Name</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#getVersion <em>Version</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#isWaitForCompletion <em>Wait For Completion</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.DocumentRootImpl#isIndependent <em>Independent</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DocumentRootImpl extends org.eclipse.bpmn2.impl.DocumentRootImpl implements DocumentRoot {
+ /**
+ * The default value of the '{@link #getPackageName() <em>Package Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPackageName()
+ * @generated
+ * @ordered
+ */
+ protected static final String PACKAGE_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPackageName() <em>Package Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPackageName()
+ * @generated
+ * @ordered
+ */
+ protected String packageName = PACKAGE_NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPriority() <em>Priority</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPriority()
+ * @generated
+ * @ordered
+ */
+ protected static final BigInteger PRIORITY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPriority() <em>Priority</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPriority()
+ * @generated
+ * @ordered
+ */
+ protected BigInteger priority = PRIORITY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getRuleFlowGroup() <em>Rule Flow Group</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRuleFlowGroup()
+ * @generated
+ * @ordered
+ */
+ protected static final String RULE_FLOW_GROUP_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getRuleFlowGroup() <em>Rule Flow Group</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRuleFlowGroup()
+ * @generated
+ * @ordered
+ */
+ protected String ruleFlowGroup = RULE_FLOW_GROUP_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTaskName() <em>Task Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTaskName()
+ * @generated
+ * @ordered
+ */
+ protected static final String TASK_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTaskName() <em>Task Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTaskName()
+ * @generated
+ * @ordered
+ */
+ protected String taskName = TASK_NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final BigInteger VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected BigInteger version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isWaitForCompletion() <em>Wait For Completion</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isWaitForCompletion()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean WAIT_FOR_COMPLETION_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isWaitForCompletion() <em>Wait For Completion</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isWaitForCompletion()
+ * @generated
+ * @ordered
+ */
+ protected boolean waitForCompletion = WAIT_FOR_COMPLETION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isIndependent() <em>Independent</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIndependent()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean INDEPENDENT_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isIndependent() <em>Independent</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIndependent()
+ * @generated
+ * @ordered
+ */
+ protected boolean independent = INDEPENDENT_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DocumentRootImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ModelPackage.Literals.DOCUMENT_ROOT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GlobalType getGlobal() {
+ return (GlobalType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__GLOBAL, true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetGlobal(GlobalType newGlobal, NotificationChain msgs) {
+ return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__GLOBAL, newGlobal, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGlobal(GlobalType newGlobal) {
+ ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__GLOBAL, newGlobal);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ImportType getImportType() {
+ return (ImportType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__IMPORT_TYPE, true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetImportType(ImportType newImportType, NotificationChain msgs) {
+ return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__IMPORT_TYPE, newImportType, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setImportType(ImportType newImportType) {
+ ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__IMPORT_TYPE, newImportType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OnEntryScriptType getOnEntryScript() {
+ return (OnEntryScriptType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetOnEntryScript(OnEntryScriptType newOnEntryScript, NotificationChain msgs) {
+ return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, newOnEntryScript, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOnEntryScript(OnEntryScriptType newOnEntryScript) {
+ ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, newOnEntryScript);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OnExitScriptType getOnExitScript() {
+ return (OnExitScriptType)getMixed().get(ModelPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetOnExitScript(OnExitScriptType newOnExitScript, NotificationChain msgs) {
+ return ((FeatureMap.Internal)getMixed()).basicAdd(ModelPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, newOnExitScript, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOnExitScript(OnExitScriptType newOnExitScript) {
+ ((FeatureMap.Internal)getMixed()).set(ModelPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, newOnExitScript);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getPackageName() {
+ return packageName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPackageName(String newPackageName) {
+ String oldPackageName = packageName;
+ packageName = newPackageName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME, oldPackageName, packageName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigInteger getPriority() {
+ return priority;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPriority(BigInteger newPriority) {
+ BigInteger oldPriority = priority;
+ priority = newPriority;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__PRIORITY, oldPriority, priority));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getRuleFlowGroup() {
+ return ruleFlowGroup;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setRuleFlowGroup(String newRuleFlowGroup) {
+ String oldRuleFlowGroup = ruleFlowGroup;
+ ruleFlowGroup = newRuleFlowGroup;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP, oldRuleFlowGroup, ruleFlowGroup));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTaskName() {
+ return taskName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTaskName(String newTaskName) {
+ String oldTaskName = taskName;
+ taskName = newTaskName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__TASK_NAME, oldTaskName, taskName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigInteger getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVersion(BigInteger newVersion) {
+ BigInteger oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isWaitForCompletion() {
+ return waitForCompletion;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setWaitForCompletion(boolean newWaitForCompletion) {
+ boolean oldWaitForCompletion = waitForCompletion;
+ waitForCompletion = newWaitForCompletion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION, oldWaitForCompletion, waitForCompletion));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isIndependent() {
+ return independent;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIndependent(boolean newIndependent) {
+ boolean oldIndependent = independent;
+ independent = newIndependent;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DOCUMENT_ROOT__INDEPENDENT, oldIndependent, independent));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case ModelPackage.DOCUMENT_ROOT__GLOBAL:
+ return basicSetGlobal(null, msgs);
+ case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
+ return basicSetImportType(null, msgs);
+ case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
+ return basicSetOnEntryScript(null, msgs);
+ case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
+ return basicSetOnExitScript(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ModelPackage.DOCUMENT_ROOT__GLOBAL:
+ return getGlobal();
+ case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
+ return getImportType();
+ case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
+ return getOnEntryScript();
+ case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
+ return getOnExitScript();
+ case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
+ return getPackageName();
+ case ModelPackage.DOCUMENT_ROOT__PRIORITY:
+ return getPriority();
+ case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
+ return getRuleFlowGroup();
+ case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
+ return getTaskName();
+ case ModelPackage.DOCUMENT_ROOT__VERSION:
+ return getVersion();
+ case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
+ return isWaitForCompletion();
+ case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
+ return isIndependent();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ModelPackage.DOCUMENT_ROOT__GLOBAL:
+ setGlobal((GlobalType)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
+ setImportType((ImportType)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
+ setOnEntryScript((OnEntryScriptType)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
+ setOnExitScript((OnExitScriptType)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
+ setPackageName((String)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__PRIORITY:
+ setPriority((BigInteger)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
+ setRuleFlowGroup((String)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
+ setTaskName((String)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__VERSION:
+ setVersion((BigInteger)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
+ setWaitForCompletion((Boolean)newValue);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
+ setIndependent((Boolean)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ModelPackage.DOCUMENT_ROOT__GLOBAL:
+ setGlobal((GlobalType)null);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
+ setImportType((ImportType)null);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
+ setOnEntryScript((OnEntryScriptType)null);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
+ setOnExitScript((OnExitScriptType)null);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
+ setPackageName(PACKAGE_NAME_EDEFAULT);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__PRIORITY:
+ setPriority(PRIORITY_EDEFAULT);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
+ setRuleFlowGroup(RULE_FLOW_GROUP_EDEFAULT);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
+ setTaskName(TASK_NAME_EDEFAULT);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
+ setWaitForCompletion(WAIT_FOR_COMPLETION_EDEFAULT);
+ return;
+ case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
+ setIndependent(INDEPENDENT_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ModelPackage.DOCUMENT_ROOT__GLOBAL:
+ return getGlobal() != null;
+ case ModelPackage.DOCUMENT_ROOT__IMPORT_TYPE:
+ return getImportType() != null;
+ case ModelPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
+ return getOnEntryScript() != null;
+ case ModelPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
+ return getOnExitScript() != null;
+ case ModelPackage.DOCUMENT_ROOT__PACKAGE_NAME:
+ return PACKAGE_NAME_EDEFAULT == null ? packageName != null : !PACKAGE_NAME_EDEFAULT.equals(packageName);
+ case ModelPackage.DOCUMENT_ROOT__PRIORITY:
+ return PRIORITY_EDEFAULT == null ? priority != null : !PRIORITY_EDEFAULT.equals(priority);
+ case ModelPackage.DOCUMENT_ROOT__RULE_FLOW_GROUP:
+ return RULE_FLOW_GROUP_EDEFAULT == null ? ruleFlowGroup != null : !RULE_FLOW_GROUP_EDEFAULT.equals(ruleFlowGroup);
+ case ModelPackage.DOCUMENT_ROOT__TASK_NAME:
+ return TASK_NAME_EDEFAULT == null ? taskName != null : !TASK_NAME_EDEFAULT.equals(taskName);
+ case ModelPackage.DOCUMENT_ROOT__VERSION:
+ return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
+ case ModelPackage.DOCUMENT_ROOT__WAIT_FOR_COMPLETION:
+ return waitForCompletion != WAIT_FOR_COMPLETION_EDEFAULT;
+ case ModelPackage.DOCUMENT_ROOT__INDEPENDENT:
+ return independent != INDEPENDENT_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (packageName: ");
+ result.append(packageName);
+ result.append(", priority: ");
+ result.append(priority);
+ result.append(", ruleFlowGroup: ");
+ result.append(ruleFlowGroup);
+ result.append(", taskName: ");
+ result.append(taskName);
+ result.append(", version: ");
+ result.append(version);
+ result.append(", waitForCompletion: ");
+ result.append(waitForCompletion);
+ result.append(", independent: ");
+ result.append(independent);
+ result.append(')');
+ return result.toString();
+ }
+
+} //DocumentRootImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/GlobalTypeImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/GlobalTypeImpl.java
index faa2c6b..4ab9fea 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/GlobalTypeImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/GlobalTypeImpl.java
@@ -1,218 +1,218 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Global Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.GlobalTypeImpl#getIdentifier <em>Identifier</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.GlobalTypeImpl#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class GlobalTypeImpl extends EObjectImpl implements GlobalType {
- /**
- * The default value of the '{@link #getIdentifier() <em>Identifier</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdentifier()
- * @generated
- * @ordered
- */
- protected static final String IDENTIFIER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdentifier()
- * @generated
- * @ordered
- */
- protected String identifier = IDENTIFIER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final String TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected String type = TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected GlobalTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return ModelPackage.Literals.GLOBAL_TYPE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getIdentifier() {
- return identifier;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setIdentifier(String newIdentifier) {
- String oldIdentifier = identifier;
- identifier = newIdentifier;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.GLOBAL_TYPE__IDENTIFIER, oldIdentifier, identifier));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getType() {
- return type;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setType(String newType) {
- String oldType = type;
- type = newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.GLOBAL_TYPE__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
- return getIdentifier();
- case ModelPackage.GLOBAL_TYPE__TYPE:
- return getType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
- setIdentifier((String)newValue);
- return;
- case ModelPackage.GLOBAL_TYPE__TYPE:
- setType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
- setIdentifier(IDENTIFIER_EDEFAULT);
- return;
- case ModelPackage.GLOBAL_TYPE__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
- return IDENTIFIER_EDEFAULT == null ? identifier != null : !IDENTIFIER_EDEFAULT.equals(identifier);
- case ModelPackage.GLOBAL_TYPE__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (identifier: ");
- result.append(identifier);
- result.append(", type: ");
- result.append(type);
- result.append(')');
- return result.toString();
- }
-
-} //GlobalTypeImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Global Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.GlobalTypeImpl#getIdentifier <em>Identifier</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.GlobalTypeImpl#getType <em>Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class GlobalTypeImpl extends EObjectImpl implements GlobalType {
+ /**
+ * The default value of the '{@link #getIdentifier() <em>Identifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIdentifier()
+ * @generated
+ * @ordered
+ */
+ protected static final String IDENTIFIER_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIdentifier()
+ * @generated
+ * @ordered
+ */
+ protected String identifier = IDENTIFIER_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected String type = TYPE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GlobalTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ModelPackage.Literals.GLOBAL_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIdentifier(String newIdentifier) {
+ String oldIdentifier = identifier;
+ identifier = newIdentifier;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.GLOBAL_TYPE__IDENTIFIER, oldIdentifier, identifier));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(String newType) {
+ String oldType = type;
+ type = newType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.GLOBAL_TYPE__TYPE, oldType, type));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
+ return getIdentifier();
+ case ModelPackage.GLOBAL_TYPE__TYPE:
+ return getType();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
+ setIdentifier((String)newValue);
+ return;
+ case ModelPackage.GLOBAL_TYPE__TYPE:
+ setType((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
+ setIdentifier(IDENTIFIER_EDEFAULT);
+ return;
+ case ModelPackage.GLOBAL_TYPE__TYPE:
+ setType(TYPE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ModelPackage.GLOBAL_TYPE__IDENTIFIER:
+ return IDENTIFIER_EDEFAULT == null ? identifier != null : !IDENTIFIER_EDEFAULT.equals(identifier);
+ case ModelPackage.GLOBAL_TYPE__TYPE:
+ return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (identifier: ");
+ result.append(identifier);
+ result.append(", type: ");
+ result.append(type);
+ result.append(')');
+ return result.toString();
+ }
+
+} //GlobalTypeImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ImportTypeImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ImportTypeImpl.java
index 2c4125e..b8beca0 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ImportTypeImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ImportTypeImpl.java
@@ -1,164 +1,164 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Import Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.ImportTypeImpl#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ImportTypeImpl extends EObjectImpl implements ImportType {
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ImportTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return ModelPackage.Literals.IMPORT_TYPE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.IMPORT_TYPE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ModelPackage.IMPORT_TYPE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ModelPackage.IMPORT_TYPE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case ModelPackage.IMPORT_TYPE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ModelPackage.IMPORT_TYPE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} //ImportTypeImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Import Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.ImportTypeImpl#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ImportTypeImpl extends EObjectImpl implements ImportType {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ImportTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ModelPackage.Literals.IMPORT_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.IMPORT_TYPE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ModelPackage.IMPORT_TYPE__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ModelPackage.IMPORT_TYPE__NAME:
+ setName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ModelPackage.IMPORT_TYPE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ModelPackage.IMPORT_TYPE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ImportTypeImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelFactoryImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelFactoryImpl.java
index c08f99e..1d00c2d 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelFactoryImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelFactoryImpl.java
@@ -1,288 +1,288 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import java.math.BigInteger;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class ModelFactoryImpl extends EFactoryImpl implements ModelFactory {
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ModelFactory init() {
- try {
- ModelFactory theModelFactory = (ModelFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.jboss.org/drools");
- if (theModelFactory != null) {
- return theModelFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new ModelFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ModelFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case ModelPackage.DOCUMENT_ROOT: return createDocumentRoot();
- case ModelPackage.GLOBAL_TYPE: return createGlobalType();
- case ModelPackage.IMPORT_TYPE: return createImportType();
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE: return createOnEntryScriptType();
- case ModelPackage.ON_EXIT_SCRIPT_TYPE: return createOnExitScriptType();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue) {
- switch (eDataType.getClassifierID()) {
- case ModelPackage.PACKAGE_NAME_TYPE:
- return createPackageNameTypeFromString(eDataType, initialValue);
- case ModelPackage.PRIORITY_TYPE:
- return createPriorityTypeFromString(eDataType, initialValue);
- case ModelPackage.RULE_FLOW_GROUP_TYPE:
- return createRuleFlowGroupTypeFromString(eDataType, initialValue);
- case ModelPackage.TASK_NAME_TYPE:
- return createTaskNameTypeFromString(eDataType, initialValue);
- case ModelPackage.VERSION_TYPE:
- return createVersionTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue) {
- switch (eDataType.getClassifierID()) {
- case ModelPackage.PACKAGE_NAME_TYPE:
- return convertPackageNameTypeToString(eDataType, instanceValue);
- case ModelPackage.PRIORITY_TYPE:
- return convertPriorityTypeToString(eDataType, instanceValue);
- case ModelPackage.RULE_FLOW_GROUP_TYPE:
- return convertRuleFlowGroupTypeToString(eDataType, instanceValue);
- case ModelPackage.TASK_NAME_TYPE:
- return convertTaskNameTypeToString(eDataType, instanceValue);
- case ModelPackage.VERSION_TYPE:
- return convertVersionTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DocumentRoot createDocumentRoot() {
- DocumentRootImpl documentRoot = new DocumentRootImpl();
- return documentRoot;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public GlobalType createGlobalType() {
- GlobalTypeImpl globalType = new GlobalTypeImpl();
- return globalType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ImportType createImportType() {
- ImportTypeImpl importType = new ImportTypeImpl();
- return importType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OnEntryScriptType createOnEntryScriptType() {
- OnEntryScriptTypeImpl onEntryScriptType = new OnEntryScriptTypeImpl();
- return onEntryScriptType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OnExitScriptType createOnExitScriptType() {
- OnExitScriptTypeImpl onExitScriptType = new OnExitScriptTypeImpl();
- return onExitScriptType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createPackageNameTypeFromString(EDataType eDataType, String initialValue) {
- return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertPackageNameTypeToString(EDataType eDataType, Object instanceValue) {
- return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public BigInteger createPriorityTypeFromString(EDataType eDataType, String initialValue) {
- return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertPriorityTypeToString(EDataType eDataType, Object instanceValue) {
- return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createRuleFlowGroupTypeFromString(EDataType eDataType, String initialValue) {
- return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertRuleFlowGroupTypeToString(EDataType eDataType, Object instanceValue) {
- return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createTaskNameTypeFromString(EDataType eDataType, String initialValue) {
- return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertTaskNameTypeToString(EDataType eDataType, Object instanceValue) {
- return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public BigInteger createVersionTypeFromString(EDataType eDataType, String initialValue) {
- return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertVersionTypeToString(EDataType eDataType, Object instanceValue) {
- return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ModelPackage getModelPackage() {
- return (ModelPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static ModelPackage getPackage() {
- return ModelPackage.eINSTANCE;
- }
-
-} //ModelFactoryImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import java.math.BigInteger;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ModelFactoryImpl extends EFactoryImpl implements ModelFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static ModelFactory init() {
+ try {
+ ModelFactory theModelFactory = (ModelFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.jboss.org/drools");
+ if (theModelFactory != null) {
+ return theModelFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new ModelFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case ModelPackage.DOCUMENT_ROOT: return createDocumentRoot();
+ case ModelPackage.GLOBAL_TYPE: return createGlobalType();
+ case ModelPackage.IMPORT_TYPE: return createImportType();
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE: return createOnEntryScriptType();
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE: return createOnExitScriptType();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue) {
+ switch (eDataType.getClassifierID()) {
+ case ModelPackage.PACKAGE_NAME_TYPE:
+ return createPackageNameTypeFromString(eDataType, initialValue);
+ case ModelPackage.PRIORITY_TYPE:
+ return createPriorityTypeFromString(eDataType, initialValue);
+ case ModelPackage.RULE_FLOW_GROUP_TYPE:
+ return createRuleFlowGroupTypeFromString(eDataType, initialValue);
+ case ModelPackage.TASK_NAME_TYPE:
+ return createTaskNameTypeFromString(eDataType, initialValue);
+ case ModelPackage.VERSION_TYPE:
+ return createVersionTypeFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue) {
+ switch (eDataType.getClassifierID()) {
+ case ModelPackage.PACKAGE_NAME_TYPE:
+ return convertPackageNameTypeToString(eDataType, instanceValue);
+ case ModelPackage.PRIORITY_TYPE:
+ return convertPriorityTypeToString(eDataType, instanceValue);
+ case ModelPackage.RULE_FLOW_GROUP_TYPE:
+ return convertRuleFlowGroupTypeToString(eDataType, instanceValue);
+ case ModelPackage.TASK_NAME_TYPE:
+ return convertTaskNameTypeToString(eDataType, instanceValue);
+ case ModelPackage.VERSION_TYPE:
+ return convertVersionTypeToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DocumentRoot createDocumentRoot() {
+ DocumentRootImpl documentRoot = new DocumentRootImpl();
+ return documentRoot;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GlobalType createGlobalType() {
+ GlobalTypeImpl globalType = new GlobalTypeImpl();
+ return globalType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ImportType createImportType() {
+ ImportTypeImpl importType = new ImportTypeImpl();
+ return importType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OnEntryScriptType createOnEntryScriptType() {
+ OnEntryScriptTypeImpl onEntryScriptType = new OnEntryScriptTypeImpl();
+ return onEntryScriptType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OnExitScriptType createOnExitScriptType() {
+ OnExitScriptTypeImpl onExitScriptType = new OnExitScriptTypeImpl();
+ return onExitScriptType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String createPackageNameTypeFromString(EDataType eDataType, String initialValue) {
+ return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertPackageNameTypeToString(EDataType eDataType, Object instanceValue) {
+ return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigInteger createPriorityTypeFromString(EDataType eDataType, String initialValue) {
+ return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertPriorityTypeToString(EDataType eDataType, Object instanceValue) {
+ return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String createRuleFlowGroupTypeFromString(EDataType eDataType, String initialValue) {
+ return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertRuleFlowGroupTypeToString(EDataType eDataType, Object instanceValue) {
+ return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String createTaskNameTypeFromString(EDataType eDataType, String initialValue) {
+ return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertTaskNameTypeToString(EDataType eDataType, Object instanceValue) {
+ return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigInteger createVersionTypeFromString(EDataType eDataType, String initialValue) {
+ return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertVersionTypeToString(EDataType eDataType, Object instanceValue) {
+ return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelPackage getModelPackage() {
+ return (ModelPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static ModelPackage getPackage() {
+ return ModelPackage.eINSTANCE;
+ }
+
+} //ModelFactoryImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelPackageImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelPackageImpl.java
index 705f011..7f249a7 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelPackageImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/ModelPackageImpl.java
@@ -1,807 +1,807 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import java.math.BigInteger;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.di.BpmnDiPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util.ModelValidator;
-import org.eclipse.dd.dc.DcPackage;
-import org.eclipse.dd.di.DiPackage;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EValidator;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class ModelPackageImpl extends EPackageImpl implements ModelPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass documentRootEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass globalTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass importTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass onEntryScriptTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass onExitScriptTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType packageNameTypeEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType priorityTypeEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType ruleFlowGroupTypeEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType taskNameTypeEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType versionTypeEDataType = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private ModelPackageImpl() {
- super(eNS_URI, ModelFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link ModelPackage#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static ModelPackage init() {
- if (isInited) return (ModelPackage)EPackage.Registry.INSTANCE.getEPackage(ModelPackage.eNS_URI);
-
- // Obtain or create and register package
- ModelPackageImpl theModelPackage = (ModelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ModelPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- Bpmn2Package.eINSTANCE.eClass();
- BpmnDiPackage.eINSTANCE.eClass();
- DiPackage.eINSTANCE.eClass();
- DcPackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theModelPackage.createPackageContents();
-
- // Initialize created meta-data
- theModelPackage.initializePackageContents();
-
- // Register package validator
- EValidator.Registry.INSTANCE.put
- (theModelPackage,
- new EValidator.Descriptor() {
- public EValidator getEValidator() {
- return ModelValidator.INSTANCE;
- }
- });
-
- // Mark meta-data to indicate it can't be changed
- theModelPackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(ModelPackage.eNS_URI, theModelPackage);
- return theModelPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getDocumentRoot() {
- return documentRootEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getDocumentRoot_Global() {
- return (EReference)documentRootEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getDocumentRoot_ImportType() {
- return (EReference)documentRootEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getDocumentRoot_OnEntryScript() {
- return (EReference)documentRootEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getDocumentRoot_OnExitScript() {
- return (EReference)documentRootEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_PackageName() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_Priority() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_RuleFlowGroup() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_TaskName() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_Version() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_WaitForCompletion() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getDocumentRoot_Independent() {
- return (EAttribute)documentRootEClass.getEStructuralFeatures().get(10);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getGlobalType() {
- return globalTypeEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getGlobalType_Identifier() {
- return (EAttribute)globalTypeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getGlobalType_Type() {
- return (EAttribute)globalTypeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getImportType() {
- return importTypeEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getImportType_Name() {
- return (EAttribute)importTypeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getOnEntryScriptType() {
- return onEntryScriptTypeEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOnEntryScriptType_Script() {
- return (EAttribute)onEntryScriptTypeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOnEntryScriptType_ScriptFormat() {
- return (EAttribute)onEntryScriptTypeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getOnExitScriptType() {
- return onExitScriptTypeEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOnExitScriptType_Script() {
- return (EAttribute)onExitScriptTypeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOnExitScriptType_ScriptFormat() {
- return (EAttribute)onExitScriptTypeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getPackageNameType() {
- return packageNameTypeEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getPriorityType() {
- return priorityTypeEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getRuleFlowGroupType() {
- return ruleFlowGroupTypeEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getTaskNameType() {
- return taskNameTypeEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getVersionType() {
- return versionTypeEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ModelFactory getModelFactory() {
- return (ModelFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- documentRootEClass = createEClass(DOCUMENT_ROOT);
- createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL);
- createEReference(documentRootEClass, DOCUMENT_ROOT__IMPORT_TYPE);
- createEReference(documentRootEClass, DOCUMENT_ROOT__ON_ENTRY_SCRIPT);
- createEReference(documentRootEClass, DOCUMENT_ROOT__ON_EXIT_SCRIPT);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__PACKAGE_NAME);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__PRIORITY);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__RULE_FLOW_GROUP);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__TASK_NAME);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__VERSION);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__WAIT_FOR_COMPLETION);
- createEAttribute(documentRootEClass, DOCUMENT_ROOT__INDEPENDENT);
-
- globalTypeEClass = createEClass(GLOBAL_TYPE);
- createEAttribute(globalTypeEClass, GLOBAL_TYPE__IDENTIFIER);
- createEAttribute(globalTypeEClass, GLOBAL_TYPE__TYPE);
-
- importTypeEClass = createEClass(IMPORT_TYPE);
- createEAttribute(importTypeEClass, IMPORT_TYPE__NAME);
-
- onEntryScriptTypeEClass = createEClass(ON_ENTRY_SCRIPT_TYPE);
- createEAttribute(onEntryScriptTypeEClass, ON_ENTRY_SCRIPT_TYPE__SCRIPT);
- createEAttribute(onEntryScriptTypeEClass, ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT);
-
- onExitScriptTypeEClass = createEClass(ON_EXIT_SCRIPT_TYPE);
- createEAttribute(onExitScriptTypeEClass, ON_EXIT_SCRIPT_TYPE__SCRIPT);
- createEAttribute(onExitScriptTypeEClass, ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT);
-
- // Create data types
- packageNameTypeEDataType = createEDataType(PACKAGE_NAME_TYPE);
- priorityTypeEDataType = createEDataType(PRIORITY_TYPE);
- ruleFlowGroupTypeEDataType = createEDataType(RULE_FLOW_GROUP_TYPE);
- taskNameTypeEDataType = createEDataType(TASK_NAME_TYPE);
- versionTypeEDataType = createEDataType(VERSION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- Bpmn2Package theBpmn2Package = (Bpmn2Package)EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- documentRootEClass.getESuperTypes().add(theBpmn2Package.getDocumentRoot());
-
- // Initialize classes and features; add operations and parameters
- initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getDocumentRoot_Global(), this.getGlobalType(), null, "global", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEReference(getDocumentRoot_ImportType(), this.getImportType(), null, "importType", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEReference(getDocumentRoot_OnEntryScript(), this.getOnEntryScriptType(), null, "onEntryScript", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEReference(getDocumentRoot_OnExitScript(), this.getOnExitScriptType(), null, "onExitScript", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_PackageName(), this.getPackageNameType(), "packageName", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_Priority(), this.getPriorityType(), "priority", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_RuleFlowGroup(), this.getRuleFlowGroupType(), "ruleFlowGroup", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_TaskName(), this.getTaskNameType(), "taskName", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_Version(), this.getVersionType(), "version", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_WaitForCompletion(), ecorePackage.getEBoolean(), "waitForCompletion", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDocumentRoot_Independent(), ecorePackage.getEBoolean(), "independent", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(globalTypeEClass, GlobalType.class, "GlobalType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getGlobalType_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, GlobalType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getGlobalType_Type(), ecorePackage.getEString(), "type", null, 1, 1, GlobalType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(importTypeEClass, ImportType.class, "ImportType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getImportType_Name(), ecorePackage.getEString(), "name", null, 1, 1, ImportType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(onEntryScriptTypeEClass, OnEntryScriptType.class, "OnEntryScriptType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getOnEntryScriptType_Script(), ecorePackage.getEString(), "script", null, 1, 1, OnEntryScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getOnEntryScriptType_ScriptFormat(), ecorePackage.getEString(), "scriptFormat", null, 1, 1, OnEntryScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(onExitScriptTypeEClass, OnExitScriptType.class, "OnExitScriptType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getOnExitScriptType_Script(), ecorePackage.getEString(), "script", null, 1, 1, OnExitScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getOnExitScriptType_ScriptFormat(), ecorePackage.getEString(), "scriptFormat", null, 1, 1, OnExitScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize data types
- initEDataType(packageNameTypeEDataType, String.class, "PackageNameType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(priorityTypeEDataType, BigInteger.class, "PriorityType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(ruleFlowGroupTypeEDataType, String.class, "RuleFlowGroupType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(taskNameTypeEDataType, String.class, "TaskNameType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(versionTypeEDataType, BigInteger.class, "VersionType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (documentRootEClass,
- source,
- new String[] {
- "name", "",
- "kind", "mixed",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_Global(),
- source,
- new String[] {
- "kind", "element",
- "name", "global",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_ImportType(),
- source,
- new String[] {
- "kind", "element",
- "name", "import",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_OnEntryScript(),
- source,
- new String[] {
- "kind", "element",
- "name", "onEntry-script",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_OnExitScript(),
- source,
- new String[] {
- "kind", "element",
- "name", "onExit-script",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_PackageName(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "packageName",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_Priority(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "priority",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_RuleFlowGroup(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "ruleFlowGroup",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_TaskName(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "taskName",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_Version(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "version",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_WaitForCompletion(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "waitForCompletion",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getDocumentRoot_Independent(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "independent",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (globalTypeEClass,
- source,
- new String[] {
- "name", "global_._type",
- "kind", "element",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getGlobalType_Identifier(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "identifier",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getGlobalType_Type(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "type",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (importTypeEClass,
- source,
- new String[] {
- "name", "import_._type",
- "kind", "element",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getImportType_Name(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "name"
- });
- addAnnotation
- (onEntryScriptTypeEClass,
- source,
- new String[] {
- "name", "onEntry-script_._type",
- "kind", "elementOnly",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getOnEntryScriptType_Script(),
- source,
- new String[] {
- "kind", "element",
- "name", "script",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getOnEntryScriptType_ScriptFormat(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "scriptFormat",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (onExitScriptTypeEClass,
- source,
- new String[] {
- "name", "onExit-script_._type",
- "kind", "elementOnly",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getOnExitScriptType_Script(),
- source,
- new String[] {
- "kind", "element",
- "name", "script",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (getOnExitScriptType_ScriptFormat(),
- source,
- new String[] {
- "kind", "attribute",
- "name", "scriptFormat",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (packageNameTypeEDataType,
- source,
- new String[] {
- "name", "packageName_._type",
- "baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
- });
- addAnnotation
- (priorityTypeEDataType,
- source,
- new String[] {
- "name", "priority_._type",
- "baseType", "http://www.eclipse.org/emf/2003/XMLType#integer",
- "minInclusive", "1"
- });
- addAnnotation
- (ruleFlowGroupTypeEDataType,
- source,
- new String[] {
- "name", "ruleFlowGroup_._type",
- "baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
- });
- addAnnotation
- (taskNameTypeEDataType,
- source,
- new String[] {
- "name", "taskName_._type",
- "baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
- });
- addAnnotation
- (versionTypeEDataType,
- source,
- new String[] {
- "name", "version_._type",
- "baseType", "http://www.eclipse.org/emf/2003/XMLType#integer",
- "minInclusive", "0"
- });
- }
-
-} //ModelPackageImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import java.math.BigInteger;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.di.BpmnDiPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util.ModelValidator;
+import org.eclipse.dd.dc.DcPackage;
+import org.eclipse.dd.di.DiPackage;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EValidator;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ModelPackageImpl extends EPackageImpl implements ModelPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass documentRootEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass globalTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass importTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass onEntryScriptTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass onExitScriptTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType packageNameTypeEDataType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType priorityTypeEDataType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType ruleFlowGroupTypeEDataType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType taskNameTypeEDataType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType versionTypeEDataType = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private ModelPackageImpl() {
+ super(eNS_URI, ModelFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link ModelPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static ModelPackage init() {
+ if (isInited) return (ModelPackage)EPackage.Registry.INSTANCE.getEPackage(ModelPackage.eNS_URI);
+
+ // Obtain or create and register package
+ ModelPackageImpl theModelPackage = (ModelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ModelPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ Bpmn2Package.eINSTANCE.eClass();
+ BpmnDiPackage.eINSTANCE.eClass();
+ DiPackage.eINSTANCE.eClass();
+ DcPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theModelPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theModelPackage.initializePackageContents();
+
+ // Register package validator
+ EValidator.Registry.INSTANCE.put
+ (theModelPackage,
+ new EValidator.Descriptor() {
+ public EValidator getEValidator() {
+ return ModelValidator.INSTANCE;
+ }
+ });
+
+ // Mark meta-data to indicate it can't be changed
+ theModelPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(ModelPackage.eNS_URI, theModelPackage);
+ return theModelPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDocumentRoot() {
+ return documentRootEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_Global() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_ImportType() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_OnEntryScript() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_OnExitScript() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_PackageName() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_Priority() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_RuleFlowGroup() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_TaskName() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_Version() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_WaitForCompletion() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(9);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_Independent() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(10);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGlobalType() {
+ return globalTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getGlobalType_Identifier() {
+ return (EAttribute)globalTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getGlobalType_Type() {
+ return (EAttribute)globalTypeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getImportType() {
+ return importTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getImportType_Name() {
+ return (EAttribute)importTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getOnEntryScriptType() {
+ return onEntryScriptTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getOnEntryScriptType_Script() {
+ return (EAttribute)onEntryScriptTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getOnEntryScriptType_ScriptFormat() {
+ return (EAttribute)onEntryScriptTypeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getOnExitScriptType() {
+ return onExitScriptTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getOnExitScriptType_Script() {
+ return (EAttribute)onExitScriptTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getOnExitScriptType_ScriptFormat() {
+ return (EAttribute)onExitScriptTypeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getPackageNameType() {
+ return packageNameTypeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getPriorityType() {
+ return priorityTypeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getRuleFlowGroupType() {
+ return ruleFlowGroupTypeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getTaskNameType() {
+ return taskNameTypeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getVersionType() {
+ return versionTypeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelFactory getModelFactory() {
+ return (ModelFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ documentRootEClass = createEClass(DOCUMENT_ROOT);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__IMPORT_TYPE);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__ON_ENTRY_SCRIPT);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__ON_EXIT_SCRIPT);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__PACKAGE_NAME);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__PRIORITY);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__RULE_FLOW_GROUP);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__TASK_NAME);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__VERSION);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__WAIT_FOR_COMPLETION);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__INDEPENDENT);
+
+ globalTypeEClass = createEClass(GLOBAL_TYPE);
+ createEAttribute(globalTypeEClass, GLOBAL_TYPE__IDENTIFIER);
+ createEAttribute(globalTypeEClass, GLOBAL_TYPE__TYPE);
+
+ importTypeEClass = createEClass(IMPORT_TYPE);
+ createEAttribute(importTypeEClass, IMPORT_TYPE__NAME);
+
+ onEntryScriptTypeEClass = createEClass(ON_ENTRY_SCRIPT_TYPE);
+ createEAttribute(onEntryScriptTypeEClass, ON_ENTRY_SCRIPT_TYPE__SCRIPT);
+ createEAttribute(onEntryScriptTypeEClass, ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT);
+
+ onExitScriptTypeEClass = createEClass(ON_EXIT_SCRIPT_TYPE);
+ createEAttribute(onExitScriptTypeEClass, ON_EXIT_SCRIPT_TYPE__SCRIPT);
+ createEAttribute(onExitScriptTypeEClass, ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT);
+
+ // Create data types
+ packageNameTypeEDataType = createEDataType(PACKAGE_NAME_TYPE);
+ priorityTypeEDataType = createEDataType(PRIORITY_TYPE);
+ ruleFlowGroupTypeEDataType = createEDataType(RULE_FLOW_GROUP_TYPE);
+ taskNameTypeEDataType = createEDataType(TASK_NAME_TYPE);
+ versionTypeEDataType = createEDataType(VERSION_TYPE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ Bpmn2Package theBpmn2Package = (Bpmn2Package)EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ documentRootEClass.getESuperTypes().add(theBpmn2Package.getDocumentRoot());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getDocumentRoot_Global(), this.getGlobalType(), null, "global", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_ImportType(), this.getImportType(), null, "importType", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_OnEntryScript(), this.getOnEntryScriptType(), null, "onEntryScript", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_OnExitScript(), this.getOnExitScriptType(), null, "onExitScript", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_PackageName(), this.getPackageNameType(), "packageName", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_Priority(), this.getPriorityType(), "priority", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_RuleFlowGroup(), this.getRuleFlowGroupType(), "ruleFlowGroup", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_TaskName(), this.getTaskNameType(), "taskName", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_Version(), this.getVersionType(), "version", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_WaitForCompletion(), ecorePackage.getEBoolean(), "waitForCompletion", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDocumentRoot_Independent(), ecorePackage.getEBoolean(), "independent", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(globalTypeEClass, GlobalType.class, "GlobalType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getGlobalType_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, GlobalType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getGlobalType_Type(), ecorePackage.getEString(), "type", null, 1, 1, GlobalType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(importTypeEClass, ImportType.class, "ImportType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getImportType_Name(), ecorePackage.getEString(), "name", null, 1, 1, ImportType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(onEntryScriptTypeEClass, OnEntryScriptType.class, "OnEntryScriptType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getOnEntryScriptType_Script(), ecorePackage.getEString(), "script", null, 1, 1, OnEntryScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getOnEntryScriptType_ScriptFormat(), ecorePackage.getEString(), "scriptFormat", null, 1, 1, OnEntryScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(onExitScriptTypeEClass, OnExitScriptType.class, "OnExitScriptType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getOnExitScriptType_Script(), ecorePackage.getEString(), "script", null, 1, 1, OnExitScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getOnExitScriptType_ScriptFormat(), ecorePackage.getEString(), "scriptFormat", null, 1, 1, OnExitScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize data types
+ initEDataType(packageNameTypeEDataType, String.class, "PackageNameType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(priorityTypeEDataType, BigInteger.class, "PriorityType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(ruleFlowGroupTypeEDataType, String.class, "RuleFlowGroupType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(taskNameTypeEDataType, String.class, "TaskNameType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(versionTypeEDataType, BigInteger.class, "VersionType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations() {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ addAnnotation
+ (documentRootEClass,
+ source,
+ new String[] {
+ "name", "",
+ "kind", "mixed",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_Global(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "global",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_ImportType(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "import",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_OnEntryScript(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "onEntry-script",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_OnExitScript(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "onExit-script",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_PackageName(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "packageName",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_Priority(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "priority",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_RuleFlowGroup(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "ruleFlowGroup",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_TaskName(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "taskName",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_Version(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_WaitForCompletion(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "waitForCompletion",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDocumentRoot_Independent(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "independent",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (globalTypeEClass,
+ source,
+ new String[] {
+ "name", "global_._type",
+ "kind", "element",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getGlobalType_Identifier(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "identifier",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getGlobalType_Type(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "type",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (importTypeEClass,
+ source,
+ new String[] {
+ "name", "import_._type",
+ "kind", "element",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getImportType_Name(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "name"
+ });
+ addAnnotation
+ (onEntryScriptTypeEClass,
+ source,
+ new String[] {
+ "name", "onEntry-script_._type",
+ "kind", "elementOnly",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getOnEntryScriptType_Script(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "script",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getOnEntryScriptType_ScriptFormat(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "scriptFormat",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (onExitScriptTypeEClass,
+ source,
+ new String[] {
+ "name", "onExit-script_._type",
+ "kind", "elementOnly",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getOnExitScriptType_Script(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "script",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getOnExitScriptType_ScriptFormat(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "scriptFormat",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (packageNameTypeEDataType,
+ source,
+ new String[] {
+ "name", "packageName_._type",
+ "baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
+ });
+ addAnnotation
+ (priorityTypeEDataType,
+ source,
+ new String[] {
+ "name", "priority_._type",
+ "baseType", "http://www.eclipse.org/emf/2003/XMLType#integer",
+ "minInclusive", "1"
+ });
+ addAnnotation
+ (ruleFlowGroupTypeEDataType,
+ source,
+ new String[] {
+ "name", "ruleFlowGroup_._type",
+ "baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
+ });
+ addAnnotation
+ (taskNameTypeEDataType,
+ source,
+ new String[] {
+ "name", "taskName_._type",
+ "baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
+ });
+ addAnnotation
+ (versionTypeEDataType,
+ source,
+ new String[] {
+ "name", "version_._type",
+ "baseType", "http://www.eclipse.org/emf/2003/XMLType#integer",
+ "minInclusive", "0"
+ });
+ }
+
+} //ModelPackageImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnEntryScriptTypeImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnEntryScriptTypeImpl.java
index 9c9a852..67006df 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnEntryScriptTypeImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnEntryScriptTypeImpl.java
@@ -1,218 +1,218 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>On Entry Script Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnEntryScriptTypeImpl#getScript <em>Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnEntryScriptTypeImpl#getScriptFormat <em>Script Format</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class OnEntryScriptTypeImpl extends EObjectImpl implements OnEntryScriptType {
- /**
- * The default value of the '{@link #getScript() <em>Script</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScript()
- * @generated
- * @ordered
- */
- protected static final String SCRIPT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getScript() <em>Script</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScript()
- * @generated
- * @ordered
- */
- protected String script = SCRIPT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScriptFormat()
- * @generated
- * @ordered
- */
- protected static final String SCRIPT_FORMAT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScriptFormat()
- * @generated
- * @ordered
- */
- protected String scriptFormat = SCRIPT_FORMAT_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected OnEntryScriptTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return ModelPackage.Literals.ON_ENTRY_SCRIPT_TYPE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getScript() {
- return script;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setScript(String newScript) {
- String oldScript = script;
- script = newScript;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT, oldScript, script));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getScriptFormat() {
- return scriptFormat;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setScriptFormat(String newScriptFormat) {
- String oldScriptFormat = scriptFormat;
- scriptFormat = newScriptFormat;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT, oldScriptFormat, scriptFormat));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
- return getScript();
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
- return getScriptFormat();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
- setScript((String)newValue);
- return;
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
- setScriptFormat((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
- setScript(SCRIPT_EDEFAULT);
- return;
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
- setScriptFormat(SCRIPT_FORMAT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
- return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script);
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
- return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : !SCRIPT_FORMAT_EDEFAULT.equals(scriptFormat);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (script: ");
- result.append(script);
- result.append(", scriptFormat: ");
- result.append(scriptFormat);
- result.append(')');
- return result.toString();
- }
-
-} //OnEntryScriptTypeImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>On Entry Script Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnEntryScriptTypeImpl#getScript <em>Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnEntryScriptTypeImpl#getScriptFormat <em>Script Format</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class OnEntryScriptTypeImpl extends EObjectImpl implements OnEntryScriptType {
+ /**
+ * The default value of the '{@link #getScript() <em>Script</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScript()
+ * @generated
+ * @ordered
+ */
+ protected static final String SCRIPT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getScript() <em>Script</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScript()
+ * @generated
+ * @ordered
+ */
+ protected String script = SCRIPT_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScriptFormat()
+ * @generated
+ * @ordered
+ */
+ protected static final String SCRIPT_FORMAT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScriptFormat()
+ * @generated
+ * @ordered
+ */
+ protected String scriptFormat = SCRIPT_FORMAT_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected OnEntryScriptTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ModelPackage.Literals.ON_ENTRY_SCRIPT_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getScript() {
+ return script;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setScript(String newScript) {
+ String oldScript = script;
+ script = newScript;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT, oldScript, script));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getScriptFormat() {
+ return scriptFormat;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setScriptFormat(String newScriptFormat) {
+ String oldScriptFormat = scriptFormat;
+ scriptFormat = newScriptFormat;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT, oldScriptFormat, scriptFormat));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
+ return getScript();
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
+ return getScriptFormat();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
+ setScript((String)newValue);
+ return;
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
+ setScriptFormat((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
+ setScript(SCRIPT_EDEFAULT);
+ return;
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
+ setScriptFormat(SCRIPT_FORMAT_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT:
+ return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script);
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT:
+ return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : !SCRIPT_FORMAT_EDEFAULT.equals(scriptFormat);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (script: ");
+ result.append(script);
+ result.append(", scriptFormat: ");
+ result.append(scriptFormat);
+ result.append(')');
+ return result.toString();
+ }
+
+} //OnEntryScriptTypeImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnExitScriptTypeImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnExitScriptTypeImpl.java
index 7380093..8a3c7f3 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnExitScriptTypeImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/impl/OnExitScriptTypeImpl.java
@@ -1,218 +1,218 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>On Exit Script Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnExitScriptTypeImpl#getScript <em>Script</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnExitScriptTypeImpl#getScriptFormat <em>Script Format</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class OnExitScriptTypeImpl extends EObjectImpl implements OnExitScriptType {
- /**
- * The default value of the '{@link #getScript() <em>Script</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScript()
- * @generated
- * @ordered
- */
- protected static final String SCRIPT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getScript() <em>Script</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScript()
- * @generated
- * @ordered
- */
- protected String script = SCRIPT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScriptFormat()
- * @generated
- * @ordered
- */
- protected static final String SCRIPT_FORMAT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScriptFormat()
- * @generated
- * @ordered
- */
- protected String scriptFormat = SCRIPT_FORMAT_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected OnExitScriptTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return ModelPackage.Literals.ON_EXIT_SCRIPT_TYPE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getScript() {
- return script;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setScript(String newScript) {
- String oldScript = script;
- script = newScript;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT, oldScript, script));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getScriptFormat() {
- return scriptFormat;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setScriptFormat(String newScriptFormat) {
- String oldScriptFormat = scriptFormat;
- scriptFormat = newScriptFormat;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT, oldScriptFormat, scriptFormat));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
- return getScript();
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
- return getScriptFormat();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
- setScript((String)newValue);
- return;
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
- setScriptFormat((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
- setScript(SCRIPT_EDEFAULT);
- return;
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
- setScriptFormat(SCRIPT_FORMAT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
- return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script);
- case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
- return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : !SCRIPT_FORMAT_EDEFAULT.equals(scriptFormat);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (script: ");
- result.append(script);
- result.append(", scriptFormat: ");
- result.append(scriptFormat);
- result.append(')');
- return result.toString();
- }
-
-} //OnExitScriptTypeImpl
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>On Exit Script Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnExitScriptTypeImpl#getScript <em>Script</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl.OnExitScriptTypeImpl#getScriptFormat <em>Script Format</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class OnExitScriptTypeImpl extends EObjectImpl implements OnExitScriptType {
+ /**
+ * The default value of the '{@link #getScript() <em>Script</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScript()
+ * @generated
+ * @ordered
+ */
+ protected static final String SCRIPT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getScript() <em>Script</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScript()
+ * @generated
+ * @ordered
+ */
+ protected String script = SCRIPT_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScriptFormat()
+ * @generated
+ * @ordered
+ */
+ protected static final String SCRIPT_FORMAT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getScriptFormat()
+ * @generated
+ * @ordered
+ */
+ protected String scriptFormat = SCRIPT_FORMAT_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected OnExitScriptTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ModelPackage.Literals.ON_EXIT_SCRIPT_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getScript() {
+ return script;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setScript(String newScript) {
+ String oldScript = script;
+ script = newScript;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT, oldScript, script));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getScriptFormat() {
+ return scriptFormat;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setScriptFormat(String newScriptFormat) {
+ String oldScriptFormat = scriptFormat;
+ scriptFormat = newScriptFormat;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT, oldScriptFormat, scriptFormat));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
+ return getScript();
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
+ return getScriptFormat();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
+ setScript((String)newValue);
+ return;
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
+ setScriptFormat((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
+ setScript(SCRIPT_EDEFAULT);
+ return;
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
+ setScriptFormat(SCRIPT_FORMAT_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT:
+ return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script);
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT:
+ return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : !SCRIPT_FORMAT_EDEFAULT.equals(scriptFormat);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (script: ");
+ result.append(script);
+ result.append(", scriptFormat: ");
+ result.append(scriptFormat);
+ result.append(')');
+ return result.toString();
+ }
+
+} //OnExitScriptTypeImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelAdapterFactory.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelAdapterFactory.java
index 847b574..8d2bc29 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelAdapterFactory.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelAdapterFactory.java
@@ -1,229 +1,229 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage
- * @generated
- */
-public class ModelAdapterFactory extends AdapterFactoryImpl {
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static ModelPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ModelAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = ModelPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- @Override
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch that delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ModelSwitch<Adapter> modelSwitch =
- new ModelSwitch<Adapter>() {
- @Override
- public Adapter caseDocumentRoot(DocumentRoot object) {
- return createDocumentRootAdapter();
- }
- @Override
- public Adapter caseGlobalType(GlobalType object) {
- return createGlobalTypeAdapter();
- }
- @Override
- public Adapter caseImportType(ImportType object) {
- return createImportTypeAdapter();
- }
- @Override
- public Adapter caseOnEntryScriptType(OnEntryScriptType object) {
- return createOnEntryScriptTypeAdapter();
- }
- @Override
- public Adapter caseOnExitScriptType(OnExitScriptType object) {
- return createOnExitScriptTypeAdapter();
- }
- @Override
- public Adapter caseBpmn2_DocumentRoot(org.eclipse.bpmn2.DocumentRoot object) {
- return createBpmn2_DocumentRootAdapter();
- }
- @Override
- public Adapter defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- @Override
- public Adapter createAdapter(Notifier target) {
- return modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot <em>Document Root</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot
- * @generated
- */
- public Adapter createDocumentRootAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType <em>Global Type</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType
- * @generated
- */
- public Adapter createGlobalTypeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType <em>Import Type</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType
- * @generated
- */
- public Adapter createImportTypeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType <em>On Entry Script Type</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType
- * @generated
- */
- public Adapter createOnEntryScriptTypeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType <em>On Exit Script Type</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType
- * @generated
- */
- public Adapter createOnExitScriptTypeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DocumentRoot <em>Document Root</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.bpmn2.DocumentRoot
- * @generated
- */
- public Adapter createBpmn2_DocumentRootAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //ModelAdapterFactory
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage
+ * @generated
+ */
+public class ModelAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static ModelPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = ModelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModelSwitch<Adapter> modelSwitch =
+ new ModelSwitch<Adapter>() {
+ @Override
+ public Adapter caseDocumentRoot(DocumentRoot object) {
+ return createDocumentRootAdapter();
+ }
+ @Override
+ public Adapter caseGlobalType(GlobalType object) {
+ return createGlobalTypeAdapter();
+ }
+ @Override
+ public Adapter caseImportType(ImportType object) {
+ return createImportTypeAdapter();
+ }
+ @Override
+ public Adapter caseOnEntryScriptType(OnEntryScriptType object) {
+ return createOnEntryScriptTypeAdapter();
+ }
+ @Override
+ public Adapter caseOnExitScriptType(OnExitScriptType object) {
+ return createOnExitScriptTypeAdapter();
+ }
+ @Override
+ public Adapter caseBpmn2_DocumentRoot(org.eclipse.bpmn2.DocumentRoot object) {
+ return createBpmn2_DocumentRootAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot <em>Document Root</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot
+ * @generated
+ */
+ public Adapter createDocumentRootAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType <em>Global Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType
+ * @generated
+ */
+ public Adapter createGlobalTypeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType <em>Import Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType
+ * @generated
+ */
+ public Adapter createImportTypeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType <em>On Entry Script Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType
+ * @generated
+ */
+ public Adapter createOnEntryScriptTypeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType <em>On Exit Script Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType
+ * @generated
+ */
+ public Adapter createOnExitScriptTypeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DocumentRoot <em>Document Root</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.bpmn2.DocumentRoot
+ * @generated
+ */
+ public Adapter createBpmn2_DocumentRootAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //ModelAdapterFactory
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelResourceFactoryImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelResourceFactoryImpl.java
index 8799e36..052d528 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelResourceFactoryImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelResourceFactoryImpl.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
-
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceFactoryImpl;
-import org.eclipse.bpmn2.util.OnlyContainmentTypeInfo;
-import org.eclipse.bpmn2.util.XmlExtendedMetadata;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xmi.impl.ElementHandlerImpl;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource Factory</b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util.ModelResourceImpl
- * @generated NOT
- */
-public class ModelResourceFactoryImpl extends Bpmn2ModelerResourceFactoryImpl {
- /**
- * Creates an instance of the resource eFactory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public ModelResourceFactoryImpl() {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- @Override
- public Resource createResource(URI uri) {
- ModelResourceImpl result = new ModelResourceImpl(uri);
- ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
- new OnlyContainmentTypeInfo());
-
- // allow "href" object resolution
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE,
- Boolean.FALSE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_ELEMENT_HANDLER,
- new ElementHandlerImpl(true));
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8");
-
- // save xsi:schemaLocation in Definitions parameter
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
-
- return result;
- }
-
-} //ModelResourceFactoryImpl
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
+
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceFactoryImpl;
+import org.eclipse.bpmn2.util.OnlyContainmentTypeInfo;
+import org.eclipse.bpmn2.util.XmlExtendedMetadata;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.ElementHandlerImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Resource Factory</b> associated with the package.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util.ModelResourceImpl
+ * @generated NOT
+ */
+public class ModelResourceFactoryImpl extends Bpmn2ModelerResourceFactoryImpl {
+ /**
+ * Creates an instance of the resource eFactory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public ModelResourceFactoryImpl() {
+ super();
+ }
+
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public Resource createResource(URI uri) {
+ ModelResourceImpl result = new ModelResourceImpl(uri);
+ ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
+ new OnlyContainmentTypeInfo());
+
+ // allow "href" object resolution
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE,
+ Boolean.FALSE);
+
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_ELEMENT_HANDLER,
+ new ElementHandlerImpl(true));
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8");
+
+ // save xsi:schemaLocation in Definitions parameter
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
+
+ return result;
+ }
+
+} //ModelResourceFactoryImpl
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelValidator.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelValidator.java
index 33eceea..4a6305c 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelValidator.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelValidator.java
@@ -1,279 +1,279 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
-
-import java.math.BigInteger;
-import java.util.Map;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
-import org.eclipse.emf.common.util.DiagnosticChain;
-import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.util.EObjectValidator;
-import org.eclipse.emf.ecore.xml.type.util.XMLTypeValidator;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Validator</b> for the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage
- * @generated
- */
-public class ModelValidator extends EObjectValidator {
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final ModelValidator INSTANCE = new ModelValidator();
-
- /**
- * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Diagnostic#getSource()
- * @see org.eclipse.emf.common.util.Diagnostic#getCode()
- * @generated
- */
- public static final String DIAGNOSTIC_SOURCE = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model";
-
- /**
- * A constant with a fixed name that can be used as the base value for additional hand written constants.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
-
- /**
- * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
-
- /**
- * The cached base package validator.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XMLTypeValidator xmlTypeValidator;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ModelValidator() {
- super();
- xmlTypeValidator = XMLTypeValidator.INSTANCE;
- }
-
- /**
- * Returns the package of this validator switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EPackage getEPackage() {
- return ModelPackage.eINSTANCE;
- }
-
- /**
- * Calls <code>validateXXX</code> for the corresponding classifier of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) {
- switch (classifierID) {
- case ModelPackage.DOCUMENT_ROOT:
- return validateDocumentRoot((DocumentRoot)value, diagnostics, context);
- case ModelPackage.GLOBAL_TYPE:
- return validateGlobalType((GlobalType)value, diagnostics, context);
- case ModelPackage.IMPORT_TYPE:
- return validateImportType((ImportType)value, diagnostics, context);
- case ModelPackage.ON_ENTRY_SCRIPT_TYPE:
- return validateOnEntryScriptType((OnEntryScriptType)value, diagnostics, context);
- case ModelPackage.ON_EXIT_SCRIPT_TYPE:
- return validateOnExitScriptType((OnExitScriptType)value, diagnostics, context);
- case ModelPackage.PACKAGE_NAME_TYPE:
- return validatePackageNameType((String)value, diagnostics, context);
- case ModelPackage.PRIORITY_TYPE:
- return validatePriorityType((BigInteger)value, diagnostics, context);
- case ModelPackage.RULE_FLOW_GROUP_TYPE:
- return validateRuleFlowGroupType((String)value, diagnostics, context);
- case ModelPackage.TASK_NAME_TYPE:
- return validateTaskNameType((String)value, diagnostics, context);
- case ModelPackage.VERSION_TYPE:
- return validateVersionType((BigInteger)value, diagnostics, context);
- default:
- return true;
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateDocumentRoot(DocumentRoot documentRoot, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(documentRoot, diagnostics, context);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateGlobalType(GlobalType globalType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(globalType, diagnostics, context);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateImportType(ImportType importType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(importType, diagnostics, context);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateOnEntryScriptType(OnEntryScriptType onEntryScriptType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(onEntryScriptType, diagnostics, context);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateOnExitScriptType(OnExitScriptType onExitScriptType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(onExitScriptType, diagnostics, context);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validatePackageNameType(String packageNameType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return true;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validatePriorityType(BigInteger priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- boolean result = validatePriorityType_Min(priorityType, diagnostics, context);
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @see #validatePriorityType_Min
- */
- public static final BigInteger PRIORITY_TYPE__MIN__VALUE = new BigInteger("1");
-
- /**
- * Validates the Min constraint of '<em>Priority Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validatePriorityType_Min(BigInteger priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- boolean result = priorityType.compareTo(PRIORITY_TYPE__MIN__VALUE) >= 0;
- if (!result && diagnostics != null)
- reportMinViolation(ModelPackage.Literals.PRIORITY_TYPE, priorityType, PRIORITY_TYPE__MIN__VALUE, true, diagnostics, context);
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateRuleFlowGroupType(String ruleFlowGroupType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return true;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateTaskNameType(String taskNameType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return true;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateVersionType(BigInteger versionType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- boolean result = validateVersionType_Min(versionType, diagnostics, context);
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @see #validateVersionType_Min
- */
- public static final BigInteger VERSION_TYPE__MIN__VALUE = new BigInteger("0");
-
- /**
- * Validates the Min constraint of '<em>Version Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean validateVersionType_Min(BigInteger versionType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- boolean result = versionType.compareTo(VERSION_TYPE__MIN__VALUE) >= 0;
- if (!result && diagnostics != null)
- reportMinViolation(ModelPackage.Literals.VERSION_TYPE, versionType, VERSION_TYPE__MIN__VALUE, true, diagnostics, context);
- return result;
- }
-
- /**
- * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public ResourceLocator getResourceLocator() {
- // TODO
- // Specialize this to return a resource locator for messages specific to this validator.
- // Ensure that you remove @generated or mark it @generated NOT
- return super.getResourceLocator();
- }
-
-} //ModelValidator
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
+
+import java.math.BigInteger;
+import java.util.Map;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.DocumentRoot;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnEntryScriptType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.OnExitScriptType;
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.EObjectValidator;
+import org.eclipse.emf.ecore.xml.type.util.XMLTypeValidator;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Validator</b> for the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage
+ * @generated
+ */
+public class ModelValidator extends EObjectValidator {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final ModelValidator INSTANCE = new ModelValidator();
+
+ /**
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.common.util.Diagnostic#getSource()
+ * @see org.eclipse.emf.common.util.Diagnostic#getCode()
+ * @generated
+ */
+ public static final String DIAGNOSTIC_SOURCE = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model";
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
+
+ /**
+ * The cached base package validator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected XMLTypeValidator xmlTypeValidator;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelValidator() {
+ super();
+ xmlTypeValidator = XMLTypeValidator.INSTANCE;
+ }
+
+ /**
+ * Returns the package of this validator switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EPackage getEPackage() {
+ return ModelPackage.eINSTANCE;
+ }
+
+ /**
+ * Calls <code>validateXXX</code> for the corresponding classifier of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ switch (classifierID) {
+ case ModelPackage.DOCUMENT_ROOT:
+ return validateDocumentRoot((DocumentRoot)value, diagnostics, context);
+ case ModelPackage.GLOBAL_TYPE:
+ return validateGlobalType((GlobalType)value, diagnostics, context);
+ case ModelPackage.IMPORT_TYPE:
+ return validateImportType((ImportType)value, diagnostics, context);
+ case ModelPackage.ON_ENTRY_SCRIPT_TYPE:
+ return validateOnEntryScriptType((OnEntryScriptType)value, diagnostics, context);
+ case ModelPackage.ON_EXIT_SCRIPT_TYPE:
+ return validateOnExitScriptType((OnExitScriptType)value, diagnostics, context);
+ case ModelPackage.PACKAGE_NAME_TYPE:
+ return validatePackageNameType((String)value, diagnostics, context);
+ case ModelPackage.PRIORITY_TYPE:
+ return validatePriorityType((BigInteger)value, diagnostics, context);
+ case ModelPackage.RULE_FLOW_GROUP_TYPE:
+ return validateRuleFlowGroupType((String)value, diagnostics, context);
+ case ModelPackage.TASK_NAME_TYPE:
+ return validateTaskNameType((String)value, diagnostics, context);
+ case ModelPackage.VERSION_TYPE:
+ return validateVersionType((BigInteger)value, diagnostics, context);
+ default:
+ return true;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateDocumentRoot(DocumentRoot documentRoot, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(documentRoot, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateGlobalType(GlobalType globalType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(globalType, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateImportType(ImportType importType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(importType, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateOnEntryScriptType(OnEntryScriptType onEntryScriptType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(onEntryScriptType, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateOnExitScriptType(OnExitScriptType onExitScriptType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(onExitScriptType, diagnostics, context);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validatePackageNameType(String packageNameType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validatePriorityType(BigInteger priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ boolean result = validatePriorityType_Min(priorityType, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @see #validatePriorityType_Min
+ */
+ public static final BigInteger PRIORITY_TYPE__MIN__VALUE = new BigInteger("1");
+
+ /**
+ * Validates the Min constraint of '<em>Priority Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validatePriorityType_Min(BigInteger priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ boolean result = priorityType.compareTo(PRIORITY_TYPE__MIN__VALUE) >= 0;
+ if (!result && diagnostics != null)
+ reportMinViolation(ModelPackage.Literals.PRIORITY_TYPE, priorityType, PRIORITY_TYPE__MIN__VALUE, true, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateRuleFlowGroupType(String ruleFlowGroupType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateTaskNameType(String taskNameType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateVersionType(BigInteger versionType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ boolean result = validateVersionType_Min(versionType, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @see #validateVersionType_Min
+ */
+ public static final BigInteger VERSION_TYPE__MIN__VALUE = new BigInteger("0");
+
+ /**
+ * Validates the Min constraint of '<em>Version Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean validateVersionType_Min(BigInteger versionType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ boolean result = versionType.compareTo(VERSION_TYPE__MIN__VALUE) >= 0;
+ if (!result && diagnostics != null)
+ reportMinViolation(ModelPackage.Literals.VERSION_TYPE, versionType, VERSION_TYPE__MIN__VALUE, true, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ // TODO
+ // Specialize this to return a resource locator for messages specific to this validator.
+ // Ensure that you remove @generated or mark it @generated NOT
+ return super.getResourceLocator();
+ }
+
+} //ModelValidator
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelXMLProcessor.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelXMLProcessor.java
index 5fa4183..f8df18e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelXMLProcessor.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/util/ModelXMLProcessor.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
-
-import java.util.Map;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
-
-/**
- * This class contains helper methods to serialize and deserialize XML documents
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class ModelXMLProcessor extends XMLProcessor {
-
- /**
- * Public constructor to instantiate the helper.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ModelXMLProcessor() {
- super((EPackage.Registry.INSTANCE));
- ModelPackage.eINSTANCE.eClass();
- }
-
- /**
- * Register for "*" and "xml" file extensions the ModelResourceFactoryImpl factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected Map<String, Resource.Factory> getRegistrations() {
- if (registrations == null) {
- super.getRegistrations();
- registrations.put(XML_EXTENSION, new ModelResourceFactoryImpl());
- registrations.put(STAR_EXTENSION, new ModelResourceFactoryImpl());
- }
- return registrations;
- }
-
-} //ModelXMLProcessor
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.util;
+
+import java.util.Map;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
+
+/**
+ * This class contains helper methods to serialize and deserialize XML documents
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ModelXMLProcessor extends XMLProcessor {
+
+ /**
+ * Public constructor to instantiate the helper.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelXMLProcessor() {
+ super((EPackage.Registry.INSTANCE));
+ ModelPackage.eINSTANCE.eClass();
+ }
+
+ /**
+ * Register for "*" and "xml" file extensions the ModelResourceFactoryImpl factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected Map<String, Resource.Factory> getRegistrations() {
+ if (registrations == null) {
+ super.getRegistrations();
+ registrations.put(XML_EXTENSION, new ModelResourceFactoryImpl());
+ registrations.put(STAR_EXTENSION, new ModelResourceFactoryImpl());
+ }
+ return registrations;
+ }
+
+} //ModelXMLProcessor
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityDetailComposite.java
index 154a4d0..c1a75a0 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityDetailComposite.java
@@ -1,106 +1,106 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.ui.property.ExtensionValueListComposite;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.ActivityDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmActivityDetailComposite extends ActivityDetailComposite {
-
- ScriptTableComposite onEntryScriptTable;
- ScriptTableComposite onExitScriptTable;
-
- /**
- * @param section
- */
- public JbpmActivityDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public JbpmActivityDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- onEntryScriptTable = null;
- onExitScriptTable = null;
- }
-
- @Override
- public void createBindings(EObject be) {
- super.createBindings(be);
-
- onEntryScriptTable = new ScriptTableComposite(this);
- onEntryScriptTable.bindList(be, ModelPackage.eINSTANCE.getDocumentRoot_OnEntryScript());
- onEntryScriptTable.setTitle("On Entry Scripts");
-
- onExitScriptTable = new ScriptTableComposite(this);
- onExitScriptTable.bindList(be, ModelPackage.eINSTANCE.getDocumentRoot_OnExitScript());
- onExitScriptTable.setTitle("On Exit Scripts");
- }
-
- private class ScriptTableComposite extends ExtensionValueListComposite {
-
- /**
- * @param parent
- * @param style
- */
- public ScriptTableComposite(Composite parent) {
- super(parent, AbstractListComposite.DEFAULT_STYLE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.ExtensionValueTableComposite#addListItem(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
- */
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- EObject newScript = ModelFactory.eINSTANCE.create(listItemClass);
- EStructuralFeature f = newScript.eClass().getEStructuralFeature("script");
- if (f!=null)
- newScript.eSet(feature, "");
- f = newScript.eClass().getEStructuralFeature("scriptFormat");
- if (f!=null)
- newScript.eSet(f,"http://www.java.com/java");
- addExtensionValue(newScript);
- return newScript;
- }
-
- @Override
- public AbstractDetailComposite createDetailComposite(final Composite parent, Class eClass) {
- return new JbpmScriptTaskDetailComposite(parent, SWT.NONE) {
- @Override
- public Composite getAttributesParent() {
- ((Section)parent).setText("Script Details");
- return (Composite) ((Section)parent).getClient();
- }
- };
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.ui.property.ExtensionValueListComposite;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.ActivityDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmActivityDetailComposite extends ActivityDetailComposite {
+
+ ScriptTableComposite onEntryScriptTable;
+ ScriptTableComposite onExitScriptTable;
+
+ /**
+ * @param section
+ */
+ public JbpmActivityDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public JbpmActivityDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ onEntryScriptTable = null;
+ onExitScriptTable = null;
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ super.createBindings(be);
+
+ onEntryScriptTable = new ScriptTableComposite(this);
+ onEntryScriptTable.bindList(be, ModelPackage.eINSTANCE.getDocumentRoot_OnEntryScript());
+ onEntryScriptTable.setTitle("On Entry Scripts");
+
+ onExitScriptTable = new ScriptTableComposite(this);
+ onExitScriptTable.bindList(be, ModelPackage.eINSTANCE.getDocumentRoot_OnExitScript());
+ onExitScriptTable.setTitle("On Exit Scripts");
+ }
+
+ private class ScriptTableComposite extends ExtensionValueListComposite {
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public ScriptTableComposite(Composite parent) {
+ super(parent, AbstractListComposite.DEFAULT_STYLE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.ExtensionValueTableComposite#addListItem(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
+ */
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ EObject newScript = ModelFactory.eINSTANCE.create(listItemClass);
+ EStructuralFeature f = newScript.eClass().getEStructuralFeature("script");
+ if (f!=null)
+ newScript.eSet(feature, "");
+ f = newScript.eClass().getEStructuralFeature("scriptFormat");
+ if (f!=null)
+ newScript.eSet(f,"http://www.java.com/java");
+ addExtensionValue(newScript);
+ return newScript;
+ }
+
+ @Override
+ public AbstractDetailComposite createDetailComposite(final Composite parent, Class eClass) {
+ return new JbpmScriptTaskDetailComposite(parent, SWT.NONE) {
+ @Override
+ public Composite getAttributesParent() {
+ ((Section)parent).setText("Script Details");
+ return (Composite) ((Section)parent).getClient();
+ }
+ };
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityPropertySection.java
index 3a06a1f..7f7cbac 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmActivityPropertySection.java
@@ -1,24 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmActivityPropertySection extends DefaultPropertySection {
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmActivityPropertySection extends DefaultPropertySection {
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityPropertySection.java
index cd540f6..d0aedec 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityPropertySection.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmCallActivityPropertySection extends JbpmActivityPropertySection {
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- return object!=null && Bpmn2Package.eINSTANCE.getCallActivity() == object.eClass();
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmCallActivityDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmCallActivityDetailComposite(parent,style);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmCallActivityPropertySection extends JbpmActivityPropertySection {
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ return object!=null && Bpmn2Package.eINSTANCE.getCallActivity() == object.eClass();
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmCallActivityDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmCallActivityDetailComposite(parent,style);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCommonEventPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCommonEventPropertySection.java
index a8dbf82..4c17fe4 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCommonEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCommonEventPropertySection.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.ui.property.events.CommonEventPropertySection;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmCommonEventPropertySection extends CommonEventPropertySection {
- static {
- PropertiesCompositeFactory.register(Event.class, JbpmCommonEventDetailComposite.class);
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmCommonEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmCommonEventDetailComposite(parent,style);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.ui.property.events.CommonEventPropertySection;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmCommonEventPropertySection extends CommonEventPropertySection {
+ static {
+ PropertiesCompositeFactory.register(Event.class, JbpmCommonEventDetailComposite.class);
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmCommonEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmCommonEventDetailComposite(parent,style);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskDetailComposite.java
index 63194a9..b0bd6c1 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskDetailComposite.java
@@ -1,37 +1,37 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.swt.widgets.Composite;
-
-public class JbpmCustomTaskDetailComposite extends JbpmActivityDetailComposite {
-
- public JbpmCustomTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- public JbpmCustomTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.swt.widgets.Composite;
+
+public class JbpmCustomTaskDetailComposite extends JbpmActivityDetailComposite {
+
+ public JbpmCustomTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public JbpmCustomTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskPropertySection.java
index b18cb4a..2e2c05d 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCustomTaskPropertySection.java
@@ -1,88 +1,88 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class JbpmCustomTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmCustomTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmCustomTaskDetailComposite(parent, style);
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- // only show this property section if the selected Task is a "custom task"
- // that is, it has a "taskName" extension attribute
- BPMN2Editor editor = (BPMN2Editor)part.getAdapter(BPMN2Editor.class);
- if (editor!=null) {
- PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection(selection);
- EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- ModelEnablementDescriptor modelEnablement = editor.getTargetRuntime().getModelEnablements(object);
-
- if (object instanceof Task) {
- if (modelEnablement.isEnabled(object.eClass()))
- {
- List<EStructuralFeature> features = ModelUtil.getAnyAttributes(object);
- for (EStructuralFeature f : features) {
- if ("taskName".equals(f.getName()))
- return true;
- }
- }
- }
- }
- return false;
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Task)
- return be;
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class JbpmCustomTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmCustomTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmCustomTaskDetailComposite(parent, style);
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ // only show this property section if the selected Task is a "custom task"
+ // that is, it has a "taskName" extension attribute
+ BPMN2Editor editor = (BPMN2Editor)part.getAdapter(BPMN2Editor.class);
+ if (editor!=null) {
+ PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection(selection);
+ EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ ModelEnablementDescriptor modelEnablement = editor.getTargetRuntime().getModelEnablements(object);
+
+ if (object instanceof Task) {
+ if (modelEnablement.isEnabled(object.eClass()))
+ {
+ List<EStructuralFeature> features = ModelUtil.getAnyAttributes(object);
+ for (EStructuralFeature f : features) {
+ if ("taskName".equals(f.getName()))
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Task)
+ return be;
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataAssociationDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataAssociationDetailComposite.java
index a6d761d..e62a465 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataAssociationDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataAssociationDetailComposite.java
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.DataAssociationDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmDataAssociationDetailComposite extends DataAssociationDetailComposite {
-
- /**
- * @param section
- */
- public JbpmDataAssociationDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /**
- * @param parent
- * @param style
- */
- public JbpmDataAssociationDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public void createBindings(EObject be) {
- super.createBindings(be);
-
- ((GridData)mapTransformationButton.getLayoutData()).exclude = true;
- ((GridData)advancedMappingButton.getLayoutData()).exclude = true;
- mapTransformationButton.setVisible(false);
- advancedMappingButton.setVisible(false);
- if (be instanceof DataOutput) {
- ((GridData)mapExpressionButton.getLayoutData()).exclude = true;
- mapExpressionButton.setVisible(false);
- ((GridData)mapPropertyButton.getLayoutData()).exclude = true;
- mapPropertyButton.setVisible(false);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.DataAssociationDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmDataAssociationDetailComposite extends DataAssociationDetailComposite {
+
+ /**
+ * @param section
+ */
+ public JbpmDataAssociationDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public JbpmDataAssociationDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ super.createBindings(be);
+
+ ((GridData)mapTransformationButton.getLayoutData()).exclude = true;
+ ((GridData)advancedMappingButton.getLayoutData()).exclude = true;
+ mapTransformationButton.setVisible(false);
+ advancedMappingButton.setVisible(false);
+ if (be instanceof DataOutput) {
+ ((GridData)mapExpressionButton.getLayoutData()).exclude = true;
+ mapExpressionButton.setVisible(false);
+ ((GridData)mapPropertyButton.getLayoutData()).exclude = true;
+ mapPropertyButton.setVisible(false);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataItemsDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataItemsDetailComposite.java
index 5e586e7..235c257 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataItemsDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDataItemsDetailComposite.java
@@ -1,120 +1,120 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.RootElement;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.ui.property.ExtensionValueListComposite;
-import org.eclipse.bpmn2.modeler.ui.property.diagrams.DataItemsDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmDataItemsDetailComposite extends DataItemsDetailComposite {
-
- ExtensionValueListComposite globalsTable;
-
- /**
- * @param section
- */
- public JbpmDataItemsDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public JbpmDataItemsDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "rootElements#Process.properties",
- "rootElements#Process.resources",
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- globalsTable = null;
- }
-
- @Override
- public void createBindings(EObject be) {
- if (be instanceof Definitions) {
- Definitions definitions = (Definitions)be;
- for (RootElement re : definitions.getRootElements()) {
- if (re instanceof Process) {
- Process process = (Process)re;
- globalsTable = new ExtensionValueListComposite(
- this, AbstractListComposite.DEFAULT_STYLE|AbstractListComposite.EDIT_BUTTON)
- {
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- // generate a unique global variable name
- String base = "globalVar";
- int suffix = 1;
- String name = base + suffix;
- for (;;) {
- boolean found = false;
- for (Object g : ModelUtil.getAllExtensionAttributeValues(object, GlobalType.class)) {
- if (name.equals(((GlobalType)g).getIdentifier()) ) {
- found = true;
- break;
- }
- }
- if (!found)
- break;
- name = base + ++suffix;
- }
-
- GlobalType newGlobal = (GlobalType)ModelFactory.eINSTANCE.create(listItemClass);
- newGlobal.setIdentifier(name);
- addExtensionValue(newGlobal);
- return newGlobal;
- }
- };
- globalsTable.bindList(process, ModelPackage.eINSTANCE.getDocumentRoot_Global());
- globalsTable.setTitle("Globals for "+ModelUtil.getLongDisplayName(process));
- }
- }
- }
- super.createBindings(be);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.RootElement;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.ui.property.ExtensionValueListComposite;
+import org.eclipse.bpmn2.modeler.ui.property.diagrams.DataItemsDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmDataItemsDetailComposite extends DataItemsDetailComposite {
+
+ ExtensionValueListComposite globalsTable;
+
+ /**
+ * @param section
+ */
+ public JbpmDataItemsDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public JbpmDataItemsDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "rootElements#Process.properties",
+ "rootElements#Process.resources",
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ globalsTable = null;
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ if (be instanceof Definitions) {
+ Definitions definitions = (Definitions)be;
+ for (RootElement re : definitions.getRootElements()) {
+ if (re instanceof Process) {
+ Process process = (Process)re;
+ globalsTable = new ExtensionValueListComposite(
+ this, AbstractListComposite.DEFAULT_STYLE|AbstractListComposite.EDIT_BUTTON)
+ {
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ // generate a unique global variable name
+ String base = "globalVar";
+ int suffix = 1;
+ String name = base + suffix;
+ for (;;) {
+ boolean found = false;
+ for (Object g : ModelUtil.getAllExtensionAttributeValues(object, GlobalType.class)) {
+ if (name.equals(((GlobalType)g).getIdentifier()) ) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ break;
+ name = base + ++suffix;
+ }
+
+ GlobalType newGlobal = (GlobalType)ModelFactory.eINSTANCE.create(listItemClass);
+ newGlobal.setIdentifier(name);
+ addExtensionValue(newGlobal);
+ return newGlobal;
+ }
+ };
+ globalsTable.bindList(process, ModelPackage.eINSTANCE.getDocumentRoot_Global());
+ globalsTable.setTitle("Globals for "+ModelUtil.getLongDisplayName(process));
+ }
+ }
+ }
+ super.createBindings(be);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDefinitionsPropertyComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDefinitionsPropertyComposite.java
index 70d50a3..aac0a74 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDefinitionsPropertyComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDefinitionsPropertyComposite.java
@@ -1,110 +1,110 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.RootElement;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
-import org.eclipse.bpmn2.modeler.ui.property.ExtensionValueListComposite;
-import org.eclipse.bpmn2.modeler.ui.property.diagrams.DefinitionsPropertyComposite;
-import org.eclipse.bpmn2.modeler.ui.property.dialogs.SchemaImportDialog;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmDefinitionsPropertyComposite extends DefinitionsPropertyComposite {
-
- /**
- * @param section
- */
- public JbpmDefinitionsPropertyComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public JbpmDefinitionsPropertyComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "name",
- "targetNamespace",
- "typeLanguage",
- "expressionLanguage",
- "exporter",
- "exporterVersion",
- "rootElements#ItemDefinition",
- "imports",
- "rootElements#Resource",
- "rootElements#Message",
- "rootElements#Error",
- "rootElements#Escalation",
- "rootElements#Signal",
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-
- @Override
- protected Composite bindFeature(EObject object, EStructuralFeature feature, EClass eItemClass) {
- if ("imports".equals(feature.getName())) {
- if (object instanceof Definitions) {
- Definitions definitions = (Definitions)object;
- for (RootElement re : definitions.getRootElements()) {
- if (re instanceof Process) {
- Process process = (Process)re;
- ExtensionValueListComposite importsTable = new ExtensionValueListComposite(
- this, AbstractListComposite.READ_ONLY_STYLE)
- {
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- String name = JbpmModelUtil.showImportDialog(object);
- return JbpmModelUtil.addImport(name, object);
- }
-
- };
- importsTable.bindList(process, ModelPackage.eINSTANCE.getDocumentRoot_ImportType());
- importsTable.setTitle("Imports");
- return importsTable;
- }
- }
- }
- return null;
- }
- else
- return super.bindFeature(object, feature, eItemClass);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.RootElement;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
+import org.eclipse.bpmn2.modeler.ui.property.ExtensionValueListComposite;
+import org.eclipse.bpmn2.modeler.ui.property.diagrams.DefinitionsPropertyComposite;
+import org.eclipse.bpmn2.modeler.ui.property.dialogs.SchemaImportDialog;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmDefinitionsPropertyComposite extends DefinitionsPropertyComposite {
+
+ /**
+ * @param section
+ */
+ public JbpmDefinitionsPropertyComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public JbpmDefinitionsPropertyComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "name",
+ "targetNamespace",
+ "typeLanguage",
+ "expressionLanguage",
+ "exporter",
+ "exporterVersion",
+ "rootElements#ItemDefinition",
+ "imports",
+ "rootElements#Resource",
+ "rootElements#Message",
+ "rootElements#Error",
+ "rootElements#Escalation",
+ "rootElements#Signal",
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+
+ @Override
+ protected Composite bindFeature(EObject object, EStructuralFeature feature, EClass eItemClass) {
+ if ("imports".equals(feature.getName())) {
+ if (object instanceof Definitions) {
+ Definitions definitions = (Definitions)object;
+ for (RootElement re : definitions.getRootElements()) {
+ if (re instanceof Process) {
+ Process process = (Process)re;
+ ExtensionValueListComposite importsTable = new ExtensionValueListComposite(
+ this, AbstractListComposite.READ_ONLY_STYLE)
+ {
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ String name = JbpmModelUtil.showImportDialog(object);
+ return JbpmModelUtil.addImport(name, object);
+ }
+
+ };
+ importsTable.bindList(process, ModelPackage.eINSTANCE.getDocumentRoot_ImportType());
+ importsTable.setTitle("Imports");
+ return importsTable;
+ }
+ }
+ }
+ return null;
+ }
+ else
+ return super.bindFeature(object, feature, eItemClass);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmEmptyPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmEmptyPropertySection.java
index 90de10a..b564b08 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmEmptyPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmEmptyPropertySection.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskPropertySection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * This is an empty tab section which simply exists to hide the "Basic" tab
- * defined the editor UI plugin.
- *
- * @author Bob Brodt
- *
- */
-public class JbpmEmptyPropertySection extends TaskPropertySection {
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return null;
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return null;
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- return false;
- }
-
- @Override
- public boolean doReplaceTab(String id, IWorkbenchPart part, ISelection selection) {
- return true;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskPropertySection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * This is an empty tab section which simply exists to hide the "Basic" tab
+ * defined the editor UI plugin.
+ *
+ * @author Bob Brodt
+ *
+ */
+public class JbpmEmptyPropertySection extends TaskPropertySection {
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return null;
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return null;
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ return false;
+ }
+
+ @Override
+ public boolean doReplaceTab(String id, IWorkbenchPart part, ISelection selection) {
+ return true;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmImportObjectEditor.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmImportObjectEditor.java
index 37acce3..1781635 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmImportObjectEditor.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmImportObjectEditor.java
@@ -1,38 +1,38 @@
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextAndButtonObjectEditor;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public class JbpmImportObjectEditor extends TextAndButtonObjectEditor {
-
- public JbpmImportObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) {
- super(parent, object, feature);
- }
-
- @Override
- public Control createControl(Composite composite, String label, int style) {
- super.createControl(composite, label, style);
- // the Text field should be editable
- text.setEditable(true);
- // and change the "Edit" button to a "Browse" to make it clear that
- // an XML type can be selected from the imports
- button.setText("Browse Types...");
- return text;
- }
-
- @Override
- protected void buttonClicked() {
- String name = JbpmModelUtil.showImportDialog(object);
- ImportType imp = JbpmModelUtil.addImport(name, object);
- if (imp!=null)
- setText(imp.getName());
- }
-}
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextAndButtonObjectEditor;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class JbpmImportObjectEditor extends TextAndButtonObjectEditor {
+
+ public JbpmImportObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) {
+ super(parent, object, feature);
+ }
+
+ @Override
+ public Control createControl(Composite composite, String label, int style) {
+ super.createControl(composite, label, style);
+ // the Text field should be editable
+ text.setEditable(true);
+ // and change the "Edit" button to a "Browse" to make it clear that
+ // an XML type can be selected from the imports
+ button.setText("Browse Types...");
+ return text;
+ }
+
+ @Override
+ protected void buttonClicked() {
+ String name = JbpmModelUtil.showImportDialog(object);
+ ImportType imp = JbpmModelUtil.addImport(name, object);
+ if (imp!=null)
+ setText(imp.getName());
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmIoParametersPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmIoParametersPropertySection.java
index 68eba0f..10a13ee 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmIoParametersPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmIoParametersPropertySection.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParametersPropertySection;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public class JbpmIoParametersPropertySection extends IoParametersPropertySection {
- static {
- PropertiesCompositeFactory.register(DataInput.class, JbpmDataAssociationDetailComposite.class);
- PropertiesCompositeFactory.register(DataOutput.class, JbpmDataAssociationDetailComposite.class);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ScriptTask)
- return null;
- return be;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParametersPropertySection;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public class JbpmIoParametersPropertySection extends IoParametersPropertySection {
+ static {
+ PropertiesCompositeFactory.register(DataInput.class, JbpmDataAssociationDetailComposite.class);
+ PropertiesCompositeFactory.register(DataOutput.class, JbpmDataAssociationDetailComposite.class);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ScriptTask)
+ return null;
+ return be;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskDetailComposite.java
index 3a2cd8c..378e9fb 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskDetailComposite.java
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ComboObjectEditor;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmScriptTaskDetailComposite extends JbpmTaskDetailComposite {
-
- ComboObjectEditor scriptFormatEditor;
- TextObjectEditor scriptEditor;
-
- /**
- * @param section
- */
- public JbpmScriptTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public JbpmScriptTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- scriptFormatEditor = null;
- scriptEditor = null;
- }
-
- @Override
- public void createBindings(EObject be) {
- scriptFormatEditor = new ComboObjectEditor(this,be,be.eClass().getEStructuralFeature("scriptFormat")) {
-
- @Override
- protected Hashtable<String, Object> getChoiceOfValues(EObject object, EStructuralFeature feature) {
- Hashtable<String, Object> choiceOfValues = new Hashtable<String, Object>();
- choiceOfValues.put("Java", "http://www.java.com/java");
- choiceOfValues.put("MVEL", "http://www.mvel.org/2.0");
- return choiceOfValues;
- }
-
- };
- scriptFormatEditor.createControl(getAttributesParent(),"Script Language",SWT.NONE);
-
- scriptEditor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("script"));
- scriptEditor.createControl(getAttributesParent(),"Script",SWT.MULTI);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ComboObjectEditor;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmScriptTaskDetailComposite extends JbpmTaskDetailComposite {
+
+ ComboObjectEditor scriptFormatEditor;
+ TextObjectEditor scriptEditor;
+
+ /**
+ * @param section
+ */
+ public JbpmScriptTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public JbpmScriptTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ scriptFormatEditor = null;
+ scriptEditor = null;
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ scriptFormatEditor = new ComboObjectEditor(this,be,be.eClass().getEStructuralFeature("scriptFormat")) {
+
+ @Override
+ protected Hashtable<String, Object> getChoiceOfValues(EObject object, EStructuralFeature feature) {
+ Hashtable<String, Object> choiceOfValues = new Hashtable<String, Object>();
+ choiceOfValues.put("Java", "http://www.java.com/java");
+ choiceOfValues.put("MVEL", "http://www.mvel.org/2.0");
+ return choiceOfValues;
+ }
+
+ };
+ scriptFormatEditor.createControl(getAttributesParent(),"Script Language",SWT.NONE);
+
+ scriptEditor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("script"));
+ scriptEditor.createControl(getAttributesParent(),"Script",SWT.MULTI);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskPropertySection.java
index 2e96b63..2088b9b 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmScriptTaskPropertySection.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmScriptTaskPropertySection extends JbpmTaskPropertySection {
- static {
- PropertiesCompositeFactory.register(ScriptTask.class, JbpmScriptTaskDetailComposite.class);
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- return object!=null && Bpmn2Package.eINSTANCE.getScriptTask() == object.eClass();
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmScriptTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmScriptTaskDetailComposite(parent,style);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmScriptTaskPropertySection extends JbpmTaskPropertySection {
+ static {
+ PropertiesCompositeFactory.register(ScriptTask.class, JbpmScriptTaskDetailComposite.class);
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ return object!=null && Bpmn2Package.eINSTANCE.getScriptTask() == object.eClass();
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmScriptTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmScriptTaskDetailComposite(parent,style);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowDetailComposite.java
index 1ffc810..8ed9891 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowDetailComposite.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ComboObjectEditor;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
-import org.eclipse.bpmn2.modeler.ui.property.connectors.SequenceFlowDetailComposite;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmSequenceFlowDetailComposite extends SequenceFlowDetailComposite {
-
- /**
- * @param section
- */
- public JbpmSequenceFlowDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public JbpmSequenceFlowDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public void createBindings(EObject be) {
- bindAttribute(this, be, "priority");
- super.createBindings(be);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ComboObjectEditor;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
+import org.eclipse.bpmn2.modeler.ui.property.connectors.SequenceFlowDetailComposite;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmSequenceFlowDetailComposite extends SequenceFlowDetailComposite {
+
+ /**
+ * @param section
+ */
+ public JbpmSequenceFlowDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public JbpmSequenceFlowDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(this, be, "priority");
+ super.createBindings(be);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowPropertySection.java
index f7e16fb..05e03dd 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmSequenceFlowPropertySection.java
@@ -1,72 +1,72 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.property.connectors.SequenceFlowPropertySection;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmSequenceFlowPropertySection extends SequenceFlowPropertySection {
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- if (super.appliesTo(part, selection)) {
- EObject be = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- if (be instanceof SequenceFlow) {
- // only show this tab if the sequence flow is attached to a Gateway
- if (((SequenceFlow) be).getSourceRef() instanceof Gateway) {
- Gateway gateway = (Gateway) ((SequenceFlow) be).getSourceRef();
- // hide this tab if the "condition expression" on the Sequence Flow
- // or the (possibly) attached Gateway's "default flow" feature is disabled
- boolean conditionEnabled = true;
- boolean defaultEnabled = true;
- ModelEnablementDescriptor modelEnablement = getModelEnablement(selection);
- if (!modelEnablement.isEnabled("SequenceFlow", "conditionExpression")) {
- conditionEnabled = false;
- }
- EStructuralFeature defaultFeature = gateway.eClass().getEStructuralFeature("default");
- if (defaultFeature!=null) {
- if (!modelEnablement.isEnabled(gateway.eClass(), defaultFeature))
- defaultEnabled = false;
- }
- return conditionEnabled || defaultEnabled;
- }
- }
- }
- return false;
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmSequenceFlowDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmSequenceFlowDetailComposite(parent,style);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.property.connectors.SequenceFlowPropertySection;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmSequenceFlowPropertySection extends SequenceFlowPropertySection {
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ if (super.appliesTo(part, selection)) {
+ EObject be = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ if (be instanceof SequenceFlow) {
+ // only show this tab if the sequence flow is attached to a Gateway
+ if (((SequenceFlow) be).getSourceRef() instanceof Gateway) {
+ Gateway gateway = (Gateway) ((SequenceFlow) be).getSourceRef();
+ // hide this tab if the "condition expression" on the Sequence Flow
+ // or the (possibly) attached Gateway's "default flow" feature is disabled
+ boolean conditionEnabled = true;
+ boolean defaultEnabled = true;
+ ModelEnablementDescriptor modelEnablement = getModelEnablement(selection);
+ if (!modelEnablement.isEnabled("SequenceFlow", "conditionExpression")) {
+ conditionEnabled = false;
+ }
+ EStructuralFeature defaultFeature = gateway.eClass().getEStructuralFeature("default");
+ if (defaultFeature!=null) {
+ if (!modelEnablement.isEnabled(gateway.eClass(), defaultFeature))
+ defaultEnabled = false;
+ }
+ return conditionEnabled || defaultEnabled;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmSequenceFlowDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmSequenceFlowDetailComposite(parent,style);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java
index 5d3fd90..7969278 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java
@@ -1,35 +1,35 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmTaskDetailComposite extends JbpmActivityDetailComposite {
-
- /**
- * @param section
- */
- public JbpmTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public JbpmTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmTaskDetailComposite extends JbpmActivityDetailComposite {
+
+ /**
+ * @param section
+ */
+ public JbpmTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public JbpmTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskPropertySection.java
index 11a9187..660ad78 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskPropertySection.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskPropertySection;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmTaskPropertySection extends TaskPropertySection {
- static {
- PropertiesCompositeFactory.register(Task.class, JbpmTaskDetailComposite.class);
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- if (object!=null && Bpmn2Package.eINSTANCE.getTask() == object.eClass()) {
- List<EStructuralFeature> features = ModelUtil.getAnyAttributes(object);
- for (EStructuralFeature f : features) {
- if ("taskName".equals(f.getName()))
- // don't display this tab for Custom Tasks
- return false;
- }
- return true;
- }
- return false;
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmTaskDetailComposite(parent,style);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskPropertySection;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmTaskPropertySection extends TaskPropertySection {
+ static {
+ PropertiesCompositeFactory.register(Task.class, JbpmTaskDetailComposite.class);
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ if (object!=null && Bpmn2Package.eINSTANCE.getTask() == object.eClass()) {
+ List<EStructuralFeature> features = ModelUtil.getAnyAttributes(object);
+ for (EStructuralFeature f : features) {
+ if ("taskName".equals(f.getName()))
+ // don't display this tab for Custom Tasks
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmTaskDetailComposite(parent,style);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmUserTaskPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmUserTaskPropertySection.java
index 610797e..221030c 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmUserTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmUserTaskPropertySection.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmUserTaskPropertySection extends JbpmTaskPropertySection {
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- return object!=null && Bpmn2Package.eINSTANCE.getUserTask() == object.eClass();
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmUserTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new JbpmUserTaskDetailComposite(parent,style);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.TaskDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmUserTaskPropertySection extends JbpmTaskPropertySection {
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ EObject object = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ return object!=null && Bpmn2Package.eINSTANCE.getUserTask() == object.eClass();
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmUserTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmUserTaskDetailComposite(parent,style);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmFormalExpressionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmFormalExpressionPropertiesAdapter.java
index 7f5ca9f..fba7bba 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmFormalExpressionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmFormalExpressionPropertiesAdapter.java
@@ -1,84 +1,84 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.adapters;
-
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.FormalExpression;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.ui.adapters.properties.FormalExpressionPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmFormalExpressionPropertiesAdapter extends FormalExpressionPropertiesAdapter {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public JbpmFormalExpressionPropertiesAdapter(AdapterFactory adapterFactory, FormalExpression object) {
- super(adapterFactory, object);
-
- final EStructuralFeature language = Bpmn2Package.eINSTANCE.getFormalExpression_Language();
- FeatureDescriptor<FormalExpression> fd = new FeatureDescriptor<FormalExpression>(adapterFactory,object,language) {
- @Override
- public String getLabel(Object context) {
- return "Script Language";
- }
- };
- Hashtable<String, Object> choiceOfValues = new Hashtable<String, Object>();
- choiceOfValues.put("Java", "http://www.java.com/java");
- choiceOfValues.put("MVEL", "http://www.mvel.org/2.0");
- if (object.eContainer() instanceof SequenceFlow)
- choiceOfValues.put("Rule", "http://www.jboss.org/drools/rule");
- fd.setChoiceOfValues(choiceOfValues);
- setFeatureDescriptor(language,fd);
-
- final EStructuralFeature body = Bpmn2Package.eINSTANCE.getFormalExpression_Body();
- setFeatureDescriptor(body,
- new FeatureDescriptor<FormalExpression>(adapterFactory,object,body) {
-
- @Override
- public String getDisplayName(Object context) {
- FormalExpression expression = adopt(context);
- if (expression.getBody()==null)
- return "";
- return expression.getBody();
- }
-
- @Override
- public String getLabel(Object context) {
- EObject expression = adopt(context);
- if (expression.eContainer() instanceof SequenceFlow)
- return "Constraint";
- return "Script";
- }
-
- @Override
- public boolean isMultiLine(Object context) {
- // formal expression body is always a multiline text field
- return true;
- }
- }
- );
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.adapters;
+
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.FormalExpression;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.ui.adapters.properties.FormalExpressionPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmFormalExpressionPropertiesAdapter extends FormalExpressionPropertiesAdapter {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public JbpmFormalExpressionPropertiesAdapter(AdapterFactory adapterFactory, FormalExpression object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature language = Bpmn2Package.eINSTANCE.getFormalExpression_Language();
+ FeatureDescriptor<FormalExpression> fd = new FeatureDescriptor<FormalExpression>(adapterFactory,object,language) {
+ @Override
+ public String getLabel(Object context) {
+ return "Script Language";
+ }
+ };
+ Hashtable<String, Object> choiceOfValues = new Hashtable<String, Object>();
+ choiceOfValues.put("Java", "http://www.java.com/java");
+ choiceOfValues.put("MVEL", "http://www.mvel.org/2.0");
+ if (object.eContainer() instanceof SequenceFlow)
+ choiceOfValues.put("Rule", "http://www.jboss.org/drools/rule");
+ fd.setChoiceOfValues(choiceOfValues);
+ setFeatureDescriptor(language,fd);
+
+ final EStructuralFeature body = Bpmn2Package.eINSTANCE.getFormalExpression_Body();
+ setFeatureDescriptor(body,
+ new FeatureDescriptor<FormalExpression>(adapterFactory,object,body) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ FormalExpression expression = adopt(context);
+ if (expression.getBody()==null)
+ return "";
+ return expression.getBody();
+ }
+
+ @Override
+ public String getLabel(Object context) {
+ EObject expression = adopt(context);
+ if (expression.eContainer() instanceof SequenceFlow)
+ return "Constraint";
+ return "Script";
+ }
+
+ @Override
+ public boolean isMultiLine(Object context) {
+ // formal expression body is always a multiline text field
+ return true;
+ }
+ }
+ );
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmGlobalTypePropertiesAdapter.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmGlobalTypePropertiesAdapter.java
index a1e6eba..db65801 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmGlobalTypePropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmGlobalTypePropertiesAdapter.java
@@ -1,89 +1,89 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.adapters;
-
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmGlobalTypePropertiesAdapter extends ExtendedPropertiesAdapter<GlobalType> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public JbpmGlobalTypePropertiesAdapter(AdapterFactory adapterFactory, GlobalType object) {
- super(adapterFactory, object);
- setProperty(ModelPackage.eINSTANCE.getGlobalType_Type(), UI_CAN_CREATE_NEW, Boolean.TRUE);
- setProperty(ModelPackage.eINSTANCE.getGlobalType_Type(), UI_IS_MULTI_CHOICE, Boolean.TRUE);
-
- EStructuralFeature feature = ModelPackage.eINSTANCE.getGlobalType_Identifier();
- setFeatureDescriptor(feature,
- new FeatureDescriptor<GlobalType>(adapterFactory,object,feature) {
- @Override
- public String getLabel(Object context) {
- return "Name";
- }
- });
-
- feature = ModelPackage.eINSTANCE.getGlobalType_Type();
- setFeatureDescriptor(feature,
- new FeatureDescriptor<GlobalType>(adapterFactory,object,feature) {
- @Override
- public String getLabel(Object context) {
- return "Data Type";
- }
-
- @Override
- public void setValue(Object context, final Object value) {
- final GlobalType global = adopt(context);
-
- TransactionalEditingDomain domain = getEditingDomain(object);
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- global.setType(JbpmModelUtil.getDataType(value));
- }
- });
- }
-
- @Override
- public Hashtable<String, Object> getChoiceOfValues(Object context) {
- final GlobalType global = adopt(context);
- return JbpmModelUtil.collectAllDataTypes(global);
- }
-
- @Override
- public boolean isMultiLine(Object context) {
- return true;
- }
- }
- );
-
-
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.adapters;
+
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.ModelPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmGlobalTypePropertiesAdapter extends ExtendedPropertiesAdapter<GlobalType> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public JbpmGlobalTypePropertiesAdapter(AdapterFactory adapterFactory, GlobalType object) {
+ super(adapterFactory, object);
+ setProperty(ModelPackage.eINSTANCE.getGlobalType_Type(), UI_CAN_CREATE_NEW, Boolean.TRUE);
+ setProperty(ModelPackage.eINSTANCE.getGlobalType_Type(), UI_IS_MULTI_CHOICE, Boolean.TRUE);
+
+ EStructuralFeature feature = ModelPackage.eINSTANCE.getGlobalType_Identifier();
+ setFeatureDescriptor(feature,
+ new FeatureDescriptor<GlobalType>(adapterFactory,object,feature) {
+ @Override
+ public String getLabel(Object context) {
+ return "Name";
+ }
+ });
+
+ feature = ModelPackage.eINSTANCE.getGlobalType_Type();
+ setFeatureDescriptor(feature,
+ new FeatureDescriptor<GlobalType>(adapterFactory,object,feature) {
+ @Override
+ public String getLabel(Object context) {
+ return "Data Type";
+ }
+
+ @Override
+ public void setValue(Object context, final Object value) {
+ final GlobalType global = adopt(context);
+
+ TransactionalEditingDomain domain = getEditingDomain(object);
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ global.setType(JbpmModelUtil.getDataType(value));
+ }
+ });
+ }
+
+ @Override
+ public Hashtable<String, Object> getChoiceOfValues(Object context) {
+ final GlobalType global = adopt(context);
+ return JbpmModelUtil.collectAllDataTypes(global);
+ }
+
+ @Override
+ public boolean isMultiLine(Object context) {
+ return true;
+ }
+ }
+ );
+
+
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmPropertyPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmPropertyPropertiesAdapter.java
index 8e6d505..c5f30c3 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmPropertyPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/JbpmPropertyPropertiesAdapter.java
@@ -1,104 +1,104 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.adapters;
-
-import java.util.Hashtable;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Property;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
-import org.eclipse.bpmn2.modeler.ui.adapters.properties.ItemAwareElementFeatureDescriptor;
-import org.eclipse.bpmn2.modeler.ui.adapters.properties.PropertyPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- * @author Bob Brodt
- *
- */
-public class JbpmPropertyPropertiesAdapter extends PropertyPropertiesAdapter {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public JbpmPropertyPropertiesAdapter(AdapterFactory adapterFactory, Property object) {
- super(adapterFactory, object);
- setProperty(Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef(), UI_CAN_CREATE_NEW, Boolean.TRUE);
- setProperty(Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef(), UI_CAN_EDIT, Boolean.FALSE);
-
- EStructuralFeature feature = Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef();
- setFeatureDescriptor(feature,
- new ItemAwareElementFeatureDescriptor<Property>(adapterFactory,object,feature) {
- @Override
- public String getLabel(Object context) {
- return "Data Type";
- }
-
- @Override
- public void setValue(Object context, final Object value) {
- final Property property = adopt(context);
-
- TransactionalEditingDomain domain = getEditingDomain(object);
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- property.setItemSubjectRef(JbpmModelUtil.getDataType(property, value));
- }
- });
- }
-
- @Override
- public String getDisplayName(Object context) {
- return super.getDisplayName(context);
- }
-
- @Override
- public Hashtable<String, Object> getChoiceOfValues(Object context) {
- final Property property = adopt(context);
- return JbpmModelUtil.collectAllDataTypes(property);
- }
-
- @Override
- public boolean isMultiLine(Object context) {
- return true;
- }
- }
- );
-
- feature = Bpmn2Package.eINSTANCE.getProperty_Name();
- setFeatureDescriptor(feature,
- new FeatureDescriptor<Property>(adapterFactory,object,feature) {
- @Override
- public String getLabel(Object context) {
- return "Description";
- }
- }
- );
-
- feature = Bpmn2Package.eINSTANCE.getBaseElement_Id();
- setFeatureDescriptor(feature,
- new FeatureDescriptor<Property>(adapterFactory,object,feature) {
- @Override
- public String getLabel(Object context) {
- return "Name";
- }
- }
- );
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.adapters;
+
+import java.util.Hashtable;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Property;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
+import org.eclipse.bpmn2.modeler.ui.adapters.properties.ItemAwareElementFeatureDescriptor;
+import org.eclipse.bpmn2.modeler.ui.adapters.properties.PropertyPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class JbpmPropertyPropertiesAdapter extends PropertyPropertiesAdapter {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public JbpmPropertyPropertiesAdapter(AdapterFactory adapterFactory, Property object) {
+ super(adapterFactory, object);
+ setProperty(Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef(), UI_CAN_CREATE_NEW, Boolean.TRUE);
+ setProperty(Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef(), UI_CAN_EDIT, Boolean.FALSE);
+
+ EStructuralFeature feature = Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef();
+ setFeatureDescriptor(feature,
+ new ItemAwareElementFeatureDescriptor<Property>(adapterFactory,object,feature) {
+ @Override
+ public String getLabel(Object context) {
+ return "Data Type";
+ }
+
+ @Override
+ public void setValue(Object context, final Object value) {
+ final Property property = adopt(context);
+
+ TransactionalEditingDomain domain = getEditingDomain(object);
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ property.setItemSubjectRef(JbpmModelUtil.getDataType(property, value));
+ }
+ });
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ return super.getDisplayName(context);
+ }
+
+ @Override
+ public Hashtable<String, Object> getChoiceOfValues(Object context) {
+ final Property property = adopt(context);
+ return JbpmModelUtil.collectAllDataTypes(property);
+ }
+
+ @Override
+ public boolean isMultiLine(Object context) {
+ return true;
+ }
+ }
+ );
+
+ feature = Bpmn2Package.eINSTANCE.getProperty_Name();
+ setFeatureDescriptor(feature,
+ new FeatureDescriptor<Property>(adapterFactory,object,feature) {
+ @Override
+ public String getLabel(Object context) {
+ return "Description";
+ }
+ }
+ );
+
+ feature = Bpmn2Package.eINSTANCE.getBaseElement_Id();
+ setFeatureDescriptor(feature,
+ new FeatureDescriptor<Property>(adapterFactory,object,feature) {
+ @Override
+ public String getLabel(Object context) {
+ return "Name";
+ }
+ }
+ );
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDException.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDException.java
index db9658b..a5ecbd1 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDException.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDException.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
-
-/**
- * Custom exception class so we know specific errors coming out of the
- * WIDHandler.
- * @author bfitzpat
- *
- */
-public class WIDException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public WIDException (String message) {
- super(message);
- }
-
- public WIDException (String message, Throwable exception) {
- super(message, exception);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
+
+/**
+ * Custom exception class so we know specific errors coming out of the
+ * WIDHandler.
+ * @author bfitzpat
+ *
+ */
+public class WIDException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public WIDException (String message) {
+ super(message);
+ }
+
+ public WIDException (String message, Throwable exception) {
+ super(message, exception);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDHandler.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDHandler.java
index edbc844..b515efb 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDHandler.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WIDHandler.java
@@ -1,130 +1,130 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
-
-import java.util.Map;
-
-/**
- * @author bfitzpat
- *
- */
-public class WIDHandler {
-
- public enum Section {
- PARAMETERS, RESULTS, DEPENDENCIES
- }
-
- /**
- * Takes in the String content of a *.wid/*.conf file from jbpm5 and
- * parses it into a HashMap of WorkItemDefinition classes
- * @param widDefinitions
- * @param content
- * @throws WIDException
- */
- public static void evaluateWorkDefinitions(
- Map<String, WorkItemDefinition> widDefinitions, String content) throws WIDException {
- processWorkDefinitionsContent(widDefinitions, content);
- }
-
- /*
- * Actually does the work to parse the content using RegEx and brute force
- * @param widDefinitions
- * @param content
- * @throws WIDException
- */
- private static void processWorkDefinitionsContent (Map<String, WorkItemDefinition> widDefinitions,
- String content) throws WIDException {
-
- if (content == null) {
- WIDException widException =
- new WIDException(
- "No data passed to WIDHandler.processWorkDefinitionsContent method"); //$NON-NLS-1$
- throw widException;
- }
- if (widDefinitions != null) {
- widDefinitions.clear();
- }
-
- String strings[] = content.split("[\n]+"); //$NON-NLS-1$
- int openBrackets = 0;
- WorkItemDefinition currentWid = new WorkItemDefinitionImpl();
-
- Section current = Section.PARAMETERS;
-
- for (int i = 0; i < strings.length; i++) {
- String trim = strings[i].trim();
- if (trim.length() == 0) continue;
- if (trim.startsWith("[") || trim.endsWith("[") || trim.endsWith(":")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (trim.endsWith(":") && i < strings.length - 1) { //$NON-NLS-1$
- trim = strings[i].trim() + strings[i+1].trim();
- } else {
- openBrackets++;
- }
- String[] nameValue = trim.split("[:]+"); //$NON-NLS-1$
- if (nameValue.length == 2) {
- String name = nameValue[0].replace('"', ' ').trim();
- if (name.equalsIgnoreCase("parameters")) {
- current = Section.PARAMETERS;
- } else if (name.equalsIgnoreCase("results")) {
- current = Section.RESULTS;
- } else if (name.equalsIgnoreCase("dependencies")) {
- current = Section.DEPENDENCIES;
- }
- }
- }
- if (trim.startsWith("]") || trim.endsWith("]")) { //$NON-NLS-1$ //$NON-NLS-2$
- openBrackets--;
- if (openBrackets == 1) {
- if (currentWid != null && currentWid.getName() != null) {
- widDefinitions.put(currentWid.getName(), currentWid);
- }
- currentWid = new WorkItemDefinitionImpl();
- }
- }
- if (trim.contains(":")) { //$NON-NLS-1$
- String[] nameValue = trim.split("[:]+"); //$NON-NLS-1$
- if (nameValue.length == 2 || nameValue.length == 3) {
- String name = nameValue[0].replace('"', ' ').trim();
- int valueIndex = 1;
- if (nameValue.length == 3) {
- valueIndex = 2;
- name = name + ':' + nameValue[1].replace('"', ' ').trim();
- }
- String value = nameValue[valueIndex].replace('"', ' ').replace(',', ' ').
- replace('[',' ').trim();
- if (openBrackets == 2 && value.trim().length() > 0) {
- if (name.equalsIgnoreCase("name")) { //$NON-NLS-1$
- currentWid.setName(value);
- } else if (name.equalsIgnoreCase("displayName")) { //$NON-NLS-1$
- currentWid.setDispalyName(value);
- } else if (name.equalsIgnoreCase("icon")) { //$NON-NLS-1$
- currentWid.setIcon(value);
- } else if (name.equalsIgnoreCase("customEditor")) { //$NON-NLS-1$
- currentWid.setCustomEditor(value);
- } else if (name.equalsIgnoreCase("eclipse:customEditor")) { //$NON-NLS-1$
- currentWid.setEclipseCustomEditor(value);
- }
- } else if (openBrackets == 3 && value.trim().length() > 0) {
- if (value.startsWith("new") && value.indexOf("(")>0) {
- int index = value.indexOf("(");
- value = value.substring(3,index).trim();
- }
- if (current == Section.PARAMETERS)
- currentWid.getParameters().put(name, value);
- else if (current == Section.RESULTS)
- currentWid.getResults().put(name, value);
- }
- }
- }
- }
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
+
+import java.util.Map;
+
+/**
+ * @author bfitzpat
+ *
+ */
+public class WIDHandler {
+
+ public enum Section {
+ PARAMETERS, RESULTS, DEPENDENCIES
+ }
+
+ /**
+ * Takes in the String content of a *.wid/*.conf file from jbpm5 and
+ * parses it into a HashMap of WorkItemDefinition classes
+ * @param widDefinitions
+ * @param content
+ * @throws WIDException
+ */
+ public static void evaluateWorkDefinitions(
+ Map<String, WorkItemDefinition> widDefinitions, String content) throws WIDException {
+ processWorkDefinitionsContent(widDefinitions, content);
+ }
+
+ /*
+ * Actually does the work to parse the content using RegEx and brute force
+ * @param widDefinitions
+ * @param content
+ * @throws WIDException
+ */
+ private static void processWorkDefinitionsContent (Map<String, WorkItemDefinition> widDefinitions,
+ String content) throws WIDException {
+
+ if (content == null) {
+ WIDException widException =
+ new WIDException(
+ "No data passed to WIDHandler.processWorkDefinitionsContent method"); //$NON-NLS-1$
+ throw widException;
+ }
+ if (widDefinitions != null) {
+ widDefinitions.clear();
+ }
+
+ String strings[] = content.split("[\n]+"); //$NON-NLS-1$
+ int openBrackets = 0;
+ WorkItemDefinition currentWid = new WorkItemDefinitionImpl();
+
+ Section current = Section.PARAMETERS;
+
+ for (int i = 0; i < strings.length; i++) {
+ String trim = strings[i].trim();
+ if (trim.length() == 0) continue;
+ if (trim.startsWith("[") || trim.endsWith("[") || trim.endsWith(":")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (trim.endsWith(":") && i < strings.length - 1) { //$NON-NLS-1$
+ trim = strings[i].trim() + strings[i+1].trim();
+ } else {
+ openBrackets++;
+ }
+ String[] nameValue = trim.split("[:]+"); //$NON-NLS-1$
+ if (nameValue.length == 2) {
+ String name = nameValue[0].replace('"', ' ').trim();
+ if (name.equalsIgnoreCase("parameters")) {
+ current = Section.PARAMETERS;
+ } else if (name.equalsIgnoreCase("results")) {
+ current = Section.RESULTS;
+ } else if (name.equalsIgnoreCase("dependencies")) {
+ current = Section.DEPENDENCIES;
+ }
+ }
+ }
+ if (trim.startsWith("]") || trim.endsWith("]")) { //$NON-NLS-1$ //$NON-NLS-2$
+ openBrackets--;
+ if (openBrackets == 1) {
+ if (currentWid != null && currentWid.getName() != null) {
+ widDefinitions.put(currentWid.getName(), currentWid);
+ }
+ currentWid = new WorkItemDefinitionImpl();
+ }
+ }
+ if (trim.contains(":")) { //$NON-NLS-1$
+ String[] nameValue = trim.split("[:]+"); //$NON-NLS-1$
+ if (nameValue.length == 2 || nameValue.length == 3) {
+ String name = nameValue[0].replace('"', ' ').trim();
+ int valueIndex = 1;
+ if (nameValue.length == 3) {
+ valueIndex = 2;
+ name = name + ':' + nameValue[1].replace('"', ' ').trim();
+ }
+ String value = nameValue[valueIndex].replace('"', ' ').replace(',', ' ').
+ replace('[',' ').trim();
+ if (openBrackets == 2 && value.trim().length() > 0) {
+ if (name.equalsIgnoreCase("name")) { //$NON-NLS-1$
+ currentWid.setName(value);
+ } else if (name.equalsIgnoreCase("displayName")) { //$NON-NLS-1$
+ currentWid.setDispalyName(value);
+ } else if (name.equalsIgnoreCase("icon")) { //$NON-NLS-1$
+ currentWid.setIcon(value);
+ } else if (name.equalsIgnoreCase("customEditor")) { //$NON-NLS-1$
+ currentWid.setCustomEditor(value);
+ } else if (name.equalsIgnoreCase("eclipse:customEditor")) { //$NON-NLS-1$
+ currentWid.setEclipseCustomEditor(value);
+ }
+ } else if (openBrackets == 3 && value.trim().length() > 0) {
+ if (value.startsWith("new") && value.indexOf("(")>0) {
+ int index = value.indexOf("(");
+ value = value.substring(3,index).trim();
+ }
+ if (current == Section.PARAMETERS)
+ currentWid.getParameters().put(name, value);
+ else if (current == Section.RESULTS)
+ currentWid.getResults().put(name, value);
+ }
+ }
+ }
+ }
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinition.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinition.java
index 49fd00c..52e2acc 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinition.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinition.java
@@ -1,35 +1,35 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
-
-import java.util.LinkedHashMap;
-
-/**
- * WorkItemDefinition simply captures the data we need from the *.wid/*.conf file
- * @author bfitzpat
- *
- */
-public interface WorkItemDefinition {
-
- public String getName();
- public void setName ( String name );
- public String getDisplayName();
- public String getCustomEditor();
- public String getEclipseCustomEditor();
- public void setCustomEditor ( String editor );
- public void setEclipseCustomEditor ( String editor );
- public void setDispalyName ( String displayName );
- public String getIcon();
- public void setIcon ( String iconPath );
- public LinkedHashMap<String, String> getParameters();
- public LinkedHashMap<String, String> getResults();
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
+
+import java.util.LinkedHashMap;
+
+/**
+ * WorkItemDefinition simply captures the data we need from the *.wid/*.conf file
+ * @author bfitzpat
+ *
+ */
+public interface WorkItemDefinition {
+
+ public String getName();
+ public void setName ( String name );
+ public String getDisplayName();
+ public String getCustomEditor();
+ public String getEclipseCustomEditor();
+ public void setCustomEditor ( String editor );
+ public void setEclipseCustomEditor ( String editor );
+ public void setDispalyName ( String displayName );
+ public String getIcon();
+ public void setIcon ( String iconPath );
+ public LinkedHashMap<String, String> getParameters();
+ public LinkedHashMap<String, String> getResults();
+
+}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinitionImpl.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinitionImpl.java
index 545e678..7f146f5 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinitionImpl.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/wid/WorkItemDefinitionImpl.java
@@ -1,105 +1,105 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
-
-import java.util.LinkedHashMap;
-
-/**
- * @author bfitzpat
- *
- */
-public class WorkItemDefinitionImpl implements WorkItemDefinition {
-
- @Override
- public String toString() {
- return "WorkItemDefinitionImpl [widName=" + widName //$NON-NLS-1$
- + ", widDisplayName=" + widDisplayName //$NON-NLS-1$
- + ", widIcon=" + widIcon //$NON-NLS-1$
- + ", widCustomEditor=" + widCustomEditor //$NON-NLS-1$
- + ", widEclipseCustomEditor=" + widEclipseCustomEditor //$NON-NLS-1$
- + ", widParameters=" + widParameters //$NON-NLS-1$
- + ", widResults=" + widResults //$NON-NLS-1$
- + "]"; //$NON-NLS-1$
- }
-
- private String widName;
- private String widDisplayName;
- private String widIcon;
- private String widCustomEditor;
- private String widEclipseCustomEditor;
- private LinkedHashMap<String, String> widParameters;
- private LinkedHashMap<String, String> widResults;
-
- @Override
- public String getName() {
- return this.widName;
- }
-
- @Override
- public String getDisplayName() {
- return this.widDisplayName;
- }
-
- @Override
- public String getIcon() {
- return this.widIcon;
- }
-
- @Override
- public LinkedHashMap<String, String> getParameters() {
- if (this.widParameters == null)
- this.widParameters = new LinkedHashMap<String, String>();
- return this.widParameters;
- }
-
- @Override
- public void setName(String name) {
- this.widName = name;
- }
-
- @Override
- public void setDispalyName(String displayName) {
- this.widDisplayName = displayName;
- }
-
- @Override
- public void setIcon(String iconPath) {
- this.widIcon = iconPath;
- }
-
- @Override
- public String getCustomEditor() {
- return this.widCustomEditor;
- }
-
- @Override
- public void setCustomEditor(String editor) {
- this.widCustomEditor = editor;
- }
-
- @Override
- public String getEclipseCustomEditor() {
- return this.widEclipseCustomEditor;
- }
-
- @Override
- public void setEclipseCustomEditor(String editor) {
- this.widEclipseCustomEditor = editor;
- }
-
- @Override
- public LinkedHashMap<String, String> getResults() {
- if (this.widResults == null)
- this.widResults = new LinkedHashMap<String, String>();
- return this.widResults;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid;
+
+import java.util.LinkedHashMap;
+
+/**
+ * @author bfitzpat
+ *
+ */
+public class WorkItemDefinitionImpl implements WorkItemDefinition {
+
+ @Override
+ public String toString() {
+ return "WorkItemDefinitionImpl [widName=" + widName //$NON-NLS-1$
+ + ", widDisplayName=" + widDisplayName //$NON-NLS-1$
+ + ", widIcon=" + widIcon //$NON-NLS-1$
+ + ", widCustomEditor=" + widCustomEditor //$NON-NLS-1$
+ + ", widEclipseCustomEditor=" + widEclipseCustomEditor //$NON-NLS-1$
+ + ", widParameters=" + widParameters //$NON-NLS-1$
+ + ", widResults=" + widResults //$NON-NLS-1$
+ + "]"; //$NON-NLS-1$
+ }
+
+ private String widName;
+ private String widDisplayName;
+ private String widIcon;
+ private String widCustomEditor;
+ private String widEclipseCustomEditor;
+ private LinkedHashMap<String, String> widParameters;
+ private LinkedHashMap<String, String> widResults;
+
+ @Override
+ public String getName() {
+ return this.widName;
+ }
+
+ @Override
+ public String getDisplayName() {
+ return this.widDisplayName;
+ }
+
+ @Override
+ public String getIcon() {
+ return this.widIcon;
+ }
+
+ @Override
+ public LinkedHashMap<String, String> getParameters() {
+ if (this.widParameters == null)
+ this.widParameters = new LinkedHashMap<String, String>();
+ return this.widParameters;
+ }
+
+ @Override
+ public void setName(String name) {
+ this.widName = name;
+ }
+
+ @Override
+ public void setDispalyName(String displayName) {
+ this.widDisplayName = displayName;
+ }
+
+ @Override
+ public void setIcon(String iconPath) {
+ this.widIcon = iconPath;
+ }
+
+ @Override
+ public String getCustomEditor() {
+ return this.widCustomEditor;
+ }
+
+ @Override
+ public void setCustomEditor(String editor) {
+ this.widCustomEditor = editor;
+ }
+
+ @Override
+ public String getEclipseCustomEditor() {
+ return this.widEclipseCustomEditor;
+ }
+
+ @Override
+ public void setEclipseCustomEditor(String editor) {
+ this.widEclipseCustomEditor = editor;
+ }
+
+ @Override
+ public LinkedHashMap<String, String> getResults() {
+ if (this.widResults == null)
+ this.widResults = new LinkedHashMap<String, String>();
+ return this.widResults;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/.classpath b/org.eclipse.bpmn2.modeler.ui/.classpath
index 8a8f166..ad32c83 100644
--- a/org.eclipse.bpmn2.modeler.ui/.classpath
+++ b/org.eclipse.bpmn2.modeler.ui/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.bpmn2.modeler.ui/.project b/org.eclipse.bpmn2.modeler.ui/.project
index 3a74e21..244bb62 100644
--- a/org.eclipse.bpmn2.modeler.ui/.project
+++ b/org.eclipse.bpmn2.modeler.ui/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.ui</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>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.ui</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/org.eclipse.bpmn2.modeler.ui/about.html b/org.eclipse.bpmn2.modeler.ui/about.html
index dd1a159..3408ea2 100644
--- a/org.eclipse.bpmn2.modeler.ui/about.html
+++ b/org.eclipse.bpmn2.modeler.ui/about.html
@@ -1,26 +1,26 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/build.properties b/org.eclipse.bpmn2.modeler.ui/build.properties
index 3fac0f6..125f872 100644
--- a/org.eclipse.bpmn2.modeler.ui/build.properties
+++ b/org.eclipse.bpmn2.modeler.ui/build.properties
@@ -1,9 +1,9 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/,\
- about.html,\
- plugin.properties
-src.includes = icons/bpmn2_editor_16.png
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ about.html,\
+ plugin.properties
+src.includes = icons/bpmn2_editor_16.png
diff --git a/org.eclipse.bpmn2.modeler.ui/icons/16/blackbox.png b/org.eclipse.bpmn2.modeler.ui/icons/16/blackbox.png
new file mode 100644
index 0000000..da26a8e
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/icons/16/blackbox.png
Binary files differ
diff --git a/org.eclipse.bpmn2.modeler.ui/icons/16/whitebox.png b/org.eclipse.bpmn2.modeler.ui/icons/16/whitebox.png
new file mode 100644
index 0000000..d299fdd
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/icons/16/whitebox.png
Binary files differ
diff --git a/org.eclipse.bpmn2.modeler.ui/patch.txt b/org.eclipse.bpmn2.modeler.ui/patch.txt
index e93f8b2..e4f97e4 100644
--- a/org.eclipse.bpmn2.modeler.ui/patch.txt
+++ b/org.eclipse.bpmn2.modeler.ui/patch.txt
@@ -1,108 +1,108 @@
-diff --git a/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF b/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF
-index 4886c8e..42b0be6 100644
---- a/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF
-+++ b/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF
-@@ -53,6 +53,7 @@
- org.eclipse.bpmn2.modeler.ui.features.participant,
- org.eclipse.bpmn2.modeler.ui.preferences,
- org.eclipse.bpmn2.modeler.ui.property,
-+ org.eclipse.bpmn2.modeler.ui.property.artifact,
- org.eclipse.bpmn2.modeler.ui.property.connectors,
- org.eclipse.bpmn2.modeler.ui.property.diagrams,
- org.eclipse.bpmn2.modeler.ui.property.dialogs,
-diff --git a/org.eclipse.bpmn2.modeler.ui/plugin.xml b/org.eclipse.bpmn2.modeler.ui/plugin.xml
-index 686cbc5..5010a76 100644
---- a/org.eclipse.bpmn2.modeler.ui/plugin.xml
-+++ b/org.eclipse.bpmn2.modeler.ui/plugin.xml
-@@ -276,6 +276,13 @@
- replaceTab="org.eclipse.bpmn2.modeler.main.tab"
- label="Task">
- </propertyTab>
-+ <propertyTab
-+ afterTab="org.eclipse.bpmn2.modeler.task.tab"
-+ class="org.eclipse.bpmn2.modeler.ui.property.artifact.TextAnnotationPropertySection"
-+ id="org.eclipse.bpmn2.modeler.textAnnotation.tab"
-+ label="Text Anotation"
-+ type="org.eclipse.bpmn2.TextAnnotation">
-+ </propertyTab>
-
- <propertyTab
- id="org.eclipse.bpmn2.modeler.scriptTask.tab"
-diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertiesComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertiesComposite.java
-new file mode 100644
-index 0000000..d010cea
---- /dev/null
-+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertiesComposite.java
-@@ -0,0 +1,33 @@
-+package org.eclipse.bpmn2.modeler.ui.property.artifact;
-+
-+import org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection;
-+import org.eclipse.bpmn2.modeler.ui.property.DefaultPropertiesComposite;
-+import org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor;
-+import org.eclipse.bpmn2.modeler.ui.property.editors.TextObjectEditor;
-+import org.eclipse.emf.ecore.EObject;
-+import org.eclipse.swt.SWT;
-+import org.eclipse.swt.widgets.Composite;
-+/**
-+ *
-+ * @author hien quoc dang
-+ *
-+ */
-+public class TextAnnotationPropertiesComposite extends
-+ DefaultPropertiesComposite {
-+ public TextAnnotationPropertiesComposite(Composite parent, int style) {
-+ super(parent, style);
-+ }
-+
-+ public TextAnnotationPropertiesComposite(AbstractBpmn2PropertySection section) {
-+ super(section);
-+ }
-+
-+ @Override
-+ public void createBindings(EObject be) {
-+ //bindAttribute(be,"text");
-+ ObjectEditor editor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("text"));
-+ editor.createControl(getAttributesParent(),"Text",SWT.MULTI);
-+ //ObjectEditor editor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("text"));
-+ //editor.createControl(getAttributesParent(),"Text",SWT.);
-+ }
-+}
-diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
-new file mode 100644
-index 0000000..93e9d88
---- /dev/null
-+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
-@@ -0,0 +1,33 @@
-+package org.eclipse.bpmn2.modeler.ui.property.artifact;
-+
-+import org.eclipse.bpmn2.TextAnnotation;
-+import org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertiesComposite;
-+import org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection;
-+import org.eclipse.bpmn2.modeler.ui.property.PropertiesCompositeFactory;
-+import org.eclipse.emf.ecore.EObject;
-+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-+import org.eclipse.graphiti.services.Graphiti;
-+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-+/**
-+ *
-+ * @author hien quoc dang
-+ *
-+ */
-+public class TextAnnotationPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants{
-+ static {
-+ PropertiesCompositeFactory.register(TextAnnotation.class, TextAnnotationPropertiesComposite.class);
-+ }
-+
-+ @Override
-+ protected AbstractBpmn2PropertiesComposite createSectionRoot() {
-+ return new TextAnnotationPropertiesComposite(this);
-+ }
-+
-+ @Override
-+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
-+ EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
-+ if (be instanceof TextAnnotation)
-+ return be;
-+ return null;
-+ }
-+}
+diff --git a/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF b/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF
+index 4886c8e..42b0be6 100644
+--- a/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF
++++ b/org.eclipse.bpmn2.modeler.ui/META-INF/MANIFEST.MF
+@@ -53,6 +53,7 @@
+ org.eclipse.bpmn2.modeler.ui.features.participant,
+ org.eclipse.bpmn2.modeler.ui.preferences,
+ org.eclipse.bpmn2.modeler.ui.property,
++ org.eclipse.bpmn2.modeler.ui.property.artifact,
+ org.eclipse.bpmn2.modeler.ui.property.connectors,
+ org.eclipse.bpmn2.modeler.ui.property.diagrams,
+ org.eclipse.bpmn2.modeler.ui.property.dialogs,
+diff --git a/org.eclipse.bpmn2.modeler.ui/plugin.xml b/org.eclipse.bpmn2.modeler.ui/plugin.xml
+index 686cbc5..5010a76 100644
+--- a/org.eclipse.bpmn2.modeler.ui/plugin.xml
++++ b/org.eclipse.bpmn2.modeler.ui/plugin.xml
+@@ -276,6 +276,13 @@
+ replaceTab="org.eclipse.bpmn2.modeler.main.tab"
+ label="Task">
+ </propertyTab>
++ <propertyTab
++ afterTab="org.eclipse.bpmn2.modeler.task.tab"
++ class="org.eclipse.bpmn2.modeler.ui.property.artifact.TextAnnotationPropertySection"
++ id="org.eclipse.bpmn2.modeler.textAnnotation.tab"
++ label="Text Anotation"
++ type="org.eclipse.bpmn2.TextAnnotation">
++ </propertyTab>
+
+ <propertyTab
+ id="org.eclipse.bpmn2.modeler.scriptTask.tab"
+diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertiesComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertiesComposite.java
+new file mode 100644
+index 0000000..d010cea
+--- /dev/null
++++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertiesComposite.java
+@@ -0,0 +1,33 @@
++package org.eclipse.bpmn2.modeler.ui.property.artifact;
++
++import org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection;
++import org.eclipse.bpmn2.modeler.ui.property.DefaultPropertiesComposite;
++import org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor;
++import org.eclipse.bpmn2.modeler.ui.property.editors.TextObjectEditor;
++import org.eclipse.emf.ecore.EObject;
++import org.eclipse.swt.SWT;
++import org.eclipse.swt.widgets.Composite;
++/**
++ *
++ * @author hien quoc dang
++ *
++ */
++public class TextAnnotationPropertiesComposite extends
++ DefaultPropertiesComposite {
++ public TextAnnotationPropertiesComposite(Composite parent, int style) {
++ super(parent, style);
++ }
++
++ public TextAnnotationPropertiesComposite(AbstractBpmn2PropertySection section) {
++ super(section);
++ }
++
++ @Override
++ public void createBindings(EObject be) {
++ //bindAttribute(be,"text");
++ ObjectEditor editor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("text"));
++ editor.createControl(getAttributesParent(),"Text",SWT.MULTI);
++ //ObjectEditor editor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("text"));
++ //editor.createControl(getAttributesParent(),"Text",SWT.);
++ }
++}
+diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
+new file mode 100644
+index 0000000..93e9d88
+--- /dev/null
++++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
+@@ -0,0 +1,33 @@
++package org.eclipse.bpmn2.modeler.ui.property.artifact;
++
++import org.eclipse.bpmn2.TextAnnotation;
++import org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertiesComposite;
++import org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection;
++import org.eclipse.bpmn2.modeler.ui.property.PropertiesCompositeFactory;
++import org.eclipse.emf.ecore.EObject;
++import org.eclipse.graphiti.mm.pictograms.PictogramElement;
++import org.eclipse.graphiti.services.Graphiti;
++import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
++/**
++ *
++ * @author hien quoc dang
++ *
++ */
++public class TextAnnotationPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants{
++ static {
++ PropertiesCompositeFactory.register(TextAnnotation.class, TextAnnotationPropertiesComposite.class);
++ }
++
++ @Override
++ protected AbstractBpmn2PropertiesComposite createSectionRoot() {
++ return new TextAnnotationPropertiesComposite(this);
++ }
++
++ @Override
++ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
++ EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
++ if (be instanceof TextAnnotation)
++ return be;
++ return null;
++ }
++}
diff --git a/org.eclipse.bpmn2.modeler.ui/plugin.properties b/org.eclipse.bpmn2.modeler.ui/plugin.properties
index 50f50b2..26a0029 100644
--- a/org.eclipse.bpmn2.modeler.ui/plugin.properties
+++ b/org.eclipse.bpmn2.modeler.ui/plugin.properties
@@ -1,6 +1,6 @@
-# Preference Page titles
-PREFERENCE_PAGE_WSIL=WSIL Browser
-PREFERENCE_PAGE_EDITOR=Editor
-PREFERENCE_PAGE_HOME=BPMN2
-
-PROPERTY_PAGE_TOOL_ENABLEMENT=Tool Enablement
+# Preference Page titles
+PREFERENCE_PAGE_WSIL=WSIL Browser
+PREFERENCE_PAGE_EDITOR=Editor
+PREFERENCE_PAGE_HOME=BPMN2
+
+PROPERTY_PAGE_TOOL_ENABLEMENT=Tool Enablement
diff --git a/org.eclipse.bpmn2.modeler.ui/pom.xml b/org.eclipse.bpmn2.modeler.ui/pom.xml
index c76f25e..4a69752 100644
--- a/org.eclipse.bpmn2.modeler.ui/pom.xml
+++ b/org.eclipse.bpmn2.modeler.ui/pom.xml
@@ -1,16 +1,16 @@
-<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>
- <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <artifactId>org.eclipse.bpmn2.modeler.ui</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
- <name>BPMN2 Modeler UI</name>
- <description>Main UI for BPMN2 Modeler</description>
+<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>
+ <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <artifactId>org.eclipse.bpmn2.modeler.ui</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>BPMN2 Modeler UI</name>
+ <description>Main UI for BPMN2 Modeler</description>
</project>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/BPMN2ContentDescriber.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/BPMN2ContentDescriber.java
index b7a7c2a..2b43586 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/BPMN2ContentDescriber.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/BPMN2ContentDescriber.java
@@ -1,129 +1,129 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-import org.apache.xerces.parsers.SAXParser;
-import org.apache.xerces.xni.Augmentations;
-import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLAttributes;
-import org.apache.xerces.xni.XNIException;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.xml.sax.InputSource;
-
-public class BPMN2ContentDescriber implements ITextContentDescriber {
-
- private static final String BPMN2_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL"; //$NON-NLS-1$
- private static final String ROOT_ELEMENT = "definitions"; //$NON-NLS-1$
-
- private RootElementParser parser;
-
- public BPMN2ContentDescriber() {
- }
-
- @Override
- public int describe(Reader contents, IContentDescription description) throws IOException {
- return doDescribe(contents) == null ? INVALID : VALID;
- }
-
- @Override
- public int describe(InputStream contents, IContentDescription description) throws IOException {
- return describe(new InputStreamReader(contents), description);
- }
-
- private synchronized String doDescribe(Reader contents) throws IOException {
- try {
- InputSource source = new InputSource(contents);
- parser = new RootElementParser();
- parser.parse(source);
- } catch (AcceptedException e) {
- return e.acceptedRootElement;
- } catch (RejectedException e) {
- return null;
- } catch (Exception e) {
- return null;
- } finally {
- parser = null;
- }
-
- return null;
- }
-
- @Override
- public QualifiedName[] getSupportedOptions() {
- return null;
- }
-
- private class RootElementParser extends SAXParser {
- @Override
- public void startElement(QName qName, XMLAttributes attributes, Augmentations augmentations)
- throws XNIException {
-
- super.startElement(qName, attributes, augmentations);
-
- if (ROOT_ELEMENT.equals(qName.localpart)) {
- String namespace = fNamespaceContext.getURI(qName.prefix);
- if (BPMN2_NAMESPACE.equals(namespace)) {
- throw new AcceptedException(qName.localpart);
- } else {
- throw new RejectedException();
- }
- } else {
- throw new RejectedException();
- }
- }
- }
-
- private class AcceptedException extends RuntimeException {
- public String acceptedRootElement;
-
- public AcceptedException(String acceptedRootElement) {
- this.acceptedRootElement = acceptedRootElement;
- }
-
- private static final long serialVersionUID = 1L;
- }
-
- private class RejectedException extends RuntimeException {
- private static final long serialVersionUID = 1L;
- }
-
- public static boolean isBPMN2File(IResource res)
- {
- try
- {
- if (res.getType() == IResource.FILE) {
- IContentDescription desc = ((IFile) res).getContentDescription();
- if (desc != null) {
- IContentType type = desc.getContentType();
- if (type.getId().equals(Bpmn2ModelerResourceImpl.BPMN2_CONTENT_TYPE_ID))
- return true;
- }
- }
- }
- catch(Exception ex)
- {
- }
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import org.apache.xerces.parsers.SAXParser;
+import org.apache.xerces.xni.Augmentations;
+import org.apache.xerces.xni.QName;
+import org.apache.xerces.xni.XMLAttributes;
+import org.apache.xerces.xni.XNIException;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.ITextContentDescriber;
+import org.xml.sax.InputSource;
+
+public class BPMN2ContentDescriber implements ITextContentDescriber {
+
+ private static final String BPMN2_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL"; //$NON-NLS-1$
+ private static final String ROOT_ELEMENT = "definitions"; //$NON-NLS-1$
+
+ private RootElementParser parser;
+
+ public BPMN2ContentDescriber() {
+ }
+
+ @Override
+ public int describe(Reader contents, IContentDescription description) throws IOException {
+ return doDescribe(contents) == null ? INVALID : VALID;
+ }
+
+ @Override
+ public int describe(InputStream contents, IContentDescription description) throws IOException {
+ return describe(new InputStreamReader(contents), description);
+ }
+
+ private synchronized String doDescribe(Reader contents) throws IOException {
+ try {
+ InputSource source = new InputSource(contents);
+ parser = new RootElementParser();
+ parser.parse(source);
+ } catch (AcceptedException e) {
+ return e.acceptedRootElement;
+ } catch (RejectedException e) {
+ return null;
+ } catch (Exception e) {
+ return null;
+ } finally {
+ parser = null;
+ }
+
+ return null;
+ }
+
+ @Override
+ public QualifiedName[] getSupportedOptions() {
+ return null;
+ }
+
+ private class RootElementParser extends SAXParser {
+ @Override
+ public void startElement(QName qName, XMLAttributes attributes, Augmentations augmentations)
+ throws XNIException {
+
+ super.startElement(qName, attributes, augmentations);
+
+ if (ROOT_ELEMENT.equals(qName.localpart)) {
+ String namespace = fNamespaceContext.getURI(qName.prefix);
+ if (BPMN2_NAMESPACE.equals(namespace)) {
+ throw new AcceptedException(qName.localpart);
+ } else {
+ throw new RejectedException();
+ }
+ } else {
+ throw new RejectedException();
+ }
+ }
+ }
+
+ private class AcceptedException extends RuntimeException {
+ public String acceptedRootElement;
+
+ public AcceptedException(String acceptedRootElement) {
+ this.acceptedRootElement = acceptedRootElement;
+ }
+
+ private static final long serialVersionUID = 1L;
+ }
+
+ private class RejectedException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+ }
+
+ public static boolean isBPMN2File(IResource res)
+ {
+ try
+ {
+ if (res.getType() == IResource.FILE) {
+ IContentDescription desc = ((IFile) res).getContentDescription();
+ if (desc != null) {
+ IContentType type = desc.getContentType();
+ if (type.getId().equals(Bpmn2ModelerResourceImpl.BPMN2_CONTENT_TYPE_ID))
+ return true;
+ }
+ }
+ }
+ catch(Exception ex)
+ {
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/DefaultBpmn2RuntimeExtension.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/DefaultBpmn2RuntimeExtension.java
index 804b0fe..b6d721c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/DefaultBpmn2RuntimeExtension.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/DefaultBpmn2RuntimeExtension.java
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui;
-import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class DefaultBpmn2RuntimeExtension implements IBpmn2RuntimeExtension {
-
- public DefaultBpmn2RuntimeExtension() {
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public boolean isContentForRuntime(IFile file) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public String getTargetNamespace(Bpmn2DiagramType diagramType){
- String type = "";
- switch (diagramType) {
- case PROCESS:
- type = "/process";
- break;
- case COLLABORATION:
- type = "/collaboration";
- break;
- case CHOREOGRAPHY:
- type = "/choreography";
- break;
- }
- return "http://sample.bpmn2.org/bpmn2/sample" + type;
- }
-
- @Override
- public void initialize() {
- // TODO Auto-generated method stub
- }
-
- @Override
- public Composite getPreferencesComposite(Composite parent, Bpmn2Preferences preferences) {
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui;
+import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.widgets.Composite;
+
+
+public class DefaultBpmn2RuntimeExtension implements IBpmn2RuntimeExtension {
+
+ public DefaultBpmn2RuntimeExtension() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public boolean isContentForRuntime(IFile file) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public String getTargetNamespace(Bpmn2DiagramType diagramType){
+ String type = "";
+ switch (diagramType) {
+ case PROCESS:
+ type = "/process";
+ break;
+ case COLLABORATION:
+ type = "/collaboration";
+ break;
+ case CHOREOGRAPHY:
+ type = "/choreography";
+ break;
+ }
+ return "http://sample.bpmn2.org/bpmn2/sample" + type;
+ }
+
+ @Override
+ public void initialize() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public Composite getPreferencesComposite(Composite parent, Bpmn2Preferences preferences) {
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/FeatureMap.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/FeatureMap.java
index 3a9359f..39e2d61 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/FeatureMap.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/FeatureMap.java
@@ -1,152 +1,152 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.bpmn2.AdHocSubProcess;
-import org.eclipse.bpmn2.Association;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.BusinessRuleTask;
-import org.eclipse.bpmn2.CallActivity;
-import org.eclipse.bpmn2.CallChoreography;
-import org.eclipse.bpmn2.CancelEventDefinition;
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.CompensateEventDefinition;
-import org.eclipse.bpmn2.ComplexGateway;
-import org.eclipse.bpmn2.ConditionalEventDefinition;
-import org.eclipse.bpmn2.Conversation;
-import org.eclipse.bpmn2.DataAssociation;
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataObject;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.DataStoreReference;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.ErrorEventDefinition;
-import org.eclipse.bpmn2.EscalationEventDefinition;
-import org.eclipse.bpmn2.EventBasedGateway;
-import org.eclipse.bpmn2.ExclusiveGateway;
-import org.eclipse.bpmn2.Group;
-import org.eclipse.bpmn2.InclusiveGateway;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LinkEventDefinition;
-import org.eclipse.bpmn2.ManualTask;
-import org.eclipse.bpmn2.Message;
-import org.eclipse.bpmn2.MessageEventDefinition;
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.ParallelGateway;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.ReceiveTask;
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.SendTask;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.ServiceTask;
-import org.eclipse.bpmn2.SignalEventDefinition;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.SubChoreography;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.TerminateEventDefinition;
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.bpmn2.TimerEventDefinition;
-import org.eclipse.bpmn2.Transaction;
-import org.eclipse.bpmn2.UserTask;
-
-public class FeatureMap {
- public static final List<Class> CONNECTORS;
- public static final List<Class> EVENT_DEFINITIONS;
- public static final List<Class> EVENTS;
- public static final List<Class> GATEWAYS;
- public static final List<Class> TASKS;
- public static final List<Class> DATA;
- public static final List<Class> OTHER;
- static {
- ArrayList<Class> features = new ArrayList<Class>();
- features.add(SequenceFlow.class);
- features.add(MessageFlow.class);
- features.add(Association.class);
- features.add(DataAssociation.class);
- CONNECTORS = Collections.unmodifiableList(features);
-
- features = new ArrayList<Class>();
- features.add(ConditionalEventDefinition.class);
- features.add(TimerEventDefinition.class);
- features.add(SignalEventDefinition.class);
- features.add(MessageEventDefinition.class);
- features.add(EscalationEventDefinition.class);
- features.add(CompensateEventDefinition.class);
- features.add(LinkEventDefinition.class);
- features.add(ErrorEventDefinition.class);
- features.add(CancelEventDefinition.class);
- features.add(TerminateEventDefinition.class);
- EVENT_DEFINITIONS = Collections.unmodifiableList(features);
-
- features = new ArrayList<Class>();
- features.add(StartEvent.class);
- features.add(EndEvent.class);
- features.add(IntermediateThrowEvent.class);
- features.add(IntermediateCatchEvent.class);
- features.add(BoundaryEvent.class);
- EVENTS = Collections.unmodifiableList(features);
-
- features = new ArrayList<Class>();
- features.add(InclusiveGateway.class);
- features.add(ExclusiveGateway.class);
- features.add(ParallelGateway.class);
- features.add(EventBasedGateway.class);
- features.add(ComplexGateway.class);
-
- GATEWAYS = Collections.unmodifiableList(features);
-
- features = new ArrayList<Class>();
- features.add(Task.class);
- features.add(ManualTask.class);
- features.add(UserTask.class);
- features.add(ScriptTask.class);
- features.add(BusinessRuleTask.class);
- features.add(ServiceTask.class);
- features.add(SendTask.class);
- features.add(ReceiveTask.class);
- features.add(ChoreographyTask.class);
- TASKS = Collections.unmodifiableList(features);
-
- features = new ArrayList<Class>();
- features.add(DataObject.class);
-// features.add(DataObjectReference.class);
- features.add(DataStoreReference.class);
- features.add(DataInput.class);
- features.add(DataOutput.class);
- DATA = Collections.unmodifiableList(features);
-
- features = new ArrayList<Class>();
- features.add(Lane.class);
- features.add(Participant.class);
- features.add(TextAnnotation.class);
- features.add(SubProcess.class);
- features.add(Transaction.class);
- features.add(Group.class);
- features.add(AdHocSubProcess.class);
- features.add(CallActivity.class);
- features.add(Message.class);
- features.add(Conversation.class);
- features.add(SubChoreography.class);
- features.add(CallChoreography.class);
- OTHER = Collections.unmodifiableList(features);
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.bpmn2.AdHocSubProcess;
+import org.eclipse.bpmn2.Association;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.BusinessRuleTask;
+import org.eclipse.bpmn2.CallActivity;
+import org.eclipse.bpmn2.CallChoreography;
+import org.eclipse.bpmn2.CancelEventDefinition;
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.CompensateEventDefinition;
+import org.eclipse.bpmn2.ComplexGateway;
+import org.eclipse.bpmn2.ConditionalEventDefinition;
+import org.eclipse.bpmn2.Conversation;
+import org.eclipse.bpmn2.DataAssociation;
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataObject;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.DataStoreReference;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.ErrorEventDefinition;
+import org.eclipse.bpmn2.EscalationEventDefinition;
+import org.eclipse.bpmn2.EventBasedGateway;
+import org.eclipse.bpmn2.ExclusiveGateway;
+import org.eclipse.bpmn2.Group;
+import org.eclipse.bpmn2.InclusiveGateway;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LinkEventDefinition;
+import org.eclipse.bpmn2.ManualTask;
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.MessageEventDefinition;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.ParallelGateway;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.ReceiveTask;
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.SendTask;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.ServiceTask;
+import org.eclipse.bpmn2.SignalEventDefinition;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.SubChoreography;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.TerminateEventDefinition;
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.bpmn2.TimerEventDefinition;
+import org.eclipse.bpmn2.Transaction;
+import org.eclipse.bpmn2.UserTask;
+
+public class FeatureMap {
+ public static final List<Class> CONNECTORS;
+ public static final List<Class> EVENT_DEFINITIONS;
+ public static final List<Class> EVENTS;
+ public static final List<Class> GATEWAYS;
+ public static final List<Class> TASKS;
+ public static final List<Class> DATA;
+ public static final List<Class> OTHER;
+ static {
+ ArrayList<Class> features = new ArrayList<Class>();
+ features.add(SequenceFlow.class);
+ features.add(MessageFlow.class);
+ features.add(Association.class);
+ features.add(DataAssociation.class);
+ CONNECTORS = Collections.unmodifiableList(features);
+
+ features = new ArrayList<Class>();
+ features.add(ConditionalEventDefinition.class);
+ features.add(TimerEventDefinition.class);
+ features.add(SignalEventDefinition.class);
+ features.add(MessageEventDefinition.class);
+ features.add(EscalationEventDefinition.class);
+ features.add(CompensateEventDefinition.class);
+ features.add(LinkEventDefinition.class);
+ features.add(ErrorEventDefinition.class);
+ features.add(CancelEventDefinition.class);
+ features.add(TerminateEventDefinition.class);
+ EVENT_DEFINITIONS = Collections.unmodifiableList(features);
+
+ features = new ArrayList<Class>();
+ features.add(StartEvent.class);
+ features.add(EndEvent.class);
+ features.add(IntermediateThrowEvent.class);
+ features.add(IntermediateCatchEvent.class);
+ features.add(BoundaryEvent.class);
+ EVENTS = Collections.unmodifiableList(features);
+
+ features = new ArrayList<Class>();
+ features.add(InclusiveGateway.class);
+ features.add(ExclusiveGateway.class);
+ features.add(ParallelGateway.class);
+ features.add(EventBasedGateway.class);
+ features.add(ComplexGateway.class);
+
+ GATEWAYS = Collections.unmodifiableList(features);
+
+ features = new ArrayList<Class>();
+ features.add(Task.class);
+ features.add(ManualTask.class);
+ features.add(UserTask.class);
+ features.add(ScriptTask.class);
+ features.add(BusinessRuleTask.class);
+ features.add(ServiceTask.class);
+ features.add(SendTask.class);
+ features.add(ReceiveTask.class);
+ features.add(ChoreographyTask.class);
+ TASKS = Collections.unmodifiableList(features);
+
+ features = new ArrayList<Class>();
+ features.add(DataObject.class);
+// features.add(DataObjectReference.class);
+ features.add(DataStoreReference.class);
+ features.add(DataInput.class);
+ features.add(DataOutput.class);
+ DATA = Collections.unmodifiableList(features);
+
+ features = new ArrayList<Class>();
+ features.add(Lane.class);
+ features.add(Participant.class);
+ features.add(TextAnnotation.class);
+ features.add(SubProcess.class);
+ features.add(Transaction.class);
+ features.add(Group.class);
+ features.add(AdHocSubProcess.class);
+ features.add(CallActivity.class);
+ features.add(Message.class);
+ features.add(Conversation.class);
+ features.add(SubChoreography.class);
+ features.add(CallChoreography.class);
+ OTHER = Collections.unmodifiableList(features);
+
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IConstants.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IConstants.java
index 690e13d..b8161a6 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IConstants.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IConstants.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui;
-
-/**
- * @author Bob Brodt
- *
- */
-public interface IConstants {
-
- public final String ICON_PATH = "icons/";
-
- public final String ICON_MESSAGE_16 = "obj16/message.gif"; //$NON-NLS-1$
- public final String ICON_MESSAGE_32 = "obj20/message.png"; //$NON-NLS-1$
- public final String ICON_OPERATION_16 = "obj16/operation.gif"; //$NON-NLS-1$
- public final String ICON_PART_16 = "obj16/message_part.gif"; //$NON-NLS-1$
- public final String ICON_PART_32 = "obj20/message_part.png"; //$NON-NLS-1$
- public final String ICON_PORTTYPE_16 = "obj16/wsdl_port_type.gif"; //$NON-NLS-1$
- public final String ICON_PORTTYPE_32 = "obj20/wsdl_port_type.png"; //$NON-NLS-1$
- public final String ICON_INPUT_16 = "obj16/input.gif"; //$NON-NLS-1$
- public final String ICON_INPUT_32 = "obj20/input.png"; //$NON-NLS-1$
- public final String ICON_OUTPUT_16 = "obj16/output.gif"; //$NON-NLS-1$
- public final String ICON_OUTPUT_32 = "obj20/output.png"; //$NON-NLS-1$
- public final String ICON_THROW_16 = "obj16/throw.gif"; //$NON-NLS-1$
- public final String ICON_THROW_32 = "obj20/throw.png"; //$NON-NLS-1$
-
- public final String ICON_WSIL = "obj16/wsil.gif"; //$NON-NLS-1$
- public final String ICON_WSIL_SERVICE = "obj16/service.gif"; //$NON-NLS-1$
- public final String ICON_WSIL_LINK = "obj16/wsil_link.gif"; //$NON-NLS-1$
-
- public final String ICON_XSD_ATTRIBUTE_DECLARATION_16 = "obj16/XSDAttributeDeclaration.gif"; //$NON-NLS-1$
- public final String ICON_XSD_ELEMENT_DECLARATION_16 = "obj16/XSDElementDeclaration.gif"; //$NON-NLS-1$
- public final String ICON_XSD_COMPLEX_TYPE_DEFINITION_16 = "obj16/XSDComplexTypeDefinition.gif"; //$NON-NLS-1$
- public final String ICON_XSD_SIMPLE_TYPE_DEFINITION_16 = "obj16/XSDSimpleTypeDefinition.gif"; //$NON-NLS-1$
-
- public final String IMAGE_PROCESS = "wizards/process.gif";
- public final String IMAGE_COLLABORATION = "wizards/collaboration.gif";
- public final String IMAGE_CHOREOGRAPHY = "wizards/choreography.gif";
- public final String IMAGE_PROCESS_PUSHED = "wizards/process-pushed.gif";
- public final String IMAGE_COLLABORATION_PUSHED = "wizards/collaboration-pushed.gif";
- public final String IMAGE_CHOREOGRAPHY_PUSHED = "wizards/choreography-pushed.gif";
-
- public final String ICON_BPMN2_PROCESS_16 = "obj16/bpmn2process.png"; //$NON-NLS-1$
- public final String ICON_BPMN2_INTERFACE_16 = "obj16/bpmn2interface.png"; //$NON-NLS-1$
- public final String ICON_BPMN2_OPERATION_16 = "obj16/bpmn2operation.png"; //$NON-NLS-1$
- public final String ICON_BPMN2_INPUT_16 = "obj16/bpmn2input.png"; //$NON-NLS-1$
- public final String ICON_BPMN2_OUTPUT_16 = "obj16/bpmn2output.png"; //$NON-NLS-1$
- public final String ICON_BPMN2_ERROR_16 = "obj16/bpmn2error.png"; //$NON-NLS-1$
-
- public final String ICON_JAVA_CLASS_16 = "obj16/javaClass.png"; //$NON-NLS-1$
- public final String ICON_JAVA_INTERFACE_16 = "obj16/javaInterface.png"; //$NON-NLS-1$
- public final String ICON_JAVA_PUBLIC_METHOD_16 = "obj16/javaPublicMethod.png"; //$NON-NLS-1$
- public final String ICON_JAVA_PUBLIC_FIELD_16 = "obj16/javaPublicField.png"; //$NON-NLS-1$
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public interface IConstants {
+
+ public final String ICON_PATH = "icons/";
+
+ public final String ICON_MESSAGE_16 = "obj16/message.gif"; //$NON-NLS-1$
+ public final String ICON_MESSAGE_32 = "obj20/message.png"; //$NON-NLS-1$
+ public final String ICON_OPERATION_16 = "obj16/operation.gif"; //$NON-NLS-1$
+ public final String ICON_PART_16 = "obj16/message_part.gif"; //$NON-NLS-1$
+ public final String ICON_PART_32 = "obj20/message_part.png"; //$NON-NLS-1$
+ public final String ICON_PORTTYPE_16 = "obj16/wsdl_port_type.gif"; //$NON-NLS-1$
+ public final String ICON_PORTTYPE_32 = "obj20/wsdl_port_type.png"; //$NON-NLS-1$
+ public final String ICON_INPUT_16 = "obj16/input.gif"; //$NON-NLS-1$
+ public final String ICON_INPUT_32 = "obj20/input.png"; //$NON-NLS-1$
+ public final String ICON_OUTPUT_16 = "obj16/output.gif"; //$NON-NLS-1$
+ public final String ICON_OUTPUT_32 = "obj20/output.png"; //$NON-NLS-1$
+ public final String ICON_THROW_16 = "obj16/throw.gif"; //$NON-NLS-1$
+ public final String ICON_THROW_32 = "obj20/throw.png"; //$NON-NLS-1$
+
+ public final String ICON_WSIL = "obj16/wsil.gif"; //$NON-NLS-1$
+ public final String ICON_WSIL_SERVICE = "obj16/service.gif"; //$NON-NLS-1$
+ public final String ICON_WSIL_LINK = "obj16/wsil_link.gif"; //$NON-NLS-1$
+
+ public final String ICON_XSD_ATTRIBUTE_DECLARATION_16 = "obj16/XSDAttributeDeclaration.gif"; //$NON-NLS-1$
+ public final String ICON_XSD_ELEMENT_DECLARATION_16 = "obj16/XSDElementDeclaration.gif"; //$NON-NLS-1$
+ public final String ICON_XSD_COMPLEX_TYPE_DEFINITION_16 = "obj16/XSDComplexTypeDefinition.gif"; //$NON-NLS-1$
+ public final String ICON_XSD_SIMPLE_TYPE_DEFINITION_16 = "obj16/XSDSimpleTypeDefinition.gif"; //$NON-NLS-1$
+
+ public final String IMAGE_PROCESS = "wizards/process.gif";
+ public final String IMAGE_COLLABORATION = "wizards/collaboration.gif";
+ public final String IMAGE_CHOREOGRAPHY = "wizards/choreography.gif";
+ public final String IMAGE_PROCESS_PUSHED = "wizards/process-pushed.gif";
+ public final String IMAGE_COLLABORATION_PUSHED = "wizards/collaboration-pushed.gif";
+ public final String IMAGE_CHOREOGRAPHY_PUSHED = "wizards/choreography-pushed.gif";
+
+ public final String ICON_BPMN2_PROCESS_16 = "obj16/bpmn2process.png"; //$NON-NLS-1$
+ public final String ICON_BPMN2_INTERFACE_16 = "obj16/bpmn2interface.png"; //$NON-NLS-1$
+ public final String ICON_BPMN2_OPERATION_16 = "obj16/bpmn2operation.png"; //$NON-NLS-1$
+ public final String ICON_BPMN2_INPUT_16 = "obj16/bpmn2input.png"; //$NON-NLS-1$
+ public final String ICON_BPMN2_OUTPUT_16 = "obj16/bpmn2output.png"; //$NON-NLS-1$
+ public final String ICON_BPMN2_ERROR_16 = "obj16/bpmn2error.png"; //$NON-NLS-1$
+
+ public final String ICON_JAVA_CLASS_16 = "obj16/javaClass.png"; //$NON-NLS-1$
+ public final String ICON_JAVA_INTERFACE_16 = "obj16/javaInterface.png"; //$NON-NLS-1$
+ public final String ICON_JAVA_PUBLIC_METHOD_16 = "obj16/javaPublicMethod.png"; //$NON-NLS-1$
+ public final String ICON_JAVA_PUBLIC_FIELD_16 = "obj16/javaPublicField.png"; //$NON-NLS-1$
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IFileChangeListener.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IFileChangeListener.java
index ddba68b..52c1855 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IFileChangeListener.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/IFileChangeListener.java
@@ -1,26 +1,26 @@
-package org.eclipse.bpmn2.modeler.ui;
-
-/**
- * @author Bob Brodt
- *
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Similar to IResourceChangeListener but with more specific events.
- */
-public interface IFileChangeListener {
- /**
- * Called after a file is moved or renamed.
- *
- * @param source the previous file
- * @param destination the new file
- */
- void moved(IPath oldFilePath, IPath newFilePath);
-
- /**
- * Called after a file is deleted.
- */
- void deleted(IPath filePath);
+package org.eclipse.bpmn2.modeler.ui;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Similar to IResourceChangeListener but with more specific events.
+ */
+public interface IFileChangeListener {
+ /**
+ * Called after a file is moved or renamed.
+ *
+ * @param source the previous file
+ * @param destination the new file
+ */
+ void moved(IPath oldFilePath, IPath newFilePath);
+
+ /**
+ * Called after a file is deleted.
+ */
+ void deleted(IPath filePath);
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/ImageProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/ImageProvider.java
index fdc3740..6be2187 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/ImageProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/ImageProvider.java
@@ -150,6 +150,8 @@
public static final String IMG_16_ADD_PARTICIPANT = PREFIX + "addparticipant" + dot16;
public static final String IMG_16_ADD_MESSAGE = PREFIX + "addmessage" + dot16;
public static final String IMG_16_ROTATE = PREFIX + "rotate" + dot16;
+ public static final String IMG_16_WHITEBOX = PREFIX + "whitebox" + dot16;
+ public static final String IMG_16_BLACKBOX = PREFIX + "blackbox" + dot16;
public final String IMG_16_PROPERTIES = "org.eclipse.bpmn2.modeler.icons." + "properties" + dot16; //$NON-NLS-1$
@@ -215,6 +217,9 @@
addImageFilePath(IMG_16_ADD_MESSAGE, ICONS_16 + "addmessage.png");
addImageFilePath(IMG_16_ROTATE, ICONS_16 + "rotate.png");
addImageFilePath(IMG_16_PROPERTIES, ICONS_16 + "properties.png");
+
+ addImageFilePath(IMG_16_WHITEBOX, ICONS_16 + "whitebox.png");
+ addImageFilePath(IMG_16_BLACKBOX, ICONS_16 + "blackbox.png");
}
}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/Messages.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/Messages.java
index 979ff3a..7c64066 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/Messages.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/Messages.java
@@ -1,157 +1,157 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @author Bob Brodt
- *
- */
-public class Messages extends NLS {
-
-
- private static String BUNDLE_NAME = "org.eclipse.bpmn2.modeler.ui.messages"; //$NON-NLS-1$
-
- public static String SchemaImportDialog_0;
- public static String SchemaImportDialog_1;
- public static String SchemaImportDialog_2;
- public static String SchemaImportDialog_3;
- public static String SchemaImportDialog_4;
- public static String SchemaImportDialog_5;
- public static String SchemaImportDialog_6;
- public static String SchemaImportDialog_7;
- public static String SchemaImportDialog_15;
- public static String SchemaImportDialog_8;
- public static String SchemaImportDialog_9;
- public static String SchemaImportDialog_10;
- public static String SchemaImportDialog_11;
- public static String SchemaImportDialog_12;
- public static String SchemaImportDialog_17;
- public static String SchemaImportDialog_13;
- public static String SchemaImportDialog_19;
- public static String SchemaImportDialog_18;
- public static String SchemaImportDialog_14;
- public static String SchemaImportDialog_16;
-
- public static String SchemaImportDialog_20;
- public static String SchemaImportDialog_21;
- public static String SchemaImportDialog_22;
- public static String SchemaImportDialog_23;
- public static String SchemaImportDialog_24;
- public static String SchemaImportDialog_25;
- public static String SchemaImportDialog_26;
- public static String SchemaImportDialog_27;
- public static String SchemaImportDialog_28;
- public static String SchemaImportDialog_29;
- public static String SchemaImportDialog_30;
- public static String SchemaImportDialog_31;
-
- public static String XSDSchemaTreeNode_1;
- public static String XSDSchemaTreeNode_0;
-
- public static String ModelTreeLabelProvider_s1_s2;
-
- public static String InputMessageAdapter_0;
- public static String MessageAdapter_Message_1;
- public static String OperationAdapter_Operation_1;
- public static String OperationAdapter_0;
- public static String OutputMessageAdapter_0;
- public static String PartAdapter_Part_1;
- public static String PortTypeAdapter_Port_Type_2;
- public static String FaultAdapter_Fault_1;
- public static String XSDAttributeDeclarationAdapter_XSD_Attribute_1;
- public static String XSDComplexTypeDefinitionAdapter_0;
- public static String XSDElementDeclarationAdapter_XSD_Element_1;
- public static String XSDSchemaAdapter_0;
- public static String XSDSchemaAdapter_1;
- public static String XSDTypeDefinitionAdapter_XSD_Type_1;
- public static String XSDSimpleTypeDefinitionAdapter_0;
-
- public static String Bpmn2PreferencePage_HomePage_Description;
- public static String Bpmn2PreferencePage_EditorPage_Description;
-
- public static String UI_UnknownDiagram_long_description;
- public static String UI_ProcessDiagram_long_description;
- public static String UI_ChoreographyDiagram_long_description;
- public static String UI_CollaborationDiagram_long_description;
-
- public static String UI_SequenceFlow_long_description;
- public static String UI_MessageFlow_long_description;
- public static String UI_Association_long_description;
- public static String UI_Annotation_long_description;
- public static String UI_Task_long_description;
- public static String UI_ManualTask_long_description;
- public static String UI_UserTask_long_description;
- public static String UI_BusinessRuleTask_long_description;
- public static String UI_ServiceTask_long_description;
- public static String UI_SendTask_long_description;
- public static String UI_ReceiveTask_long_description;
- public static String UI_ChoreographyTask_long_description;
- public static String UI_ScriptTask_long_description;
-
- public static String UI_StartEvent_long_description;
- public static String UI_EndEvent_long_description;
- public static String UI_IntermediateThrowEvent_long_description;
- public static String UI_IntermediateCatchEvent_long_description;
- public static String UI_BoundaryEvent_long_description;
- public static String UI_DataStore_long_description;
- public static String UI_DataInput_long_description;
- public static String UI_DataOutput_long_description;
- public static String UI_Message_long_description;
-
- public static String UI_ExclusiveGateway_long_description;
- public static String UI_InclusiveGateway_long_description;
- public static String UI_ParallelGateway_long_description;
- public static String UI_EventBasedGateway_long_description;
- public static String UI_ComplexGateway_long_description;
-
- public static String UI_Participant_long_description;
- public static String UI_Lane_long_description;
- public static String UI_SubProcess_long_description;
- public static String UI_Group_long_description;
- public static String UI_SubChoreography_long_description;
- public static String UI_CallActivity_long_description;
- public static String UI_Conversation_long_description;
- public static String UI_CallConversation_long_description;
- public static String UI_SubConversation_long_description;
- public static String UI_TextAnnotation_long_description;
-
-
-
- public static String WSILPreferencePage_WSIL_1;
- public static String WSILPreferencePage_WSIL_2;
- public static String WSILPreferencePage_WSIL_Description;
- public static String WSILPreferencePage_WSIL_Add;
- public static String WSILPreferencePage_WSIL_EnterLocation;
- public static String WSILPreferencePage_WSIL_EnterDescription;
- public static String WSILPreferencePage_WSIL_Remove;
- public static String WSILPreferencePage_WSIL_MoveUp;
- public static String WSILPreferencePage_WSIL_MoveDown;
- public static String WSILPreferencePage_WSIL_OpenInBrowser;
- public static String WSILPreferencePage_WSIL_NameLimit;
- public static String WSILPreferencePage_WSIL_DocumentNotLoaded;
- public static String WSILPreferencePage_WSIL_Abstract;
- public static String WSILPreferencePage_WSIL_Location;
- public static String WSILPreferencePage_WSIL_Namespace;
- public static String WSILPreferencePage_WSIL_Index;
-
- private Messages() {
- // Do not instantiate
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class Messages extends NLS {
+
+
+ private static String BUNDLE_NAME = "org.eclipse.bpmn2.modeler.ui.messages"; //$NON-NLS-1$
+
+ public static String SchemaImportDialog_0;
+ public static String SchemaImportDialog_1;
+ public static String SchemaImportDialog_2;
+ public static String SchemaImportDialog_3;
+ public static String SchemaImportDialog_4;
+ public static String SchemaImportDialog_5;
+ public static String SchemaImportDialog_6;
+ public static String SchemaImportDialog_7;
+ public static String SchemaImportDialog_15;
+ public static String SchemaImportDialog_8;
+ public static String SchemaImportDialog_9;
+ public static String SchemaImportDialog_10;
+ public static String SchemaImportDialog_11;
+ public static String SchemaImportDialog_12;
+ public static String SchemaImportDialog_17;
+ public static String SchemaImportDialog_13;
+ public static String SchemaImportDialog_19;
+ public static String SchemaImportDialog_18;
+ public static String SchemaImportDialog_14;
+ public static String SchemaImportDialog_16;
+
+ public static String SchemaImportDialog_20;
+ public static String SchemaImportDialog_21;
+ public static String SchemaImportDialog_22;
+ public static String SchemaImportDialog_23;
+ public static String SchemaImportDialog_24;
+ public static String SchemaImportDialog_25;
+ public static String SchemaImportDialog_26;
+ public static String SchemaImportDialog_27;
+ public static String SchemaImportDialog_28;
+ public static String SchemaImportDialog_29;
+ public static String SchemaImportDialog_30;
+ public static String SchemaImportDialog_31;
+
+ public static String XSDSchemaTreeNode_1;
+ public static String XSDSchemaTreeNode_0;
+
+ public static String ModelTreeLabelProvider_s1_s2;
+
+ public static String InputMessageAdapter_0;
+ public static String MessageAdapter_Message_1;
+ public static String OperationAdapter_Operation_1;
+ public static String OperationAdapter_0;
+ public static String OutputMessageAdapter_0;
+ public static String PartAdapter_Part_1;
+ public static String PortTypeAdapter_Port_Type_2;
+ public static String FaultAdapter_Fault_1;
+ public static String XSDAttributeDeclarationAdapter_XSD_Attribute_1;
+ public static String XSDComplexTypeDefinitionAdapter_0;
+ public static String XSDElementDeclarationAdapter_XSD_Element_1;
+ public static String XSDSchemaAdapter_0;
+ public static String XSDSchemaAdapter_1;
+ public static String XSDTypeDefinitionAdapter_XSD_Type_1;
+ public static String XSDSimpleTypeDefinitionAdapter_0;
+
+ public static String Bpmn2PreferencePage_HomePage_Description;
+ public static String Bpmn2PreferencePage_EditorPage_Description;
+
+ public static String UI_UnknownDiagram_long_description;
+ public static String UI_ProcessDiagram_long_description;
+ public static String UI_ChoreographyDiagram_long_description;
+ public static String UI_CollaborationDiagram_long_description;
+
+ public static String UI_SequenceFlow_long_description;
+ public static String UI_MessageFlow_long_description;
+ public static String UI_Association_long_description;
+ public static String UI_Annotation_long_description;
+ public static String UI_Task_long_description;
+ public static String UI_ManualTask_long_description;
+ public static String UI_UserTask_long_description;
+ public static String UI_BusinessRuleTask_long_description;
+ public static String UI_ServiceTask_long_description;
+ public static String UI_SendTask_long_description;
+ public static String UI_ReceiveTask_long_description;
+ public static String UI_ChoreographyTask_long_description;
+ public static String UI_ScriptTask_long_description;
+
+ public static String UI_StartEvent_long_description;
+ public static String UI_EndEvent_long_description;
+ public static String UI_IntermediateThrowEvent_long_description;
+ public static String UI_IntermediateCatchEvent_long_description;
+ public static String UI_BoundaryEvent_long_description;
+ public static String UI_DataStore_long_description;
+ public static String UI_DataInput_long_description;
+ public static String UI_DataOutput_long_description;
+ public static String UI_Message_long_description;
+
+ public static String UI_ExclusiveGateway_long_description;
+ public static String UI_InclusiveGateway_long_description;
+ public static String UI_ParallelGateway_long_description;
+ public static String UI_EventBasedGateway_long_description;
+ public static String UI_ComplexGateway_long_description;
+
+ public static String UI_Participant_long_description;
+ public static String UI_Lane_long_description;
+ public static String UI_SubProcess_long_description;
+ public static String UI_Group_long_description;
+ public static String UI_SubChoreography_long_description;
+ public static String UI_CallActivity_long_description;
+ public static String UI_Conversation_long_description;
+ public static String UI_CallConversation_long_description;
+ public static String UI_SubConversation_long_description;
+ public static String UI_TextAnnotation_long_description;
+
+
+
+ public static String WSILPreferencePage_WSIL_1;
+ public static String WSILPreferencePage_WSIL_2;
+ public static String WSILPreferencePage_WSIL_Description;
+ public static String WSILPreferencePage_WSIL_Add;
+ public static String WSILPreferencePage_WSIL_EnterLocation;
+ public static String WSILPreferencePage_WSIL_EnterDescription;
+ public static String WSILPreferencePage_WSIL_Remove;
+ public static String WSILPreferencePage_WSIL_MoveUp;
+ public static String WSILPreferencePage_WSIL_MoveDown;
+ public static String WSILPreferencePage_WSIL_OpenInBrowser;
+ public static String WSILPreferencePage_WSIL_NameLimit;
+ public static String WSILPreferencePage_WSIL_DocumentNotLoaded;
+ public static String WSILPreferencePage_WSIL_Abstract;
+ public static String WSILPreferencePage_WSIL_Location;
+ public static String WSILPreferencePage_WSIL_Namespace;
+ public static String WSILPreferencePage_WSIL_Index;
+
+ private Messages() {
+ // Do not instantiate
+ }
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2EditorDiItemProviderAdapterFactory.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2EditorDiItemProviderAdapterFactory.java
index eda9c38..b6e72f2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2EditorDiItemProviderAdapterFactory.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2EditorDiItemProviderAdapterFactory.java
@@ -1,89 +1,89 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.di.provider.BpmnDiItemProviderAdapterFactory;
-import org.eclipse.bpmn2.di.util.BpmnDiSwitch;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @author Bob Brodt
- *
- */
-public class Bpmn2EditorDiItemProviderAdapterFactory extends BpmnDiItemProviderAdapterFactory {
-
- /**
- *
- */
- public Bpmn2EditorDiItemProviderAdapterFactory() {
- super();
- supportedTypes.add(ExtendedPropertiesAdapter.class);
- }
-
-
- @Override
- public Adapter adaptNew(Notifier object, Object type) {
- if (type == ExtendedPropertiesAdapter.class && object instanceof EObject) {
- return bpmnDiModelSwitch.doSwitch((EObject) object);
- }
- return super.adaptNew(object, type);
- }
-
- protected BpmnDiSwitch<ExtendedPropertiesAdapter> bpmnDiModelSwitch = new BpmnDiExtendedPropertiesSwitch(this);
-
- public class BpmnDiExtendedPropertiesSwitch extends BpmnDiSwitch<ExtendedPropertiesAdapter> {
-
- private AdapterFactory adapterFactory;
-
- public BpmnDiExtendedPropertiesSwitch(AdapterFactory adapterFactory) {
- super();
- this.adapterFactory = adapterFactory;
- }
-
- @Override
- public ExtendedPropertiesAdapter defaultCase(EObject object) {
- ExtendedPropertiesAdapter adapter = new ExtendedPropertiesAdapter(adapterFactory,object);
- adapter.setObjectDescriptor(new ObjectDescriptor(adapterFactory, object) {
- @Override
- public String getLabel(Object context) {
- EObject object = this.object;
- if (context instanceof EObject)
- object = (EObject)context;
- if (ModelUtil.isStringWrapper(object)) {
- return "Item Type";
- }
- return super.getLabel(context);
- }
-
- @Override
- public String getDisplayName(Object context) {
- EObject object = this.object;
- if (context instanceof EObject)
- object = (EObject)context;
- if (ModelUtil.isStringWrapper(object)) {
- return ModelUtil.getStringWrapperValue(object);
- }
- return super.getDisplayName(context);
- }
- });
- return adapter;
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.di.provider.BpmnDiItemProviderAdapterFactory;
+import org.eclipse.bpmn2.di.util.BpmnDiSwitch;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class Bpmn2EditorDiItemProviderAdapterFactory extends BpmnDiItemProviderAdapterFactory {
+
+ /**
+ *
+ */
+ public Bpmn2EditorDiItemProviderAdapterFactory() {
+ super();
+ supportedTypes.add(ExtendedPropertiesAdapter.class);
+ }
+
+
+ @Override
+ public Adapter adaptNew(Notifier object, Object type) {
+ if (type == ExtendedPropertiesAdapter.class && object instanceof EObject) {
+ return bpmnDiModelSwitch.doSwitch((EObject) object);
+ }
+ return super.adaptNew(object, type);
+ }
+
+ protected BpmnDiSwitch<ExtendedPropertiesAdapter> bpmnDiModelSwitch = new BpmnDiExtendedPropertiesSwitch(this);
+
+ public class BpmnDiExtendedPropertiesSwitch extends BpmnDiSwitch<ExtendedPropertiesAdapter> {
+
+ private AdapterFactory adapterFactory;
+
+ public BpmnDiExtendedPropertiesSwitch(AdapterFactory adapterFactory) {
+ super();
+ this.adapterFactory = adapterFactory;
+ }
+
+ @Override
+ public ExtendedPropertiesAdapter defaultCase(EObject object) {
+ ExtendedPropertiesAdapter adapter = new ExtendedPropertiesAdapter(adapterFactory,object);
+ adapter.setObjectDescriptor(new ObjectDescriptor(adapterFactory, object) {
+ @Override
+ public String getLabel(Object context) {
+ EObject object = this.object;
+ if (context instanceof EObject)
+ object = (EObject)context;
+ if (ModelUtil.isStringWrapper(object)) {
+ return "Item Type";
+ }
+ return super.getLabel(context);
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ EObject object = this.object;
+ if (context instanceof EObject)
+ object = (EObject)context;
+ if (ModelUtil.isStringWrapper(object)) {
+ return ModelUtil.getStringWrapperValue(object);
+ }
+ return super.getDisplayName(context);
+ }
+ });
+ return adapter;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSDLAdapterFactory.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSDLAdapterFactory.java
index 426756f..c0ba985 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSDLAdapterFactory.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSDLAdapterFactory.java
@@ -56,17 +56,17 @@
instance = new Bpmn2WSDLAdapterFactory();
}
return instance;
- }
-
- /**
- * @see org.eclipse.wst.wsdl.internal.util.WSDLAdapterFactory#createDefinitionAdapter()
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=330813
- * https://jira.jboss.org/browse/JBIDE-7107
- * This adds the INamespace adapter to Definition objects (required for the XPath expression editor)
- */
- @Override
- public Adapter createDefinitionAdapter() {
- return provider.getAdapter( DefinitionAdapter.class );
+ }
+
+ /**
+ * @see org.eclipse.wst.wsdl.internal.util.WSDLAdapterFactory#createDefinitionAdapter()
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=330813
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * This adds the INamespace adapter to Definition objects (required for the XPath expression editor)
+ */
+ @Override
+ public Adapter createDefinitionAdapter() {
+ return provider.getAdapter( DefinitionAdapter.class );
}
/**
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSILAdapterFactory.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSILAdapterFactory.java
index ef5a677..ad11d62 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSILAdapterFactory.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2WSILAdapterFactory.java
@@ -1,107 +1,107 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterProvider;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-
-/**
- * Bpmn2WSILAdapterFactory for generating adapters.
- *
- * We use an instance of AdapterProvider that caches singleton adapters.
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 10, 2007
- *
- */
-public class Bpmn2WSILAdapterFactory extends InspectionAdapterFactory {
-
- static private Bpmn2WSILAdapterFactory instance;
-
- AdapterProvider provider;
-
- /**
- * The AdapterFactory constructor. Private, because there is only
- * 1 instance of the factory obtainable via getInstance() method below.
- */
-
- private Bpmn2WSILAdapterFactory () {
- provider = new AdapterProvider();
- }
-
- /**
- * Get the instance of the factory.
- *
- * @return an instance of this WSIL UI factory
- */
-
- public static Bpmn2WSILAdapterFactory getInstance() {
- if (instance == null) {
- instance = new Bpmn2WSILAdapterFactory();
- }
- return instance;
- }
-
- /**
- * Create the inspection adapter.
- *
- * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createInspectionAdapter()
- */
- @Override
- public Adapter createInspectionAdapter() {
- return provider.getAdapter(WSILInspectionAdapter.class);
- }
-
- /**
- * Create the link adapter.
- * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createLinkAdapter()
- */
-
- @Override
- public Adapter createLinkAdapter() {
- return provider.getAdapter(WSILLinkAdapter.class);
- }
-
- /** Create the service adapter.
- *
- * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createServiceAdapter()
- */
- @Override
- public Adapter createServiceAdapter() {
- return provider.getAdapter(WSILServiceAdapter.class);
- }
-
- /**
- * @see org.eclipse.emf.common.notify.impl.AdapterFactoryImpl#adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
- */
- @Override
- public Adapter adaptNew(Notifier target, Object type) {
- Adapter adapter = createAdapter(target, type);
- // Bugzilla 330519
- // only associate the adapter with the target (i.e. add it to the
- // target's eAdapters list) if the adapter is for the requested type
- if (adapter!=null && adapter.isAdapterForType(type)) {
- associate(adapter,target);
- return adapter;
- }
- return null;
- }
-
-
- @Override
- protected Object resolve(Object object, Object type) {
- return null;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterProvider;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+
+/**
+ * Bpmn2WSILAdapterFactory for generating adapters.
+ *
+ * We use an instance of AdapterProvider that caches singleton adapters.
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 10, 2007
+ *
+ */
+public class Bpmn2WSILAdapterFactory extends InspectionAdapterFactory {
+
+ static private Bpmn2WSILAdapterFactory instance;
+
+ AdapterProvider provider;
+
+ /**
+ * The AdapterFactory constructor. Private, because there is only
+ * 1 instance of the factory obtainable via getInstance() method below.
+ */
+
+ private Bpmn2WSILAdapterFactory () {
+ provider = new AdapterProvider();
+ }
+
+ /**
+ * Get the instance of the factory.
+ *
+ * @return an instance of this WSIL UI factory
+ */
+
+ public static Bpmn2WSILAdapterFactory getInstance() {
+ if (instance == null) {
+ instance = new Bpmn2WSILAdapterFactory();
+ }
+ return instance;
+ }
+
+ /**
+ * Create the inspection adapter.
+ *
+ * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createInspectionAdapter()
+ */
+ @Override
+ public Adapter createInspectionAdapter() {
+ return provider.getAdapter(WSILInspectionAdapter.class);
+ }
+
+ /**
+ * Create the link adapter.
+ * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createLinkAdapter()
+ */
+
+ @Override
+ public Adapter createLinkAdapter() {
+ return provider.getAdapter(WSILLinkAdapter.class);
+ }
+
+ /** Create the service adapter.
+ *
+ * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createServiceAdapter()
+ */
+ @Override
+ public Adapter createServiceAdapter() {
+ return provider.getAdapter(WSILServiceAdapter.class);
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.impl.AdapterFactoryImpl#adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
+ */
+ @Override
+ public Adapter adaptNew(Notifier target, Object type) {
+ Adapter adapter = createAdapter(target, type);
+ // Bugzilla 330519
+ // only associate the adapter with the target (i.e. add it to the
+ // target's eAdapters list) if the adapter is for the requested type
+ if (adapter!=null && adapter.isAdapterForType(type)) {
+ associate(adapter,target);
+ return adapter;
+ }
+ return null;
+ }
+
+
+ @Override
+ protected Object resolve(Object object, Object type) {
+ return null;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2XSDAdapterFactory.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2XSDAdapterFactory.java
index faaefd9..1234ae6 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2XSDAdapterFactory.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/Bpmn2XSDAdapterFactory.java
@@ -1,130 +1,130 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterProvider;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.xsd.util.XSDAdapterFactory;
-
-
-
-/**
- * Bpmn2XSDAdapterFactory for generating adapters.
- *
- * We use an instance of AdapterProvider that caches singleton adapters.
- *
- * @auhtor IBM
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 10, 2007
- *
- */
-
-public class Bpmn2XSDAdapterFactory extends XSDAdapterFactory {
-
- static private Bpmn2XSDAdapterFactory instance;
-
- AdapterProvider provider;
-
- /**
- * The AdapterFactory constructor. Private, because there is only
- * 1 instance of the factory obtainable via getInstance() method below.
- */
-
- private Bpmn2XSDAdapterFactory () {
- provider = new AdapterProvider();
- }
-
-
- /**
- * Get the instance of the factory.
- *
- * @return an instance of this WSIL UI factory
- */
-
- public static Bpmn2XSDAdapterFactory getInstance() {
- if (instance == null) {
- instance = new Bpmn2XSDAdapterFactory();
- }
- return instance;
- }
-
- /**
- * @return the simple type definition adapter.
- */
-
- public Adapter createXSDSimpleTypeDefinitionAdatper () {
- return provider.getAdapter( XSDSimpleTypeDefinitionAdapter.class );
- }
-
- /**
- * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDComplexTypeDefinitionAdapter()
- */
- @Override
- public Adapter createXSDComplexTypeDefinitionAdapter () {
- return provider.getAdapter( XSDComplexTypeDefinitionAdapter.class );
- }
-
- /**
- * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDTypeDefinitionAdapter()
- */
- @Override
- public Adapter createXSDTypeDefinitionAdapter() {
- return provider.getAdapter( XSDTypeDefinitionAdapter.class );
- }
-
- /**
- * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDAttributeDeclarationAdapter()
- */
- @Override
- public Adapter createXSDAttributeDeclarationAdapter() {
- return provider.getAdapter( XSDAttributeDeclarationAdapter.class );
- }
-
- /**
- * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDElementDeclarationAdapter()
- */
- @Override
- public Adapter createXSDElementDeclarationAdapter() {
- return provider.getAdapter( XSDElementDeclarationAdapter.class );
- }
-
- /**
- * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDSchemaAdapter()
- */
- @Override
- public Adapter createXSDSchemaAdapter() {
- return provider.getAdapter( XSDSchemaAdapter.class );
- }
- /**
- * @see org.eclipse.emf.common.notify.impl.AdapterFactoryImpl#adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
- */
- @Override
- public Adapter adaptNew(Notifier target, Object type) {
- Adapter adapter = createAdapter(target, type);
- // Bugzilla 330519
- // only associate the adapter with the target (i.e. add it to the
- // target's eAdapters list) if the adapter is for the requested type
- if (adapter!=null && adapter.isAdapterForType(type)) {
- associate(adapter,target);
- return adapter;
- }
- return null;
- }
-
-
-
- @Override
- protected Object resolve(Object object, Object type) {
- return null;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterProvider;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.xsd.util.XSDAdapterFactory;
+
+
+
+/**
+ * Bpmn2XSDAdapterFactory for generating adapters.
+ *
+ * We use an instance of AdapterProvider that caches singleton adapters.
+ *
+ * @auhtor IBM
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 10, 2007
+ *
+ */
+
+public class Bpmn2XSDAdapterFactory extends XSDAdapterFactory {
+
+ static private Bpmn2XSDAdapterFactory instance;
+
+ AdapterProvider provider;
+
+ /**
+ * The AdapterFactory constructor. Private, because there is only
+ * 1 instance of the factory obtainable via getInstance() method below.
+ */
+
+ private Bpmn2XSDAdapterFactory () {
+ provider = new AdapterProvider();
+ }
+
+
+ /**
+ * Get the instance of the factory.
+ *
+ * @return an instance of this WSIL UI factory
+ */
+
+ public static Bpmn2XSDAdapterFactory getInstance() {
+ if (instance == null) {
+ instance = new Bpmn2XSDAdapterFactory();
+ }
+ return instance;
+ }
+
+ /**
+ * @return the simple type definition adapter.
+ */
+
+ public Adapter createXSDSimpleTypeDefinitionAdatper () {
+ return provider.getAdapter( XSDSimpleTypeDefinitionAdapter.class );
+ }
+
+ /**
+ * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDComplexTypeDefinitionAdapter()
+ */
+ @Override
+ public Adapter createXSDComplexTypeDefinitionAdapter () {
+ return provider.getAdapter( XSDComplexTypeDefinitionAdapter.class );
+ }
+
+ /**
+ * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDTypeDefinitionAdapter()
+ */
+ @Override
+ public Adapter createXSDTypeDefinitionAdapter() {
+ return provider.getAdapter( XSDTypeDefinitionAdapter.class );
+ }
+
+ /**
+ * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDAttributeDeclarationAdapter()
+ */
+ @Override
+ public Adapter createXSDAttributeDeclarationAdapter() {
+ return provider.getAdapter( XSDAttributeDeclarationAdapter.class );
+ }
+
+ /**
+ * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDElementDeclarationAdapter()
+ */
+ @Override
+ public Adapter createXSDElementDeclarationAdapter() {
+ return provider.getAdapter( XSDElementDeclarationAdapter.class );
+ }
+
+ /**
+ * @see org.eclipse.xsd.util.XSDAdapterFactory#createXSDSchemaAdapter()
+ */
+ @Override
+ public Adapter createXSDSchemaAdapter() {
+ return provider.getAdapter( XSDSchemaAdapter.class );
+ }
+ /**
+ * @see org.eclipse.emf.common.notify.impl.AdapterFactoryImpl#adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
+ */
+ @Override
+ public Adapter adaptNew(Notifier target, Object type) {
+ Adapter adapter = createAdapter(target, type);
+ // Bugzilla 330519
+ // only associate the adapter with the target (i.e. add it to the
+ // target's eAdapters list) if the adapter is for the requested type
+ if (adapter!=null && adapter.isAdapterForType(type)) {
+ associate(adapter,target);
+ return adapter;
+ }
+ return null;
+ }
+
+
+
+ @Override
+ protected Object resolve(Object object, Object type) {
+ return null;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/DefinitionAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/DefinitionAdapter.java
index 9897689..29858e0 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/DefinitionAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/DefinitionAdapter.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2010 JBoss, Inc. and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.modeler.core.adapters.BasicEObjectAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.INamespaceMap;
-import org.eclipse.wst.wsdl.Definition;
-
-/*
- * This adds the INamespace adapter to Definition objects (required for the XPath expression editor)
- *
- * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=330813
- * @see https://jira.jboss.org/browse/JBIDE-7107
- * @author Bob Brodt
- * @date Oct 12, 2010
- */
-public class DefinitionAdapter extends BasicEObjectAdapter implements INamespaceMap<String, String> {
-
- /**
- *
- * @param key
- * the namespace to get the reverse mapping for
- * @return The reverse mapping of the Namespace to namespace prefixes.
- * @see org.eclipse.bpel.model.adapters.INamespaceMap#getReverse(java.lang.Object)
- */
-
- public List<String> getReverse(String key) {
- List<String> list = new ArrayList<String>(1);
- list.add( ((Definition)getTarget()).getPrefix(key) );
- return list;
- }
-
-}
+/*
+ * Copyright (c) 2010 JBoss, Inc. and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.modeler.core.adapters.BasicEObjectAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.INamespaceMap;
+import org.eclipse.wst.wsdl.Definition;
+
+/*
+ * This adds the INamespace adapter to Definition objects (required for the XPath expression editor)
+ *
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=330813
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
+public class DefinitionAdapter extends BasicEObjectAdapter implements INamespaceMap<String, String> {
+
+ /**
+ *
+ * @param key
+ * the namespace to get the reverse mapping for
+ * @return The reverse mapping of the Namespace to namespace prefixes.
+ * @see org.eclipse.bpel.model.adapters.INamespaceMap#getReverse(java.lang.Object)
+ */
+
+ public List<String> getReverse(String key) {
+ List<String> list = new ArrayList<String>(1);
+ list.add( ((Definition)getTarget()).getPrefix(key) );
+ return list;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/FaultAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/FaultAdapter.java
index fe9ac16..c32c898 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/FaultAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/FaultAdapter.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractStatefulAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.jface.fieldassist.IContentProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Fault;
-
-public class FaultAdapter extends AbstractStatefulAdapter implements ILabeledElement, IContentProposal {
-
- /* ILabeledElement */
-
- // TODO: need a unique icon for WSDL faults
-
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_THROW_16);
- }
-
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_THROW_32);
- }
-
- public String getTypeLabel(Object object) {
- return Messages.FaultAdapter_Fault_1;
- }
- public String getLabel(Object object) {
- String name = getTarget(object, Fault.class).getName();
- if (name != null) {
- return name;
- }
- return getTypeLabel(object);
- }
-
- public String getContent() {
- return getLabel ( getTarget() );
- }
-
- public int getCursorPosition() {
- // TODO Why -1?
- return -1;
- }
-
- public String getDescription() {
- // TODO Temporary returns null, then should be updated
- return null;
- }
-
- public String getLabel() {
- return getLabel ( getTarget() ) + " - " + getLabel ( getTarget() );
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractStatefulAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Fault;
+
+public class FaultAdapter extends AbstractStatefulAdapter implements ILabeledElement, IContentProposal {
+
+ /* ILabeledElement */
+
+ // TODO: need a unique icon for WSDL faults
+
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_THROW_16);
+ }
+
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_THROW_32);
+ }
+
+ public String getTypeLabel(Object object) {
+ return Messages.FaultAdapter_Fault_1;
+ }
+ public String getLabel(Object object) {
+ String name = getTarget(object, Fault.class).getName();
+ if (name != null) {
+ return name;
+ }
+ return getTypeLabel(object);
+ }
+
+ public String getContent() {
+ return getLabel ( getTarget() );
+ }
+
+ public int getCursorPosition() {
+ // TODO Why -1?
+ return -1;
+ }
+
+ public String getDescription() {
+ // TODO Temporary returns null, then should be updated
+ return null;
+ }
+
+ public String getLabel() {
+ return getLabel ( getTarget() ) + " - " + getLabel ( getTarget() );
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/ILabeledElement.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/ILabeledElement.java
index 4cc9019..2f9822e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/ILabeledElement.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/ILabeledElement.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * An ILabeledElement provides UI facilities for labeling the parameter.
- * This includes both images and a string label.
- */
-public interface ILabeledElement {
-
- /**
- * Return a string labelling the generic type of the model object (e.g. "Sequence")
- */
- public String getTypeLabel(Object object);
-
- /**
- * Return a string labelling the given model object. If no label is available, it
- * should return the same value as getTypeLabel().
- */
- public String getLabel(Object object);
-
- /**
- * Return a small image representing the given model object
- */
- public Image getSmallImage(Object object);
-
- /**
- * Return a large image representing the given model object
- */
- public Image getLargeImage(Object object);
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * An ILabeledElement provides UI facilities for labeling the parameter.
+ * This includes both images and a string label.
+ */
+public interface ILabeledElement {
+
+ /**
+ * Return a string labelling the generic type of the model object (e.g. "Sequence")
+ */
+ public String getTypeLabel(Object object);
+
+ /**
+ * Return a string labelling the given model object. If no label is available, it
+ * should return the same value as getTypeLabel().
+ */
+ public String getLabel(Object object);
+
+ /**
+ * Return a small image representing the given model object
+ */
+ public Image getSmallImage(Object object);
+
+ /**
+ * Return a large image representing the given model object
+ */
+ public Image getLargeImage(Object object);
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/INamedElement.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/INamedElement.java
index 80f9b47..b55ce34 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/INamedElement.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/INamedElement.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.emf.common.notify.Notification;
-
-/**
- * An INamedElement provides a common API for accessing the
- * name of a model parameter.
- */
-public interface INamedElement {
- /**
- * Return the name of the given parameter. The name may
- * be null.
- */
- public String getName(Object modelObject);
-
- /**
- * Set the name of the parameter to the given string.
- * The string may be null;
- */
- public void setName(Object modelObject, String name);
-
- /**
- * Returns true if the given notification affects the name of the model parameter.
- */
- public boolean isNameAffected(Object modelObject, Notification n);
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.emf.common.notify.Notification;
+
+/**
+ * An INamedElement provides a common API for accessing the
+ * name of a model parameter.
+ */
+public interface INamedElement {
+ /**
+ * Return the name of the given parameter. The name may
+ * be null.
+ */
+ public String getName(Object modelObject);
+
+ /**
+ * Set the name of the parameter to the given string.
+ * The string may be null;
+ */
+ public void setName(Object modelObject, String name);
+
+ /**
+ * Returns true if the given notification affects the name of the model parameter.
+ */
+ public boolean isNameAffected(Object modelObject, Notification n);
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/InputMessageAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/InputMessageAdapter.java
index 49b77a6..d26a8a0 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/InputMessageAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/InputMessageAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Input;
-
-public class InputMessageAdapter extends MessageAdapter {
-
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_INPUT_16);
- }
-
- @Override
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_INPUT_32);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.InputMessageAdapter_0;
- }
-
- @Override
- public String getLabel (Object object) {
- Input input = (Input) object;
- return super.getLabel ( input.getMessage() );
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Input;
+
+public class InputMessageAdapter extends MessageAdapter {
+
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_INPUT_16);
+ }
+
+ @Override
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_INPUT_32);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.InputMessageAdapter_0;
+ }
+
+ @Override
+ public String getLabel (Object object) {
+ Input input = (Input) object;
+ return super.getLabel ( input.getMessage() );
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/MessageAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/MessageAdapter.java
index aa4a1af..9d64745 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/MessageAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/MessageAdapter.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Message;
-
-public class MessageAdapter extends AbstractAdapter implements ILabeledElement {
-
- /* ILabeledElement */
-
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_MESSAGE_16);
- }
-
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_MESSAGE_32);
- }
-
- public String getTypeLabel(Object object) {
- return Messages.MessageAdapter_Message_1;
- }
-
- public String getLabel (Object object) {
- if (object == null){
- return null;
- }
- Message msg = (Message)object;
- if (msg.getQName() != null) {
- if (msg.getQName().getLocalPart() != null) return msg.getQName().getLocalPart();
- }
- return getTypeLabel(object);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Message;
+
+public class MessageAdapter extends AbstractAdapter implements ILabeledElement {
+
+ /* ILabeledElement */
+
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_MESSAGE_16);
+ }
+
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_MESSAGE_32);
+ }
+
+ public String getTypeLabel(Object object) {
+ return Messages.MessageAdapter_Message_1;
+ }
+
+ public String getLabel (Object object) {
+ if (object == null){
+ return null;
+ }
+ Message msg = (Message)object;
+ if (msg.getQName() != null) {
+ if (msg.getQName().getLocalPart() != null) return msg.getQName().getLocalPart();
+ }
+ return getTypeLabel(object);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OperationAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OperationAdapter.java
index 9bd5174..7ff2105 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OperationAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OperationAdapter.java
@@ -1,108 +1,108 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.IStatefullAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.jface.fieldassist.IContentProposal;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.w3c.dom.Element;
-
-public class OperationAdapter extends AbstractAdapter
- implements ILabeledElement, INamedElement, IContentProposal, IStatefullAdapter {
-
-
- /* ILabeledElement */
-
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_OPERATION_16);
- }
-
- public Image getLargeImage(Object object) {
- return null;
- }
-
- public String getTypeLabel(Object object) {
- return Messages.OperationAdapter_Operation_1;
- }
- public String getLabel(Object object) {
- Operation op = getTarget( object ,Operation.class );
- String name = op.getName();
- if (name != null) {
- return name;
- }
- return getTypeLabel (op) ;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.fieldassist.IContentProposal#getContent()
- */
- public String getContent() {
- return getLabel ( getTarget() );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.fieldassist.IContentProposal#getCursorPosition()
- */
- public int getCursorPosition() {
- // TODO Auto-generated method stub
- return -1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.fieldassist.IContentProposal#getDescription()
- */
- public String getDescription() {
- Operation op = getTarget(null, Operation.class );
- Element elm = op.getDocumentationElement();
- return (elm != null ? elm.getNodeValue() : null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.fieldassist.IContentProposal#getLabel()
- */
-
- public String getLabel() {
- return NLS.bind(Messages.OperationAdapter_0,
- getLabel( getTarget() ),
- getLabel ( getTarget() ) );
- }
-
- /* INamedElement */
-
- public String getName(Object modelObject) {
- Operation op = getTarget( modelObject ,Operation.class );
- return op.getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.INamedElement#isNameAffected(java.lang.Object, org.eclipse.emf.common.notify.Notification)
- */
- public boolean isNameAffected (Object modelObject, Notification n) {
- return (n.getFeatureID(Operation.class) == WSDLPackage.OPERATION__NAME);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.INamedElement#setName(java.lang.Object, java.lang.String)
- */
- public void setName(Object modelObject, String name) {
- Operation op = getTarget( modelObject ,Operation.class );
- op.setName( name );
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.IStatefullAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Operation;
+import org.eclipse.wst.wsdl.WSDLPackage;
+import org.w3c.dom.Element;
+
+public class OperationAdapter extends AbstractAdapter
+ implements ILabeledElement, INamedElement, IContentProposal, IStatefullAdapter {
+
+
+ /* ILabeledElement */
+
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_OPERATION_16);
+ }
+
+ public Image getLargeImage(Object object) {
+ return null;
+ }
+
+ public String getTypeLabel(Object object) {
+ return Messages.OperationAdapter_Operation_1;
+ }
+ public String getLabel(Object object) {
+ Operation op = getTarget( object ,Operation.class );
+ String name = op.getName();
+ if (name != null) {
+ return name;
+ }
+ return getTypeLabel (op) ;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.fieldassist.IContentProposal#getContent()
+ */
+ public String getContent() {
+ return getLabel ( getTarget() );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.fieldassist.IContentProposal#getCursorPosition()
+ */
+ public int getCursorPosition() {
+ // TODO Auto-generated method stub
+ return -1;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.fieldassist.IContentProposal#getDescription()
+ */
+ public String getDescription() {
+ Operation op = getTarget(null, Operation.class );
+ Element elm = op.getDocumentationElement();
+ return (elm != null ? elm.getNodeValue() : null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.fieldassist.IContentProposal#getLabel()
+ */
+
+ public String getLabel() {
+ return NLS.bind(Messages.OperationAdapter_0,
+ getLabel( getTarget() ),
+ getLabel ( getTarget() ) );
+ }
+
+ /* INamedElement */
+
+ public String getName(Object modelObject) {
+ Operation op = getTarget( modelObject ,Operation.class );
+ return op.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpel.ui.adapters.INamedElement#isNameAffected(java.lang.Object, org.eclipse.emf.common.notify.Notification)
+ */
+ public boolean isNameAffected (Object modelObject, Notification n) {
+ return (n.getFeatureID(Operation.class) == WSDLPackage.OPERATION__NAME);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpel.ui.adapters.INamedElement#setName(java.lang.Object, java.lang.String)
+ */
+ public void setName(Object modelObject, String name) {
+ Operation op = getTarget( modelObject ,Operation.class );
+ op.setName( name );
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OutputMessageAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OutputMessageAdapter.java
index 1899b8b..7501df7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OutputMessageAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/OutputMessageAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Output;
-
-public class OutputMessageAdapter extends MessageAdapter {
-
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_OUTPUT_16);
- }
-
- @Override
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_OUTPUT_32);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.OutputMessageAdapter_0;
- }
-
- @Override
- public String getLabel (Object object) {
- Output output = (Output) object;
- return super.getLabel ( output.getMessage() );
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Output;
+
+public class OutputMessageAdapter extends MessageAdapter {
+
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_OUTPUT_16);
+ }
+
+ @Override
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_OUTPUT_32);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.OutputMessageAdapter_0;
+ }
+
+ @Override
+ public String getLabel (Object object) {
+ Output output = (Output) object;
+ return super.getLabel ( output.getMessage() );
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PartAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PartAdapter.java
index 67b2d4c..840c3db 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PartAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PartAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Part;
-
-public class PartAdapter extends AbstractAdapter implements ILabeledElement {
-
- /* ILabeledElement */
-
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_PART_16);
- }
-
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_PART_32);
- }
-
- public String getTypeLabel(Object object) {
- return Messages.PartAdapter_Part_1;
- }
- public String getLabel(Object object) {
- Part part = (Part)object;
- String name = part.getName();
- if (name != null) return name;
- return getTypeLabel(object);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Part;
+
+public class PartAdapter extends AbstractAdapter implements ILabeledElement {
+
+ /* ILabeledElement */
+
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_PART_16);
+ }
+
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_PART_32);
+ }
+
+ public String getTypeLabel(Object object) {
+ return Messages.PartAdapter_Part_1;
+ }
+ public String getLabel(Object object) {
+ Part part = (Part)object;
+ String name = part.getName();
+ if (name != null) return name;
+ return getTypeLabel(object);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PortTypeAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PortTypeAdapter.java
index 7387a03..55118e2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PortTypeAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/PortTypeAdapter.java
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLPackage;
-
-public class PortTypeAdapter extends AbstractAdapter implements INamedElement,
- ILabeledElement
-{
-
- /* INamedElement */
-
- public String getName(Object namedElement) {
- QName name = ((PortType)namedElement).getQName();
- return (name != null)? name.getLocalPart() : null;
- }
-
- public void setName(Object namedElement, String name) {
- PortType portType = (PortType)namedElement;
- String ns = ""; //$NON-NLS-1$
- if (portType.getEnclosingDefinition() != null) {
- ns = portType.getEnclosingDefinition().getTargetNamespace();
- }
- ((PortType)namedElement).setQName(new QName(ns, name));
- }
-
- public boolean isNameAffected(Object modelObject, Notification n) {
- return (n.getFeatureID(PortType.class) == WSDLPackage.PORT_TYPE__QNAME);
- }
-
- /* ILabeledElement */
-
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_PORTTYPE_16);
- }
-
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_PORTTYPE_32);
- }
-
- public String getTypeLabel(Object object) {
- return Messages.PortTypeAdapter_Port_Type_2;
- }
-
- public String getLabel(Object object) {
- PortType pt = (PortType)object;
- if (pt.getQName() != null) {
- if (pt.getQName().getLocalPart() != null) return pt.getQName().getLocalPart();
- }
- return getTypeLabel(object);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import javax.xml.namespace.QName;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.PortType;
+import org.eclipse.wst.wsdl.WSDLPackage;
+
+public class PortTypeAdapter extends AbstractAdapter implements INamedElement,
+ ILabeledElement
+{
+
+ /* INamedElement */
+
+ public String getName(Object namedElement) {
+ QName name = ((PortType)namedElement).getQName();
+ return (name != null)? name.getLocalPart() : null;
+ }
+
+ public void setName(Object namedElement, String name) {
+ PortType portType = (PortType)namedElement;
+ String ns = ""; //$NON-NLS-1$
+ if (portType.getEnclosingDefinition() != null) {
+ ns = portType.getEnclosingDefinition().getTargetNamespace();
+ }
+ ((PortType)namedElement).setQName(new QName(ns, name));
+ }
+
+ public boolean isNameAffected(Object modelObject, Notification n) {
+ return (n.getFeatureID(PortType.class) == WSDLPackage.PORT_TYPE__QNAME);
+ }
+
+ /* ILabeledElement */
+
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_PORTTYPE_16);
+ }
+
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_PORTTYPE_32);
+ }
+
+ public String getTypeLabel(Object object) {
+ return Messages.PortTypeAdapter_Port_Type_2;
+ }
+
+ public String getLabel(Object object) {
+ PortType pt = (PortType)object;
+ if (pt.getQName() != null) {
+ if (pt.getQName().getLocalPart() != null) return pt.getQName().getLocalPart();
+ }
+ return getTypeLabel(object);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILInspectionAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILInspectionAdapter.java
index 8affea6..5b50439 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILInspectionAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILInspectionAdapter.java
@@ -1,65 +1,65 @@
-/**
- *
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import java.util.List;
-
-import org.eclipse.bpel.wsil.model.inspection.Inspection;
-import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- *
- */
-
-public class WSILInspectionAdapter extends AbstractAdapter
- implements ILabeledElement
-{
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLargeImage(java.lang.Object)
- */
- public Image getLargeImage(Object object) {
- return null;
- }
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getSmallImage(java.lang.Object)
- */
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_WSIL);
- }
-
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getTypeLabel(java.lang.Object)
- */
- public String getTypeLabel ( Object obj ) {
- return obj.getClass().getSimpleName();
- }
-
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLabel(java.lang.Object)
- */
- public String getLabel ( Object obj )
- {
- Inspection inspection = getTarget(obj, Inspection.class);
- if (inspection == null) {
- return getTypeLabel(obj);
- }
- List<?> abs = inspection.getAbstract();
-
- if (abs.size() > 0) {
- TypeOfAbstract iwa = (TypeOfAbstract) abs.get(0);
- return "Inspection - " + iwa.getValue();
- }
- return "Inspection " ;
- }
-
+/**
+ *
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import java.util.List;
+
+import org.eclipse.bpel.wsil.model.inspection.Inspection;
+import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ *
+ */
+
+public class WSILInspectionAdapter extends AbstractAdapter
+ implements ILabeledElement
+{
+
+ /** (non-Javadoc)
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLargeImage(java.lang.Object)
+ */
+ public Image getLargeImage(Object object) {
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getSmallImage(java.lang.Object)
+ */
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_WSIL);
+ }
+
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getTypeLabel(java.lang.Object)
+ */
+ public String getTypeLabel ( Object obj ) {
+ return obj.getClass().getSimpleName();
+ }
+
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLabel(java.lang.Object)
+ */
+ public String getLabel ( Object obj )
+ {
+ Inspection inspection = getTarget(obj, Inspection.class);
+ if (inspection == null) {
+ return getTypeLabel(obj);
+ }
+ List<?> abs = inspection.getAbstract();
+
+ if (abs.size() > 0) {
+ TypeOfAbstract iwa = (TypeOfAbstract) abs.get(0);
+ return "Inspection - " + iwa.getValue();
+ }
+ return "Inspection " ;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILLinkAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILLinkAdapter.java
index eb2c871..03ea16a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILLinkAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILLinkAdapter.java
@@ -1,56 +1,56 @@
-/**
- *
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpel.wsil.model.inspection.Link;
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- *
- */
-
-public class WSILLinkAdapter extends AbstractAdapter
- implements ILabeledElement
-{
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLargeImage(java.lang.Object)
- */
- public Image getLargeImage(Object object) {
- return null;
- }
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getSmallImage(java.lang.Object)
- */
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_WSIL_LINK );
- }
-
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getTypeLabel(java.lang.Object)
- */
- public String getTypeLabel ( Object obj ) {
- return obj.getClass().getSimpleName();
- }
-
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLabel(java.lang.Object)
- */
- public String getLabel ( Object obj )
- {
- Link link = getTarget(obj, Link.class);
- if (link == null) {
- return getTypeLabel(obj);
- }
- return link.getLocation();
- }
-
+/**
+ *
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpel.wsil.model.inspection.Link;
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ *
+ */
+
+public class WSILLinkAdapter extends AbstractAdapter
+ implements ILabeledElement
+{
+
+ /** (non-Javadoc)
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLargeImage(java.lang.Object)
+ */
+ public Image getLargeImage(Object object) {
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getSmallImage(java.lang.Object)
+ */
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_WSIL_LINK );
+ }
+
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getTypeLabel(java.lang.Object)
+ */
+ public String getTypeLabel ( Object obj ) {
+ return obj.getClass().getSimpleName();
+ }
+
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLabel(java.lang.Object)
+ */
+ public String getLabel ( Object obj )
+ {
+ Link link = getTarget(obj, Link.class);
+ if (link == null) {
+ return getTypeLabel(obj);
+ }
+ return link.getLocation();
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILServiceAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILServiceAdapter.java
index aa9b318..e0ca63b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILServiceAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/WSILServiceAdapter.java
@@ -1,78 +1,78 @@
-/**
- *
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpel.wsil.model.inspection.Name;
-import org.eclipse.bpel.wsil.model.inspection.Service;
-import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- *
- */
-
-
-@SuppressWarnings({"nls"})
-
-public class WSILServiceAdapter extends AbstractAdapter
- implements ILabeledElement
-{
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLargeImage(java.lang.Object)
- */
- public Image getLargeImage(Object object) {
- // TODO: ?
- return null;
- }
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getSmallImage(java.lang.Object)
- */
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_WSIL_SERVICE );
- }
-
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getTypeLabel(java.lang.Object)
- */
- public String getTypeLabel ( Object obj ) {
- return obj.getClass().getSimpleName();
- }
-
-
- /**
- * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLabel(java.lang.Object)
- */
-
- public String getLabel ( Object obj )
- {
- Service service = getTarget(obj, Service.class);
- if (service == null) {
- return getTypeLabel(obj);
- }
-
- String label = "";
- Name name = null;
- TypeOfAbstract abs = null;
-
- if (service.getName().size() > 0) {
- name = service.getName().get(0);
- label += name.getValue();
- label += " - "; //$NON-NLS-1$
- }
-
- if (service.getAbstract().size() > 0) {
- abs = service.getAbstract().get(0);
- label += abs.getValue();
- }
- return label;
- }
-
+/**
+ *
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpel.wsil.model.inspection.Name;
+import org.eclipse.bpel.wsil.model.inspection.Service;
+import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ *
+ */
+
+
+@SuppressWarnings({"nls"})
+
+public class WSILServiceAdapter extends AbstractAdapter
+ implements ILabeledElement
+{
+
+ /** (non-Javadoc)
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLargeImage(java.lang.Object)
+ */
+ public Image getLargeImage(Object object) {
+ // TODO: ?
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getSmallImage(java.lang.Object)
+ */
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_WSIL_SERVICE );
+ }
+
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getTypeLabel(java.lang.Object)
+ */
+ public String getTypeLabel ( Object obj ) {
+ return obj.getClass().getSimpleName();
+ }
+
+
+ /**
+ * @see org.eclipse.bpel.ui.adapters.ILabeledElement#getLabel(java.lang.Object)
+ */
+
+ public String getLabel ( Object obj )
+ {
+ Service service = getTarget(obj, Service.class);
+ if (service == null) {
+ return getTypeLabel(obj);
+ }
+
+ String label = "";
+ Name name = null;
+ TypeOfAbstract abs = null;
+
+ if (service.getName().size() > 0) {
+ name = service.getName().get(0);
+ label += name.getValue();
+ label += " - "; //$NON-NLS-1$
+ }
+
+ if (service.getAbstract().size() > 0) {
+ abs = service.getAbstract().get(0);
+ label += abs.getValue();
+ }
+ return label;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAbstractAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAbstractAdapter.java
index 718b63a..0d1809b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAbstractAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAbstractAdapter.java
@@ -1,73 +1,73 @@
-/**
- *
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import java.util.Map;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.IStatefullAdapter;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.xsd.XSDNamedComponent;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- *
- */
-
-public class XSDAbstractAdapter extends AbstractAdapter
- implements ILabeledElement, IStatefullAdapter
-{
-
- public Image getLargeImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_PART_32);
- }
-
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_PART_16);
- }
-
- public String getNamespacePrefix(String namespace) {
- Object context = getContext();
- // if this is
- if (context instanceof EObject) {
- EObject eObject = (EObject) context;
- return ModelUtil.getNamespacePrefix(eObject, namespace);
- } else if (context instanceof Map) {
- return (String) ((Map)context).get(namespace);
- }
-
- return null;
- }
-
- public String getTypeLabel ( Object obj ) {
- return obj.getClass().getName();
- }
-
-
- public String getLabel ( Object obj )
- {
- XSDNamedComponent component = (XSDNamedComponent) ModelUtil.resolveXSDObject(obj);;
- String name = component.getName();
- String ns = component.getTargetNamespace();
-
- if (name == null) {
- return getTypeLabel( obj );
- }
-
- if (ns == null) {
- return name;
- }
-
- String prefix = getNamespacePrefix(ns);
-
- if (prefix == null) {
- return "{" + ns + "}" + name; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return prefix + ":" + name; //$NON-NLS-1$
- }
+/**
+ *
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import java.util.Map;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AbstractAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.IStatefullAdapter;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.xsd.XSDNamedComponent;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ *
+ */
+
+public class XSDAbstractAdapter extends AbstractAdapter
+ implements ILabeledElement, IStatefullAdapter
+{
+
+ public Image getLargeImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_PART_32);
+ }
+
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_PART_16);
+ }
+
+ public String getNamespacePrefix(String namespace) {
+ Object context = getContext();
+ // if this is
+ if (context instanceof EObject) {
+ EObject eObject = (EObject) context;
+ return ModelUtil.getNamespacePrefix(eObject, namespace);
+ } else if (context instanceof Map) {
+ return (String) ((Map)context).get(namespace);
+ }
+
+ return null;
+ }
+
+ public String getTypeLabel ( Object obj ) {
+ return obj.getClass().getName();
+ }
+
+
+ public String getLabel ( Object obj )
+ {
+ XSDNamedComponent component = (XSDNamedComponent) ModelUtil.resolveXSDObject(obj);;
+ String name = component.getName();
+ String ns = component.getTargetNamespace();
+
+ if (name == null) {
+ return getTypeLabel( obj );
+ }
+
+ if (ns == null) {
+ return name;
+ }
+
+ String prefix = getNamespacePrefix(ns);
+
+ if (prefix == null) {
+ return "{" + ns + "}" + name; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return prefix + ":" + name; //$NON-NLS-1$
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAttributeDeclarationAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAttributeDeclarationAdapter.java
index 8d97125..06741aa 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAttributeDeclarationAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDAttributeDeclarationAdapter.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class XSDAttributeDeclarationAdapter extends XSDAbstractAdapter
-{
-
- /* ILabeledElement overrides */
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_XSD_ATTRIBUTE_DECLARATION_16);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.XSDAttributeDeclarationAdapter_XSD_Attribute_1;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+
+
+public class XSDAttributeDeclarationAdapter extends XSDAbstractAdapter
+{
+
+ /* ILabeledElement overrides */
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_XSD_ATTRIBUTE_DECLARATION_16);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.XSDAttributeDeclarationAdapter_XSD_Attribute_1;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDComplexTypeDefinitionAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDComplexTypeDefinitionAdapter.java
index 09e7ed2..100f051 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDComplexTypeDefinitionAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDComplexTypeDefinitionAdapter.java
@@ -1,28 +1,28 @@
-/**
- *
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mchmiele
- *
- */
-public class XSDComplexTypeDefinitionAdapter extends XSDAbstractAdapter implements
- ILabeledElement {
-
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_XSD_COMPLEX_TYPE_DEFINITION_16);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.XSDComplexTypeDefinitionAdapter_0;
- }
-
-}
+/**
+ *
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author mchmiele
+ *
+ */
+public class XSDComplexTypeDefinitionAdapter extends XSDAbstractAdapter implements
+ ILabeledElement {
+
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_XSD_COMPLEX_TYPE_DEFINITION_16);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.XSDComplexTypeDefinitionAdapter_0;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDElementDeclarationAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDElementDeclarationAdapter.java
index 74e5a02..eb05fb9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDElementDeclarationAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDElementDeclarationAdapter.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class XSDElementDeclarationAdapter extends XSDAbstractAdapter
-{
-
- /* ILabeledElement overrides */
-
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_XSD_ELEMENT_DECLARATION_16);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.XSDElementDeclarationAdapter_XSD_Element_1;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+
+
+public class XSDElementDeclarationAdapter extends XSDAbstractAdapter
+{
+
+ /* ILabeledElement overrides */
+
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_XSD_ELEMENT_DECLARATION_16);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.XSDElementDeclarationAdapter_XSD_Element_1;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSchemaAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSchemaAdapter.java
index 6440ba2..1688b27 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSchemaAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSchemaAdapter.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import java.text.MessageFormat;
-
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class XSDSchemaAdapter extends XSDAbstractAdapter {
-
-
- @Override
- public String getLabel(Object obj) {
- XSDSchema schema = (XSDSchema) obj;
- String tns = schema.getTargetNamespace();
-
- if (tns == null) {
- return Messages.XSDSchemaAdapter_0;
- }
- return MessageFormat.format(Messages.XSDSchemaAdapter_1,
- new Object[] { tns } );
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.XSDTypeDefinitionAdapter_XSD_Type_1;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import java.text.MessageFormat;
+
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class XSDSchemaAdapter extends XSDAbstractAdapter {
+
+
+ @Override
+ public String getLabel(Object obj) {
+ XSDSchema schema = (XSDSchema) obj;
+ String tns = schema.getTargetNamespace();
+
+ if (tns == null) {
+ return Messages.XSDSchemaAdapter_0;
+ }
+ return MessageFormat.format(Messages.XSDSchemaAdapter_1,
+ new Object[] { tns } );
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.XSDTypeDefinitionAdapter_XSD_Type_1;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSimpleTypeDefinitionAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSimpleTypeDefinitionAdapter.java
index b025c4f..0d8d6cf 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSimpleTypeDefinitionAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDSimpleTypeDefinitionAdapter.java
@@ -1,26 +1,26 @@
-/**
- *
- */
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mchmiele
- *
- */
-public class XSDSimpleTypeDefinitionAdapter extends XSDAbstractAdapter {
-
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_XSD_SIMPLE_TYPE_DEFINITION_16);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.XSDSimpleTypeDefinitionAdapter_0;
- }
-}
+/**
+ *
+ */
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author mchmiele
+ *
+ */
+public class XSDSimpleTypeDefinitionAdapter extends XSDAbstractAdapter {
+
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_XSD_SIMPLE_TYPE_DEFINITION_16);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.XSDSimpleTypeDefinitionAdapter_0;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDTypeDefinitionAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDTypeDefinitionAdapter.java
index e9f76b1..6b9001f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDTypeDefinitionAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/XSDTypeDefinitionAdapter.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.adapters;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class XSDTypeDefinitionAdapter extends XSDAbstractAdapter {
-
- /* ILabeledElement overrides */
-
- @Override
- public Image getSmallImage(Object object) {
- return Activator.getDefault().getImage(IConstants.ICON_XSD_SIMPLE_TYPE_DEFINITION_16);
- }
-
- @Override
- public String getTypeLabel(Object object) {
- return Messages.XSDTypeDefinitionAdapter_XSD_Type_1;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.adapters;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.swt.graphics.Image;
+
+
+public class XSDTypeDefinitionAdapter extends XSDAbstractAdapter {
+
+ /* ILabeledElement overrides */
+
+ @Override
+ public Image getSmallImage(Object object) {
+ return Activator.getDefault().getImage(IConstants.ICON_XSD_SIMPLE_TYPE_DEFINITION_16);
+ }
+
+ @Override
+ public String getTypeLabel(Object object) {
+ return Messages.XSDTypeDefinitionAdapter_XSD_Type_1;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ActivityPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ActivityPropertiesAdapter.java
index 2075f13..02f291a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ActivityPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ActivityPropertiesAdapter.java
@@ -1,37 +1,37 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ActivityPropertiesAdapter<T extends Activity> extends ExtendedPropertiesAdapter<T> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ActivityPropertiesAdapter(AdapterFactory adapterFactory, T object) {
- super(adapterFactory, object);
- setProperty(Bpmn2Package.eINSTANCE.getActivity_LoopCharacteristics(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getActivity_LoopCharacteristics(), UI_CAN_EDIT, Boolean.FALSE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ActivityPropertiesAdapter<T extends Activity> extends ExtendedPropertiesAdapter<T> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ActivityPropertiesAdapter(AdapterFactory adapterFactory, T object) {
+ super(adapterFactory, object);
+ setProperty(Bpmn2Package.eINSTANCE.getActivity_LoopCharacteristics(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getActivity_LoopCharacteristics(), UI_CAN_EDIT, Boolean.FALSE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallActivityPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallActivityPropertiesAdapter.java
index 044031d..6cf48c8 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallActivityPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallActivityPropertiesAdapter.java
@@ -1,65 +1,65 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CallActivity;
-import org.eclipse.bpmn2.CallableElement;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CallActivityPropertiesAdapter extends ActivityPropertiesAdapter<CallActivity> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CallActivityPropertiesAdapter(AdapterFactory adapterFactory, CallActivity object) {
- super(adapterFactory, object);
-
- EStructuralFeature ce = Bpmn2Package.eINSTANCE.getCallActivity_CalledElementRef();
- setProperty(ce, UI_CAN_CREATE_NEW, Boolean.TRUE);
- setFeatureDescriptor(ce,
- new RootElementRefFeatureDescriptor<CallActivity>(adapterFactory,object,ce) {
- @Override
- public String getLabel(Object context) {
- return "Called Activity";
- }
-
- @Override
- public String getDisplayName(Object context) {
- CallActivity object = adopt(context);
- CallableElement ce = object.getCalledElementRef();
- if (ce!=null && ce.eIsProxy()) {
- URI uri = ((InternalEObject)ce).eProxyURI();
- if (uri.hasFragment())
- return uri.fragment();
- return uri.lastSegment();
- }
- return super.getDisplayName(context);
- }
- }
- );
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CallActivity;
+import org.eclipse.bpmn2.CallableElement;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CallActivityPropertiesAdapter extends ActivityPropertiesAdapter<CallActivity> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CallActivityPropertiesAdapter(AdapterFactory adapterFactory, CallActivity object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature ce = Bpmn2Package.eINSTANCE.getCallActivity_CalledElementRef();
+ setProperty(ce, UI_CAN_CREATE_NEW, Boolean.TRUE);
+ setFeatureDescriptor(ce,
+ new RootElementRefFeatureDescriptor<CallActivity>(adapterFactory,object,ce) {
+ @Override
+ public String getLabel(Object context) {
+ return "Called Activity";
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ CallActivity object = adopt(context);
+ CallableElement ce = object.getCalledElementRef();
+ if (ce!=null && ce.eIsProxy()) {
+ URI uri = ((InternalEObject)ce).eProxyURI();
+ if (uri.hasFragment())
+ return uri.fragment();
+ return uri.lastSegment();
+ }
+ return super.getDisplayName(context);
+ }
+ }
+ );
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallChoreographyPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallChoreographyPropertiesAdapter.java
index 908c5f4..f9aebf2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallChoreographyPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallChoreographyPropertiesAdapter.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CallChoreography;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CallChoreographyPropertiesAdapter extends ExtendedPropertiesAdapter<CallChoreography> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CallChoreographyPropertiesAdapter(AdapterFactory adapterFactory, CallChoreography object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCallChoreography_CalledChoreographyRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CallChoreography>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CallChoreography;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CallChoreographyPropertiesAdapter extends ExtendedPropertiesAdapter<CallChoreography> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CallChoreographyPropertiesAdapter(AdapterFactory adapterFactory, CallChoreography object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCallChoreography_CalledChoreographyRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CallChoreography>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallConversationPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallConversationPropertiesAdapter.java
index 11175c3..d5b601b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallConversationPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CallConversationPropertiesAdapter.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CallConversation;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CallConversationPropertiesAdapter extends ExtendedPropertiesAdapter<CallConversation> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CallConversationPropertiesAdapter(AdapterFactory adapterFactory, CallConversation object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCallConversation_CalledCollaborationRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CallConversation>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CallConversation;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CallConversationPropertiesAdapter extends ExtendedPropertiesAdapter<CallConversation> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CallConversationPropertiesAdapter(AdapterFactory adapterFactory, CallConversation object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCallConversation_CalledCollaborationRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CallConversation>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CompensateEventDefinitionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CompensateEventDefinitionPropertiesAdapter.java
index 88b09fd..c66327b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CompensateEventDefinitionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CompensateEventDefinitionPropertiesAdapter.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CompensateEventDefinition;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CompensateEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<CompensateEventDefinition> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CompensateEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, CompensateEventDefinition object) {
- super(adapterFactory, object);
- setProperty(Bpmn2Package.eINSTANCE.getCompensateEventDefinition_ActivityRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getCompensateEventDefinition_ActivityRef(), UI_CAN_EDIT, Boolean.FALSE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CompensateEventDefinition;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CompensateEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<CompensateEventDefinition> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CompensateEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, CompensateEventDefinition object) {
+ super(adapterFactory, object);
+ setProperty(Bpmn2Package.eINSTANCE.getCompensateEventDefinition_ActivityRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getCompensateEventDefinition_ActivityRef(), UI_CAN_EDIT, Boolean.FALSE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationKeyPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationKeyPropertiesAdapter.java
index 3b91ffb..ed3d7c3 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationKeyPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationKeyPropertiesAdapter.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CorrelationKey;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CorrelationKeyPropertiesAdapter extends ExtendedPropertiesAdapter<CorrelationKey> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CorrelationKeyPropertiesAdapter(AdapterFactory adapterFactory, CorrelationKey object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCorrelationKey_CorrelationPropertyRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CorrelationKey>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CorrelationKey;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CorrelationKeyPropertiesAdapter extends ExtendedPropertiesAdapter<CorrelationKey> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CorrelationKeyPropertiesAdapter(AdapterFactory adapterFactory, CorrelationKey object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCorrelationKey_CorrelationPropertyRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CorrelationKey>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyBindingPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyBindingPropertiesAdapter.java
index f7e4f3f..519a0af 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyBindingPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyBindingPropertiesAdapter.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CorrelationPropertyBinding;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CorrelationPropertyBindingPropertiesAdapter extends ExtendedPropertiesAdapter<CorrelationPropertyBinding> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CorrelationPropertyBindingPropertiesAdapter(AdapterFactory adapterFactory, CorrelationPropertyBinding object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCorrelationPropertyBinding_CorrelationPropertyRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CorrelationPropertyBinding>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CorrelationPropertyBinding;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CorrelationPropertyBindingPropertiesAdapter extends ExtendedPropertiesAdapter<CorrelationPropertyBinding> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CorrelationPropertyBindingPropertiesAdapter(AdapterFactory adapterFactory, CorrelationPropertyBinding object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCorrelationPropertyBinding_CorrelationPropertyRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CorrelationPropertyBinding>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyRetrievalExpressionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyRetrievalExpressionPropertiesAdapter.java
index d6e2d36..474c91d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyRetrievalExpressionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/CorrelationPropertyRetrievalExpressionPropertiesAdapter.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CorrelationPropertyRetrievalExpressionPropertiesAdapter extends ExtendedPropertiesAdapter<CorrelationPropertyRetrievalExpression> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public CorrelationPropertyRetrievalExpressionPropertiesAdapter(AdapterFactory adapterFactory, CorrelationPropertyRetrievalExpression object) {
- super(adapterFactory, object);
-
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCorrelationPropertyRetrievalExpression_MessageRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CorrelationPropertyRetrievalExpression>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CorrelationPropertyRetrievalExpressionPropertiesAdapter extends ExtendedPropertiesAdapter<CorrelationPropertyRetrievalExpression> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public CorrelationPropertyRetrievalExpressionPropertiesAdapter(AdapterFactory adapterFactory, CorrelationPropertyRetrievalExpression object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCorrelationPropertyRetrievalExpression_MessageRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<CorrelationPropertyRetrievalExpression>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java
index 2ab0b39..06729be 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java
@@ -1,93 +1,93 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataInputPropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataInput> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public DataInputPropertiesAdapter(AdapterFactory adapterFactory, DataInput object) {
- super(adapterFactory, object);
- EStructuralFeature f = Bpmn2Package.eINSTANCE.getDataInput_Name();
- final FeatureDescriptor<DataInput> fd = new FeatureDescriptor<DataInput>(adapterFactory,object, f) {
-
- @Override
- public void setDisplayName(String text) {
- int i = text.lastIndexOf("/");
- if (i>=0)
- text = text.substring(i+1);
- text = text.trim();
- ((DataInput)object).setName(text);
- }
-
- @Override
- public String getChoiceString(Object context) {
- DataInput dataInput = adopt(context);
- String text = dataInput.getName();
- if (text==null || text.isEmpty())
- text = dataInput.getId();
-
- EObject container = dataInput.eContainer();
- while (container!=null) {
- if (container instanceof Participant) {
- container = ((Participant)container).getProcessRef();
- if (container==null)
- break;
- }
- if (container instanceof Activity || container instanceof Process) {
- text = ModelUtil.getDisplayName(container) + "/" + text;
- }
- container = container.eContainer();
- }
- return text;
- }
-
- };
- setFeatureDescriptor(f, fd);
-
- setObjectDescriptor(new ObjectDescriptor<DataInput>(adapterFactory, object) {
-
- @Override
- public void setDisplayName(String text) {
- fd.setDisplayName(text);
- ModelUtil.setID(object);
- }
-
- @Override
- public String getDisplayName(Object context) {
- return fd.getChoiceString(context);
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataInputPropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataInput> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public DataInputPropertiesAdapter(AdapterFactory adapterFactory, DataInput object) {
+ super(adapterFactory, object);
+ EStructuralFeature f = Bpmn2Package.eINSTANCE.getDataInput_Name();
+ final FeatureDescriptor<DataInput> fd = new FeatureDescriptor<DataInput>(adapterFactory,object, f) {
+
+ @Override
+ public void setDisplayName(String text) {
+ int i = text.lastIndexOf("/");
+ if (i>=0)
+ text = text.substring(i+1);
+ text = text.trim();
+ ((DataInput)object).setName(text);
+ }
+
+ @Override
+ public String getChoiceString(Object context) {
+ DataInput dataInput = adopt(context);
+ String text = dataInput.getName();
+ if (text==null || text.isEmpty())
+ text = dataInput.getId();
+
+ EObject container = dataInput.eContainer();
+ while (container!=null) {
+ if (container instanceof Participant) {
+ container = ((Participant)container).getProcessRef();
+ if (container==null)
+ break;
+ }
+ if (container instanceof Activity || container instanceof Process) {
+ text = ModelUtil.getDisplayName(container) + "/" + text;
+ }
+ container = container.eContainer();
+ }
+ return text;
+ }
+
+ };
+ setFeatureDescriptor(f, fd);
+
+ setObjectDescriptor(new ObjectDescriptor<DataInput>(adapterFactory, object) {
+
+ @Override
+ public void setDisplayName(String text) {
+ fd.setDisplayName(text);
+ ModelUtil.setID(object);
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ return fd.getChoiceString(context);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataObjectReferencePropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataObjectReferencePropertiesAdapter.java
index 7a6fd78..ad175e2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataObjectReferencePropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataObjectReferencePropertiesAdapter.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataObjectReferencePropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataObjectReference> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public DataObjectReferencePropertiesAdapter(AdapterFactory adapterFactory, DataObjectReference object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getDataStoreReference_DataStoreRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<DataObjectReference>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataObjectReferencePropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataObjectReference> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public DataObjectReferencePropertiesAdapter(AdapterFactory adapterFactory, DataObjectReference object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getDataStoreReference_DataStoreRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<DataObjectReference>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java
index 77b4c35..9e98b64 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java
@@ -1,93 +1,93 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataOutputPropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataOutput> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public DataOutputPropertiesAdapter(AdapterFactory adapterFactory, DataOutput object) {
- super(adapterFactory, object);
- EStructuralFeature f = Bpmn2Package.eINSTANCE.getDataOutput_Name();
- final FeatureDescriptor<DataOutput> fd = new FeatureDescriptor<DataOutput>(adapterFactory,object, f) {
-
- @Override
- public void setDisplayName(String text) {
- int i = text.lastIndexOf("/");
- if (i>=0)
- text = text.substring(i+1);
- text = text.trim();
- ((DataOutput)object).setName(text);
- }
-
- @Override
- public String getChoiceString(Object context) {
- DataOutput dataOutput = adopt(context);
- String text = dataOutput.getName();
- if (text==null || text.isEmpty())
- text = dataOutput.getId();
-
- EObject container = dataOutput.eContainer();
- while (container!=null) {
- if (container instanceof Participant) {
- container = ((Participant)container).getProcessRef();
- if (container==null)
- break;
- }
- if (container instanceof Activity || container instanceof Process) {
- text = ModelUtil.getDisplayName(container) + "/" + text;
- }
- container = container.eContainer();
- }
- return text;
- }
-
- };
- setFeatureDescriptor(f, fd);
-
- setObjectDescriptor(new ObjectDescriptor<DataOutput>(adapterFactory, object) {
-
- @Override
- public void setDisplayName(String text) {
- fd.setDisplayName(text);
- ModelUtil.setID(object);
- }
-
- @Override
- public String getDisplayName(Object context) {
- return fd.getDisplayName(context);
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataOutputPropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataOutput> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public DataOutputPropertiesAdapter(AdapterFactory adapterFactory, DataOutput object) {
+ super(adapterFactory, object);
+ EStructuralFeature f = Bpmn2Package.eINSTANCE.getDataOutput_Name();
+ final FeatureDescriptor<DataOutput> fd = new FeatureDescriptor<DataOutput>(adapterFactory,object, f) {
+
+ @Override
+ public void setDisplayName(String text) {
+ int i = text.lastIndexOf("/");
+ if (i>=0)
+ text = text.substring(i+1);
+ text = text.trim();
+ ((DataOutput)object).setName(text);
+ }
+
+ @Override
+ public String getChoiceString(Object context) {
+ DataOutput dataOutput = adopt(context);
+ String text = dataOutput.getName();
+ if (text==null || text.isEmpty())
+ text = dataOutput.getId();
+
+ EObject container = dataOutput.eContainer();
+ while (container!=null) {
+ if (container instanceof Participant) {
+ container = ((Participant)container).getProcessRef();
+ if (container==null)
+ break;
+ }
+ if (container instanceof Activity || container instanceof Process) {
+ text = ModelUtil.getDisplayName(container) + "/" + text;
+ }
+ container = container.eContainer();
+ }
+ return text;
+ }
+
+ };
+ setFeatureDescriptor(f, fd);
+
+ setObjectDescriptor(new ObjectDescriptor<DataOutput>(adapterFactory, object) {
+
+ @Override
+ public void setDisplayName(String text) {
+ fd.setDisplayName(text);
+ ModelUtil.setID(object);
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ return fd.getDisplayName(context);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataStoreReferencePropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataStoreReferencePropertiesAdapter.java
index 0c95061..49be203 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataStoreReferencePropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataStoreReferencePropertiesAdapter.java
@@ -1,38 +1,38 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataStoreReference;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataStoreReferencePropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataStoreReference> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public DataStoreReferencePropertiesAdapter(AdapterFactory adapterFactory, DataStoreReference object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getDataStoreReference_DataStoreRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<DataStoreReference>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataStoreReference;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataStoreReferencePropertiesAdapter extends ItemAwareElementPropertiesAdapter<DataStoreReference> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public DataStoreReferencePropertiesAdapter(AdapterFactory adapterFactory, DataStoreReference object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getDataStoreReference_DataStoreRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<DataStoreReference>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorEventDefinitionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorEventDefinitionPropertiesAdapter.java
index 4b21a26..5db19c4 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorEventDefinitionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorEventDefinitionPropertiesAdapter.java
@@ -1,37 +1,37 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ErrorEventDefinition;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ErrorEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<ErrorEventDefinition> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ErrorEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, ErrorEventDefinition object) {
- super(adapterFactory, object);
-
- setProperty(Bpmn2Package.eINSTANCE.getErrorEventDefinition_ErrorRef(), UI_CAN_CREATE_NEW, Boolean.TRUE);
- setProperty(Bpmn2Package.eINSTANCE.getErrorEventDefinition_ErrorRef(), UI_CAN_EDIT, Boolean.TRUE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ErrorEventDefinition;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ErrorEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<ErrorEventDefinition> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ErrorEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, ErrorEventDefinition object) {
+ super(adapterFactory, object);
+
+ setProperty(Bpmn2Package.eINSTANCE.getErrorEventDefinition_ErrorRef(), UI_CAN_CREATE_NEW, Boolean.TRUE);
+ setProperty(Bpmn2Package.eINSTANCE.getErrorEventDefinition_ErrorRef(), UI_CAN_EDIT, Boolean.TRUE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorPropertiesAdapter.java
index 73c07af..fa03ffe 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ErrorPropertiesAdapter.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Error;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ErrorPropertiesAdapter extends RootElementPropertiesAdapter<Error> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ErrorPropertiesAdapter(AdapterFactory adapterFactory, Error object) {
- super(adapterFactory, object);
-
- setObjectDescriptor(new RootElementObjectDescriptor<Error>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- final Error error = adopt(context);
- String text = "";
- if (error.getName()!=null) {
- text += error.getName();
- }
- else if (error.getErrorCode()!=null) {
- text += "Error Code: " + error.getErrorCode();
- }
- if (text.isEmpty())
- text = "ID: " + error.getId();
- return text;
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Error;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ErrorPropertiesAdapter extends RootElementPropertiesAdapter<Error> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ErrorPropertiesAdapter(AdapterFactory adapterFactory, Error object) {
+ super(adapterFactory, object);
+
+ setObjectDescriptor(new RootElementObjectDescriptor<Error>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ final Error error = adopt(context);
+ String text = "";
+ if (error.getName()!=null) {
+ text += error.getName();
+ }
+ else if (error.getErrorCode()!=null) {
+ text += "Error Code: " + error.getErrorCode();
+ }
+ if (text.isEmpty())
+ text = "ID: " + error.getId();
+ return text;
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationEventDefinitionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationEventDefinitionPropertiesAdapter.java
index 7187365..9115687 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationEventDefinitionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationEventDefinitionPropertiesAdapter.java
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EscalationEventDefinition;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class EscalationEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<EscalationEventDefinition> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public EscalationEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, EscalationEventDefinition object) {
- super(adapterFactory, object);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EscalationEventDefinition;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class EscalationEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<EscalationEventDefinition> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public EscalationEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, EscalationEventDefinition object) {
+ super(adapterFactory, object);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationPropertiesAdapter.java
index 6471b5e..8a6becd 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/EscalationPropertiesAdapter.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Error;
-import org.eclipse.bpmn2.Escalation;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.resource.Resource;
-
-/**
- * @author Bob Brodt
- *
- */
-public class EscalationPropertiesAdapter extends RootElementPropertiesAdapter<Escalation> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public EscalationPropertiesAdapter(AdapterFactory adapterFactory, Escalation object) {
- super(adapterFactory, object);
-
- setObjectDescriptor(new RootElementObjectDescriptor<Escalation>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- final Escalation escalation = adopt(context);
- String text = "";
- if (escalation.getName()!=null) {
- text += escalation.getName();
- }
- else if (escalation.getEscalationCode()!=null) {
- text += "Escalation Code: " + escalation.getEscalationCode();
- }
- if (text.isEmpty())
- text = "ID: " + escalation.getId();
- return text;
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Error;
+import org.eclipse.bpmn2.Escalation;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class EscalationPropertiesAdapter extends RootElementPropertiesAdapter<Escalation> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public EscalationPropertiesAdapter(AdapterFactory adapterFactory, Escalation object) {
+ super(adapterFactory, object);
+
+ setObjectDescriptor(new RootElementObjectDescriptor<Escalation>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ final Escalation escalation = adopt(context);
+ String text = "";
+ if (escalation.getName()!=null) {
+ text += escalation.getName();
+ }
+ else if (escalation.getEscalationCode()!=null) {
+ text += "Escalation Code: " + escalation.getEscalationCode();
+ }
+ if (text.isEmpty())
+ text = "ID: " + escalation.getId();
+ return text;
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FlowElementPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FlowElementPropertiesAdapter.java
index 31902b7..2ed7d5a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FlowElementPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FlowElementPropertiesAdapter.java
@@ -1,95 +1,95 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- * TODO: This was intended for elements that are both FlowElements and ItemAwareElements like
- * DataObject, DataObjectReference and DataStoreReference but alas, multiple inheritance ain't
- * happening in java. need to figure this out...
- */
-public class FlowElementPropertiesAdapter<T extends FlowElement> extends ExtendedPropertiesAdapter<T> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public FlowElementPropertiesAdapter(AdapterFactory adapterFactory, T object) {
- super(adapterFactory, object);
- EStructuralFeature f = Bpmn2Package.eINSTANCE.getFlowElement_Name();
- final FeatureDescriptor<T> fd = new FeatureDescriptor<T>(adapterFactory,object, f) {
-
- @Override
- public void setDisplayName(String text) {
- int i = text.lastIndexOf("/");
- if (i>=0)
- text = text.substring(i+1);
- text = text.trim();
- ((T)object).setName(text);
- }
-
- @Override
- public String getChoiceString(Object context) {
- T flowElement = adopt(context);
- String text = flowElement.getName();
- if (text==null || text.isEmpty())
- text = flowElement.getId();
-
- EObject container = flowElement.eContainer();
- while (container!=null) {
- if (container instanceof Participant) {
- container = ((Participant)container).getProcessRef();
- if (container==null)
- break;
- }
- if (container instanceof Activity || container instanceof Process) {
- text = ModelUtil.getDisplayName(container) + "/" + text;
- }
- container = container.eContainer();
- }
- return text;
- }
-
- };
- setFeatureDescriptor(f, fd);
-
- setObjectDescriptor(new ObjectDescriptor<T>(adapterFactory, object) {
-
- @Override
- public void setDisplayName(String text) {
- fd.setDisplayName(text);
- ModelUtil.setID(object);
- }
-
- @Override
- public String getDisplayName(Object context) {
- return fd.getDisplayName(context);
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ * TODO: This was intended for elements that are both FlowElements and ItemAwareElements like
+ * DataObject, DataObjectReference and DataStoreReference but alas, multiple inheritance ain't
+ * happening in java. need to figure this out...
+ */
+public class FlowElementPropertiesAdapter<T extends FlowElement> extends ExtendedPropertiesAdapter<T> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public FlowElementPropertiesAdapter(AdapterFactory adapterFactory, T object) {
+ super(adapterFactory, object);
+ EStructuralFeature f = Bpmn2Package.eINSTANCE.getFlowElement_Name();
+ final FeatureDescriptor<T> fd = new FeatureDescriptor<T>(adapterFactory,object, f) {
+
+ @Override
+ public void setDisplayName(String text) {
+ int i = text.lastIndexOf("/");
+ if (i>=0)
+ text = text.substring(i+1);
+ text = text.trim();
+ ((T)object).setName(text);
+ }
+
+ @Override
+ public String getChoiceString(Object context) {
+ T flowElement = adopt(context);
+ String text = flowElement.getName();
+ if (text==null || text.isEmpty())
+ text = flowElement.getId();
+
+ EObject container = flowElement.eContainer();
+ while (container!=null) {
+ if (container instanceof Participant) {
+ container = ((Participant)container).getProcessRef();
+ if (container==null)
+ break;
+ }
+ if (container instanceof Activity || container instanceof Process) {
+ text = ModelUtil.getDisplayName(container) + "/" + text;
+ }
+ container = container.eContainer();
+ }
+ return text;
+ }
+
+ };
+ setFeatureDescriptor(f, fd);
+
+ setObjectDescriptor(new ObjectDescriptor<T>(adapterFactory, object) {
+
+ @Override
+ public void setDisplayName(String text) {
+ fd.setDisplayName(text);
+ ModelUtil.setID(object);
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ return fd.getDisplayName(context);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java
index 2c3cc67..d25baec 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.FormalExpression;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class FormalExpressionPropertiesAdapter extends ExtendedPropertiesAdapter<FormalExpression> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public FormalExpressionPropertiesAdapter(AdapterFactory adapterFactory, FormalExpression object) {
- super(adapterFactory, object);
-
- final EStructuralFeature body = Bpmn2Package.eINSTANCE.getFormalExpression_Body();
- setFeatureDescriptor(body,
- new FeatureDescriptor<FormalExpression>(adapterFactory,object,body) {
-
- @Override
- public String getDisplayName(Object context) {
- FormalExpression expression = adopt(context);
- if (expression.getBody()==null)
- return "";
- return expression.getBody();
- }
-
- @Override
- public String getLabel(Object context) {
- FormalExpression expression = adopt(context);
- if (expression.eContainer() instanceof SequenceFlow)
- return "Constraint";
- return super.getLabel(context);
- }
-
- @Override
- public boolean isMultiLine(Object context) {
- // formal expression body is always a multiline text field
- return true;
- }
- }
- );
- setObjectDescriptor(new ObjectDescriptor<FormalExpression>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- return getFeatureDescriptor(body).getDisplayName(context);
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.FormalExpression;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class FormalExpressionPropertiesAdapter extends ExtendedPropertiesAdapter<FormalExpression> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public FormalExpressionPropertiesAdapter(AdapterFactory adapterFactory, FormalExpression object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature body = Bpmn2Package.eINSTANCE.getFormalExpression_Body();
+ setFeatureDescriptor(body,
+ new FeatureDescriptor<FormalExpression>(adapterFactory,object,body) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ FormalExpression expression = adopt(context);
+ if (expression.getBody()==null)
+ return "";
+ return expression.getBody();
+ }
+
+ @Override
+ public String getLabel(Object context) {
+ FormalExpression expression = adopt(context);
+ if (expression.eContainer() instanceof SequenceFlow)
+ return "Constraint";
+ return super.getLabel(context);
+ }
+
+ @Override
+ public boolean isMultiLine(Object context) {
+ // formal expression body is always a multiline text field
+ return true;
+ }
+ }
+ );
+ setObjectDescriptor(new ObjectDescriptor<FormalExpression>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ return getFeatureDescriptor(body).getDisplayName(context);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ImportPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ImportPropertiesAdapter.java
index b5e782e..000f0fe 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ImportPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ImportPropertiesAdapter.java
@@ -1,27 +1,27 @@
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Import;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-public class ImportPropertiesAdapter extends ExtendedPropertiesAdapter<Import> {
-
- public ImportPropertiesAdapter(AdapterFactory adapterFactory, Import object) {
- super(adapterFactory, object);
-
- setObjectDescriptor(new ObjectDescriptor<Import>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- Import imp = adopt(context);
- return imp.getLocation();
- }
-
- @Override
- public String getLabel(Object context) {
- return "Import";
- }
- });
- }
-
-}
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Import;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+public class ImportPropertiesAdapter extends ExtendedPropertiesAdapter<Import> {
+
+ public ImportPropertiesAdapter(AdapterFactory adapterFactory, Import object) {
+ super(adapterFactory, object);
+
+ setObjectDescriptor(new ObjectDescriptor<Import>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ Import imp = adopt(context);
+ return imp.getLocation();
+ }
+
+ @Override
+ public String getLabel(Object context) {
+ return "Import";
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementFeatureDescriptor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementFeatureDescriptor.java
index e50a385..99fa72f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementFeatureDescriptor.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementFeatureDescriptor.java
@@ -1,41 +1,41 @@
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ItemAwareElement;
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-public class ItemAwareElementFeatureDescriptor<T extends ItemAwareElement> extends RootElementRefFeatureDescriptor<T> {
- public ItemAwareElementFeatureDescriptor(AdapterFactory adapterFactory, T object,EStructuralFeature feature) {
- super(adapterFactory, object, feature);
- }
-
- @Override
- public String getLabel(Object context) {
- return "Data Type";
- }
-
- @Override
- public String getDisplayName(Object context) {
- EObject object = this.object;
- if (context instanceof EObject)
- object = (EObject)context;
- ItemDefinition itemDefinition = null;
- if (object instanceof ItemDefinition)
- itemDefinition = (ItemDefinition) object;
- else if (object instanceof ItemAwareElement)
- itemDefinition = (ItemDefinition) object.eGet(feature);
- if (itemDefinition!=null) {
- ExtendedPropertiesAdapter<ItemDefinition> adapter =
- (ExtendedPropertiesAdapter<ItemDefinition>) AdapterUtil.adapt(itemDefinition, ExtendedPropertiesAdapter.class);
- return adapter.getFeatureDescriptor(Bpmn2Package.eINSTANCE.getItemDefinition_StructureRef()).getDisplayName(itemDefinition);
- }
- return super.getDisplayName(context);
- }
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ItemAwareElement;
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+public class ItemAwareElementFeatureDescriptor<T extends ItemAwareElement> extends RootElementRefFeatureDescriptor<T> {
+ public ItemAwareElementFeatureDescriptor(AdapterFactory adapterFactory, T object,EStructuralFeature feature) {
+ super(adapterFactory, object, feature);
+ }
+
+ @Override
+ public String getLabel(Object context) {
+ return "Data Type";
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ EObject object = this.object;
+ if (context instanceof EObject)
+ object = (EObject)context;
+ ItemDefinition itemDefinition = null;
+ if (object instanceof ItemDefinition)
+ itemDefinition = (ItemDefinition) object;
+ else if (object instanceof ItemAwareElement)
+ itemDefinition = (ItemDefinition) object.eGet(feature);
+ if (itemDefinition!=null) {
+ ExtendedPropertiesAdapter<ItemDefinition> adapter =
+ (ExtendedPropertiesAdapter<ItemDefinition>) AdapterUtil.adapt(itemDefinition, ExtendedPropertiesAdapter.class);
+ return adapter.getFeatureDescriptor(Bpmn2Package.eINSTANCE.getItemDefinition_StructureRef()).getDisplayName(itemDefinition);
+ }
+ return super.getDisplayName(context);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementPropertiesAdapter.java
index a1d8f6a..60397c2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ItemAwareElementPropertiesAdapter.java
@@ -1,111 +1,111 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataState;
-import org.eclipse.bpmn2.ItemAwareElement;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ItemAwareElementPropertiesAdapter<T extends ItemAwareElement> extends ExtendedPropertiesAdapter<T> {
-
- /**
- * @param adapterFactory
- * @param target
- */
- public ItemAwareElementPropertiesAdapter(AdapterFactory adapterFactory, T object) {
- super(adapterFactory, object);
-
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef();
-
- setFeatureDescriptor(ref,
- new ItemAwareElementFeatureDescriptor<T>(adapterFactory, object, ref)
- );
-
- ref = Bpmn2Package.eINSTANCE.getItemAwareElement_DataState();
- setFeatureDescriptor(ref,
- new FeatureDescriptor<T>(adapterFactory,object,ref) {
- @Override
- public void setValue(Object context, Object value) {
- final ItemAwareElement element = adopt(context);
- if (value instanceof String) {
- // construct a DataState from the given name string
- DataState ds = Bpmn2ModelerFactory.create(DataState.class);
- ds.setName((String)value);
- value = ds;
- }
- if (value instanceof DataState) {
- final DataState oldValue = (DataState) element.eGet(feature);
- if (value != oldValue) {
- // if this DataState belongs to some other ItemAwareElement, make a copy
- final DataState newValue = (DataState)(((DataState)value).eContainer()!=null ?
- EcoreUtil.copy((DataState) value) : value);
- TransactionalEditingDomain editingDomain = getEditingDomain(element);
- if (editingDomain == null) {
- element.eSet(feature, value);
- } else {
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- element.eSet(feature, newValue);
- newValue.setId(null);
- ModelUtil.setID(newValue);
- }
- });
- }
- }
- }
- }
-
- @Override
- public Hashtable<String, Object> getChoiceOfValues(Object context) {
- Hashtable<String,Object> choices = new Hashtable<String,Object>();
- try {
- List<DataState> states = ModelHandler.getInstance(this.object).getAll(DataState.class);
- for (DataState s : states) {
- String label = s.getName();
- if (label==null || label.isEmpty())
- label = "ID: " + s.getId();
-// else
-// label += " (ID: " + s.getId() + ")";
- choices.put(label,s);
- }
- } catch (IOException e) {
- }
- return choices;
- }
- }
- );
-
- setProperty(Bpmn2Package.eINSTANCE.getItemAwareElement_DataState(), UI_IS_MULTI_CHOICE, Boolean.TRUE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataState;
+import org.eclipse.bpmn2.ItemAwareElement;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ItemAwareElementPropertiesAdapter<T extends ItemAwareElement> extends ExtendedPropertiesAdapter<T> {
+
+ /**
+ * @param adapterFactory
+ * @param target
+ */
+ public ItemAwareElementPropertiesAdapter(AdapterFactory adapterFactory, T object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getItemAwareElement_ItemSubjectRef();
+
+ setFeatureDescriptor(ref,
+ new ItemAwareElementFeatureDescriptor<T>(adapterFactory, object, ref)
+ );
+
+ ref = Bpmn2Package.eINSTANCE.getItemAwareElement_DataState();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<T>(adapterFactory,object,ref) {
+ @Override
+ public void setValue(Object context, Object value) {
+ final ItemAwareElement element = adopt(context);
+ if (value instanceof String) {
+ // construct a DataState from the given name string
+ DataState ds = Bpmn2ModelerFactory.create(DataState.class);
+ ds.setName((String)value);
+ value = ds;
+ }
+ if (value instanceof DataState) {
+ final DataState oldValue = (DataState) element.eGet(feature);
+ if (value != oldValue) {
+ // if this DataState belongs to some other ItemAwareElement, make a copy
+ final DataState newValue = (DataState)(((DataState)value).eContainer()!=null ?
+ EcoreUtil.copy((DataState) value) : value);
+ TransactionalEditingDomain editingDomain = getEditingDomain(element);
+ if (editingDomain == null) {
+ element.eSet(feature, value);
+ } else {
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ element.eSet(feature, newValue);
+ newValue.setId(null);
+ ModelUtil.setID(newValue);
+ }
+ });
+ }
+ }
+ }
+ }
+
+ @Override
+ public Hashtable<String, Object> getChoiceOfValues(Object context) {
+ Hashtable<String,Object> choices = new Hashtable<String,Object>();
+ try {
+ List<DataState> states = ModelHandler.getInstance(this.object).getAll(DataState.class);
+ for (DataState s : states) {
+ String label = s.getName();
+ if (label==null || label.isEmpty())
+ label = "ID: " + s.getId();
+// else
+// label += " (ID: " + s.getId() + ")";
+ choices.put(label,s);
+ }
+ } catch (IOException e) {
+ }
+ return choices;
+ }
+ }
+ );
+
+ setProperty(Bpmn2Package.eINSTANCE.getItemAwareElement_DataState(), UI_IS_MULTI_CHOICE, Boolean.TRUE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/LinkEventDefinitionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/LinkEventDefinitionPropertiesAdapter.java
index 2028b46..9d05873 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/LinkEventDefinitionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/LinkEventDefinitionPropertiesAdapter.java
@@ -1,85 +1,85 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.LinkEventDefinition;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class LinkEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<LinkEventDefinition> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public LinkEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, LinkEventDefinition object) {
- super(adapterFactory, object);
-
- setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Source(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Source(), UI_CAN_EDIT, Boolean.TRUE);
- setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Target(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Target(), UI_CAN_EDIT, Boolean.FALSE);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getLinkEventDefinition_Target();
- setFeatureDescriptor(ref,
- new FeatureDescriptor<LinkEventDefinition>(adapterFactory,object,ref) {
-
- @Override
- public String getDisplayName(Object context) {
- final LinkEventDefinition led = adopt(context);
- String name = led.getName();
- if (name==null || name.isEmpty())
- name = led.getId();
- return name;
- }
-
- @Override
- public Hashtable<String, Object> getChoiceOfValues(Object context) {
- LinkEventDefinition object = adopt(context);
- // add all ItemDefinitions
- Hashtable<String,Object> choices = new Hashtable<String,Object>();
- String s;
- Definitions defs = ModelUtil.getDefinitions(object);
- List<LinkEventDefinition> links = (List)ModelUtil.getAllReachableObjects(defs, Bpmn2Package.eINSTANCE.getLinkEventDefinition());
- for (LinkEventDefinition link : links) {
- if (link!=object) {
- s = getDisplayName(link);
- choices.put(s,link);
- }
- }
- return choices;
- }
-
- @Override
- public String getChoiceString(Object value) {
- return super.getChoiceString(value);
- }
-
- }
- );
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import java.util.Hashtable;
+import java.util.List;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.LinkEventDefinition;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class LinkEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<LinkEventDefinition> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public LinkEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, LinkEventDefinition object) {
+ super(adapterFactory, object);
+
+ setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Source(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Source(), UI_CAN_EDIT, Boolean.TRUE);
+ setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Target(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getLinkEventDefinition_Target(), UI_CAN_EDIT, Boolean.FALSE);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getLinkEventDefinition_Target();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<LinkEventDefinition>(adapterFactory,object,ref) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ final LinkEventDefinition led = adopt(context);
+ String name = led.getName();
+ if (name==null || name.isEmpty())
+ name = led.getId();
+ return name;
+ }
+
+ @Override
+ public Hashtable<String, Object> getChoiceOfValues(Object context) {
+ LinkEventDefinition object = adopt(context);
+ // add all ItemDefinitions
+ Hashtable<String,Object> choices = new Hashtable<String,Object>();
+ String s;
+ Definitions defs = ModelUtil.getDefinitions(object);
+ List<LinkEventDefinition> links = (List)ModelUtil.getAllReachableObjects(defs, Bpmn2Package.eINSTANCE.getLinkEventDefinition());
+ for (LinkEventDefinition link : links) {
+ if (link!=object) {
+ s = getDisplayName(link);
+ choices.put(s,link);
+ }
+ }
+ return choices;
+ }
+
+ @Override
+ public String getChoiceString(Object value) {
+ return super.getChoiceString(value);
+ }
+
+ }
+ );
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageEventDefinitionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageEventDefinitionPropertiesAdapter.java
index ace08b1..87d1be0 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageEventDefinitionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageEventDefinitionPropertiesAdapter.java
@@ -1,38 +1,38 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.MessageEventDefinition;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class MessageEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<MessageEventDefinition> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public MessageEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, MessageEventDefinition object) {
- super(adapterFactory, object);
-
- setProperty(Bpmn2Package.eINSTANCE.getMessageEventDefinition_OperationRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getMessageEventDefinition_OperationRef(), UI_CAN_EDIT, Boolean.FALSE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.MessageEventDefinition;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class MessageEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<MessageEventDefinition> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public MessageEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, MessageEventDefinition object) {
+ super(adapterFactory, object);
+
+ setProperty(Bpmn2Package.eINSTANCE.getMessageEventDefinition_OperationRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getMessageEventDefinition_OperationRef(), UI_CAN_EDIT, Boolean.FALSE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageFlowPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageFlowPropertiesAdapter.java
index d2a77fd..96af3cc 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageFlowPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MessageFlowPropertiesAdapter.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Gary Brown
- *
- */
-public class MessageFlowPropertiesAdapter extends ExtendedPropertiesAdapter<MessageFlow> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public MessageFlowPropertiesAdapter(AdapterFactory adapterFactory, MessageFlow object) {
- super(adapterFactory, object);
-
- setObjectDescriptor(new ObjectDescriptor<MessageFlow>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- final MessageFlow flow = adopt(context);
- String text = "";
- if (flow.getMessageRef()!=null) {
- text += ChoreographyUtil.getMessageFlowName(flow);
- }
-
- if (flow.getSourceRef() instanceof Participant) {
- text += " "+((Participant)flow.getSourceRef()).getName()+"->";
-
- if (flow.getTargetRef() instanceof Participant) {
- text += ((Participant)flow.getTargetRef()).getName();
- }
- }
- return text;
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Gary Brown
+ *
+ */
+public class MessageFlowPropertiesAdapter extends ExtendedPropertiesAdapter<MessageFlow> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public MessageFlowPropertiesAdapter(AdapterFactory adapterFactory, MessageFlow object) {
+ super(adapterFactory, object);
+
+ setObjectDescriptor(new ObjectDescriptor<MessageFlow>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ final MessageFlow flow = adopt(context);
+ String text = "";
+ if (flow.getMessageRef()!=null) {
+ text += ChoreographyUtil.getMessageFlowName(flow);
+ }
+
+ if (flow.getSourceRef() instanceof Participant) {
+ text += " "+((Participant)flow.getSourceRef()).getName()+"->";
+
+ if (flow.getTargetRef() instanceof Participant) {
+ text += ((Participant)flow.getTargetRef()).getName();
+ }
+ }
+ return text;
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MultiInstanceLoopCharacteristicsPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MultiInstanceLoopCharacteristicsPropertiesAdapter.java
index d317168..c636c3d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MultiInstanceLoopCharacteristicsPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/MultiInstanceLoopCharacteristicsPropertiesAdapter.java
@@ -1,100 +1,100 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.InputOutputSpecification;
-import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class MultiInstanceLoopCharacteristicsPropertiesAdapter extends ExtendedPropertiesAdapter<MultiInstanceLoopCharacteristics> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public MultiInstanceLoopCharacteristicsPropertiesAdapter(AdapterFactory adapterFactory, MultiInstanceLoopCharacteristics object) {
- super(adapterFactory, object);
-
- EStructuralFeature f = Bpmn2Package.eINSTANCE.getMultiInstanceLoopCharacteristics_InputDataItem();
- setFeatureDescriptor(f, new LoopCharacteristicsDataInputFeatureDescriptor(adapterFactory,object, f));
-
- f = Bpmn2Package.eINSTANCE.getMultiInstanceLoopCharacteristics_LoopDataInputRef();
- setFeatureDescriptor(f, new LoopCharacteristicsDataInputFeatureDescriptor(adapterFactory,object, f));
- }
-
- protected class LoopCharacteristicsDataInputFeatureDescriptor extends FeatureDescriptor<MultiInstanceLoopCharacteristics> {
-
- /**
- * @param adapterFactory
- * @param object
- * @param feature
- */
- public LoopCharacteristicsDataInputFeatureDescriptor(AdapterFactory adapterFactory, MultiInstanceLoopCharacteristics object, EStructuralFeature feature) {
- super(adapterFactory, object, feature);
-
- setProperty(feature, UI_CAN_EDIT, Boolean.FALSE);
- setProperty(feature, UI_CAN_CREATE_NEW, Boolean.FALSE);
- }
-
- @Override
- public Hashtable<String, Object> getChoiceOfValues(Object context) {
- Hashtable<String, Object> values = new Hashtable<String, Object>();
- MultiInstanceLoopCharacteristics loopCharacteristics = adopt(context);
-
- EObject container = loopCharacteristics.eContainer();
- while (container!=null) {
- if (container instanceof Activity || container instanceof Process) {
- List properties = null;
- if (feature.getName().equals("inputDataItem")) {
- EStructuralFeature f = container.eClass().getEStructuralFeature("ioSpecification");
- if (f!=null) {
- InputOutputSpecification ioSpecification = (InputOutputSpecification)container.eGet(f);
- if (ioSpecification!=null)
- properties = ioSpecification.getDataInputs();
- }
- }
- else {
- EStructuralFeature f = container.eClass().getEStructuralFeature("properties");
- if (f!=null)
- properties = (List)container.eGet(f);
- }
-
- if (properties!=null) {
- for (Object p : properties) {
- values.put( getChoiceString(p), p);
- }
- }
- }
- container = container.eContainer();
- }
- super.setChoiceOfValues(values);
- return super.getChoiceOfValues(context);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.InputOutputSpecification;
+import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class MultiInstanceLoopCharacteristicsPropertiesAdapter extends ExtendedPropertiesAdapter<MultiInstanceLoopCharacteristics> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public MultiInstanceLoopCharacteristicsPropertiesAdapter(AdapterFactory adapterFactory, MultiInstanceLoopCharacteristics object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature f = Bpmn2Package.eINSTANCE.getMultiInstanceLoopCharacteristics_InputDataItem();
+ setFeatureDescriptor(f, new LoopCharacteristicsDataInputFeatureDescriptor(adapterFactory,object, f));
+
+ f = Bpmn2Package.eINSTANCE.getMultiInstanceLoopCharacteristics_LoopDataInputRef();
+ setFeatureDescriptor(f, new LoopCharacteristicsDataInputFeatureDescriptor(adapterFactory,object, f));
+ }
+
+ protected class LoopCharacteristicsDataInputFeatureDescriptor extends FeatureDescriptor<MultiInstanceLoopCharacteristics> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ * @param feature
+ */
+ public LoopCharacteristicsDataInputFeatureDescriptor(AdapterFactory adapterFactory, MultiInstanceLoopCharacteristics object, EStructuralFeature feature) {
+ super(adapterFactory, object, feature);
+
+ setProperty(feature, UI_CAN_EDIT, Boolean.FALSE);
+ setProperty(feature, UI_CAN_CREATE_NEW, Boolean.FALSE);
+ }
+
+ @Override
+ public Hashtable<String, Object> getChoiceOfValues(Object context) {
+ Hashtable<String, Object> values = new Hashtable<String, Object>();
+ MultiInstanceLoopCharacteristics loopCharacteristics = adopt(context);
+
+ EObject container = loopCharacteristics.eContainer();
+ while (container!=null) {
+ if (container instanceof Activity || container instanceof Process) {
+ List properties = null;
+ if (feature.getName().equals("inputDataItem")) {
+ EStructuralFeature f = container.eClass().getEStructuralFeature("ioSpecification");
+ if (f!=null) {
+ InputOutputSpecification ioSpecification = (InputOutputSpecification)container.eGet(f);
+ if (ioSpecification!=null)
+ properties = ioSpecification.getDataInputs();
+ }
+ }
+ else {
+ EStructuralFeature f = container.eClass().getEStructuralFeature("properties");
+ if (f!=null)
+ properties = (List)container.eGet(f);
+ }
+
+ if (properties!=null) {
+ for (Object p : properties) {
+ values.put( getChoiceString(p), p);
+ }
+ }
+ }
+ container = container.eContainer();
+ }
+ super.setChoiceOfValues(values);
+ return super.getChoiceOfValues(context);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/OperationPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/OperationPropertiesAdapter.java
index 019e58e..a066b1c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/OperationPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/OperationPropertiesAdapter.java
@@ -1,42 +1,42 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Operation;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class OperationPropertiesAdapter extends ExtendedPropertiesAdapter<Operation> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public OperationPropertiesAdapter(AdapterFactory adapterFactory, Operation object) {
- super(adapterFactory, object);
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getOperation_InMessageRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<Operation>(adapterFactory,object,ref));
-
- ref = Bpmn2Package.eINSTANCE.getOperation_OutMessageRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<Operation>(adapterFactory,object,ref));
-
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Operation;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class OperationPropertiesAdapter extends ExtendedPropertiesAdapter<Operation> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public OperationPropertiesAdapter(AdapterFactory adapterFactory, Operation object) {
+ super(adapterFactory, object);
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getOperation_InMessageRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<Operation>(adapterFactory,object,ref));
+
+ ref = Bpmn2Package.eINSTANCE.getOperation_OutMessageRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<Operation>(adapterFactory,object,ref));
+
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ProcessPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ProcessPropertiesAdapter.java
index 9083026..2f06878 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ProcessPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ProcessPropertiesAdapter.java
@@ -1,49 +1,95 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.resource.Resource;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ProcessPropertiesAdapter extends RootElementPropertiesAdapter<Process> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ProcessPropertiesAdapter(AdapterFactory adapterFactory, Process object) {
- super(adapterFactory, object);
-
- setObjectDescriptor(new ObjectDescriptor<Process>(adapterFactory, object) {
- @Override
- public Process createObject(Resource resource, Object context) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(
- Bpmn2Package.eINSTANCE.getRootElement(),
- ExtendedPropertiesAdapter.class);
- Process process = (Process) adapter.getObjectDescriptor().createObject(resource, object);
- return process;
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ProcessPropertiesAdapter extends RootElementPropertiesAdapter<Process> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ProcessPropertiesAdapter(AdapterFactory adapterFactory, Process object) {
+ super(adapterFactory, object);
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getCallableElement_Name();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<Process>(adapterFactory,object,ref) {
+ @Override
+ public void setValue(Object context, final Object value) {
+ // changing the process name also changes its BPMNDiagram name
+ // which is used as the tab label in the multipage editor
+ final Process process = adopt(context);
+ BPMNDiagram bpmnDiagram = null;
+ Definitions defs = ModelUtil.getDefinitions(process);
+ if (defs!=null) {
+ for (BPMNDiagram d : defs.getDiagrams()) {
+ if (d.getPlane().getBpmnElement() == process) {
+ bpmnDiagram = d;
+ break;
+ }
+ }
+ }
+
+ TransactionalEditingDomain editingDomain = getEditingDomain(process);
+ if (editingDomain == null) {
+ process.setName((String)value);
+ if (bpmnDiagram!=null)
+ bpmnDiagram.setName((String)value);
+ } else {
+ final BPMNDiagram d = bpmnDiagram;
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ process.setName((String)value);
+ if (d!=null)
+ d.setName((String)value);
+ }
+ });
+ }
+ }
+ }
+ );
+
+ setObjectDescriptor(new ObjectDescriptor<Process>(adapterFactory, object) {
+ @Override
+ public Process createObject(Resource resource, Object context) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(
+ Bpmn2Package.eINSTANCE.getRootElement(),
+ ExtendedPropertiesAdapter.class);
+ Process process = (Process) adapter.getObjectDescriptor().createObject(resource, object);
+ return process;
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/PropertyPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/PropertyPropertiesAdapter.java
index 17a9035..4e0e75d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/PropertyPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/PropertyPropertiesAdapter.java
@@ -1,104 +1,104 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import java.util.ArrayList;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.Property;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.adapters.properties.MultiInstanceLoopCharacteristicsPropertiesAdapter.LoopCharacteristicsDataInputFeatureDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class PropertyPropertiesAdapter extends ItemAwareElementPropertiesAdapter<Property> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public PropertyPropertiesAdapter(AdapterFactory adapterFactory, Property object) {
- super(adapterFactory, object);
-
- EStructuralFeature f = Bpmn2Package.eINSTANCE.getProperty_Name();
- final FeatureDescriptor<Property> fd = new FeatureDescriptor<Property>(adapterFactory,object, f) {
-
- @Override
- public void setDisplayName(String text) {
- int i = text.lastIndexOf("/");
- if (i>=0)
- text = text.substring(i+1);
- text = text.trim();
- ((Property)object).setName(text);
- }
-
- @Override
- public String getChoiceString(Object context) {
- Property property = adopt(context);
- String text = property.getName();
- if (text==null || text.isEmpty())
- text = property.getId();
-
- EObject container = property.eContainer();
- while (container!=null && !(container instanceof Definitions)) {
- if (container instanceof Participant) {
- container = ((Participant)container).getProcessRef();
- if (container==null)
- break;
- }
- else if (container instanceof Activity || container instanceof Process) {
- text = ModelUtil.getDisplayName(container) + "/" + text;
- }
- else if (container instanceof CatchEvent || container instanceof ThrowEvent) {
- text = ModelUtil.getDisplayName(container) + "/" + text;
- }
- container = container.eContainer();
- }
- return text;
- }
-
- };
- setFeatureDescriptor(f, fd);
-
- setObjectDescriptor(new ObjectDescriptor<Property>(adapterFactory, object) {
-
- @Override
- public void setDisplayName(String text) {
- fd.setDisplayName(text);
- ModelUtil.setID(object);
- }
-
- @Override
- public String getDisplayName(Object context) {
- return fd.getChoiceString(context);
- }
-
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import java.util.ArrayList;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.Property;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.adapters.properties.MultiInstanceLoopCharacteristicsPropertiesAdapter.LoopCharacteristicsDataInputFeatureDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class PropertyPropertiesAdapter extends ItemAwareElementPropertiesAdapter<Property> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public PropertyPropertiesAdapter(AdapterFactory adapterFactory, Property object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature f = Bpmn2Package.eINSTANCE.getProperty_Name();
+ final FeatureDescriptor<Property> fd = new FeatureDescriptor<Property>(adapterFactory,object, f) {
+
+ @Override
+ public void setDisplayName(String text) {
+ int i = text.lastIndexOf("/");
+ if (i>=0)
+ text = text.substring(i+1);
+ text = text.trim();
+ ((Property)object).setName(text);
+ }
+
+ @Override
+ public String getChoiceString(Object context) {
+ Property property = adopt(context);
+ String text = property.getName();
+ if (text==null || text.isEmpty())
+ text = property.getId();
+
+ EObject container = property.eContainer();
+ while (container!=null && !(container instanceof Definitions)) {
+ if (container instanceof Participant) {
+ container = ((Participant)container).getProcessRef();
+ if (container==null)
+ break;
+ }
+ else if (container instanceof Activity || container instanceof Process) {
+ text = ModelUtil.getDisplayName(container) + "/" + text;
+ }
+ else if (container instanceof CatchEvent || container instanceof ThrowEvent) {
+ text = ModelUtil.getDisplayName(container) + "/" + text;
+ }
+ container = container.eContainer();
+ }
+ return text;
+ }
+
+ };
+ setFeatureDescriptor(f, fd);
+
+ setObjectDescriptor(new ObjectDescriptor<Property>(adapterFactory, object) {
+
+ @Override
+ public void setDisplayName(String text) {
+ fd.setDisplayName(text);
+ ModelUtil.setID(object);
+ }
+
+ @Override
+ public String getDisplayName(Object context) {
+ return fd.getChoiceString(context);
+ }
+
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ReceiveTaskPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ReceiveTaskPropertiesAdapter.java
index 19461a0..0053aba 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ReceiveTaskPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ReceiveTaskPropertiesAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ReceiveTask;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ReceiveTaskPropertiesAdapter extends TaskPropertiesAdapter<ReceiveTask> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ReceiveTaskPropertiesAdapter(AdapterFactory adapterFactory, ReceiveTask object) {
- super(adapterFactory, object);
-
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getReceiveTask_MessageRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<ReceiveTask>(adapterFactory,object,ref));
-
- ref = Bpmn2Package.eINSTANCE.getReceiveTask_OperationRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<ReceiveTask>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ReceiveTask;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ReceiveTaskPropertiesAdapter extends TaskPropertiesAdapter<ReceiveTask> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ReceiveTaskPropertiesAdapter(AdapterFactory adapterFactory, ReceiveTask object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getReceiveTask_MessageRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<ReceiveTask>(adapterFactory,object,ref));
+
+ ref = Bpmn2Package.eINSTANCE.getReceiveTask_OperationRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<ReceiveTask>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceAssignmentExpressionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceAssignmentExpressionPropertiesAdapter.java
index ae2bf9a..024ee5e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceAssignmentExpressionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceAssignmentExpressionPropertiesAdapter.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.FormalExpression;
-import org.eclipse.bpmn2.ResourceAssignmentExpression;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ResourceAssignmentExpressionPropertiesAdapter extends ExtendedPropertiesAdapter<ResourceAssignmentExpression> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ResourceAssignmentExpressionPropertiesAdapter(AdapterFactory adapterFactory, ResourceAssignmentExpression object) {
- super(adapterFactory, object);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getResourceAssignmentExpression_Expression();
- setFeatureDescriptor(ref,
- new FeatureDescriptor<ResourceAssignmentExpression>(adapterFactory,object,ref) {
-
- @Override
- public String getDisplayName(Object context) {
- ResourceAssignmentExpression expression = adopt(context);
- if (expression.getExpression() instanceof FormalExpression) {
- return ((FormalExpression)expression.getExpression()).getBody();
- }
- return "";
- }
-
- @Override
- public void setValue(Object context, Object value) {
- final ResourceAssignmentExpression expression = adopt(context);
- if (!(expression.getExpression() instanceof FormalExpression)) {
- final FormalExpression e = Bpmn2ModelerFactory.create(FormalExpression.class);
- e.setBody((String) value);
- TransactionalEditingDomain editingDomain = getEditingDomain(expression);
- if (editingDomain == null) {
- expression.eSet(feature, e);
- } else {
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- expression.eSet(feature, e);
- ModelUtil.setID(e);
- }
- });
- }
- }
- }
- }
- );
- setObjectDescriptor(new ObjectDescriptor<ResourceAssignmentExpression>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- return getFeatureDescriptor(ref).getDisplayName(context);
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.FormalExpression;
+import org.eclipse.bpmn2.ResourceAssignmentExpression;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ResourceAssignmentExpressionPropertiesAdapter extends ExtendedPropertiesAdapter<ResourceAssignmentExpression> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ResourceAssignmentExpressionPropertiesAdapter(AdapterFactory adapterFactory, ResourceAssignmentExpression object) {
+ super(adapterFactory, object);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getResourceAssignmentExpression_Expression();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<ResourceAssignmentExpression>(adapterFactory,object,ref) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ ResourceAssignmentExpression expression = adopt(context);
+ if (expression.getExpression() instanceof FormalExpression) {
+ return ((FormalExpression)expression.getExpression()).getBody();
+ }
+ return "";
+ }
+
+ @Override
+ public void setValue(Object context, Object value) {
+ final ResourceAssignmentExpression expression = adopt(context);
+ if (!(expression.getExpression() instanceof FormalExpression)) {
+ final FormalExpression e = Bpmn2ModelerFactory.create(FormalExpression.class);
+ e.setBody((String) value);
+ TransactionalEditingDomain editingDomain = getEditingDomain(expression);
+ if (editingDomain == null) {
+ expression.eSet(feature, e);
+ } else {
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ expression.eSet(feature, e);
+ ModelUtil.setID(e);
+ }
+ });
+ }
+ }
+ }
+ }
+ );
+ setObjectDescriptor(new ObjectDescriptor<ResourceAssignmentExpression>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ return getFeatureDescriptor(ref).getDisplayName(context);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceParameterBindingPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceParameterBindingPropertiesAdapter.java
index 1ae1022..4c7aa6c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceParameterBindingPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceParameterBindingPropertiesAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ResourceParameterBinding;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ResourceParameterBindingPropertiesAdapter extends ExtendedPropertiesAdapter<ResourceParameterBinding> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ResourceParameterBindingPropertiesAdapter(AdapterFactory adapterFactory, ResourceParameterBinding object) {
- super(adapterFactory, object);
-
- // ResourceParameters are contained in Resource, a root element
- setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_IS_MULTI_CHOICE, Boolean.TRUE);
- setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_CAN_EDIT, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_CAN_SET_NULL, Boolean.TRUE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ResourceParameterBinding;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ResourceParameterBindingPropertiesAdapter extends ExtendedPropertiesAdapter<ResourceParameterBinding> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ResourceParameterBindingPropertiesAdapter(AdapterFactory adapterFactory, ResourceParameterBinding object) {
+ super(adapterFactory, object);
+
+ // ResourceParameters are contained in Resource, a root element
+ setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_IS_MULTI_CHOICE, Boolean.TRUE);
+ setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_CAN_EDIT, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getResourceParameterBinding_ParameterRef(), UI_CAN_SET_NULL, Boolean.TRUE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceRolePropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceRolePropertiesAdapter.java
index f35ffc6..6a0c393 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceRolePropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ResourceRolePropertiesAdapter.java
@@ -1,71 +1,71 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ResourceAssignmentExpression;
-import org.eclipse.bpmn2.ResourceRole;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ResourceRolePropertiesAdapter extends ExtendedPropertiesAdapter<ResourceRole> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ResourceRolePropertiesAdapter(AdapterFactory adapterFactory, ResourceRole object) {
- super(adapterFactory, object);
- // ResourceRoles are contained in Process, GlobalTask and Activity
- setProperty(Bpmn2Package.eINSTANCE.getResourceRole_ResourceAssignmentExpression(), ExtendedPropertiesAdapter.UI_IS_MULTI_CHOICE, Boolean.FALSE);
-
- final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getResourceRole_ResourceAssignmentExpression();
- setFeatureDescriptor(ref,
- new FeatureDescriptor<ResourceRole>(adapterFactory,object,ref) {
-
- @Override
- public String getDisplayName(Object context) {
- final ResourceRole rr = adopt(context);
- ResourceAssignmentExpression rae = rr.getResourceAssignmentExpression();
- if (rae!=null) {
- ExtendedPropertiesAdapter<ResourceAssignmentExpression> adapter =
- (ExtendedPropertiesAdapter<ResourceAssignmentExpression>) AdapterUtil.adapt(rae, ExtendedPropertiesAdapter.class);
- return adapter.getObjectDescriptor().getDisplayName(rae);
- }
- return "";
- }
-
- @Override
- public void setValue(Object context, Object value) {
- final ResourceRole rr = adopt(context);
- ResourceAssignmentExpression rae = rr.getResourceAssignmentExpression();
- if (rae!=null) {
- ExtendedPropertiesAdapter<ResourceAssignmentExpression> adapter =
- (ExtendedPropertiesAdapter<ResourceAssignmentExpression>) AdapterUtil.adapt(rae, ExtendedPropertiesAdapter.class);
- EStructuralFeature raeFeature = Bpmn2Package.eINSTANCE.getResourceAssignmentExpression_Expression();
- adapter.getFeatureDescriptor(raeFeature).setValue(rae, value);
- }
- }
- }
- );
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ResourceAssignmentExpression;
+import org.eclipse.bpmn2.ResourceRole;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ResourceRolePropertiesAdapter extends ExtendedPropertiesAdapter<ResourceRole> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ResourceRolePropertiesAdapter(AdapterFactory adapterFactory, ResourceRole object) {
+ super(adapterFactory, object);
+ // ResourceRoles are contained in Process, GlobalTask and Activity
+ setProperty(Bpmn2Package.eINSTANCE.getResourceRole_ResourceAssignmentExpression(), ExtendedPropertiesAdapter.UI_IS_MULTI_CHOICE, Boolean.FALSE);
+
+ final EStructuralFeature ref = Bpmn2Package.eINSTANCE.getResourceRole_ResourceAssignmentExpression();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<ResourceRole>(adapterFactory,object,ref) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ final ResourceRole rr = adopt(context);
+ ResourceAssignmentExpression rae = rr.getResourceAssignmentExpression();
+ if (rae!=null) {
+ ExtendedPropertiesAdapter<ResourceAssignmentExpression> adapter =
+ (ExtendedPropertiesAdapter<ResourceAssignmentExpression>) AdapterUtil.adapt(rae, ExtendedPropertiesAdapter.class);
+ return adapter.getObjectDescriptor().getDisplayName(rae);
+ }
+ return "";
+ }
+
+ @Override
+ public void setValue(Object context, Object value) {
+ final ResourceRole rr = adopt(context);
+ ResourceAssignmentExpression rae = rr.getResourceAssignmentExpression();
+ if (rae!=null) {
+ ExtendedPropertiesAdapter<ResourceAssignmentExpression> adapter =
+ (ExtendedPropertiesAdapter<ResourceAssignmentExpression>) AdapterUtil.adapt(rae, ExtendedPropertiesAdapter.class);
+ EStructuralFeature raeFeature = Bpmn2Package.eINSTANCE.getResourceAssignmentExpression_Expression();
+ adapter.getFeatureDescriptor(raeFeature).setValue(rae, value);
+ }
+ }
+ }
+ );
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ScriptTaskPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ScriptTaskPropertiesAdapter.java
index e28f536..1a9deb7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ScriptTaskPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ScriptTaskPropertiesAdapter.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.FormalExpression;
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ScriptTaskPropertiesAdapter extends TaskPropertiesAdapter<ScriptTask> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ScriptTaskPropertiesAdapter(AdapterFactory adapterFactory, ScriptTask object) {
- super(adapterFactory, object);
-
-
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getScriptTask_Script();
- setFeatureDescriptor(ref,
- new FeatureDescriptor<ScriptTask>(adapterFactory,object,ref) {
-
- @Override
- public String getDisplayName(Object context) {
- ScriptTask task = adopt(context);
- if (task.getScript()==null)
- return "";
- return task.getScript();
- }
- });
-
- ref = Bpmn2Package.eINSTANCE.getScriptTask_ScriptFormat();
- setFeatureDescriptor(ref,
- new FeatureDescriptor<ScriptTask>(adapterFactory,object,ref) {
-
- @Override
- public String getDisplayName(Object context) {
- ScriptTask task = adopt(context);
- if (task.getScriptFormat()==null)
- return "text/xml"; // TODO: is there a default mime-type?
- return task.getScriptFormat();
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.FormalExpression;
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ScriptTaskPropertiesAdapter extends TaskPropertiesAdapter<ScriptTask> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ScriptTaskPropertiesAdapter(AdapterFactory adapterFactory, ScriptTask object) {
+ super(adapterFactory, object);
+
+
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getScriptTask_Script();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<ScriptTask>(adapterFactory,object,ref) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ ScriptTask task = adopt(context);
+ if (task.getScript()==null)
+ return "";
+ return task.getScript();
+ }
+ });
+
+ ref = Bpmn2Package.eINSTANCE.getScriptTask_ScriptFormat();
+ setFeatureDescriptor(ref,
+ new FeatureDescriptor<ScriptTask>(adapterFactory,object,ref) {
+
+ @Override
+ public String getDisplayName(Object context) {
+ ScriptTask task = adopt(context);
+ if (task.getScriptFormat()==null)
+ return "text/xml"; // TODO: is there a default mime-type?
+ return task.getScriptFormat();
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SendTaskPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SendTaskPropertiesAdapter.java
index 5210f39..0f9fd3c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SendTaskPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SendTaskPropertiesAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.SendTask;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SendTaskPropertiesAdapter extends TaskPropertiesAdapter<SendTask> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public SendTaskPropertiesAdapter(AdapterFactory adapterFactory, SendTask object) {
- super(adapterFactory, object);
-
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getSendTask_MessageRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<SendTask>(adapterFactory,object,ref));
-
- ref = Bpmn2Package.eINSTANCE.getSendTask_OperationRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<SendTask>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.SendTask;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SendTaskPropertiesAdapter extends TaskPropertiesAdapter<SendTask> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public SendTaskPropertiesAdapter(AdapterFactory adapterFactory, SendTask object) {
+ super(adapterFactory, object);
+
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getSendTask_MessageRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<SendTask>(adapterFactory,object,ref));
+
+ ref = Bpmn2Package.eINSTANCE.getSendTask_OperationRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<SendTask>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SequenceFlowPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SequenceFlowPropertiesAdapter.java
index b1c6d09..a13f5fd 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SequenceFlowPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SequenceFlowPropertiesAdapter.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SequenceFlowPropertiesAdapter extends ExtendedPropertiesAdapter<SequenceFlow> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public SequenceFlowPropertiesAdapter(AdapterFactory adapterFactory, SequenceFlow object) {
- super(adapterFactory, object);
-
- // TODO: any special handling here?
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SequenceFlowPropertiesAdapter extends ExtendedPropertiesAdapter<SequenceFlow> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public SequenceFlowPropertiesAdapter(AdapterFactory adapterFactory, SequenceFlow object) {
+ super(adapterFactory, object);
+
+ // TODO: any special handling here?
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ServiceTaskPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ServiceTaskPropertiesAdapter.java
index 6e92104..e730650 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ServiceTaskPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/ServiceTaskPropertiesAdapter.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ServiceTask;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class ServiceTaskPropertiesAdapter extends TaskPropertiesAdapter<ServiceTask> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public ServiceTaskPropertiesAdapter(AdapterFactory adapterFactory, ServiceTask object) {
- super(adapterFactory, object);
- setProperty(Bpmn2Package.eINSTANCE.getServiceTask_OperationRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getServiceTask_OperationRef(), UI_CAN_EDIT, Boolean.FALSE);
-
- EStructuralFeature ref = Bpmn2Package.eINSTANCE.getServiceTask_OperationRef();
- setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<ServiceTask>(adapterFactory,object,ref));
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ServiceTask;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class ServiceTaskPropertiesAdapter extends TaskPropertiesAdapter<ServiceTask> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public ServiceTaskPropertiesAdapter(AdapterFactory adapterFactory, ServiceTask object) {
+ super(adapterFactory, object);
+ setProperty(Bpmn2Package.eINSTANCE.getServiceTask_OperationRef(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getServiceTask_OperationRef(), UI_CAN_EDIT, Boolean.FALSE);
+
+ EStructuralFeature ref = Bpmn2Package.eINSTANCE.getServiceTask_OperationRef();
+ setFeatureDescriptor(ref, new RootElementRefFeatureDescriptor<ServiceTask>(adapterFactory,object,ref));
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalEventDefinitionPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalEventDefinitionPropertiesAdapter.java
index 0b9fec2..a6aac4c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalEventDefinitionPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalEventDefinitionPropertiesAdapter.java
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.SignalEventDefinition;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SignalEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<SignalEventDefinition> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public SignalEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, SignalEventDefinition object) {
- super(adapterFactory, object);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.SignalEventDefinition;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SignalEventDefinitionPropertiesAdapter extends EventDefinitionPropertiesAdapter<SignalEventDefinition> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public SignalEventDefinitionPropertiesAdapter(AdapterFactory adapterFactory, SignalEventDefinition object) {
+ super(adapterFactory, object);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalPropertiesAdapter.java
index 6977685..d11c678 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/SignalPropertiesAdapter.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.Signal;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SignalPropertiesAdapter extends RootElementPropertiesAdapter<Signal> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public SignalPropertiesAdapter(AdapterFactory adapterFactory, Signal object) {
- super(adapterFactory, object);
-
- setObjectDescriptor(new RootElementObjectDescriptor<Signal>(adapterFactory, object) {
- @Override
- public String getDisplayName(Object context) {
- final Signal signal = adopt(context);
- String text = "";
- if (signal.getName()!=null) {
- text += signal.getName();
- }
- if (text.isEmpty())
- text = "ID: " + signal.getId();
- return text;
- }
- });
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.Signal;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.adapters.ObjectDescriptor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SignalPropertiesAdapter extends RootElementPropertiesAdapter<Signal> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public SignalPropertiesAdapter(AdapterFactory adapterFactory, Signal object) {
+ super(adapterFactory, object);
+
+ setObjectDescriptor(new RootElementObjectDescriptor<Signal>(adapterFactory, object) {
+ @Override
+ public String getDisplayName(Object context) {
+ final Signal signal = adopt(context);
+ String text = "";
+ if (signal.getName()!=null) {
+ text += signal.getName();
+ }
+ if (text.isEmpty())
+ text = "ID: " + signal.getId();
+ return text;
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/TaskPropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/TaskPropertiesAdapter.java
index 7e89780..5876733 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/TaskPropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/TaskPropertiesAdapter.java
@@ -1,37 +1,37 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.adapters.properties;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-/**
- * @author Bob Brodt
- *
- */
-public class TaskPropertiesAdapter<T extends Task> extends ActivityPropertiesAdapter<T> {
-
- /**
- * @param adapterFactory
- * @param object
- */
- public TaskPropertiesAdapter(AdapterFactory adapterFactory, T object) {
- super(adapterFactory, object);
- setProperty(Bpmn2Package.eINSTANCE.getInteractionNode_IncomingConversationLinks(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- setProperty(Bpmn2Package.eINSTANCE.getInteractionNode_OutgoingConversationLinks(), UI_CAN_CREATE_NEW, Boolean.FALSE);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.adapters.properties;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class TaskPropertiesAdapter<T extends Task> extends ActivityPropertiesAdapter<T> {
+
+ /**
+ * @param adapterFactory
+ * @param object
+ */
+ public TaskPropertiesAdapter(AdapterFactory adapterFactory, T object) {
+ super(adapterFactory, object);
+ setProperty(Bpmn2Package.eINSTANCE.getInteractionNode_IncomingConversationLinks(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ setProperty(Bpmn2Package.eINSTANCE.getInteractionNode_OutgoingConversationLinks(), UI_CAN_CREATE_NEW, Boolean.FALSE);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/MainBPMNDiagramTypeProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/MainBPMNDiagramTypeProvider.java
index 6debe68..499f4ea 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/MainBPMNDiagramTypeProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/MainBPMNDiagramTypeProvider.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.diagram;
-
-import org.eclipse.graphiti.dt.AbstractDiagramTypeProvider;
-import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-
-public class MainBPMNDiagramTypeProvider extends AbstractDiagramTypeProvider {
- private IToolBehaviorProvider[] toolBehaviorProviders;
-
- public MainBPMNDiagramTypeProvider() {
- super();
- setFeatureProvider(new BPMNFeatureProvider(this));
- }
-
- @Override
- public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() {
- if (toolBehaviorProviders == null) {
- toolBehaviorProviders = new IToolBehaviorProvider[] { new BpmnToolBehaviourFeature(this) };
- }
- return toolBehaviorProviders;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.diagram;
+
+import org.eclipse.graphiti.dt.AbstractDiagramTypeProvider;
+import org.eclipse.graphiti.tb.IToolBehaviorProvider;
+
+public class MainBPMNDiagramTypeProvider extends AbstractDiagramTypeProvider {
+ private IToolBehaviorProvider[] toolBehaviorProviders;
+
+ public MainBPMNDiagramTypeProvider() {
+ super();
+ setFeatureProvider(new BPMNFeatureProvider(this));
+ }
+
+ @Override
+ public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() {
+ if (toolBehaviorProviders == null) {
+ toolBehaviorProviders = new IToolBehaviorProvider[] { new BpmnToolBehaviourFeature(this) };
+ }
+ return toolBehaviorProviders;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditingDomainListener.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditingDomainListener.java
index 9f35932..d24d003 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditingDomainListener.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditingDomainListener.java
@@ -1,82 +1,82 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.editor;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.transaction.ExceptionHandler;
-import org.eclipse.emf.transaction.TransactionalCommandStack;
-import org.eclipse.emf.transaction.TransactionalEditingDomainEvent;
-import org.eclipse.emf.transaction.TransactionalEditingDomainListenerImpl;
-
-public class BPMN2EditingDomainListener extends TransactionalEditingDomainListenerImpl implements ExceptionHandler {
-
- protected BPMN2Editor bpmn2Editor;
- protected BasicDiagnostic diagnostics;
-
- public BPMN2EditingDomainListener(BPMN2Editor bpmn2Editor) {
- super();
- this.bpmn2Editor = bpmn2Editor;
- TransactionalCommandStack stack = (TransactionalCommandStack) bpmn2Editor.getEditingDomain().getCommandStack();
- stack.setExceptionHandler(this);
- }
-
- @Override
- public void transactionStarting(TransactionalEditingDomainEvent event) {
- diagnostics = null;
- }
-
- /**
- * this will be called in case of rollback
- */
- @Override
- public void transactionClosed(TransactionalEditingDomainEvent event) {
- super.transactionClosed(event);
- }
-
- @Override
- public void handleException(Exception e) {
- String source = null;
- int code = 0;
- String message = e.getMessage();
- Object[] data = null;
- StackTraceElement trace[] = e.getStackTrace();
- if (trace!=null && trace.length>0) {
- source = trace[0].getMethodName();
- }
- if (diagnostics==null) {
- diagnostics = new BasicDiagnostic(source,code,message,data);
- }
- else
- diagnostics.add(new BasicDiagnostic(source,code,message,data));
- }
-
- public BasicDiagnostic getDiagnostics() {
- return diagnostics;
- }
-
- public IMarker createMarker(IResource resource, int severity, String msg) {
- try {
- IMarker m = resource.createMarker(IMarker.PROBLEM);
- m.setAttribute(IMarker.MESSAGE, msg);
- m.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
- m.setAttribute(IMarker.SEVERITY, severity);
- return m;
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.editor;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.transaction.ExceptionHandler;
+import org.eclipse.emf.transaction.TransactionalCommandStack;
+import org.eclipse.emf.transaction.TransactionalEditingDomainEvent;
+import org.eclipse.emf.transaction.TransactionalEditingDomainListenerImpl;
+
+public class BPMN2EditingDomainListener extends TransactionalEditingDomainListenerImpl implements ExceptionHandler {
+
+ protected BPMN2Editor bpmn2Editor;
+ protected BasicDiagnostic diagnostics;
+
+ public BPMN2EditingDomainListener(BPMN2Editor bpmn2Editor) {
+ super();
+ this.bpmn2Editor = bpmn2Editor;
+ TransactionalCommandStack stack = (TransactionalCommandStack) bpmn2Editor.getEditingDomain().getCommandStack();
+ stack.setExceptionHandler(this);
+ }
+
+ @Override
+ public void transactionStarting(TransactionalEditingDomainEvent event) {
+ diagnostics = null;
+ }
+
+ /**
+ * this will be called in case of rollback
+ */
+ @Override
+ public void transactionClosed(TransactionalEditingDomainEvent event) {
+ super.transactionClosed(event);
+ }
+
+ @Override
+ public void handleException(Exception e) {
+ String source = null;
+ int code = 0;
+ String message = e.getMessage();
+ Object[] data = null;
+ StackTraceElement trace[] = e.getStackTrace();
+ if (trace!=null && trace.length>0) {
+ source = trace[0].getMethodName();
+ }
+ if (diagnostics==null) {
+ diagnostics = new BasicDiagnostic(source,code,message,data);
+ }
+ else
+ diagnostics.add(new BasicDiagnostic(source,code,message,data));
+ }
+
+ public BasicDiagnostic getDiagnostics() {
+ return diagnostics;
+ }
+
+ public IMarker createMarker(IResource resource, int severity, String msg) {
+ try {
+ IMarker m = resource.createMarker(IMarker.PROBLEM);
+ m.setAttribute(IMarker.MESSAGE, msg);
+ m.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
+ m.setAttribute(IMarker.SEVERITY, severity);
+ return m;
+ } catch (CoreException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
index 639f1ac..9120e70 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
@@ -17,6 +17,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Set;
import org.eclipse.bpmn2.BaseElement;
@@ -26,6 +27,7 @@
import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
import org.eclipse.bpmn2.modeler.core.ProxyURIConverterImplExtension;
import org.eclipse.bpmn2.modeler.core.di.DIImport;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDialogComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
@@ -90,6 +92,7 @@
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
@@ -139,6 +142,7 @@
private IFile modelFile;
private IFile diagramFile;
+ protected BPMNDiagram bpmnDiagram;
private IWorkbenchListener workbenchListener;
private IPartListener2 selectionListener;
@@ -151,8 +155,14 @@
private Bpmn2Preferences preferences;
private TargetRuntime targetRuntime;
+// private Hashtable<BPMNDiagram, GraphicalViewer> mapDiagramToViewer = new Hashtable<BPMNDiagram, GraphicalViewer>();
protected DiagramEditorAdapter editorAdapter;
+ protected BPMN2MultiPageEditor multipageEditor;
+
+ public BPMN2Editor(BPMN2MultiPageEditor mpe) {
+ multipageEditor = mpe;
+ }
public static BPMN2Editor getActiveEditor() {
return activeEditor;
@@ -166,6 +176,10 @@
}
}
+ public BPMN2MultiPageEditor getMultipageEditor() {
+ return multipageEditor;
+ }
+
protected DiagramEditorAdapter getEditorAdapter() {
return editorAdapter;
}
@@ -175,6 +189,8 @@
try {
Bpmn2DiagramType diagramType = Bpmn2DiagramType.NONE;
String targetNamespace = null;
+ bpmnDiagram = null;
+
if (input instanceof IFileEditorInput) {
modelFile = ((IFileEditorInput) input).getFile();
loadPreferences(modelFile.getProject());
@@ -187,6 +203,18 @@
if (input instanceof Bpmn2DiagramEditorInput) {
diagramType = ((Bpmn2DiagramEditorInput)input).getInitialDiagramType();
targetNamespace = ((Bpmn2DiagramEditorInput)input).getTargetNamespace();
+ bpmnDiagram = ((Bpmn2DiagramEditorInput)input).getBpmnDiagram();
+ }
+ if (bpmnDiagram==null) {
+ // This was incorrectly constructed input, we ditch the old one and make a new and clean one instead
+ // This code path comes in from the New File Wizard
+ input = createNewDiagramEditorInput(diagramType, targetNamespace);
+ }
+ else {
+ BPMNDiagram d = bpmnDiagram;
+ bpmnDiagram = null;
+ setBpmnDiagram(d);
+ return;
}
// This was incorrectly constructed input, we ditch the old one and make a new and clean one instead
// This code path comes in from the New File Wizard
@@ -345,7 +373,7 @@
String targetNamespace = input.getTargetNamespace();
if (diagramType != Bpmn2DiagramType.NONE) {
- BPMNDiagram bpmnDiagram = modelHandler.createDiagramType(diagramType, targetNamespace);
+ bpmnDiagram = modelHandler.createDiagramType(diagramType, targetNamespace);
featureProvider.link(diagram, bpmnDiagram);
saveModelFile();
}
@@ -449,7 +477,7 @@
IWorkbenchPart part = partRef.getPart(false);
if (part instanceof BPMN2MultiPageEditor) {
BPMN2MultiPageEditor mpe = (BPMN2MultiPageEditor)part;
- setActiveEditor(mpe.designEditor);
+ setActiveEditor(mpe.getDesignEditor());
}
}
@@ -593,6 +621,40 @@
public ModelHandler getModelHandler() {
return modelHandler;
}
+
+ public void createPartControl(Composite parent) {
+ if (getGraphicalViewer()==null) {
+ super.createPartControl(parent);
+ }
+ }
+
+ public BPMNDiagram getBpmnDiagram() {
+ if (bpmnDiagram==null)
+ bpmnDiagram = getModelHandler().getDefinitions().getDiagrams().get(0);
+
+// if (bpmnDiagram!=null) {
+// GraphicalViewer viewer = getGraphicalViewer();
+// mapDiagramToViewer.put(bpmnDiagram, viewer);
+// }
+ return bpmnDiagram;
+ }
+
+ public void setBpmnDiagram(final BPMNDiagram bpmnDiagram) {
+ // create a new Graphiti Diagram if needed
+ Diagram diagram = DIUtils.getOrCreateDiagram(this, bpmnDiagram);
+
+ // Tell the DTP about the new Diagram
+ getDiagramTypeProvider().resourceReloaded(diagram);
+ getRefreshBehavior().initRefresh();
+ setPictogramElementsForSelection(null);
+ // set Diagram as contents for the graphical viewer and refresh
+ getGraphicalViewer().setContents(diagram);
+
+ refreshContent();
+
+ // remember this for later
+ this.bpmnDiagram = bpmnDiagram;
+ }
@Override
public void doSave(IProgressMonitor monitor) {
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MultiPageEditor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MultiPageEditor.java
index 317ca6e..43441c4 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MultiPageEditor.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MultiPageEditor.java
@@ -13,31 +13,20 @@
package org.eclipse.bpmn2.modeler.ui.editor;
+import java.util.ArrayList;
import java.util.List;
-import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.wizards.Bpmn2DiagramEditorInput;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.WorkbenchPartAction;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-import org.eclipse.graphiti.ui.editor.DiagramEditorContextMenuProvider;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabFolder2Listener;
import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
@@ -75,110 +64,21 @@
*/
public class BPMN2MultiPageEditor extends MultiPageEditorPart implements IGotoMarker {
- BPMN2Editor designEditor;
- StructuredTextEditor sourceViewer;
- CTabFolder tabFolder;
- int defaultTabHeight;
+ DesignEditor designEditor;
+ SourceViewer sourceViewer;
+ private CTabFolder tabFolder;
+ private int defaultTabHeight;
+ private List<BPMNDiagram> bpmnDiagrams = new ArrayList<BPMNDiagram>();
- /**
- *
- */
public BPMN2MultiPageEditor() {
super();
}
@Override
protected IEditorSite createSite(IEditorPart editor) {
- return new MultiPageEditorSite(this, editor) {
- @Override
- protected void handleSelectionChanged(SelectionChangedEvent event) {
- ISelectionProvider parentProvider = getMultiPageEditor().getSite()
- .getSelectionProvider();
- if (parentProvider instanceof MultiPageSelectionProvider) {
- SelectionChangedEvent newEvent = getNewEvent(parentProvider, event);
- MultiPageSelectionProvider prov = (MultiPageSelectionProvider) parentProvider;
- prov.fireSelectionChanged(newEvent);
- }
- }
-
- @Override
- protected void handlePostSelectionChanged(SelectionChangedEvent event) {
- ISelectionProvider parentProvider = getMultiPageEditor().getSite()
- .getSelectionProvider();
- if (parentProvider instanceof MultiPageSelectionProvider) {
- SelectionChangedEvent newEvent = getNewEvent(parentProvider, event);
- MultiPageSelectionProvider prov = (MultiPageSelectionProvider) parentProvider;
- prov.firePostSelectionChanged(newEvent);
- }
- }
-
- protected SelectionChangedEvent getNewEvent(ISelectionProvider parentProvider, SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- Object o = ss.getFirstElement();
- if (o instanceof Node) {
- selection = getNewSelection((Node)o);
- }
- }
- if (selection!=null)
- return new SelectionChangedEvent(parentProvider, selection);
- return event;
- }
-
- protected StructuredSelection getNewSelection(Node node) {
- int type = node.getNodeType();
- if (type==1) {
- // node type = element
- PictogramElement pe = null;
- Element elem = (Element)node;
- String value = elem.getAttribute("bpmnElement");
- if (value!=null) {
- pe = findPictogramElement(value);
- }
-
- if (pe==null) {
- value = elem.getAttribute("id");
- if (value!=null)
- pe = findPictogramElement(value);
- }
-
- if (pe!=null) {
- return new StructuredSelection(pe);
- }
- return getNewSelection(node.getParentNode());
- }
- else if (type==2) {
- // node type = attribute
- // search the attribute's owner
- Attr attr = (Attr)node;
- return getNewSelection(attr.getOwnerElement());
- }
- else if (type==3) {
- // node type = text
- return getNewSelection(node.getParentNode());
- }
- return null;
- }
-
- protected PictogramElement findPictogramElement(String id) {
- PictogramElement pictogramElement = null;
- if (id!=null) {
- BaseElement be = designEditor.getModelHandler().findElement(id);
- List<PictogramElement> pes = Graphiti.getLinkService().getPictogramElements(designEditor.getDiagramTypeProvider().getDiagram(), be);
- for (PictogramElement pe : pes) {
- if (pe instanceof ContainerShape) {
- pictogramElement = pe;
- }
- else if (pe instanceof FreeFormConnection) {
- pictogramElement = pe;
- }
- }
- }
-
- return pictogramElement;
- }
- };
+ if (editor instanceof DesignEditor)
+ return new DesignEditorSite(this, editor);
+ return new MultiPageEditorSite(this, editor);
}
@Override
@@ -207,15 +107,6 @@
}
IDE.gotoMarker(getEditor(getActivePage()), marker);
}
-
- @Override
- protected void pageChange(int newPageIndex) {
- super.pageChange(newPageIndex);
- if (newPageIndex>0 && newPageIndex==tabFolder.getItemCount()-1) {
- // TODO: sync source viewer's DOM with model
- }
- }
-
/* (non-Javadoc)
* @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
*/
@@ -247,13 +138,25 @@
}
});
+
+ // defer editor layout until all pages have been created
+ tabFolder.setLayoutDeferred(true);
+
createDesignEditor();
-// createSourceViewer();
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ setActivePage(0);
+ tabFolder.setLayoutDeferred(false);
+ tabFolder.setTabPosition(SWT.TOP);
+ updateTabs();
+ }
+ });
}
protected void createDesignEditor() {
if (designEditor==null) {
- designEditor = new DesignEditor();
+ designEditor = new DesignEditor(this, this);
try {
int pageIndex = tabFolder.getItemCount();
@@ -261,21 +164,10 @@
--pageIndex;
addPage(pageIndex, designEditor, BPMN2MultiPageEditor.this.getEditorInput());
defaultTabHeight = tabFolder.getTabHeight();
- setPageText(pageIndex,"Design");
+ setPageText(pageIndex,ModelUtil.getDiagramTypeName( designEditor.getBpmnDiagram() ));
- // TODO: it should be possible to create additional instances of the BPMN2Editor
- // that use the same IEditorInput as the original, but work within different
- // BPMNPlane objects within the same model.
- // Likewise, it should be possible to remove a page, which causes the associated
- // BPMNPlane to be removed from the model. The last page may not be removed because
- // this would invalidate the bpmn file.
-// ++pageIndex;
-// DesignEditor designEditor2 = new DesignEditor();
-// addPage(pageIndex, designEditor2, BPMN2MultiPageEditor.this.getEditorInput());
-// setPageText(pageIndex,"Design 2");
-
defaultTabHeight = tabFolder.getTabHeight();
-
+
updateTabs();
}
catch (Exception e) {
@@ -283,10 +175,90 @@
}
}
}
+
+ public DesignEditor getDesignEditor() {
+ return designEditor;
+ }
+ protected void addDesignPage(final BPMNDiagram bpmnDiagram) {
+ createDesignEditor();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+
+ int pageIndex = tabFolder.getItemCount();
+ if (sourceViewer!=null)
+ --pageIndex;
+ Bpmn2DiagramEditorInput input = (Bpmn2DiagramEditorInput)designEditor.getEditorInput();
+ input.setBpmnDiagram(bpmnDiagram);
+ addPage(pageIndex, designEditor, input);
+ CTabItem oldItem = tabFolder.getItem(pageIndex-1);
+ CTabItem newItem = tabFolder.getItem(pageIndex);
+ newItem.setControl( oldItem.getControl() );
+ setPageText(pageIndex,bpmnDiagram.getName());
+
+ setActivePage(pageIndex);
+ updateTabs();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ public void showDesignPage(final BPMNDiagram bpmnDiagram) {
+ final int pageIndex = bpmnDiagrams.indexOf(bpmnDiagram);
+ if (pageIndex>0) {
+ // go back to "Design" page - the only page that can't be removed
+ Display.getCurrent().asyncExec( new Runnable() {
+ @Override
+ public void run() {
+ setActivePage(pageIndex);
+ }
+ });
+ }
+ else {
+ designEditor.showDesignPage(bpmnDiagram);
+ }
+ }
+
+ protected void removeDesignPage(final BPMNDiagram bpmnDiagram) {
+ final int pageIndex = bpmnDiagrams.indexOf(bpmnDiagram);
+ if (pageIndex>0) {
+ // go back to "Design" page - the only page that can't be removed
+ Display.getCurrent().asyncExec( new Runnable() {
+ @Override
+ public void run() {
+ setActivePage(0);
+
+ IEditorPart editor = getEditor(pageIndex);
+ if (editor instanceof DesignEditor) {
+ ((DesignEditor)editor).deleteBpmnDiagram(bpmnDiagram);
+ }
+
+ // need to manage this ourselves so that the CTabFolder doesn't
+ // dispose our editor site (a child of the CTabItem.control)
+ tabFolder.getItem(pageIndex).setControl(null);
+
+ removePage(pageIndex);
+
+ tabFolder.getSelection().getControl().setVisible(true);
+ }
+ });
+ }
+ }
+
+ public int getDesignPageCount() {
+ int count = getPageCount();
+ if (sourceViewer!=null)
+ --count;
+ return count;
+ }
+
protected void createSourceViewer() {
if (sourceViewer==null) {
- sourceViewer = new SourceViewer();
+ sourceViewer = new SourceViewer(this);
try {
int pageIndex = tabFolder.getItemCount();
@@ -295,6 +267,8 @@
tabFolder.getItem(pageIndex).setShowClose(true);
setPageText(pageIndex,"Source");
+ setActivePage(pageIndex);
+
updateTabs();
}
catch (Exception e) {
@@ -304,36 +278,81 @@
}
}
}
-
- @Override
- public void removePage(int pageIndex) {
- Object page = tabFolder.getItem(pageIndex).getData();
- if (page instanceof EditorPart) {
- // make sure the editor gets disposed - neither CTabFolder nor super does this for us!
- ((EditorPart)page).dispose();
- }
- super.removePage(pageIndex);
- updateTabs();
+
+ public SourceViewer getSourceViewer() {
+ return sourceViewer;
}
public void removeSourceViewer() {
// there will only be one source page and it will always be the last page in the tab folder
if (sourceViewer!=null) {
int pageIndex = tabFolder.getItemCount() - 1;
- if (pageIndex>0)
+ if (pageIndex>0) {
removePage(pageIndex);
+ sourceViewer = null;
+ }
}
}
- private void updateTabs() {
- if (tabFolder.getItemCount()==1) {
- tabFolder.setTabHeight(0);
+ public void addPage(int pageIndex, IEditorPart editor, IEditorInput input)
+ throws PartInitException {
+ super.addPage(pageIndex,editor,input);
+ if (editor instanceof DesignEditor) {
+ bpmnDiagrams.add(pageIndex,((DesignEditor)editor).getBpmnDiagram());
}
- else
- tabFolder.setTabHeight(defaultTabHeight);
+ }
+
+ @Override
+ public void removePage(int pageIndex) {
+ Object page = tabFolder.getItem(pageIndex).getData();
+ super.removePage(pageIndex);
+ updateTabs();
+ if (page instanceof DesignEditor) {
+ bpmnDiagrams.remove(pageIndex);
+ }
+ }
+
+ @Override
+ protected void pageChange(int newPageIndex) {
+ super.pageChange(newPageIndex);
+
+ IEditorPart editor = getEditor(newPageIndex);
+ if (editor instanceof DesignEditor) {
+ BPMNDiagram bpmnDiagram = bpmnDiagrams.get(newPageIndex);
+ ((DesignEditor)editor).pageChange(bpmnDiagram);
+ }
+ }
+
+ public int getPageCount() {
+ return tabFolder.getItemCount();
+ }
+
+ public CTabItem getTabItem(int pageIndex) {
+ return tabFolder.getItem(pageIndex);
+ }
+
+ public BPMNDiagram getBpmnDiagram(int i) {
+ if (i>=0 && i<bpmnDiagrams.size()) {
+ return bpmnDiagrams.get(i);
+ }
+ return null;
+ }
+
+ private void updateTabs() {
+ if (!tabFolder.isLayoutDeferred()) {
+ if (tabFolder.getItemCount()==1) {
+ tabFolder.setTabHeight(0);
+ }
+ else
+ tabFolder.setTabHeight(defaultTabHeight);
+ }
tabFolder.layout();
}
+ public CTabFolder getTabFolder() {
+ return tabFolder;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
@@ -365,86 +384,10 @@
return activeEditor.isSaveAsAllowed();
}
- public class DesignEditor extends BPMN2Editor {
-
- @Override
- protected void createActions() {
- super.createActions();
- ActionRegistry registry = getActionRegistry();
- IAction action = new WorkbenchPartAction(designEditor) {
-
- @Override
- protected void init() {
- super.init();
- setId("show.or.hide.source.view");
- }
-
- @Override
- public String getText() {
- return sourceViewer==null ? "Show Source View" : "Hide Source View";
- }
-
- @Override
- protected boolean calculateEnabled() {
- return true;
- }
-
- public void run() {
- if (sourceViewer==null) {
- createSourceViewer();
- setActivePage(tabFolder.getItemCount()-1);
- }
- else {
- removeSourceViewer();
- }
- }
- };
- registry.registerAction(action);
- }
-
- @Override
- protected ContextMenuProvider createContextMenuProvider() {
- return new DiagramEditorContextMenuProvider(getGraphicalViewer(), getActionRegistry(), getDiagramTypeProvider()) {
- @Override
- public void buildContextMenu(IMenuManager manager) {
- super.buildContextMenu(manager);
- IAction action = getActionRegistry().getAction("show.or.hide.source.view");
- action.setText( action.getText() );
- manager.add(action);
- }
- };
- }
- }
-
- public class SourceViewer extends StructuredTextEditor {
-
- ActionRegistry actionRegistry = null;
-
- @Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class required) {
- if (required==ActionRegistry.class)
- return getActionRegistry();
- if (required==BPMN2Editor.class || required==DiagramEditor.class)
- return designEditor;
- return super.getAdapter(required);
- }
-
- @Override
- public boolean isEditable() {
- return false;
- }
-
- @Override
- public void dispose() {
- super.dispose();
- BPMN2MultiPageEditor.this.sourceViewer = null;
- }
-
- protected ActionRegistry getActionRegistry() {
- if (actionRegistry == null)
- actionRegistry = new ActionRegistry();
- return actionRegistry;
- }
+ @Override
+ public void dispose() {
+ designEditor.dispose();
+ if (sourceViewer!=null)
+ sourceViewer.dispose();
}
}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
new file mode 100644
index 0000000..b2b5458
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
@@ -0,0 +1,454 @@
+package org.eclipse.bpmn2.modeler.ui.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Choreography;
+import org.eclipse.bpmn2.Collaboration;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.RootElement;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.di.BPMNPlane;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.ResourceSetChangeEvent;
+import org.eclipse.emf.transaction.ResourceSetListener;
+import org.eclipse.emf.transaction.RollbackException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.actions.WorkbenchPartAction;
+import org.eclipse.graphiti.ui.editor.DiagramEditorContextMenuProvider;
+import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class DesignEditor extends BPMN2Editor {
+
+ protected ResourceSetListener resourceSetListener = null;
+ private BPMNDiagram bpmnDiagramDeleted = null;
+ protected boolean debug;
+ // the container that holds the tabFolder
+ protected Composite container;
+ protected CTabFolder tabFolder;
+ private int defaultTabHeight;
+
+ public DesignEditor(BPMN2MultiPageEditor bpmn2MultiPageEditor, BPMN2MultiPageEditor mpe) {
+ super(mpe);
+ }
+
+ public void deleteBpmnDiagram(BPMNDiagram bpmnDiagram) {
+ this.bpmnDiagramDeleted = bpmnDiagram;
+ }
+
+ public void dispose() {
+ if (bpmnDiagramDeleted == null) {
+ getEditingDomain().removeResourceSetListener(resourceSetListener);
+ resourceSetListener = null;
+ super.dispose();
+ } else {
+ bpmnDiagramDeleted = null;
+ }
+ }
+
+ @Override
+ protected void setInput(IEditorInput input) {
+ super.setInput(input);
+ if (resourceSetListener == null) {
+ resourceSetListener = new AddRemoveDiagramListener();
+ getEditingDomain().addResourceSetListener(resourceSetListener);
+ }
+ }
+
+ @Override
+ protected void setPartName(String partName) {
+ IEditorInput input = getEditorInput();
+ if (input instanceof DiagramEditorInput) {
+ URI uri = ((DiagramEditorInput)input).getUri();
+ partName = URI.decode(uri.trimFileExtension().lastSegment());
+
+ }
+ super.setPartName(partName);
+ }
+
+ public void pageChange(BPMNDiagram bpmnDiagram) {
+ super.setBpmnDiagram(bpmnDiagram);
+ reloadTabs();
+ }
+
+ private void reloadTabs() {
+ BPMNDiagram bpmnDiagram = getBpmnDiagram();
+ List<BPMNDiagram> bpmnDiagrams = new ArrayList<BPMNDiagram>();
+
+ BaseElement bpmnElement = bpmnDiagram.getPlane().getBpmnElement();
+ List<FlowElement> flowElements = null;
+ if (bpmnElement instanceof Process) {
+ flowElements = ((Process)bpmnElement).getFlowElements();
+ }
+ else if (bpmnElement instanceof Collaboration) {
+ ((Collaboration)bpmnElement).getParticipants();
+ }
+ else if (bpmnElement instanceof Choreography) {
+ flowElements = ((Choreography)bpmnElement).getFlowElements();
+ }
+ if (flowElements != null) {
+ for (FlowElement fe : flowElements) {
+ BPMNDiagram bd = DIUtils.findBPMNDiagram(this, fe);
+ if (bd!=null) {
+ bpmnDiagrams.add(bd);
+ }
+ }
+ }
+
+ tabFolder.setLayoutDeferred(true);
+ for (int i=tabFolder.getItemCount()-1; i>0; --i) {
+ tabFolder.getItem(i).setControl(null);
+ tabFolder.getItem(i).dispose();
+ }
+
+ if (bpmnDiagrams.size()>0) {
+ for (BPMNDiagram bd : bpmnDiagrams) {
+ CTabItem item = new CTabItem(tabFolder, SWT.NONE);
+ item.setControl(container);
+ BaseElement be = bd.getPlane().getBpmnElement();
+ item.setText(ModelUtil.getDisplayName(be));
+ item.setData(bd);
+ }
+
+ }
+ tabFolder.setSelection(0);
+ tabFolder.getItem(0).getControl().setVisible(true);
+ tabFolder.getItem(0).setData(bpmnDiagram);
+ tabFolder.setLayoutDeferred(false);
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ updateTabs();
+ }
+ });
+ }
+
+ public void createPartControl(Composite parent) {
+ if (getGraphicalViewer()==null) {
+ tabFolder = new CTabFolder(parent, SWT.BOTTOM);
+ tabFolder.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ int pageIndex = tabFolder.indexOf((CTabItem) e.item);
+ CTabItem item = tabFolder.getItem(pageIndex);
+ BPMNDiagram bpmnDiagram = (BPMNDiagram) item.getData();
+ showDesignPage(bpmnDiagram);
+ }
+ });
+ tabFolder.addTraverseListener(new TraverseListener() {
+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=199499 : Switching tabs by Ctrl+PageUp/PageDown must not be caught on the inner tab set
+ public void keyTraversed(TraverseEvent e) {
+ switch (e.detail) {
+ case SWT.TRAVERSE_PAGE_NEXT:
+ case SWT.TRAVERSE_PAGE_PREVIOUS:
+ int detail = e.detail;
+ e.doit = true;
+ e.detail = SWT.TRAVERSE_NONE;
+ Control control = tabFolder.getParent();
+ control.traverse(detail, new Event());
+ }
+ }
+ });
+ defaultTabHeight = tabFolder.getTabHeight();
+
+ container = new Composite(tabFolder, SWT.NONE);
+ container.setLayout(new FillLayout());
+ CTabItem item = new CTabItem(tabFolder, SWT.NONE, 0);
+ item.setText("Diagram");
+ item.setControl(container);
+ item.setData(getBpmnDiagram());
+
+ super.createPartControl(container);
+
+
+ // create additional editor tabs for BPMNDiagrams in the parent MultiPageEditor
+ final List<BPMNDiagram> bpmnDiagrams = getModelHandler().getAll(BPMNDiagram.class);
+ for (int i=1; i<bpmnDiagrams.size(); ++i) {
+ BPMNDiagram bpmnDiagram = bpmnDiagrams.get(i);
+ if (bpmnDiagram.getPlane().getBpmnElement() instanceof RootElement)
+ multipageEditor.addDesignPage(bpmnDiagram);
+ }
+ }
+ }
+
+ public void showDesignPage(final BPMNDiagram bpmnDiagram) {
+ for (CTabItem item : tabFolder.getItems()) {
+ if (item.getData() == bpmnDiagram) {
+ setBpmnDiagram(bpmnDiagram);
+ tabFolder.setSelection(item);
+ item.getControl().setVisible(true);
+ }
+ }
+ }
+
+ public void updateTabs() {
+// if (!tabFolder.isLayoutDeferred()) {
+ if (tabFolder.getItemCount()==1) {
+ tabFolder.setTabHeight(0);
+ }
+ else
+ tabFolder.setTabHeight(defaultTabHeight);
+// }
+ tabFolder.layout();
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+ ActionRegistry registry = getActionRegistry();
+ IAction action = new WorkbenchPartAction(multipageEditor.getDesignEditor()) {
+
+ @Override
+ protected void init() {
+ super.init();
+ setId("show.or.hide.source.view");
+ }
+
+ @Override
+ public String getText() {
+ return multipageEditor.getSourceViewer() == null ? "Show Source View" : "Hide Source View";
+ }
+
+ @Override
+ protected boolean calculateEnabled() {
+ return true;
+ }
+
+ public void run() {
+ if (multipageEditor.getSourceViewer() == null) {
+ multipageEditor.createSourceViewer();
+ } else {
+ multipageEditor.removeSourceViewer();
+ }
+ }
+ };
+ registry.registerAction(action);
+
+ action = new WorkbenchPartAction(multipageEditor.getDesignEditor()) {
+
+ @Override
+ protected void init() {
+ super.init();
+ setId("delete.page");
+ }
+
+ @Override
+ public String getText() {
+ int pageIndex = multipageEditor.getActivePage();
+ return "Delete Diagram \"" + multipageEditor.getTabItem(pageIndex).getText() + "\"";
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return calculateEnabled();
+ }
+
+ @Override
+ protected boolean calculateEnabled() {
+ BPMNDiagram bpmnDiagram = getBpmnDiagram();
+ BPMNPlane plane = bpmnDiagram.getPlane();
+ BaseElement process = plane.getBpmnElement();
+ List<Participant> participants = getModelHandler().getAll(Participant.class);
+ for (Participant p : participants) {
+ if (p.getProcessRef() == process)
+ return false;
+ }
+ return true;
+ }
+
+ public void run() {
+ int pageIndex = multipageEditor.getActivePage();
+ boolean result = MessageDialog.openQuestion(getSite().getShell(),
+ "Delete Page",
+ "Are you sure you want to delete the page \""
+ + multipageEditor.getTabItem(pageIndex).getText()
+ + "\"?");
+ if (result) {
+ final BPMNDiagram bpmnDiagram = getBpmnDiagram();
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(bpmnDiagram);
+ // removeDesignPage(bpmnDiagram);
+
+ if (domain != null) {
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ BPMNPlane plane = bpmnDiagram.getPlane();
+ BaseElement process = plane.getBpmnElement();
+ DIUtils.deleteDiagram(DesignEditor.this, bpmnDiagram);
+ EcoreUtil.delete(process);
+ }
+ });
+ }
+ }
+ }
+ };
+ registry.registerAction(action);
+ }
+
+ @Override
+ protected ContextMenuProvider createContextMenuProvider() {
+ return new DiagramEditorContextMenuProvider(getGraphicalViewer(), getActionRegistry(), getDiagramTypeProvider()) {
+ @Override
+ public void buildContextMenu(IMenuManager manager) {
+ super.buildContextMenu(manager);
+ IAction action = getActionRegistry().getAction("show.or.hide.source.view");
+ action.setText(action.getText());
+ manager.add(action);
+
+ int pageIndex = multipageEditor.getActivePage();
+ int lastPage = multipageEditor.getDesignPageCount();
+ if (pageIndex > 0 && pageIndex < lastPage) {
+ action = getActionRegistry().getAction("delete.page");
+ action.setText(action.getText());
+ action.setEnabled(action.isEnabled());
+ manager.add(action);
+ }
+ }
+ };
+ }
+
+ public class AddRemoveDiagramListener implements ResourceSetListener {
+ @Override
+ public NotificationFilter getFilter() {
+ return null;
+ }
+
+ @Override
+ public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException {
+ return null;
+ }
+
+ @Override
+ public void resourceSetChanged(ResourceSetChangeEvent event) {
+ for (Notification n : event.getNotifications()) {
+ int et = n.getEventType();
+ Object notifier = n.getNotifier();
+ Object newValue = n.getNewValue();
+ Object oldValue = n.getOldValue();
+ Object feature = n.getFeature();
+
+ if (debug) {
+ if (et == Notification.ADD || et == Notification.REMOVE || et == Notification.SET) {
+ System.out.print("event: " + et + "\t");
+ if (notifier instanceof EObject) {
+ System.out.print("notifier: $" + ((EObject) notifier).eClass().getName());
+ } else
+ System.out.print("notifier: " + notifier);
+ }
+ }
+
+ if (et == Notification.ADD) {
+ if (debug) {
+ if (newValue instanceof EObject) {
+ System.out.println("\t\tvalue: " + ((EObject) newValue).eClass().getName());
+ } else
+ System.out.println("\t\tvalue: " + newValue);
+ }
+
+ if (notifier instanceof Definitions
+ && newValue instanceof BPMNDiagram
+ && feature == Bpmn2Package.eINSTANCE.getDefinitions_Diagrams()) {
+ final BPMNDiagram bpmnDiagram = (BPMNDiagram) newValue;
+ BaseElement bpmnElement = bpmnDiagram.getPlane().getBpmnElement();
+ if (bpmnElement instanceof RootElement)
+ multipageEditor.addDesignPage(bpmnDiagram);
+ else
+ reloadTabs();
+ break;
+ }
+ } else if (et == Notification.REMOVE) {
+ if (debug) {
+ if (oldValue instanceof EObject) {
+ System.out.println("\t\tvalue: " + ((EObject) oldValue).eClass().getName());
+ } else
+ System.out.println("\t\tvalue: " + oldValue);
+ }
+
+ if (notifier instanceof Definitions
+ && oldValue instanceof BPMNDiagram
+ && feature == Bpmn2Package.eINSTANCE.getDefinitions_Diagrams()) {
+ final BPMNDiagram bpmnDiagram = (BPMNDiagram) oldValue;
+ BaseElement bpmnElement = bpmnDiagram.getPlane().getBpmnElement();
+ if (bpmnElement instanceof RootElement)
+ multipageEditor.removeDesignPage(bpmnDiagram);
+ else
+ reloadTabs();
+ break;
+ }
+ } else if (et == Notification.SET) {
+ // check if we need to change the tab names
+ if (n.getFeature() instanceof EStructuralFeature &&
+ ((EStructuralFeature)n.getFeature()).getName().equals("name")) {
+ for (int i=1; i<tabFolder.getItemCount(); ++i) {
+ CTabItem item = tabFolder.getItem(i);
+ BPMNDiagram bpmnDiagram = (BPMNDiagram)item.getData();
+ if (bpmnDiagram!=null) {
+ if (bpmnDiagram==notifier || bpmnDiagram.getPlane().getBpmnElement() == notifier) {
+ item.setText(n.getNewStringValue());
+ }
+ }
+ }
+ for (int i=0; i<multipageEditor.getPageCount(); ++i) {
+ BPMNDiagram bpmnDiagram = multipageEditor.getBpmnDiagram(i);
+ if (bpmnDiagram == notifier) {
+ CTabItem item = multipageEditor.getTabItem(i);
+ item.setText(n.getNewStringValue());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean isAggregatePrecommitListener() {
+ return false;
+ }
+
+ @Override
+ public boolean isPrecommitOnly() {
+ return false;
+ }
+
+ @Override
+ public boolean isPostcommitOnly() {
+ return true;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditorSite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditorSite.java
new file mode 100644
index 0000000..60b8bf6
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditorSite.java
@@ -0,0 +1,132 @@
+package org.eclipse.bpmn2.modeler.ui.editor;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.part.MultiPageEditorSite;
+import org.eclipse.ui.part.MultiPageSelectionProvider;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class DesignEditorSite extends MultiPageEditorSite {
+
+ final BPMN2Editor bpmn2Editor;
+
+ public DesignEditorSite(MultiPageEditorPart multiPageEditor, IEditorPart editor) {
+ super(multiPageEditor, editor);
+ this.bpmn2Editor = (BPMN2Editor) editor;
+ }
+
+ @Override
+ protected void handleSelectionChanged(SelectionChangedEvent event) {
+ ISelectionProvider parentProvider = getMultiPageEditor().getSite()
+ .getSelectionProvider();
+ if (parentProvider instanceof MultiPageSelectionProvider) {
+ SelectionChangedEvent newEvent = getNewEvent(parentProvider, event);
+ MultiPageSelectionProvider prov = (MultiPageSelectionProvider) parentProvider;
+ prov.fireSelectionChanged(newEvent);
+ }
+ }
+
+ @Override
+ protected void handlePostSelectionChanged(SelectionChangedEvent event) {
+ ISelectionProvider parentProvider = getMultiPageEditor().getSite()
+ .getSelectionProvider();
+ // make sure the selected PictogramElement is still on the same Diagram as the
+ // one currently being displayed - this event can happen after a page switch.
+ Diagram currentDiagram = bpmn2Editor.getDiagramTypeProvider().getDiagram();
+ PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection(event.getSelection());
+ Diagram peDiagram = Graphiti.getPeService().getDiagramForPictogramElement(pe);
+
+ if (currentDiagram != peDiagram)
+ return;
+
+ if (parentProvider instanceof MultiPageSelectionProvider) {
+ SelectionChangedEvent newEvent = getNewEvent(parentProvider, event);
+ MultiPageSelectionProvider prov = (MultiPageSelectionProvider) parentProvider;
+ prov.firePostSelectionChanged(newEvent);
+ }
+ }
+
+ protected SelectionChangedEvent getNewEvent(ISelectionProvider parentProvider, SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ Object o = ss.getFirstElement();
+ if (o instanceof Node) {
+ selection = getNewSelection((Node)o);
+ }
+ }
+ if (selection!=null)
+ return new SelectionChangedEvent(parentProvider, selection);
+ return event;
+ }
+
+ protected StructuredSelection getNewSelection(Node node) {
+ int type = node.getNodeType();
+ if (type==1) {
+ // node type = element
+ PictogramElement pe = null;
+ Element elem = (Element)node;
+ String value = elem.getAttribute("bpmnElement");
+ if (value!=null) {
+ pe = findPictogramElement(value);
+ }
+
+ if (pe==null) {
+ value = elem.getAttribute("id");
+ if (value!=null)
+ pe = findPictogramElement(value);
+ }
+
+ if (pe!=null) {
+ return new StructuredSelection(pe);
+ }
+ return getNewSelection(node.getParentNode());
+ }
+ else if (type==2) {
+ // node type = attribute
+ // search the attribute's owner
+ Attr attr = (Attr)node;
+ return getNewSelection(attr.getOwnerElement());
+ }
+ else if (type==3) {
+ // node type = text
+ return getNewSelection(node.getParentNode());
+ }
+ return null;
+ }
+
+ protected PictogramElement findPictogramElement(String id) {
+ PictogramElement pictogramElement = null;
+ if (id!=null) {
+ BaseElement be = bpmn2Editor.getModelHandler().findElement(id);
+ List<PictogramElement> pes = Graphiti.getLinkService().getPictogramElements(
+ bpmn2Editor.getDiagramTypeProvider().getDiagram(), be);
+ for (PictogramElement pe : pes) {
+ if (pe instanceof ContainerShape) {
+ pictogramElement = pe;
+ }
+ else if (pe instanceof FreeFormConnection) {
+ pictogramElement = pe;
+ }
+ }
+ }
+
+ return pictogramElement;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/SourceViewer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/SourceViewer.java
new file mode 100644
index 0000000..dceee6f
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/SourceViewer.java
@@ -0,0 +1,48 @@
+package org.eclipse.bpmn2.modeler.ui.editor;
+
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+
+public class SourceViewer extends StructuredTextEditor {
+
+ /**
+ *
+ */
+ private final BPMN2MultiPageEditor multiPageEditor;
+
+ /**
+ * @param multiPageEditor
+ */
+ SourceViewer(BPMN2MultiPageEditor multiPageEditor) {
+ this.multiPageEditor = multiPageEditor;
+ }
+
+ ActionRegistry actionRegistry = null;
+
+ @Override
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class required) {
+ if (required==ActionRegistry.class)
+ return getActionRegistry();
+ if (required==BPMN2Editor.class || required==DiagramEditor.class)
+ return multiPageEditor.getDesignEditor();
+ return super.getAdapter(required);
+ }
+
+ @Override
+ public boolean isEditable() {
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ protected ActionRegistry getActionRegistry() {
+ if (actionRegistry == null)
+ actionRegistry = new ActionRegistry();
+ return actionRegistry;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractDefaultDeleteFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractDefaultDeleteFeature.java
index 0375778..320e2ef 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractDefaultDeleteFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractDefaultDeleteFeature.java
@@ -1,30 +1,30 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features;
-
-import org.eclipse.bpmn2.modeler.core.features.DefaultDeleteBPMNShapeFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-
-public class AbstractDefaultDeleteFeature extends DefaultDeleteBPMNShapeFeature {
- public AbstractDefaultDeleteFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public void delete(IDeleteContext context) {
- deletePeEnvironment(context.getPictogramElement());
- super.delete(context);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features;
+
+import org.eclipse.bpmn2.modeler.core.features.DefaultDeleteBPMNShapeFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IDeleteContext;
+
+public class AbstractDefaultDeleteFeature extends DefaultDeleteBPMNShapeFeature {
+ public AbstractDefaultDeleteFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public void delete(IDeleteContext context) {
+ deletePeEnvironment(context.getPictogramElement());
+ super.delete(context);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractRotateContainerFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractRotateContainerFeature.java
index 0d05862..ba6cf35 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractRotateContainerFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/AbstractRotateContainerFeature.java
@@ -1,159 +1,159 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-/**
- * @author Bob Brodt
- *
- */
-public abstract class AbstractRotateContainerFeature extends AbstractCustomFeature {
-
- /**
- * @param fp
- */
- public AbstractRotateContainerFeature(IFeatureProvider fp) {
- super(fp);
- }
-
-
- @Override
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- @Override
- public String getImageId() {
- return ImageProvider.IMG_16_ROTATE;
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- PictogramElement[] pes = context.getPictogramElements();
- if (pes != null && pes.length == 1) {
- PictogramElement pe = pes[0];
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (pe instanceof ContainerShape && (bo instanceof Participant || bo instanceof Lane)) {
- Object parent = getBusinessObjectForPictogramElement(((ContainerShape)pe).getContainer());
- if (parent instanceof BPMNDiagram) {
- // only the top-level Lane or Pool can be rotated - all other
- // child Lanes must have the same orientation as their ancestor.
- return true;
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
- */
- @Override
- public void execute(ICustomContext context) {
- PictogramElement[] pes = context.getPictogramElements();
- if (pes != null && pes.length == 1 && pes[0] instanceof ContainerShape) {
- ContainerShape container = (ContainerShape)pes[0];
- boolean horz = FeatureSupport.isHorizontal(container);
- changeOrientation(container, !horz);
- FeatureSupport.redraw(container);
- }
- }
-
- private void changeOrientation(ContainerShape container, boolean horz) {
-
- // Recursively change the orientation of Lanes and "Pools" (Participants).
- // Note that this does not apply to Participant bands contained in a ChoreographTask.
- if (ChoreographyUtil.isChoreographyParticipantBand(container))
- return;
-
- IGaService gaService = Graphiti.getGaService();
- GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
- int x = ga.getX();
- int y = ga.getY();
- int width = ga.getWidth();
- int height = ga.getHeight();
-
- if (FeatureSupport.isParticipant(container) || FeatureSupport.isLane(container)) {
- gaService.setLocationAndSize(ga, x, y, height, width);
- FeatureSupport.setHorizontal(container, horz);
- }
- else {
- // Activities and other child figures only change location, not size
- // so simply swap x and y as a first cut.
- // TODO: replace this with auto layout algorithm, TBD later
- gaService.setLocationAndSize(ga, y, x, width, height);
-
- // TODO: also swap x and y of connection bendpoints: connection bendpoint
- // coordinates are relative to the diagram not the control figure
- // (i.e. the Lane in this case)
- ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram(container.getContainer());
- for (Anchor a : container.getAnchors()) {
- for (Connection c : a.getIncomingConnections()) {
- if (c instanceof FreeFormConnection) {
- FreeFormConnection fc = (FreeFormConnection)c;
- boolean update = false;
- for (Point p : fc.getBendpoints()) {
- int py = p.getX() - loc.getX() + loc.getY();
- int px = p.getY() - loc.getY() + loc.getX();
- p.setX(px);
- p.setY(py);
- update = true;
- }
- if (update)
- DIUtils.updateDIEdge(c);
- }
- }
- }
-
- layoutPictogramElement(container);
- }
-
- DIUtils.updateDIShape(container);
-
- for (PictogramElement pe : container.getChildren()) {
- if (pe instanceof ContainerShape) {
- changeOrientation((ContainerShape) pe, horz);
- if (BusinessObjectUtil.getBusinessObjectForPictogramElement(pe) instanceof ChoreographyTask)
- ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) pe);
- }
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+/**
+ * @author Bob Brodt
+ *
+ */
+public abstract class AbstractRotateContainerFeature extends AbstractCustomFeature {
+
+ /**
+ * @param fp
+ */
+ public AbstractRotateContainerFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+
+ @Override
+ public boolean isAvailable(IContext context) {
+ return true;
+ }
+
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_ROTATE;
+ }
+
+ @Override
+ public boolean canExecute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ if (pe instanceof ContainerShape && (bo instanceof Participant || bo instanceof Lane)) {
+ Object parent = getBusinessObjectForPictogramElement(((ContainerShape)pe).getContainer());
+ if (parent instanceof BPMNDiagram) {
+ // only the top-level Lane or Pool can be rotated - all other
+ // child Lanes must have the same orientation as their ancestor.
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public void execute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1 && pes[0] instanceof ContainerShape) {
+ ContainerShape container = (ContainerShape)pes[0];
+ boolean horz = FeatureSupport.isHorizontal(container);
+ changeOrientation(container, !horz);
+ FeatureSupport.redraw(container);
+ }
+ }
+
+ private void changeOrientation(ContainerShape container, boolean horz) {
+
+ // Recursively change the orientation of Lanes and "Pools" (Participants).
+ // Note that this does not apply to Participant bands contained in a ChoreographTask.
+ if (ChoreographyUtil.isChoreographyParticipantBand(container))
+ return;
+
+ IGaService gaService = Graphiti.getGaService();
+ GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
+ int x = ga.getX();
+ int y = ga.getY();
+ int width = ga.getWidth();
+ int height = ga.getHeight();
+
+ if (FeatureSupport.isParticipant(container) || FeatureSupport.isLane(container)) {
+ gaService.setLocationAndSize(ga, x, y, height, width);
+ FeatureSupport.setHorizontal(container, horz);
+ }
+ else {
+ // Activities and other child figures only change location, not size
+ // so simply swap x and y as a first cut.
+ // TODO: replace this with auto layout algorithm, TBD later
+ gaService.setLocationAndSize(ga, y, x, width, height);
+
+ // TODO: also swap x and y of connection bendpoints: connection bendpoint
+ // coordinates are relative to the diagram not the control figure
+ // (i.e. the Lane in this case)
+ ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram(container.getContainer());
+ for (Anchor a : container.getAnchors()) {
+ for (Connection c : a.getIncomingConnections()) {
+ if (c instanceof FreeFormConnection) {
+ FreeFormConnection fc = (FreeFormConnection)c;
+ boolean update = false;
+ for (Point p : fc.getBendpoints()) {
+ int py = p.getX() - loc.getX() + loc.getY();
+ int px = p.getY() - loc.getY() + loc.getX();
+ p.setX(px);
+ p.setY(py);
+ update = true;
+ }
+ if (update)
+ DIUtils.updateDIEdge(c);
+ }
+ }
+ }
+
+ layoutPictogramElement(container);
+ }
+
+ DIUtils.updateDIShape(container);
+
+ for (PictogramElement pe : container.getChildren()) {
+ if (pe instanceof ContainerShape) {
+ changeOrientation((ContainerShape) pe, horz);
+ if (BusinessObjectUtil.getBusinessObjectForPictogramElement(pe) instanceof ChoreographyTask)
+ ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) pe);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/LayoutBaseElementTextFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/LayoutBaseElementTextFeature.java
index e6bb5cf..6519e29 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/LayoutBaseElementTextFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/LayoutBaseElementTextFeature.java
@@ -1,65 +1,65 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public abstract class LayoutBaseElementTextFeature extends DefaultLayoutBPMNShapeFeature {
-
-// private static IGaService gaService = Graphiti.getGaService();
-
- public LayoutBaseElementTextFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- PictogramElement pictoElem = context.getPictogramElement();
- if (!(pictoElem instanceof ContainerShape)) {
- return false;
- }
- return BusinessObjectUtil.containsElementOfType(pictoElem, BaseElement.class);
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- ContainerShape container = (ContainerShape) context.getPictogramElement();
-
-// Shape textShape = getShape(control, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
-// Text textGa = (Text) textShape.getGraphicsAlgorithm();
-// String text = textGa.getValue() == null ? "" : textGa.getValue();
-// IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(text, textGa.getFont());
-
-// GraphicsAlgorithm parentGa = control.getGraphicsAlgorithm();
-
-// if (size.getWidth() > getMinimumWidth()) {
-// gaService.setSize(parentGa, parentGa.getWidth(), parentGa.getHeight());
-// } else {
-// gaService.setSize(parentGa, getMinimumWidth(), parentGa.getHeight());
-// }
-
-// gaService.setSize(textGa, size.getWidth() + 3, textGa.getHeight());
-
- return super.layout(context);
- }
-
- public abstract int getMinimumWidth();
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.modeler.core.features.DefaultLayoutBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public abstract class LayoutBaseElementTextFeature extends DefaultLayoutBPMNShapeFeature {
+
+// private static IGaService gaService = Graphiti.getGaService();
+
+ public LayoutBaseElementTextFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ PictogramElement pictoElem = context.getPictogramElement();
+ if (!(pictoElem instanceof ContainerShape)) {
+ return false;
+ }
+ return BusinessObjectUtil.containsElementOfType(pictoElem, BaseElement.class);
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ ContainerShape container = (ContainerShape) context.getPictogramElement();
+
+// Shape textShape = getShape(control, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
+// Text textGa = (Text) textShape.getGraphicsAlgorithm();
+// String text = textGa.getValue() == null ? "" : textGa.getValue();
+// IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(text, textGa.getFont());
+
+// GraphicsAlgorithm parentGa = control.getGraphicsAlgorithm();
+
+// if (size.getWidth() > getMinimumWidth()) {
+// gaService.setSize(parentGa, parentGa.getWidth(), parentGa.getHeight());
+// } else {
+// gaService.setSize(parentGa, getMinimumWidth(), parentGa.getHeight());
+// }
+
+// gaService.setSize(textGa, size.getWidth() + 3, textGa.getHeight());
+
+ return super.layout(context);
+ }
+
+ public abstract int getMinimumWidth();
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/AppendActivityFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/AppendActivityFeature.java
index 7b8c3c9..289180c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/AppendActivityFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/AppendActivityFeature.java
@@ -1,58 +1,58 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.activity;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IFeatureProvider;
-
-/**
- * @author Bob Brodt
- *
- */
-public class AppendActivityFeature extends AbstractAppendNodeNodeFeature<Activity> {
-
- /**
- * @param fp
- */
- public AppendActivityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public String getName() {
- return "Append Activity";
- }
-
- @Override
- public String getDescription() {
- return "Create a new Activity and connect it to this item";
- }
-
- @Override
- public String getImageId() {
- return ImageProvider.IMG_16_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getActivity();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.activity;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IFeatureProvider;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class AppendActivityFeature extends AbstractAppendNodeNodeFeature<Activity> {
+
+ /**
+ * @param fp
+ */
+ public AppendActivityFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Append Activity";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Create a new Activity and connect it to this item";
+ }
+
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getActivity();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/subprocess/ExpandFlowNodeFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/subprocess/ExpandFlowNodeFeature.java
index 870fb3c..f144573 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/subprocess/ExpandFlowNodeFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/subprocess/ExpandFlowNodeFeature.java
@@ -12,10 +12,13 @@
******************************************************************************/
package org.eclipse.bpmn2.modeler.ui.features.activity.subprocess;
+import static org.eclipse.bpmn2.modeler.ui.features.activity.subprocess.SubProcessFeatureContainer.IS_EXPANDED;
+
import org.eclipse.bpmn2.FlowNode;
import org.eclipse.bpmn2.di.BPMNShape;
import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.ShowDiagramPageFeature;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.IResizeShapeFeature;
import org.eclipse.graphiti.features.IUpdateFeature;
@@ -30,20 +33,26 @@
import org.eclipse.graphiti.services.Graphiti;
// NOT USED YET
-public class ExpandFlowNodeFeature extends AbstractCustomFeature {
+public class ExpandFlowNodeFeature extends ShowDiagramPageFeature {
+ private final static String NAME = "Expand";
+ private final static String DESCRIPTION = "Expand the Activity and show contents";
+
+ private String name = NAME;
+ private String description = DESCRIPTION;
+
public ExpandFlowNodeFeature(IFeatureProvider fp) {
super(fp);
}
@Override
public String getName() {
- return "Expand";
+ return name;
}
@Override
public String getDescription() {
- return "Expand the Activity and show contents";
+ return description;
}
@Override
@@ -58,6 +67,16 @@
@Override
public boolean canExecute(ICustomContext context) {
+ if (super.canExecute(context)) {
+ name = super.getName();
+ description = super.getDescription();
+ return true;
+ }
+ else {
+ name = NAME;
+ description = DESCRIPTION;
+ }
+
boolean ret = false;
PictogramElement[] pes = context.getPictogramElements();
if (pes != null && pes.length == 1) {
@@ -78,6 +97,11 @@
@Override
public void execute(ICustomContext context) {
+ if (super.canExecute(context)) {
+ super.execute(context);
+ return;
+ }
+
PictogramElement[] pes = context.getPictogramElements();
if (pes != null && pes.length == 1) {
PictogramElement pe0 = pes[0];
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/BusinessRuleTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/BusinessRuleTaskFeatureContainer.java
index ce53d48..c8b8c42 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/BusinessRuleTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/BusinessRuleTaskFeatureContainer.java
@@ -1,82 +1,82 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.BusinessRuleTask;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class BusinessRuleTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof BusinessRuleTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateBusinessRuleTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<BusinessRuleTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_BUSINESS_RULE_TASK);
- service.setLocationAndSize(img, 2, 2, 16, 16);
- }
-
- @Override
- public int getWidth() {
- return GraphicsUtil.getActivitySize(getDiagram()).getWidth();
-// return GraphicsUtil.TASK_DEFAULT_WIDTH + 50;
- }
- };
- }
-
- public static class CreateBusinessRuleTaskFeature extends AbstractCreateTaskFeature<BusinessRuleTask> {
-
- public CreateBusinessRuleTaskFeature(IFeatureProvider fp) {
- super(fp, "Business Rule Task", "Task that can use Business Rules Engine");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_BUSINESS_RULE_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getBusinessRuleTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.BusinessRuleTask;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class BusinessRuleTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof BusinessRuleTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateBusinessRuleTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<BusinessRuleTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_BUSINESS_RULE_TASK);
+ service.setLocationAndSize(img, 2, 2, 16, 16);
+ }
+
+ @Override
+ public int getWidth() {
+ return GraphicsUtil.getActivitySize(getDiagram()).getWidth();
+// return GraphicsUtil.TASK_DEFAULT_WIDTH + 50;
+ }
+ };
+ }
+
+ public static class CreateBusinessRuleTaskFeature extends AbstractCreateTaskFeature<BusinessRuleTask> {
+
+ public CreateBusinessRuleTaskFeature(IFeatureProvider fp) {
+ super(fp, "Business Rule Task", "Task that can use Business Rules Engine");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_BUSINESS_RULE_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getBusinessRuleTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/CustomTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/CustomTaskFeatureContainer.java
index a54ae51..9527cea 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/CustomTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/CustomTaskFeatureContainer.java
@@ -1,268 +1,268 @@
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.impl.TaskImpl;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.ICustomTaskFeature;
-import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskDescriptor;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.ui.diagram.BPMNFeatureProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IAreaContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IDoubleClickContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class CustomTaskFeatureContainer extends TaskFeatureContainer implements ICustomTaskFeature {
-
- protected String id;
- protected CustomTaskDescriptor customTaskDescriptor;
-
- /* (non-Javadoc)
- * Determine if the context applies to this modelObject and return the Task object. Return null otherwise.
- * @param context - the Graphiti context.
- *
- * @see org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer#getApplyObject(org.eclipse.graphiti.features.context.IContext)
- */
- @Override
- public Object getApplyObject(IContext context) {
- Object id = getId(context);
- if (id==null || !this.id.equals(id)) {
- return null;
- }
-
- return super.getApplyObject(context);
- }
-
- @Override
- public boolean canApplyTo(Object o) {
- boolean b1 = o instanceof TaskImpl;
- boolean b2 = o.getClass().isAssignableFrom(TaskImpl.class);
- return b1 || b2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.task.ICustomTaskFeature#setId(java.lang.String)
- */
- @Override
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * Set this modelObject's ID in the given Graphiti context.
- *
- * @param context - if this is a IPictogramElementContext, set the property
- * in the contained PictogramElement's list of properties;
- * otherwise set the Context's property
- * @param id - ID of this Custom Task
- */
- public static void setId(IContext context, String id) {
-
- if (context instanceof IPictogramElementContext) {
- PictogramElement pe = ((IPictogramElementContext)context).getPictogramElement();
- Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,id);
- }
- else {
- context.putProperty(CUSTOM_TASK_ID, id);
- }
- }
-
- /**
- * Returns the modelObject ID string from the given Graphiti context.
- *
- * @param context
- * @return - ID string for this modelObject.
- */
- public static String getId(IContext context) {
- Object id = null;
-
- /**
- * IAddContext can also mean that a file is dragged,
- * therefore we have to check if we are really dragging a customTask
- */
- if (context instanceof IAddContext &&
- ((IAddContext)context).getNewObject() instanceof EObject ) {
- EObject object = (EObject) ((IAddContext)context).getNewObject();
- TargetRuntime rt = TargetRuntime.getCurrentRuntime();
- for (CustomTaskDescriptor ct : rt.getCustomTasks()) {
- id = ct.getFeatureContainer().getId(object);
- if (id!=null) {
- context.putProperty(CUSTOM_TASK_ID, id);
- return (String)id;
- }
- }
- }
-
- if (context instanceof IPictogramElementContext) {
- PictogramElement pe = ((IPictogramElementContext)context).getPictogramElement();
- id = Graphiti.getPeService().getPropertyValue(pe,CUSTOM_TASK_ID);
- }
- else {
- id = context.getProperty(CUSTOM_TASK_ID);
- }
- return (String)id;
- }
-
- public String getId(EObject object) {
- return null;
- }
-
- /**
- * Set this modelObject's ID string. The ID is defined in the plugin's
- * extension point contribution to org.eclipse.bpmn2.modeler.rutime.
- * This will register the Custom Task with the BPMN Feature Provider.
- *
- * @param fp - Feature Provider (must be a BPMNFeatureProvider)
- * @param id - the modelObject ID string.
- * @throws Exception
- * Custom Task ID can not be null
- * The Feature Provider is invalid (not a BPMNFeatureProvider)
- * Attempt to add a Custom Feature with a duplicate ID {id}
- */
- public void setId(IFeatureProvider fp, String id) throws Exception {
-
- // "id" is a required parameter in the extension point.
- if (id==null || id.isEmpty()) {
- throw new Exception("Custom Task ID can not be null");
- }
- this.id = id;
-
- if (fp instanceof BPMNFeatureProvider) {
- // register this custom modelObject ID with the BPMNFeatureProvider;
- // this will allow the feature provider to find the correct feature control class
- // for this custom modelObject, instead of the generic "Task" feature control
- BPMNFeatureProvider bfp = (BPMNFeatureProvider)fp;
- try {
- bfp.addFeatureContainer(this);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- else
- throw new Exception("The Feature Provider is invalid (not a BPMNFeatureProvider)");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.features.activity.task.ICustomTaskFeatureContainer#getId()
- */
- @Override
- public String getId() {
- return id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.features.activity.task.ICustomTaskFeatureContainer#setCustomTaskDescriptor(org.eclipse.bpmn2.modeler.core.preferences.TargetRuntime.CustomTaskDescriptor)
- */
- @Override
- public void setCustomTaskDescriptor(CustomTaskDescriptor customTaskDescriptor) {
- this.customTaskDescriptor = customTaskDescriptor;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateCustomTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddCustomTaskFeature(fp);
- }
-
- /**
- * @author bbrodt
- *
- * Base class for Custom Task Feature construction. Custom Tasks contributed to
- * the editor MUST subclass this!
- *
- * The Task creation process copies the modelObject ID string into the Graphiti create
- * context during the construction phase, then migrates that ID into the created
- * PictogramElement. This is necessary because the ID must be associated with the
- * PE in to allow our BPMNFeatureProvider to correctly identify the Custom Task.
- */
- public class CreateCustomTaskFeature extends AbstractCreateTaskFeature<Task> {
-
- public CreateCustomTaskFeature(IFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
- public CreateCustomTaskFeature(IFeatureProvider fp) {
- super(fp, customTaskDescriptor.getName(), customTaskDescriptor.getDescription());
- }
-
- @Override
- protected PictogramElement addGraphicalRepresentation(IAreaContext context, Object newObject) {
-
- // create a new AddContext and copy our ID into it.
- IAddContext addContext = new AddContext(context, newObject);
- setId(addContext, getId());
-
- // create the PE and copy our ID into its properties.
- PictogramElement pe = getFeatureProvider().addIfPossible(addContext);
- Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,id);
-
- return pe;
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- // copy our ID into the CreateContext - this is where it all starts!
- setId(context, id);
- return super.canCreate(context);
- }
-
- @Override
- public Task createBusinessObject(ICreateContext context) {
- EObject target = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(context.getTargetContainer());
- Task task = (Task)customTaskDescriptor.createObject(target);
- putBusinessObject(context, task);
- return task;
- }
-
- @Override
- protected String getStencilImageId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getTask();
- }
-
- }
-
- public class AddCustomTaskFeature extends AddTaskFeature<Task> {
-
- /**
- * @param fp
- */
- public AddCustomTaskFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public PictogramElement add(IAddContext context) {
- PictogramElement pe = super.add(context);
- // make sure everyone knows that this PE is a custom task
- Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,getId());
- return pe;
- }
- }
-}
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.impl.TaskImpl;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.ICustomTaskFeature;
+import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskDescriptor;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.ui.diagram.BPMNFeatureProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IAreaContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.context.IDoubleClickContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.context.impl.AddContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class CustomTaskFeatureContainer extends TaskFeatureContainer implements ICustomTaskFeature {
+
+ protected String id;
+ protected CustomTaskDescriptor customTaskDescriptor;
+
+ /* (non-Javadoc)
+ * Determine if the context applies to this modelObject and return the Task object. Return null otherwise.
+ * @param context - the Graphiti context.
+ *
+ * @see org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer#getApplyObject(org.eclipse.graphiti.features.context.IContext)
+ */
+ @Override
+ public Object getApplyObject(IContext context) {
+ Object id = getId(context);
+ if (id==null || !this.id.equals(id)) {
+ return null;
+ }
+
+ return super.getApplyObject(context);
+ }
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ boolean b1 = o instanceof TaskImpl;
+ boolean b2 = o.getClass().isAssignableFrom(TaskImpl.class);
+ return b1 || b2;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.task.ICustomTaskFeature#setId(java.lang.String)
+ */
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * Set this modelObject's ID in the given Graphiti context.
+ *
+ * @param context - if this is a IPictogramElementContext, set the property
+ * in the contained PictogramElement's list of properties;
+ * otherwise set the Context's property
+ * @param id - ID of this Custom Task
+ */
+ public static void setId(IContext context, String id) {
+
+ if (context instanceof IPictogramElementContext) {
+ PictogramElement pe = ((IPictogramElementContext)context).getPictogramElement();
+ Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,id);
+ }
+ else {
+ context.putProperty(CUSTOM_TASK_ID, id);
+ }
+ }
+
+ /**
+ * Returns the modelObject ID string from the given Graphiti context.
+ *
+ * @param context
+ * @return - ID string for this modelObject.
+ */
+ public static String getId(IContext context) {
+ Object id = null;
+
+ /**
+ * IAddContext can also mean that a file is dragged,
+ * therefore we have to check if we are really dragging a customTask
+ */
+ if (context instanceof IAddContext &&
+ ((IAddContext)context).getNewObject() instanceof EObject ) {
+ EObject object = (EObject) ((IAddContext)context).getNewObject();
+ TargetRuntime rt = TargetRuntime.getCurrentRuntime();
+ for (CustomTaskDescriptor ct : rt.getCustomTasks()) {
+ id = ct.getFeatureContainer().getId(object);
+ if (id!=null) {
+ context.putProperty(CUSTOM_TASK_ID, id);
+ return (String)id;
+ }
+ }
+ }
+
+ if (context instanceof IPictogramElementContext) {
+ PictogramElement pe = ((IPictogramElementContext)context).getPictogramElement();
+ id = Graphiti.getPeService().getPropertyValue(pe,CUSTOM_TASK_ID);
+ }
+ else {
+ id = context.getProperty(CUSTOM_TASK_ID);
+ }
+ return (String)id;
+ }
+
+ public String getId(EObject object) {
+ return null;
+ }
+
+ /**
+ * Set this modelObject's ID string. The ID is defined in the plugin's
+ * extension point contribution to org.eclipse.bpmn2.modeler.rutime.
+ * This will register the Custom Task with the BPMN Feature Provider.
+ *
+ * @param fp - Feature Provider (must be a BPMNFeatureProvider)
+ * @param id - the modelObject ID string.
+ * @throws Exception
+ * Custom Task ID can not be null
+ * The Feature Provider is invalid (not a BPMNFeatureProvider)
+ * Attempt to add a Custom Feature with a duplicate ID {id}
+ */
+ public void setId(IFeatureProvider fp, String id) throws Exception {
+
+ // "id" is a required parameter in the extension point.
+ if (id==null || id.isEmpty()) {
+ throw new Exception("Custom Task ID can not be null");
+ }
+ this.id = id;
+
+ if (fp instanceof BPMNFeatureProvider) {
+ // register this custom modelObject ID with the BPMNFeatureProvider;
+ // this will allow the feature provider to find the correct feature control class
+ // for this custom modelObject, instead of the generic "Task" feature control
+ BPMNFeatureProvider bfp = (BPMNFeatureProvider)fp;
+ try {
+ bfp.addFeatureContainer(this);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ else
+ throw new Exception("The Feature Provider is invalid (not a BPMNFeatureProvider)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.features.activity.task.ICustomTaskFeatureContainer#getId()
+ */
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.features.activity.task.ICustomTaskFeatureContainer#setCustomTaskDescriptor(org.eclipse.bpmn2.modeler.core.preferences.TargetRuntime.CustomTaskDescriptor)
+ */
+ @Override
+ public void setCustomTaskDescriptor(CustomTaskDescriptor customTaskDescriptor) {
+ this.customTaskDescriptor = customTaskDescriptor;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateCustomTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddCustomTaskFeature(fp);
+ }
+
+ /**
+ * @author bbrodt
+ *
+ * Base class for Custom Task Feature construction. Custom Tasks contributed to
+ * the editor MUST subclass this!
+ *
+ * The Task creation process copies the modelObject ID string into the Graphiti create
+ * context during the construction phase, then migrates that ID into the created
+ * PictogramElement. This is necessary because the ID must be associated with the
+ * PE in to allow our BPMNFeatureProvider to correctly identify the Custom Task.
+ */
+ public class CreateCustomTaskFeature extends AbstractCreateTaskFeature<Task> {
+
+ public CreateCustomTaskFeature(IFeatureProvider fp, String name, String description) {
+ super(fp, name, description);
+ }
+
+ public CreateCustomTaskFeature(IFeatureProvider fp) {
+ super(fp, customTaskDescriptor.getName(), customTaskDescriptor.getDescription());
+ }
+
+ @Override
+ protected PictogramElement addGraphicalRepresentation(IAreaContext context, Object newObject) {
+
+ // create a new AddContext and copy our ID into it.
+ IAddContext addContext = new AddContext(context, newObject);
+ setId(addContext, getId());
+
+ // create the PE and copy our ID into its properties.
+ PictogramElement pe = getFeatureProvider().addIfPossible(addContext);
+ Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,id);
+
+ return pe;
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ // copy our ID into the CreateContext - this is where it all starts!
+ setId(context, id);
+ return super.canCreate(context);
+ }
+
+ @Override
+ public Task createBusinessObject(ICreateContext context) {
+ EObject target = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(context.getTargetContainer());
+ Task task = (Task)customTaskDescriptor.createObject(target);
+ putBusinessObject(context, task);
+ return task;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getTask();
+ }
+
+ }
+
+ public class AddCustomTaskFeature extends AddTaskFeature<Task> {
+
+ /**
+ * @param fp
+ */
+ public AddCustomTaskFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public PictogramElement add(IAddContext context) {
+ PictogramElement pe = super.add(context);
+ // make sure everyone knows that this PE is a custom task
+ Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,getId());
+ return pe;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ManualTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ManualTaskFeatureContainer.java
index 4cd6c7a..159ddb5 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ManualTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ManualTaskFeatureContainer.java
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.ManualTask;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class ManualTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ManualTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateManualTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<ManualTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_MANUAL_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- public static class CreateManualTaskFeature extends AbstractCreateTaskFeature<ManualTask> {
-
- public CreateManualTaskFeature(IFeatureProvider fp) {
- super(fp, "Manual Task",
- "Task that is expected to perform without the aid of any business process execution engine or any application");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_MANUAL_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getManualTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.ManualTask;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class ManualTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ManualTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateManualTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<ManualTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_MANUAL_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ public static class CreateManualTaskFeature extends AbstractCreateTaskFeature<ManualTask> {
+
+ public CreateManualTaskFeature(IFeatureProvider fp) {
+ super(fp, "Manual Task",
+ "Task that is expected to perform without the aid of any business process execution engine or any application");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_MANUAL_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getManualTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ReceiveTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ReceiveTaskFeatureContainer.java
index 94ee6c0..c413d62 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ReceiveTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ReceiveTaskFeatureContainer.java
@@ -1,77 +1,77 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ParallelGateway;
-import org.eclipse.bpmn2.ReceiveTask;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class ReceiveTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ReceiveTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateReceiveTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<ReceiveTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_RECEIVE_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- public static class CreateReceiveTaskFeature extends AbstractCreateTaskFeature<ReceiveTask> {
-
- public CreateReceiveTaskFeature(IFeatureProvider fp) {
- super(fp, "Receive Task", "Task that is completed when a message arrives");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_RECEIVE_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getReceiveTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ParallelGateway;
+import org.eclipse.bpmn2.ReceiveTask;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class ReceiveTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ReceiveTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateReceiveTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<ReceiveTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_RECEIVE_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ public static class CreateReceiveTaskFeature extends AbstractCreateTaskFeature<ReceiveTask> {
+
+ public CreateReceiveTaskFeature(IFeatureProvider fp) {
+ super(fp, "Receive Task", "Task that is completed when a message arrives");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_RECEIVE_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getReceiveTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ScriptTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ScriptTaskFeatureContainer.java
index 3bdffc3..a1a8b7c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ScriptTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ScriptTaskFeatureContainer.java
@@ -1,77 +1,77 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ReceiveTask;
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class ScriptTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ScriptTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateScriptTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<ScriptTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_SCRIPT_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- public static class CreateScriptTaskFeature extends AbstractCreateTaskFeature<ScriptTask> {
-
- public CreateScriptTaskFeature(IFeatureProvider fp) {
- super(fp, "Script Task", "Task executed by a business process engine");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_SCRIPT_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getScriptTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ReceiveTask;
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class ScriptTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ScriptTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateScriptTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<ScriptTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_SCRIPT_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ public static class CreateScriptTaskFeature extends AbstractCreateTaskFeature<ScriptTask> {
+
+ public CreateScriptTaskFeature(IFeatureProvider fp) {
+ super(fp, "Script Task", "Task executed by a business process engine");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_SCRIPT_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getScriptTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/SendTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/SendTaskFeatureContainer.java
index f2fb34a..3500625 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/SendTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/SendTaskFeatureContainer.java
@@ -1,77 +1,77 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.SendTask;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class SendTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof SendTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateSendTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<SendTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_SEND_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- public static class CreateSendTaskFeature extends AbstractCreateTaskFeature<SendTask> {
-
- public CreateSendTaskFeature(IFeatureProvider fp) {
- super(fp, "Send Task", "Task that is completed when a message is sent");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_SEND_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getSendTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.SendTask;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class SendTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof SendTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateSendTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<SendTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_SEND_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ public static class CreateSendTaskFeature extends AbstractCreateTaskFeature<SendTask> {
+
+ public CreateSendTaskFeature(IFeatureProvider fp) {
+ super(fp, "Send Task", "Task that is completed when a message is sent");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_SEND_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getSendTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ServiceTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ServiceTaskFeatureContainer.java
index b3b767e..b5873e2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ServiceTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/ServiceTaskFeatureContainer.java
@@ -1,77 +1,77 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.SendTask;
-import org.eclipse.bpmn2.ServiceTask;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class ServiceTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ServiceTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateServiceTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<ServiceTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_SERVICE_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- public static class CreateServiceTaskFeature extends AbstractCreateTaskFeature<ServiceTask> {
-
- public CreateServiceTaskFeature(IFeatureProvider fp) {
- super(fp, "Service Task", "Task that uses some kind of service");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_SERVICE_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getServiceTask();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.SendTask;
+import org.eclipse.bpmn2.ServiceTask;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class ServiceTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ServiceTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateServiceTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<ServiceTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_SERVICE_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ public static class CreateServiceTaskFeature extends AbstractCreateTaskFeature<ServiceTask> {
+
+ public CreateServiceTaskFeature(IFeatureProvider fp) {
+ super(fp, "Service Task", "Task that uses some kind of service");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_SERVICE_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getServiceTask();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/TaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/TaskFeatureContainer.java
index 4bc12f0..177a073 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/TaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/TaskFeatureContainer.java
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.impl.TaskImpl;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.FeatureEditingDialog;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.IExecutionInfo;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeature;
-import org.eclipse.graphiti.features.IFeatureAndContext;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.jface.window.Window;
-
-public class TaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o.getClass().isAssignableFrom(TaskImpl.class);
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<Task>(fp);
- }
-
- public static class CreateTaskFeature extends AbstractCreateTaskFeature<Task> {
-
- public CreateTaskFeature(IFeatureProvider fp) {
- super(fp, "Task", "Create Task");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.impl.TaskImpl;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.FeatureEditingDialog;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.IExecutionInfo;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeature;
+import org.eclipse.graphiti.features.IFeatureAndContext;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.jface.window.Window;
+
+public class TaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o.getClass().isAssignableFrom(TaskImpl.class);
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<Task>(fp);
+ }
+
+ public static class CreateTaskFeature extends AbstractCreateTaskFeature<Task> {
+
+ public CreateTaskFeature(IFeatureProvider fp) {
+ super(fp, "Task", "Create Task");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/UserTaskFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/UserTaskFeatureContainer.java
index fb44e0a..a50a4d3 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/UserTaskFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/UserTaskFeatureContainer.java
@@ -1,80 +1,80 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.activity.task;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.UserTask;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class UserTaskFeatureContainer extends AbstractTaskFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof UserTask;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateUserTaskFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTaskFeature<UserTask>(fp) {
- @Override
- protected void decorateActivityRectangle(RoundedRectangle rect) {
- IGaService service = Graphiti.getGaService();
- Image img = service.createImage(rect, ImageProvider.IMG_16_USER_TASK);
- service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
- }
- };
- }
-
- public static class CreateUserTaskFeature extends AbstractCreateTaskFeature<UserTask> {
-
- public CreateUserTaskFeature(IFeatureProvider fp) {
- super(fp, "User Task",
- "A User Task is a typical \"workflow\" Task where a human"
- +" performer performs the Task with the assistance of a"
- +" software application and is scheduled through a modelObject"
- +" list manager of some sort.");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_USER_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getUserTask();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.activity.task;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.UserTask;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AbstractCreateTaskFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.task.AddTaskFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class UserTaskFeatureContainer extends AbstractTaskFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof UserTask;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateUserTaskFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTaskFeature<UserTask>(fp) {
+ @Override
+ protected void decorateActivityRectangle(RoundedRectangle rect) {
+ IGaService service = Graphiti.getGaService();
+ Image img = service.createImage(rect, ImageProvider.IMG_16_USER_TASK);
+ service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
+ }
+ };
+ }
+
+ public static class CreateUserTaskFeature extends AbstractCreateTaskFeature<UserTask> {
+
+ public CreateUserTaskFeature(IFeatureProvider fp) {
+ super(fp, "User Task",
+ "A User Task is a typical \"workflow\" Task where a human"
+ +" performer performs the Task with the assistance of a"
+ +" software application and is scheduled through a modelObject"
+ +" list manager of some sort.");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_USER_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getUserTask();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/TextAnnotationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/TextAnnotationFeatureContainer.java
index 54ede16..40917d0 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/TextAnnotationFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/TextAnnotationFeatureContainer.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.artifact;
-
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.DefaultResizeBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.artifact.AddTextAnnotationFeature;
-import org.eclipse.bpmn2.modeler.core.features.artifact.DirectEditTextAnnotationFeature;
-import org.eclipse.bpmn2.modeler.core.features.artifact.LayoutTextAnnotationFeature;
-import org.eclipse.bpmn2.modeler.core.features.artifact.MoveTextAnnotationFeature;
-import org.eclipse.bpmn2.modeler.core.features.artifact.UpdateTextAnnotationFeature;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-
-public class TextAnnotationFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof TextAnnotation;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateTextAnnotationFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddTextAnnotationFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateTextAnnotationFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return new DirectEditTextAnnotationFeature(fp);
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutTextAnnotationFeature(fp);
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new MoveTextAnnotationFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeBPMNShapeFeature(fp);
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.artifact;
+
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.DefaultResizeBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.artifact.AddTextAnnotationFeature;
+import org.eclipse.bpmn2.modeler.core.features.artifact.DirectEditTextAnnotationFeature;
+import org.eclipse.bpmn2.modeler.core.features.artifact.LayoutTextAnnotationFeature;
+import org.eclipse.bpmn2.modeler.core.features.artifact.MoveTextAnnotationFeature;
+import org.eclipse.bpmn2.modeler.core.features.artifact.UpdateTextAnnotationFeature;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+
+public class TextAnnotationFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof TextAnnotation;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateTextAnnotationFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddTextAnnotationFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateTextAnnotationFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return new DirectEditTextAnnotationFeature(fp);
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutTextAnnotationFeature(fp);
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new MoveTextAnnotationFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeBPMNShapeFeature(fp);
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AbstractChoreographyFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AbstractChoreographyFeatureContainer.java
index aab68ee..ba589d9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AbstractChoreographyFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AbstractChoreographyFeatureContainer.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.choreography.LayoutChoreographyFeature;
-import org.eclipse.bpmn2.modeler.core.features.choreography.UpdateChoreographyNameFeature;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-
-public abstract class AbstractChoreographyFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public MultiUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
- multiUpdate.addUpdateFeature(new UpdateChoreographyNameFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateChoreographyParticipantRefsFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateChoreographyInitiatingParticipantFeature(fp));
- // multiUpdate.addUpdateFeature(new UpdateChoreographyMarkerFeature(fp)); use it when prop editor supports enums
- return multiUpdate;
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutChoreographyFeature(fp);
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new MoveChoreographyFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new ResizeChoreographyFeature(fp);
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.choreography.LayoutChoreographyFeature;
+import org.eclipse.bpmn2.modeler.core.features.choreography.UpdateChoreographyNameFeature;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+
+public abstract class AbstractChoreographyFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public MultiUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
+ multiUpdate.addUpdateFeature(new UpdateChoreographyNameFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateChoreographyParticipantRefsFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateChoreographyInitiatingParticipantFeature(fp));
+ // multiUpdate.addUpdateFeature(new UpdateChoreographyMarkerFeature(fp)); use it when prop editor supports enums
+ return multiUpdate;
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutChoreographyFeature(fp);
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new MoveChoreographyFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new ResizeChoreographyFeature(fp);
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddCallChoreographyFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddCallChoreographyFeature.java
index bb5dac4..e7f7c73 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddCallChoreographyFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddCallChoreographyFeature.java
@@ -1,44 +1,44 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import org.eclipse.bpmn2.CallChoreography;
-import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-
-public class AddCallChoreographyFeature extends AddChoreographyActivityFeature<CallChoreography> {
-
- public AddCallChoreographyFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canAdd(IAddContext context) {
- return super.canAdd(context)
- || BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), FlowElementsContainer.class);
- }
-
- @Override
- protected void decorateContainerRect(RoundedRectangle containerRect) {
- containerRect.setLineWidth(2);
- }
-
- @Override
- protected boolean isShowNames() {
- return false;
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import org.eclipse.bpmn2.CallChoreography;
+import org.eclipse.bpmn2.FlowElementsContainer;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+
+public class AddCallChoreographyFeature extends AddChoreographyActivityFeature<CallChoreography> {
+
+ public AddCallChoreographyFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canAdd(IAddContext context) {
+ return super.canAdd(context)
+ || BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), FlowElementsContainer.class);
+ }
+
+ @Override
+ protected void decorateContainerRect(RoundedRectangle containerRect) {
+ containerRect.setLineWidth(2);
+ }
+
+ @Override
+ protected boolean isShowNames() {
+ return false;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddChoreographyTaskFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddChoreographyTaskFeature.java
index 5a00c66..1a57d17 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddChoreographyTaskFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddChoreographyTaskFeature.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-
-public class AddChoreographyTaskFeature extends AddChoreographyActivityFeature<ChoreographyTask> {
-
- public AddChoreographyTaskFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canAdd(IAddContext context) {
- return super.canAdd(context)
- || BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), FlowElementsContainer.class);
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.FlowElementsContainer;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+
+public class AddChoreographyTaskFeature extends AddChoreographyActivityFeature<ChoreographyTask> {
+
+ public AddChoreographyTaskFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canAdd(IAddContext context) {
+ return super.canAdd(context)
+ || BusinessObjectUtil.containsElementOfType(context.getTargetContainer(), FlowElementsContainer.class);
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddSubChoreographyFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddSubChoreographyFeature.java
index 8ee6959..582d2b8 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddSubChoreographyFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/AddSubChoreographyFeature.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.TEXT_H;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.SubChoreography;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class AddSubChoreographyFeature extends AddChoreographyActivityFeature<SubChoreography> {
-
- public AddSubChoreographyFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected void setTextLocation(ContainerShape choreographyContainer, Text text, int w, int h) {
- List<ContainerShape> bandContainers = ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer);
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottomBands = ChoreographyUtil
- .getTopAndBottomBands(bandContainers);
- List<ContainerShape> topBands = topAndBottomBands.getFirst();
-
- int y = 3;
- if (!topBands.isEmpty()) {
- ContainerShape containerShape = topBands.get(topBands.size() - 1);
- GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
- y = ga.getY() + ga.getHeight() + 3;
- }
-
- gaService.setLocationAndSize(text, 0, y, w, TEXT_H);
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.TEXT_H;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.SubChoreography;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class AddSubChoreographyFeature extends AddChoreographyActivityFeature<SubChoreography> {
+
+ public AddSubChoreographyFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected void setTextLocation(ContainerShape choreographyContainer, Text text, int w, int h) {
+ List<ContainerShape> bandContainers = ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer);
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottomBands = ChoreographyUtil
+ .getTopAndBottomBands(bandContainers);
+ List<ContainerShape> topBands = topAndBottomBands.getFirst();
+
+ int y = 3;
+ if (!topBands.isEmpty()) {
+ ContainerShape containerShape = topBands.get(topBands.size() - 1);
+ GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
+ y = ga.getY() + ga.getHeight() + 3;
+ }
+
+ gaService.setLocationAndSize(text, 0, y, w, TEXT_H);
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/BlackboxFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/BlackboxFeature.java
new file mode 100644
index 0000000..42b9ff3
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/BlackboxFeature.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.PictogramLink;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class BlackboxFeature extends AbstractCustomFeature {
+
+ /**
+ * @param fp
+ */
+ public BlackboxFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Blackbox";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Delete the Diagram for this Participant";
+ }
+
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_BLACKBOX;
+ }
+
+ @Override
+ public boolean isAvailable(IContext context) {
+ return true;
+ }
+
+ @Override
+ public boolean canExecute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof Participant) {
+ Participant participant = (Participant)bo;
+ Process process = participant.getProcessRef();
+ if (process!=null) {
+ try {
+ ModelHandler mh = ModelHandlerLocator.getModelHandler(participant.eResource());
+ DiagramElement de = mh.findDIElement(process);
+ return de!=null;
+ }
+ catch (Exception e){
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public void execute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof Participant) {
+ Participant participant = (Participant)bo;
+ Process process = participant.getProcessRef();
+
+ if (process!=null) {
+ participant.setProcessRef(null);
+
+ // can only delete this Process and BPMNDiagram if the Participant is not
+ // a Participant Band of a ChoreographyTask because the Process may still
+ // be used (or reused) by other Participants.
+ if (!ChoreographyUtil.isChoreographyParticipantBand(pe)) {
+ try {
+ boolean canDeleteProcess = true;
+ ModelHandler mh = ModelHandlerLocator.getModelHandler(participant.eResource());
+ List<Participant> participants = mh.getAll(Participant.class);
+ for (Participant p : participants) {
+ if (p.getProcessRef() == process) {
+ canDeleteProcess = false;
+ break;
+ }
+ }
+
+ if (canDeleteProcess) {
+ DiagramElement de = mh.findDIElement(process);
+ if (de.eContainer() instanceof BPMNDiagram) {
+ BPMNDiagram bpmnDiagram = (BPMNDiagram)de.eContainer();
+ DIUtils.deleteDiagram(getDiagramEditor(), bpmnDiagram);
+ }
+
+ EcoreUtil.delete(process);
+ }
+ }
+ catch (Exception e){
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/CallChoreographyFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/CallChoreographyFeatureContainer.java
index 99385b4..b9066e6 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/CallChoreographyFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/CallChoreographyFeatureContainer.java
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CallChoreography;
-import org.eclipse.bpmn2.ChoreographyLoopType;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.choreography.UpdateChoreographyNameFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-
-public class CallChoreographyFeatureContainer extends AbstractChoreographyFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof CallChoreography;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateCallChoreographyFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddCallChoreographyFeature(fp);
- }
-
- @Override
- public MultiUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
- multiUpdate.addUpdateFeature(new UpdateChoreographyNameFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateChoreographyParticipantRefsFeature(fp) {
- @Override
- protected boolean isShowNames() {
- return false;
- }
- });
- multiUpdate.addUpdateFeature(new UpdateChoreographyInitiatingParticipantFeature(fp));
- // multiUpdate.addUpdateFeature(new UpdateChoreographyMarkerFeature(fp)); use it when property editor supports
- // enums
- return multiUpdate;
- }
-
- public static class CreateCallChoreographyFeature extends AbstractCreateFlowElementFeature<CallChoreography> {
-
- public CreateCallChoreographyFeature(IFeatureProvider fp) {
- super(fp, "Call Choreography",
- "Identifies a point in the Process where a global Choreography or a Global Choreography Task is used");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_CHOREOGRAPHY_TASK;
- }
-
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getCallChoreography();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CallChoreography;
+import org.eclipse.bpmn2.ChoreographyLoopType;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.choreography.UpdateChoreographyNameFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+
+public class CallChoreographyFeatureContainer extends AbstractChoreographyFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof CallChoreography;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateCallChoreographyFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddCallChoreographyFeature(fp);
+ }
+
+ @Override
+ public MultiUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
+ multiUpdate.addUpdateFeature(new UpdateChoreographyNameFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateChoreographyParticipantRefsFeature(fp) {
+ @Override
+ protected boolean isShowNames() {
+ return false;
+ }
+ });
+ multiUpdate.addUpdateFeature(new UpdateChoreographyInitiatingParticipantFeature(fp));
+ // multiUpdate.addUpdateFeature(new UpdateChoreographyMarkerFeature(fp)); use it when property editor supports
+ // enums
+ return multiUpdate;
+ }
+
+ public static class CreateCallChoreographyFeature extends AbstractCreateFlowElementFeature<CallChoreography> {
+
+ public CreateCallChoreographyFeature(IFeatureProvider fp) {
+ super(fp, "Call Choreography",
+ "Identifies a point in the Process where a global Choreography or a Global Choreography Task is used");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_CHOREOGRAPHY_TASK;
+ }
+
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getCallChoreography();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyMessageLinkFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyMessageLinkFeatureContainer.java
index 4b6cba1..0850a44 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyMessageLinkFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyMessageLinkFeatureContainer.java
@@ -1,157 +1,157 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.DefaultDeleteBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.PropertyBasedFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.AnchorLocation;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.BoundaryAnchor;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.AbstractMoveShapeFeature;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public class ChoreographyMessageLinkFeatureContainer extends PropertyBasedFeatureContainer {
-
- @Override
- protected String getPropertyKey() {
- return ChoreographyProperties.MESSAGE_LINK;
- }
-
- @Override
- protected boolean canApplyToProperty(String value) {
- return new Boolean(value);
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new AbstractMoveShapeFeature(fp) {
-
- @Override
- public void moveShape(IMoveShapeContext context) {
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeShapeFeature(fp) {
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new DefaultDeleteBPMNShapeFeature(fp) {
-
- @Override
- public void delete(IDeleteContext context) {
- ContainerShape envelope = (ContainerShape) context.getPictogramElement();
- Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(envelope);
- BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
- BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);
- modifyAffectedBands(topBoundaryAnchor);
- modifyAffectedBands(bottomBoundaryAnchor);
- super.delete(context);
- }
-
- private void modifyAffectedBands(BoundaryAnchor anchor) {
-
- for (Connection connection : anchor.anchor.getIncomingConnections()) {
-
- EObject start = connection.getStart().eContainer();
-
- if (!(start instanceof ContainerShape)) {
- continue;
- }
-
- if (!BusinessObjectUtil.containsElementOfType((PictogramElement) start, ChoreographyActivity.class)) {
- continue;
- }
-
- List<ContainerShape> bands = ChoreographyUtil
- .getParticipantBandContainerShapes((ContainerShape) start);
-
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottomBands = ChoreographyUtil
- .getTopAndBottomBands(bands);
-
- List<ContainerShape> affectedBands = anchor.locationType == AnchorLocation.BOTTOM ? topAndBottomBands
- .getFirst() : topAndBottomBands.getSecond();
-
- for (ContainerShape bottomBand : affectedBands) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(bottomBand, BPMNShape.class);
- bpmnShape.setIsMessageVisible(false);
- }
-
- break;
- }
- }
- };
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.DefaultDeleteBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.PropertyBasedFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.AnchorLocation;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.BoundaryAnchor;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IDeleteContext;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.impl.AbstractMoveShapeFeature;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public class ChoreographyMessageLinkFeatureContainer extends PropertyBasedFeatureContainer {
+
+ @Override
+ protected String getPropertyKey() {
+ return ChoreographyProperties.MESSAGE_LINK;
+ }
+
+ @Override
+ protected boolean canApplyToProperty(String value) {
+ return new Boolean(value);
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new AbstractMoveShapeFeature(fp) {
+
+ @Override
+ public void moveShape(IMoveShapeContext context) {
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeShapeFeature(fp) {
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new DefaultDeleteBPMNShapeFeature(fp) {
+
+ @Override
+ public void delete(IDeleteContext context) {
+ ContainerShape envelope = (ContainerShape) context.getPictogramElement();
+ Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(envelope);
+ BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
+ BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);
+ modifyAffectedBands(topBoundaryAnchor);
+ modifyAffectedBands(bottomBoundaryAnchor);
+ super.delete(context);
+ }
+
+ private void modifyAffectedBands(BoundaryAnchor anchor) {
+
+ for (Connection connection : anchor.anchor.getIncomingConnections()) {
+
+ EObject start = connection.getStart().eContainer();
+
+ if (!(start instanceof ContainerShape)) {
+ continue;
+ }
+
+ if (!BusinessObjectUtil.containsElementOfType((PictogramElement) start, ChoreographyActivity.class)) {
+ continue;
+ }
+
+ List<ContainerShape> bands = ChoreographyUtil
+ .getParticipantBandContainerShapes((ContainerShape) start);
+
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottomBands = ChoreographyUtil
+ .getTopAndBottomBands(bands);
+
+ List<ContainerShape> affectedBands = anchor.locationType == AnchorLocation.BOTTOM ? topAndBottomBands
+ .getFirst() : topAndBottomBands.getSecond();
+
+ for (ContainerShape bottomBand : affectedBands) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(bottomBand, BPMNShape.class);
+ bpmnShape.setIsMessageVisible(false);
+ }
+
+ break;
+ }
+ }
+ };
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographySelectionBehavior.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographySelectionBehavior.java
index 0178a56..f4a1a1d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographySelectionBehavior.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographySelectionBehavior.java
@@ -1,55 +1,55 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
-import org.eclipse.graphiti.mm.PropertyContainer;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class ChoreographySelectionBehavior {
-
- public static boolean canApplyTo(PictogramElement pe) {
- if (!(pe instanceof PropertyContainer)) {
- return false;
- }
-
- String property = Graphiti.getPeService().getPropertyValue(pe, ChoreographyProperties.MESSAGE_LINK);
- if (property == null) {
- return false;
- }
-
- return new Boolean(property);
- }
-
- public static GraphicsAlgorithm[] getClickArea(PictogramElement element) {
- Iterator<Shape> iterator = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element).iterator();
- GraphicsAlgorithm[] algorithms = new GraphicsAlgorithm[2];
- algorithms[0] = iterator.next().getGraphicsAlgorithm();
- algorithms[1] = iterator.next().getGraphicsAlgorithm();
- return algorithms;
- }
-
- public static GraphicsAlgorithm getSelectionBorder(PictogramElement element) {
- Collection<Shape> children = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element);
- PictogramElement first = children.iterator().next();
- return first.getGraphicsAlgorithm();
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
+import org.eclipse.graphiti.mm.PropertyContainer;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class ChoreographySelectionBehavior {
+
+ public static boolean canApplyTo(PictogramElement pe) {
+ if (!(pe instanceof PropertyContainer)) {
+ return false;
+ }
+
+ String property = Graphiti.getPeService().getPropertyValue(pe, ChoreographyProperties.MESSAGE_LINK);
+ if (property == null) {
+ return false;
+ }
+
+ return new Boolean(property);
+ }
+
+ public static GraphicsAlgorithm[] getClickArea(PictogramElement element) {
+ Iterator<Shape> iterator = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element).iterator();
+ GraphicsAlgorithm[] algorithms = new GraphicsAlgorithm[2];
+ algorithms[0] = iterator.next().getGraphicsAlgorithm();
+ algorithms[1] = iterator.next().getGraphicsAlgorithm();
+ return algorithms;
+ }
+
+ public static GraphicsAlgorithm getSelectionBorder(PictogramElement element) {
+ Collection<Shape> children = Graphiti.getPeService().getAllContainedShapes((ContainerShape) element);
+ PictogramElement first = children.iterator().next();
+ return first.getGraphicsAlgorithm();
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyUtil.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyUtil.java
index 91a6393..2a56590 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyUtil.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ChoreographyUtil.java
@@ -1,839 +1,839 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.ChoreographyLoopType;
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.InteractionNode;
-import org.eclipse.bpmn2.Message;
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.di.ParticipantBandKind;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.AnchorLocation;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.BoundaryAnchor;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Envelope;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.dd.dc.Bounds;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.PropertyContainer;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-import org.eclipse.graphiti.ui.services.GraphitiUi;
-import org.eclipse.graphiti.util.IColorConstant;
-
-public class ChoreographyUtil implements ChoreographyProperties {
-
- private static IGaService gaService = Graphiti.getGaService();
- private static IPeService peService = Graphiti.getPeService();
-
- public static List<ContainerShape> getParticipantBandContainerShapes(
- ContainerShape choreographyActivityContainerShape) {
- List<ContainerShape> containers = new ArrayList<ContainerShape>();
- Collection<Shape> shapes = peService.getAllContainedShapes(choreographyActivityContainerShape);
- for (Shape s : shapes) {
- String property = peService.getPropertyValue(s, ChoreographyProperties.BAND);
- if (property != null && new Boolean(property)) {
- containers.add((ContainerShape) s);
- }
- }
- return containers;
- }
-
- public static List<BPMNShape> getParicipantBandBpmnShapes(ContainerShape choreographyActivityContainerShape) {
- List<BPMNShape> bpmnShapes = new ArrayList<BPMNShape>();
- List<ContainerShape> containers = getParticipantBandContainerShapes(choreographyActivityContainerShape);
- for (ContainerShape container : containers) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
- bpmnShapes.add(bpmnShape);
- }
- return bpmnShapes;
- }
-
- public static boolean isChoreographyParticipantBand(PictogramElement element) {
- EObject container = element.eContainer();
- if (container instanceof PictogramElement) {
- PictogramElement containerElem = (PictogramElement) container;
- Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(containerElem);
- if (bo instanceof ChoreographyActivity) {
- return true;
- }
- }
- return false;
- }
-
- public static Tuple<List<ContainerShape>, List<ContainerShape>> getTopAndBottomBands(
- List<ContainerShape> participantBands) {
- List<ContainerShape> top = new ArrayList<ContainerShape>();
- List<ContainerShape> bottom = new ArrayList<ContainerShape>();
-
- if (participantBands.size() == 1) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(participantBands.get(0), BPMNShape.class);
- ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
- if (bandKind == ParticipantBandKind.TOP_INITIATING || bandKind == ParticipantBandKind.TOP_NON_INITIATING) {
- top.add(participantBands.get(0));
- } else if (bandKind == ParticipantBandKind.BOTTOM_INITIATING
- || bandKind == ParticipantBandKind.BOTTOM_NON_INITIATING) {
- bottom.add(participantBands.get(0));
- } else {
- top.add(participantBands.get(0));
- }
- } else {
- Collections.sort(participantBands, getParticipantBandComparator());
- int n = participantBands.size();
- int divider = n / 2;
- top.addAll(participantBands.subList(0, divider));
- bottom.addAll(participantBands.subList(divider, n));
- }
- return new Tuple<List<ContainerShape>, List<ContainerShape>>(top, bottom);
- }
-
- private static Comparator<ContainerShape> getParticipantBandComparator() {
- return new Comparator<ContainerShape>() {
-
- @Override
- public int compare(ContainerShape c1, ContainerShape c2) {
- BPMNShape bpmnShape1 = BusinessObjectUtil.getFirstElementOfType(c1, BPMNShape.class);
- Bounds bounds1 = bpmnShape1.getBounds();
- BPMNShape bpmnShape2 = BusinessObjectUtil.getFirstElementOfType(c2, BPMNShape.class);
- Bounds bounds2 = bpmnShape2.getBounds();
- return new Float(bounds1.getY()).compareTo(new Float(bounds2.getY()));
- }
-
- };
- }
-
- public static void resizePartipantBandContainerShapes(int w, int h, List<ContainerShape> top,
- List<ContainerShape> bottom, Diagram diagram) {
-
- int y = 0;
- for (ContainerShape container : top) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
- Bounds bounds = bpmnShape.getBounds();
- int hAcc = (int) bounds.getHeight();
- gaService.setLocationAndSize(container.getGraphicsAlgorithm(), 0, y, w, hAcc);
- y += hAcc;
- resizeParticipantBandChildren(container, w);
- DIUtils.updateDIShape(container);
- AnchorUtil.relocateFixPointAnchors(container, w, (int) bounds.getHeight());
- AnchorUtil.reConnect(bpmnShape, diagram);
- }
-
- Collections.reverse(bottom); // start from bottom towards center
- y = h;
- for (ContainerShape container : bottom) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
- Bounds bounds = bpmnShape.getBounds();
- y -= bounds.getHeight();
- gaService.setLocationAndSize(container.getGraphicsAlgorithm(), 0, y, w, (int) bounds.getHeight());
- resizeParticipantBandChildren(container, w);
- DIUtils.updateDIShape(container);
- AnchorUtil.relocateFixPointAnchors(container, w, (int) bounds.getHeight());
- AnchorUtil.reConnect(bpmnShape, diagram);
- }
- }
-
- private static void resizeParticipantBandChildren(ContainerShape container, int w) {
- for (Shape s : container.getChildren()) {
- GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
- if (ga instanceof Text) {
- gaService.setSize(ga, w, ga.getHeight());
- } else if (ga instanceof Rectangle) {
- gaService.setLocation(ga, (w / 2) - (ga.getWidth() / 2), ga.getY());
- }
- }
- }
-
- public static String getParticipantRefIds(ChoreographyActivity choreography) {
- if (choreography.getParticipantRefs() == null) {
- return new String();
- }
- Iterator<Participant> iterator = choreography.getParticipantRefs().iterator();
- String delim = ":";
- StringBuilder sb = new StringBuilder();
- while (iterator.hasNext()) {
- Participant participant = iterator.next();
- sb.append(participant.getId());
- if (iterator.hasNext()) {
- sb.append(delim);
- }
- }
- return sb.toString();
- }
-
- public static String getMessageRefIds(ChoreographyTask choreography) {
- if (choreography.getMessageFlowRef() == null) {
- return new String();
- }
- Iterator<MessageFlow> iterator = choreography.getMessageFlowRef().iterator();
- String delim = ":";
- StringBuilder sb = new StringBuilder();
- while (iterator.hasNext()) {
- MessageFlow message = iterator.next();
- sb.append(message.getId());
- if (iterator.hasNext()) {
- sb.append(delim);
- }
- }
- return sb.toString();
- }
-
- public static void updateParticipantReferences(ContainerShape choreographyContainer,
- List<ContainerShape> currentParticipantContainers, List<Participant> newParticipants, IFeatureProvider fp,
- boolean showNames) {
-
- Diagram diagram = peService.getDiagramForShape(choreographyContainer);
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
- ChoreographyActivity.class);
-
- BPMNDiagram dia = BusinessObjectUtil.getFirstElementOfType(diagram, BPMNDiagram.class);
- List<DiagramElement> diElements = dia.getPlane().getPlaneElement();
- for (int i = 0; i < currentParticipantContainers.size(); i++) {
- ContainerShape container = currentParticipantContainers.get(i);
- for (Connection c : peService.getOutgoingConnections(container)) {
- EObject parent = c.getEnd().eContainer();
- if (parent instanceof PictogramElement) {
- peService.deletePictogramElement((PictogramElement) parent);
- }
- }
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
- diElements.remove(bpmnShape);
- peService.deletePictogramElement(container);
- }
-
- GraphicsAlgorithm ga = choreographyContainer.getGraphicsAlgorithm();
- IDimension size = gaService.calculateSize(ga);
-
- List<ContainerShape> newContainers = new ArrayList<ContainerShape>();
- int y = 0;
- boolean first = true;
-
- List<InteractionNode> sources = new ArrayList<InteractionNode>();
- if (choreography instanceof ChoreographyTask) {
- for (MessageFlow message : ((ChoreographyTask) choreography).getMessageFlowRef()) {
- sources.add(message.getSourceRef());
- }
- }
-
- Iterator<Participant> iterator = newParticipants.iterator();
- while (iterator.hasNext()) {
- Participant participant = iterator.next();
-
- ContainerShape bandShape = peService.createContainerShape(choreographyContainer, true);
-
- ParticipantBandKind bandKind = getNewParticipantBandKind(choreography, participant, first,
- !iterator.hasNext());
-
- boolean multiple = participant.getParticipantMultiplicity() != null
- && participant.getParticipantMultiplicity().getMaximum() > 1;
-
- int w = size.getWidth();
- int h = multiple ? 40 : 20;
-
- BPMNShape bpmnShape = DIUtils.createDIShape(bandShape, participant, 0, y + h, w, h, fp, diagram);
- bpmnShape.setChoreographyActivityShape(BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
- BPMNShape.class));
- bpmnShape.setIsMarkerVisible(multiple);
- bpmnShape.setParticipantBandKind(bandKind);
- bpmnShape.setIsMessageVisible(sources.contains(participant));
- createParticipantBandContainerShape(bandKind, choreographyContainer, bandShape, bpmnShape, showNames);
- if (multiple) {
- drawMultiplicityMarkers(bandShape);
- }
- newContainers.add(bandShape);
-
- y += h;
- first = false;
- }
-
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = getTopAndBottomBands(newContainers);
- resizePartipantBandContainerShapes(size.getWidth(), size.getHeight(), topAndBottom.getFirst(),
- topAndBottom.getSecond(), diagram);
- }
-
- private static ContainerShape createTopShape(ContainerShape parent, ContainerShape bandShape, BPMNShape bpmnShape,
- boolean initiating, boolean showNames) {
-
- if (bandShape == null) {
- bandShape = peService.createContainerShape(parent, true);
- }
-
- Bounds bounds = bpmnShape.getBounds();
- int w = (int) bounds.getWidth();
- int h = (int) bounds.getHeight();
-
- Diagram diagram = peService.getDiagramForPictogramElement(parent);
- RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
- band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
- diagram, IColorConstant.LIGHT_GRAY));
- gaService.setLocationAndSize(band, 0, 0, w, h);
-
- Participant p = (Participant) bpmnShape.getBpmnElement();
- if (showNames) {
- addBandLabel(bandShape, p.getName(), w, h);
- }
- Graphiti.getPeCreateService().createChopboxAnchor(bandShape);
- AnchorUtil.addFixedPointAnchors(bandShape, band);
- peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
- peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
- Boolean.toString(bpmnShape.isIsMessageVisible()));
- return bandShape;
- }
-
- private static ContainerShape createBottomShape(ContainerShape parent, ContainerShape bandShape,
- BPMNShape bpmnShape, boolean initiating, boolean showNames) {
-
- if (bandShape == null) {
- bandShape = peService.createContainerShape(parent, true);
- }
-
- Bounds bounds = bpmnShape.getBounds();
- int w = (int) bounds.getWidth();
- int h = (int) bounds.getHeight();
-
- ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
- int y = (int) bounds.getY() - parentLoc.getY();
-
- Diagram diagram = peService.getDiagramForPictogramElement(parent);
- RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
- band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
- diagram, IColorConstant.LIGHT_GRAY));
- gaService.setLocationAndSize(band, 0, y, w, h);
-
- Participant p = (Participant) bpmnShape.getBpmnElement();
- if (showNames) {
- addBandLabel(bandShape, p.getName(), w, h);
- }
- Graphiti.getPeCreateService().createChopboxAnchor(bandShape);
- AnchorUtil.addFixedPointAnchors(bandShape, band);
- peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
- peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
- Boolean.toString(bpmnShape.isIsMessageVisible()));
- return bandShape;
- }
-
- private static ContainerShape createMiddleShape(ContainerShape parent, ContainerShape bandShape,
- BPMNShape bpmnShape, boolean initiating, boolean showNames) {
-
- if (bandShape == null) {
- bandShape = peService.createContainerShape(parent, true);
- }
-
- Bounds bounds = bpmnShape.getBounds();
- int w = (int) bounds.getWidth();
- int h = (int) bounds.getHeight();
-
- ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
- int y = (int) bounds.getY() - parentLoc.getY();
-
- Diagram diagram = peService.getDiagramForPictogramElement(parent);
- Rectangle band = gaService.createRectangle(bandShape);
- band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
- diagram, IColorConstant.LIGHT_GRAY));
- gaService.setLocationAndSize(band, 0, y, w, h);
-
- Participant p = (Participant) bpmnShape.getBpmnElement();
- if (showNames) {
- addBandLabel(bandShape, p.getName(), w, h);
- }
- Graphiti.getPeCreateService().createChopboxAnchor(bandShape);
- AnchorUtil.addFixedPointAnchors(bandShape, band);
- peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
- peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
- Boolean.toString(bpmnShape.isIsMessageVisible()));
- return bandShape;
- }
-
- private static void addBandLabel(ContainerShape container, String name, int w, int h) {
- Diagram diagram = peService.getDiagramForShape(container);
- Shape labelShape = peService.createShape(container, false);
- Text label = gaService.createDefaultText(diagram, labelShape);
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(container);
- label.setValue(name);
- gaService.setLocationAndSize(label, 0, 0, w, h);
- StyleUtil.applyStyle(label, be);
- label.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
- label.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- }
-
- private static ParticipantBandKind getNewParticipantBandKind(ChoreographyActivity choreography,
- Participant participant, boolean first, boolean last) {
- boolean initiating = choreography.getInitiatingParticipantRef() != null
- && choreography.getInitiatingParticipantRef().equals(participant);
- if (first) {
- return initiating ? ParticipantBandKind.TOP_INITIATING : ParticipantBandKind.TOP_NON_INITIATING;
- } else if (last) {
- return initiating ? ParticipantBandKind.BOTTOM_INITIATING : ParticipantBandKind.BOTTOM_NON_INITIATING;
- } else {
- return initiating ? ParticipantBandKind.MIDDLE_INITIATING : ParticipantBandKind.MIDDLE_NON_INITIATING;
- }
- }
-
- private static ContainerShape drawMessageLink(String name, BoundaryAnchor boundaryAnchor, int x, int y, boolean filled) {
- Diagram diagram = peService.getDiagramForAnchor(boundaryAnchor.anchor);
-
- FreeFormConnection connection = peService.createFreeFormConnection(diagram);
- Polyline connectionLine = gaService.createPolyline(connection);
- connectionLine.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- connectionLine.setLineStyle(LineStyle.DOT);
- connectionLine.setLineWidth(2);
-
- ContainerShape envelope = peService.createContainerShape(diagram, true);
- Rectangle invisibleRectangle = gaService.createInvisibleRectangle(envelope);
- gaService.setLocation(invisibleRectangle, x, y);
- gaService.setSize(invisibleRectangle, ENV_W + 50, ENV_H);
-
- Shape envelopeShape = peService.createShape(envelope, false);
- Envelope envelopeGa = GraphicsUtil.createEnvelope(envelopeShape, 0, 0, ENV_W, ENV_H);
- IColorConstant color = filled ? IColorConstant.LIGHT_GRAY : IColorConstant.WHITE;
- envelopeGa.rect.setFilled(true);
- envelopeGa.rect.setBackground(gaService.manageColor(diagram, color));
- envelopeGa.rect.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- envelopeGa.line.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- AnchorUtil.addFixedPointAnchors(envelope, envelopeGa.rect);
-
- Shape textShape = peService.createShape(envelope, false);
- Text text = gaService.createDefaultText(diagram, textShape);
- IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(name, text.getFont());
- gaService.setLocationAndSize(text, ENV_W + 3, 3, size.getWidth(), size.getHeight());
- text.setValue(name);
-
- gaService.setSize(invisibleRectangle, ENV_W + size.getWidth() + 3, ENV_H);
-
- AnchorLocation envelopeAnchorLoc = null;
- if (boundaryAnchor.locationType == AnchorLocation.TOP) {
- envelopeAnchorLoc = AnchorLocation.BOTTOM;
- } else {
- envelopeAnchorLoc = AnchorLocation.TOP;
- }
-
- connection.setStart(boundaryAnchor.anchor);
- connection.setEnd(AnchorUtil.getBoundaryAnchors(envelope).get(envelopeAnchorLoc).anchor);
- peService.setPropertyValue(envelope, MESSAGE_LINK, Boolean.toString(true));
- return envelope;
- }
-
- public static void drawMultiplicityMarkers(ContainerShape container) {
- Diagram diagram = peService.getDiagramForPictogramElement(container);
- Shape multiplicityShape = peService.createShape(container, false);
- Rectangle rect = gaService.createInvisibleRectangle(multiplicityShape);
-
- IDimension size = gaService.calculateSize(container.getGraphicsAlgorithm());
- int w = 10;
- int h = 10;
- int x = (size.getWidth() / 2) - (w / 2);
- int y = size.getHeight() - h - 1;
- gaService.setLocationAndSize(rect, x, y, w, h);
-
- int[][] coorinates = { new int[] { 0, 0, 0, h }, new int[] { 4, 0, 4, h }, new int[] { 8, 0, 8, h } };
- for (int[] xy : coorinates) {
- Polyline line = gaService.createPolyline(rect, xy);
- line.setLineWidth(2);
- line.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
- }
- }
-
- public static ContainerShape createParticipantBandContainerShape(ParticipantBandKind bandKind,
- ContainerShape container, ContainerShape bandContainer, BPMNShape bpmnShape, boolean showNames) {
-
- switch (bandKind) {
- case TOP_INITIATING:
- return createTopShape(container, bandContainer, bpmnShape, true, showNames);
- case TOP_NON_INITIATING:
- return createTopShape(container, bandContainer, bpmnShape, false, showNames);
- case MIDDLE_INITIATING:
- return createMiddleShape(container, bandContainer, bpmnShape, true, showNames);
- case MIDDLE_NON_INITIATING:
- return createMiddleShape(container, bandContainer, bpmnShape, false, showNames);
- case BOTTOM_INITIATING:
- return createBottomShape(container, bandContainer, bpmnShape, true, showNames);
- case BOTTOM_NON_INITIATING:
- return createBottomShape(container, bandContainer, bpmnShape, false, showNames);
- }
-
- return bandContainer;
- }
-
- public static ContainerShape createParticipantBandContainerShape(ParticipantBandKind bandKind,
- ContainerShape container, BPMNShape bpmnShape, boolean showNames) {
- return createParticipantBandContainerShape(bandKind, container, null, bpmnShape, showNames);
- }
-
- public static void drawMessageLinks(IFeatureProvider fp, ContainerShape choreographyContainer) {
-
- List<MessageFlow> messageFlows = new ArrayList<MessageFlow>();
- ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
- ChoreographyTask.class);
- if (choreography != null) {
- messageFlows.addAll(choreography.getMessageFlowRef());
- }
-
- List<ContainerShape> bandContainers = getParticipantBandContainerShapes(choreographyContainer);
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = getTopAndBottomBands(bandContainers);
- List<ContainerShape> shapesWithVisibleMessages = new ArrayList<ContainerShape>();
-
- Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(choreographyContainer);
- BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
- BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);
- int topConnectionIndex = 0;
- int bottomConnectionIndex = 0;
-
- boolean hasTopMessage = false;
- EList<Connection> topConnections = topBoundaryAnchor.anchor.getOutgoingConnections();
- for (int i = 0; i < topConnections.size(); i++) {
- Connection connection = topConnections.get(i);
- EObject container = connection.getEnd().eContainer();
- if (container instanceof PropertyContainer) {
- String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
- if (Boolean.parseBoolean(property)) {
- topConnectionIndex = i;
- hasTopMessage = true;
- break;
- }
- }
- }
-
- boolean hasBottomMessage = false;
- EList<Connection> bottomConnections = bottomBoundaryAnchor.anchor.getOutgoingConnections();
- for (int i = 0; i < bottomConnections.size(); i++) {
- Connection connection = bottomConnections.get(i);
- EObject container = connection.getEnd().eContainer();
- if (container instanceof PropertyContainer) {
- String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
- if (Boolean.parseBoolean(property)) {
- bottomConnectionIndex = i;
- hasBottomMessage = true;
- break;
- }
- }
- }
-
- Iterator<ContainerShape> iterator = bandContainers.iterator();
- while (iterator.hasNext()) {
- ContainerShape bandContainer = iterator.next();
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(bandContainer, BPMNShape.class);
- if (bpmnShape.isIsMessageVisible()) {
- shapesWithVisibleMessages.add(bandContainer);
- }
- }
-
- boolean shouldDrawTopMessage = !Collections.disjoint(topAndBottom.getFirst(), shapesWithVisibleMessages);
- boolean shouldDrawBottomMessage = !Collections.disjoint(topAndBottom.getSecond(), shapesWithVisibleMessages);
- ContainerShape envelope;
-
- String topMessageName = null;
- String bottomMessageName = null;
- Message topMessage = null;
- Message bottomMessage = null;
-
- if (shouldDrawTopMessage) {
- topMessage = getMessage(messageFlows, topAndBottom.getFirst(), false);
- topMessageName = getMessageName(messageFlows, topAndBottom.getFirst());
- }
- if (topMessageName == null) {
- topMessageName = new String();
- }
-
- if (shouldDrawBottomMessage) {
- bottomMessage = getMessage(messageFlows, topAndBottom.getSecond(), false);
- bottomMessageName = getMessageName(messageFlows, topAndBottom.getSecond());
- }
- if (bottomMessageName == null) {
- bottomMessageName = new String();
- }
-
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(choreographyContainer, BPMNShape.class);
- Bounds bounds = bpmnShape.getBounds();
- int x = (int) ((bounds.getX() + bounds.getWidth() / 2) - (ENV_W / 2));
-
- MessageFlow flow = getMessageFlow(messageFlows, topAndBottom.getFirst());
- envelope = null;
- if (!hasTopMessage && shouldDrawTopMessage && flow!=null) {
- int y = (int) (bounds.getY() - ENVELOPE_HEIGHT_MODIFIER - ENV_H);
- envelope = drawMessageLink(topMessageName, topBoundaryAnchor, x, y, isFilled(topAndBottom.getFirst()));
- if (topMessage!=null)
- fp.link(envelope, topMessage);
- peService.setPropertyValue(envelope, MESSAGE_NAME, topMessageName);
- } else if (hasTopMessage && !shouldDrawTopMessage) {
- envelope = (ContainerShape) topConnections.get(topConnectionIndex).getEnd().eContainer();
- peService.deletePictogramElement(topConnections.get(topConnectionIndex));
- peService.deletePictogramElement(envelope);
- envelope = null;
- } else if (hasTopMessage && shouldDrawTopMessage && flow!=null) {
- envelope = (ContainerShape) topConnections.get(topConnectionIndex).getEnd().eContainer();
- setMessageLabel(topMessageName, envelope);
- }
- if (envelope!=null) {
- // link up the message flow
- linkMessageFlow(fp, flow, envelope);
- }
-
- envelope = null;
- flow = getMessageFlow(messageFlows, topAndBottom.getSecond());
- if (!hasBottomMessage && shouldDrawBottomMessage && flow!=null) {
- int y = (int) (bounds.getY() + bounds.getHeight() + ENVELOPE_HEIGHT_MODIFIER);
- envelope = drawMessageLink(bottomMessageName, bottomBoundaryAnchor, x, y, isFilled(topAndBottom.getSecond()));
- if (bottomMessage!=null)
- fp.link(envelope, bottomMessage);
- peService.setPropertyValue(envelope, MESSAGE_NAME, bottomMessageName);
- } else if (hasBottomMessage && !shouldDrawBottomMessage) {
- envelope = (ContainerShape) bottomConnections.get(bottomConnectionIndex).getEnd()
- .eContainer();
- peService.deletePictogramElement(bottomConnections.get(bottomConnectionIndex));
- peService.deletePictogramElement(envelope);
- envelope = null;
- } else if (hasBottomMessage && shouldDrawBottomMessage && flow!=null) {
- envelope = (ContainerShape) bottomConnections.get(bottomConnectionIndex).getEnd()
- .eContainer();
- setMessageLabel(bottomMessageName, envelope);
- }
- if (envelope!=null) {
- // link up the message flow
- linkMessageFlow(fp, flow, envelope);
- }
-
- return;
- }
-
- private static void linkMessageFlow(IFeatureProvider fp, MessageFlow flow,ContainerShape envelope) {
- for (Anchor a : envelope.getAnchors()) {
- for (Connection c : a.getIncomingConnections()) {
- fp.link(c, flow);
- }
- for (Connection c : a.getOutgoingConnections()) {
- fp.link(c, flow);
- }
- }
- }
-
- private static boolean isFilled(List<ContainerShape> bands) {
- boolean filled = true;
- for (ContainerShape band : bands) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
- if (!bpmnShape.isIsMessageVisible()) {
- continue;
- }
- ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
- if (bandKind == ParticipantBandKind.TOP_INITIATING || bandKind == ParticipantBandKind.BOTTOM_INITIATING
- || bandKind == ParticipantBandKind.MIDDLE_INITIATING) {
- filled = false;
- break;
- }
- }
- return filled;
- }
-
- private static void setMessageLabel(String label, PictogramElement message) {
- ContainerShape containerShape = (ContainerShape) message;
- Iterator<Shape> iterator = peService.getAllContainedShapes(containerShape).iterator();
- while (iterator.hasNext()) {
- Shape shape = iterator.next();
- if (shape.getGraphicsAlgorithm() instanceof Text) {
- Text text = (Text) shape.getGraphicsAlgorithm();
- text.setValue(label);
- IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(label, text.getFont());
- gaService.setSize(containerShape.getGraphicsAlgorithm(), ENV_W + size.getWidth() + 3, ENV_H);
- gaService.setSize(text, size.getWidth(), size.getHeight());
- peService.setPropertyValue(containerShape, MESSAGE_NAME, label);
- break;
- }
- }
- }
-
- private static String getMessageName(List<MessageFlow> messageFlows, List<ContainerShape> bands) {
- for (ContainerShape band : bands) {
- Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
- if (bpmnShape.isIsMessageVisible()) {
- for (MessageFlow flow : messageFlows) {
- if (flow.getSourceRef().equals(participant)) {
- return getMessageFlowName(flow);
- }
- }
- }
- }
- return null;
- }
-
- private static MessageFlow getMessageFlow(List<MessageFlow> messageFlows, List<ContainerShape> bands) {
- for (ContainerShape band : bands) {
- Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
- if (bpmnShape.isIsMessageVisible()) {
- for (MessageFlow flow : messageFlows) {
- if (flow.getSourceRef().equals(participant)) {
- return flow;
- }
- }
- }
- }
- return null;
- }
-
- private static Message getMessage(List<MessageFlow> messageFlows, List<ContainerShape> bands, boolean create) {
- MessageFlow flow = getMessageFlow(messageFlows, bands);
- if (flow!=null) {
- if (flow.getMessageRef()==null && create) {
- Message msg = Bpmn2ModelerFactory.create(Message.class);
- msg.setName("Undefined Message");
- ModelUtil.getDefinitions(flow).getRootElements().add(msg);
- flow.setMessageRef(msg);
- ModelUtil.setID(msg);
- }
- return flow.getMessageRef();
- }
- return null;
- }
-
- public static String getMessageFlowName(MessageFlow flow) {
- if (flow.getMessageRef() == null) {
- return flow.getName();
- } else if (flow.getMessageRef().getItemRef()==null ||
- flow.getMessageRef().getItemRef().getStructureRef()==null) {
- return flow.getMessageRef().getName();
- } else {
- String messageName = flow.getMessageRef().getName();
- String itemDefinitionName = ModelUtil.getDisplayName(flow.getMessageRef().getItemRef());
- String text = itemDefinitionName;
- if (messageName!=null && !messageName.isEmpty())
- text += "/" + messageName;
- return text;
- }
- }
-
- public static String getMessageName(Message mesg) {
- if (mesg.getItemRef()==null ||
- mesg.getItemRef().getStructureRef()==null) {
- return mesg.getName();
- } else {
- String type = "(" + ModelUtil.getDisplayName(mesg.getItemRef()) +")";
- if (mesg.getName()==null)
- return type;
- return mesg.getName() + type;
- }
- }
-
- public static void moveChoreographyMessageLinks(ContainerShape choreographyContainer) {
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(choreographyContainer, BPMNShape.class);
- Bounds bounds = bpmnShape.getBounds();
- int x = (int) ((bounds.getX() + bounds.getWidth() / 2) - (ENV_W / 2));
-
- Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(choreographyContainer);
- BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
- BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);
-
- for (Connection connection : topBoundaryAnchor.anchor.getOutgoingConnections()) {
- EObject container = connection.getEnd().eContainer();
- if (container instanceof PropertyContainer) {
- String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
- if (property != null && new Boolean(property)) {
- int y = (int) (bounds.getY() - ENVELOPE_HEIGHT_MODIFIER - ENV_H);
- gaService.setLocation(((ContainerShape) container).getGraphicsAlgorithm(), x, y);
- break;
- }
- }
- }
-
- for (Connection connection : bottomBoundaryAnchor.anchor.getOutgoingConnections()) {
- EObject container = connection.getEnd().eContainer();
- if (container instanceof PropertyContainer) {
- String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
- if (property != null && new Boolean(property)) {
- int y = (int) (bounds.getY() + bounds.getHeight() + ENVELOPE_HEIGHT_MODIFIER);
- gaService.setLocation(((ContainerShape) container).getGraphicsAlgorithm(), x, y);
- break;
- }
- }
- }
- }
-
- public static void drawChoreographyLoopType(ContainerShape markerShape, ChoreographyLoopType type) {
- Collection<Shape> shapes = peService.getAllContainedShapes(markerShape);
- Shape drawingShape = null;
-
- if (shapes.size() == 1) { // remove previous shape
- Iterator<Shape> iterator = shapes.iterator();
- while (iterator.hasNext()) {
- Shape shape = iterator.next();
- drawingShape = shape;
- break;
- }
- }
-
- if (drawingShape != null) {
- peService.deletePictogramElement(drawingShape);
- }
-
- drawingShape = peService.createShape(markerShape, false);
- Rectangle rectangle = gaService.createInvisibleRectangle(drawingShape);
- gaService.setLocationAndSize(rectangle, 0, 0, MARKER_H, MARKER_H);
-
- if (type == null || type == ChoreographyLoopType.NONE) {
- return;
- }
-
- switch (type) {
- case STANDARD:
- // TODO implement when property editors supports enums
- break;
- case MULTI_INSTANCE_PARALLEL:
- // TODO implement when property editors supports enums
- break;
- case MULTI_INSTANCE_SEQUENTIAL:
- // TODO implement when property editors supports enums
- break;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.ChoreographyLoopType;
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.InteractionNode;
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.di.ParticipantBandKind;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.AnchorLocation;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.BoundaryAnchor;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Envelope;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.dd.dc.Bounds;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.datatypes.IDimension;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.mm.PropertyContainer;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.Rectangle;
+import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+import org.eclipse.graphiti.ui.services.GraphitiUi;
+import org.eclipse.graphiti.util.IColorConstant;
+
+public class ChoreographyUtil implements ChoreographyProperties {
+
+ private static IGaService gaService = Graphiti.getGaService();
+ private static IPeService peService = Graphiti.getPeService();
+
+ public static List<ContainerShape> getParticipantBandContainerShapes(
+ ContainerShape choreographyActivityContainerShape) {
+ List<ContainerShape> containers = new ArrayList<ContainerShape>();
+ Collection<Shape> shapes = peService.getAllContainedShapes(choreographyActivityContainerShape);
+ for (Shape s : shapes) {
+ String property = peService.getPropertyValue(s, ChoreographyProperties.BAND);
+ if (property != null && new Boolean(property)) {
+ containers.add((ContainerShape) s);
+ }
+ }
+ return containers;
+ }
+
+ public static List<BPMNShape> getParicipantBandBpmnShapes(ContainerShape choreographyActivityContainerShape) {
+ List<BPMNShape> bpmnShapes = new ArrayList<BPMNShape>();
+ List<ContainerShape> containers = getParticipantBandContainerShapes(choreographyActivityContainerShape);
+ for (ContainerShape container : containers) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
+ bpmnShapes.add(bpmnShape);
+ }
+ return bpmnShapes;
+ }
+
+ public static boolean isChoreographyParticipantBand(PictogramElement element) {
+ EObject container = element.eContainer();
+ if (container instanceof PictogramElement) {
+ PictogramElement containerElem = (PictogramElement) container;
+ Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(containerElem);
+ if (bo instanceof ChoreographyActivity) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static Tuple<List<ContainerShape>, List<ContainerShape>> getTopAndBottomBands(
+ List<ContainerShape> participantBands) {
+ List<ContainerShape> top = new ArrayList<ContainerShape>();
+ List<ContainerShape> bottom = new ArrayList<ContainerShape>();
+
+ if (participantBands.size() == 1) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(participantBands.get(0), BPMNShape.class);
+ ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
+ if (bandKind == ParticipantBandKind.TOP_INITIATING || bandKind == ParticipantBandKind.TOP_NON_INITIATING) {
+ top.add(participantBands.get(0));
+ } else if (bandKind == ParticipantBandKind.BOTTOM_INITIATING
+ || bandKind == ParticipantBandKind.BOTTOM_NON_INITIATING) {
+ bottom.add(participantBands.get(0));
+ } else {
+ top.add(participantBands.get(0));
+ }
+ } else {
+ Collections.sort(participantBands, getParticipantBandComparator());
+ int n = participantBands.size();
+ int divider = n / 2;
+ top.addAll(participantBands.subList(0, divider));
+ bottom.addAll(participantBands.subList(divider, n));
+ }
+ return new Tuple<List<ContainerShape>, List<ContainerShape>>(top, bottom);
+ }
+
+ private static Comparator<ContainerShape> getParticipantBandComparator() {
+ return new Comparator<ContainerShape>() {
+
+ @Override
+ public int compare(ContainerShape c1, ContainerShape c2) {
+ BPMNShape bpmnShape1 = BusinessObjectUtil.getFirstElementOfType(c1, BPMNShape.class);
+ Bounds bounds1 = bpmnShape1.getBounds();
+ BPMNShape bpmnShape2 = BusinessObjectUtil.getFirstElementOfType(c2, BPMNShape.class);
+ Bounds bounds2 = bpmnShape2.getBounds();
+ return new Float(bounds1.getY()).compareTo(new Float(bounds2.getY()));
+ }
+
+ };
+ }
+
+ public static void resizePartipantBandContainerShapes(int w, int h, List<ContainerShape> top,
+ List<ContainerShape> bottom, Diagram diagram) {
+
+ int y = 0;
+ for (ContainerShape container : top) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
+ Bounds bounds = bpmnShape.getBounds();
+ int hAcc = (int) bounds.getHeight();
+ gaService.setLocationAndSize(container.getGraphicsAlgorithm(), 0, y, w, hAcc);
+ y += hAcc;
+ resizeParticipantBandChildren(container, w);
+ DIUtils.updateDIShape(container);
+ AnchorUtil.relocateFixPointAnchors(container, w, (int) bounds.getHeight());
+ AnchorUtil.reConnect(bpmnShape, diagram);
+ }
+
+ Collections.reverse(bottom); // start from bottom towards center
+ y = h;
+ for (ContainerShape container : bottom) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
+ Bounds bounds = bpmnShape.getBounds();
+ y -= bounds.getHeight();
+ gaService.setLocationAndSize(container.getGraphicsAlgorithm(), 0, y, w, (int) bounds.getHeight());
+ resizeParticipantBandChildren(container, w);
+ DIUtils.updateDIShape(container);
+ AnchorUtil.relocateFixPointAnchors(container, w, (int) bounds.getHeight());
+ AnchorUtil.reConnect(bpmnShape, diagram);
+ }
+ }
+
+ private static void resizeParticipantBandChildren(ContainerShape container, int w) {
+ for (Shape s : container.getChildren()) {
+ GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
+ if (ga instanceof Text) {
+ gaService.setSize(ga, w, ga.getHeight());
+ } else if (ga instanceof Rectangle) {
+ gaService.setLocation(ga, (w / 2) - (ga.getWidth() / 2), ga.getY());
+ }
+ }
+ }
+
+ public static String getParticipantRefIds(ChoreographyActivity choreography) {
+ if (choreography.getParticipantRefs() == null) {
+ return new String();
+ }
+ Iterator<Participant> iterator = choreography.getParticipantRefs().iterator();
+ String delim = ":";
+ StringBuilder sb = new StringBuilder();
+ while (iterator.hasNext()) {
+ Participant participant = iterator.next();
+ sb.append(participant.getId());
+ if (iterator.hasNext()) {
+ sb.append(delim);
+ }
+ }
+ return sb.toString();
+ }
+
+ public static String getMessageRefIds(ChoreographyTask choreography) {
+ if (choreography.getMessageFlowRef() == null) {
+ return new String();
+ }
+ Iterator<MessageFlow> iterator = choreography.getMessageFlowRef().iterator();
+ String delim = ":";
+ StringBuilder sb = new StringBuilder();
+ while (iterator.hasNext()) {
+ MessageFlow message = iterator.next();
+ sb.append(message.getId());
+ if (iterator.hasNext()) {
+ sb.append(delim);
+ }
+ }
+ return sb.toString();
+ }
+
+ public static void updateParticipantReferences(ContainerShape choreographyContainer,
+ List<ContainerShape> currentParticipantContainers, List<Participant> newParticipants, IFeatureProvider fp,
+ boolean showNames) {
+
+ Diagram diagram = peService.getDiagramForShape(choreographyContainer);
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
+ ChoreographyActivity.class);
+
+ BPMNDiagram dia = BusinessObjectUtil.getFirstElementOfType(diagram, BPMNDiagram.class);
+ List<DiagramElement> diElements = dia.getPlane().getPlaneElement();
+ for (int i = 0; i < currentParticipantContainers.size(); i++) {
+ ContainerShape container = currentParticipantContainers.get(i);
+ for (Connection c : peService.getOutgoingConnections(container)) {
+ EObject parent = c.getEnd().eContainer();
+ if (parent instanceof PictogramElement) {
+ peService.deletePictogramElement((PictogramElement) parent);
+ }
+ }
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
+ diElements.remove(bpmnShape);
+ peService.deletePictogramElement(container);
+ }
+
+ GraphicsAlgorithm ga = choreographyContainer.getGraphicsAlgorithm();
+ IDimension size = gaService.calculateSize(ga);
+
+ List<ContainerShape> newContainers = new ArrayList<ContainerShape>();
+ int y = 0;
+ boolean first = true;
+
+ List<InteractionNode> sources = new ArrayList<InteractionNode>();
+ if (choreography instanceof ChoreographyTask) {
+ for (MessageFlow message : ((ChoreographyTask) choreography).getMessageFlowRef()) {
+ sources.add(message.getSourceRef());
+ }
+ }
+
+ Iterator<Participant> iterator = newParticipants.iterator();
+ while (iterator.hasNext()) {
+ Participant participant = iterator.next();
+
+ ContainerShape bandShape = peService.createContainerShape(choreographyContainer, true);
+
+ ParticipantBandKind bandKind = getNewParticipantBandKind(choreography, participant, first,
+ !iterator.hasNext());
+
+ boolean multiple = participant.getParticipantMultiplicity() != null
+ && participant.getParticipantMultiplicity().getMaximum() > 1;
+
+ int w = size.getWidth();
+ int h = multiple ? 40 : 20;
+
+ BPMNShape bpmnShape = DIUtils.createDIShape(bandShape, participant, 0, y + h, w, h, fp, diagram);
+ bpmnShape.setChoreographyActivityShape(BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
+ BPMNShape.class));
+ bpmnShape.setIsMarkerVisible(multiple);
+ bpmnShape.setParticipantBandKind(bandKind);
+ bpmnShape.setIsMessageVisible(sources.contains(participant));
+ createParticipantBandContainerShape(bandKind, choreographyContainer, bandShape, bpmnShape, showNames);
+ if (multiple) {
+ drawMultiplicityMarkers(bandShape);
+ }
+ newContainers.add(bandShape);
+
+ y += h;
+ first = false;
+ }
+
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = getTopAndBottomBands(newContainers);
+ resizePartipantBandContainerShapes(size.getWidth(), size.getHeight(), topAndBottom.getFirst(),
+ topAndBottom.getSecond(), diagram);
+ }
+
+ private static ContainerShape createTopShape(ContainerShape parent, ContainerShape bandShape, BPMNShape bpmnShape,
+ boolean initiating, boolean showNames) {
+
+ if (bandShape == null) {
+ bandShape = peService.createContainerShape(parent, true);
+ }
+
+ Bounds bounds = bpmnShape.getBounds();
+ int w = (int) bounds.getWidth();
+ int h = (int) bounds.getHeight();
+
+ Diagram diagram = peService.getDiagramForPictogramElement(parent);
+ RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
+ band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
+ diagram, IColorConstant.LIGHT_GRAY));
+ gaService.setLocationAndSize(band, 0, 0, w, h);
+
+ Participant p = (Participant) bpmnShape.getBpmnElement();
+ if (showNames) {
+ addBandLabel(bandShape, p.getName(), w, h);
+ }
+ Graphiti.getPeCreateService().createChopboxAnchor(bandShape);
+ AnchorUtil.addFixedPointAnchors(bandShape, band);
+ peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
+ peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
+ Boolean.toString(bpmnShape.isIsMessageVisible()));
+ return bandShape;
+ }
+
+ private static ContainerShape createBottomShape(ContainerShape parent, ContainerShape bandShape,
+ BPMNShape bpmnShape, boolean initiating, boolean showNames) {
+
+ if (bandShape == null) {
+ bandShape = peService.createContainerShape(parent, true);
+ }
+
+ Bounds bounds = bpmnShape.getBounds();
+ int w = (int) bounds.getWidth();
+ int h = (int) bounds.getHeight();
+
+ ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
+ int y = (int) bounds.getY() - parentLoc.getY();
+
+ Diagram diagram = peService.getDiagramForPictogramElement(parent);
+ RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
+ band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
+ diagram, IColorConstant.LIGHT_GRAY));
+ gaService.setLocationAndSize(band, 0, y, w, h);
+
+ Participant p = (Participant) bpmnShape.getBpmnElement();
+ if (showNames) {
+ addBandLabel(bandShape, p.getName(), w, h);
+ }
+ Graphiti.getPeCreateService().createChopboxAnchor(bandShape);
+ AnchorUtil.addFixedPointAnchors(bandShape, band);
+ peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
+ peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
+ Boolean.toString(bpmnShape.isIsMessageVisible()));
+ return bandShape;
+ }
+
+ private static ContainerShape createMiddleShape(ContainerShape parent, ContainerShape bandShape,
+ BPMNShape bpmnShape, boolean initiating, boolean showNames) {
+
+ if (bandShape == null) {
+ bandShape = peService.createContainerShape(parent, true);
+ }
+
+ Bounds bounds = bpmnShape.getBounds();
+ int w = (int) bounds.getWidth();
+ int h = (int) bounds.getHeight();
+
+ ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
+ int y = (int) bounds.getY() - parentLoc.getY();
+
+ Diagram diagram = peService.getDiagramForPictogramElement(parent);
+ Rectangle band = gaService.createRectangle(bandShape);
+ band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
+ diagram, IColorConstant.LIGHT_GRAY));
+ gaService.setLocationAndSize(band, 0, y, w, h);
+
+ Participant p = (Participant) bpmnShape.getBpmnElement();
+ if (showNames) {
+ addBandLabel(bandShape, p.getName(), w, h);
+ }
+ Graphiti.getPeCreateService().createChopboxAnchor(bandShape);
+ AnchorUtil.addFixedPointAnchors(bandShape, band);
+ peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
+ peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
+ Boolean.toString(bpmnShape.isIsMessageVisible()));
+ return bandShape;
+ }
+
+ private static void addBandLabel(ContainerShape container, String name, int w, int h) {
+ Diagram diagram = peService.getDiagramForShape(container);
+ Shape labelShape = peService.createShape(container, false);
+ Text label = gaService.createDefaultText(diagram, labelShape);
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(container);
+ label.setValue(name);
+ gaService.setLocationAndSize(label, 0, 0, w, h);
+ StyleUtil.applyStyle(label, be);
+ label.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
+ label.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
+ }
+
+ private static ParticipantBandKind getNewParticipantBandKind(ChoreographyActivity choreography,
+ Participant participant, boolean first, boolean last) {
+ boolean initiating = choreography.getInitiatingParticipantRef() != null
+ && choreography.getInitiatingParticipantRef().equals(participant);
+ if (first) {
+ return initiating ? ParticipantBandKind.TOP_INITIATING : ParticipantBandKind.TOP_NON_INITIATING;
+ } else if (last) {
+ return initiating ? ParticipantBandKind.BOTTOM_INITIATING : ParticipantBandKind.BOTTOM_NON_INITIATING;
+ } else {
+ return initiating ? ParticipantBandKind.MIDDLE_INITIATING : ParticipantBandKind.MIDDLE_NON_INITIATING;
+ }
+ }
+
+ private static ContainerShape drawMessageLink(String name, BoundaryAnchor boundaryAnchor, int x, int y, boolean filled) {
+ Diagram diagram = peService.getDiagramForAnchor(boundaryAnchor.anchor);
+
+ FreeFormConnection connection = peService.createFreeFormConnection(diagram);
+ Polyline connectionLine = gaService.createPolyline(connection);
+ connectionLine.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ connectionLine.setLineStyle(LineStyle.DOT);
+ connectionLine.setLineWidth(2);
+
+ ContainerShape envelope = peService.createContainerShape(diagram, true);
+ Rectangle invisibleRectangle = gaService.createInvisibleRectangle(envelope);
+ gaService.setLocation(invisibleRectangle, x, y);
+ gaService.setSize(invisibleRectangle, ENV_W + 50, ENV_H);
+
+ Shape envelopeShape = peService.createShape(envelope, false);
+ Envelope envelopeGa = GraphicsUtil.createEnvelope(envelopeShape, 0, 0, ENV_W, ENV_H);
+ IColorConstant color = filled ? IColorConstant.LIGHT_GRAY : IColorConstant.WHITE;
+ envelopeGa.rect.setFilled(true);
+ envelopeGa.rect.setBackground(gaService.manageColor(diagram, color));
+ envelopeGa.rect.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ envelopeGa.line.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ AnchorUtil.addFixedPointAnchors(envelope, envelopeGa.rect);
+
+ Shape textShape = peService.createShape(envelope, false);
+ Text text = gaService.createDefaultText(diagram, textShape);
+ IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(name, text.getFont());
+ gaService.setLocationAndSize(text, ENV_W + 3, 3, size.getWidth(), size.getHeight());
+ text.setValue(name);
+
+ gaService.setSize(invisibleRectangle, ENV_W + size.getWidth() + 3, ENV_H);
+
+ AnchorLocation envelopeAnchorLoc = null;
+ if (boundaryAnchor.locationType == AnchorLocation.TOP) {
+ envelopeAnchorLoc = AnchorLocation.BOTTOM;
+ } else {
+ envelopeAnchorLoc = AnchorLocation.TOP;
+ }
+
+ connection.setStart(boundaryAnchor.anchor);
+ connection.setEnd(AnchorUtil.getBoundaryAnchors(envelope).get(envelopeAnchorLoc).anchor);
+ peService.setPropertyValue(envelope, MESSAGE_LINK, Boolean.toString(true));
+ return envelope;
+ }
+
+ public static void drawMultiplicityMarkers(ContainerShape container) {
+ Diagram diagram = peService.getDiagramForPictogramElement(container);
+ Shape multiplicityShape = peService.createShape(container, false);
+ Rectangle rect = gaService.createInvisibleRectangle(multiplicityShape);
+
+ IDimension size = gaService.calculateSize(container.getGraphicsAlgorithm());
+ int w = 10;
+ int h = 10;
+ int x = (size.getWidth() / 2) - (w / 2);
+ int y = size.getHeight() - h - 1;
+ gaService.setLocationAndSize(rect, x, y, w, h);
+
+ int[][] coorinates = { new int[] { 0, 0, 0, h }, new int[] { 4, 0, 4, h }, new int[] { 8, 0, 8, h } };
+ for (int[] xy : coorinates) {
+ Polyline line = gaService.createPolyline(rect, xy);
+ line.setLineWidth(2);
+ line.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
+ }
+ }
+
+ public static ContainerShape createParticipantBandContainerShape(ParticipantBandKind bandKind,
+ ContainerShape container, ContainerShape bandContainer, BPMNShape bpmnShape, boolean showNames) {
+
+ switch (bandKind) {
+ case TOP_INITIATING:
+ return createTopShape(container, bandContainer, bpmnShape, true, showNames);
+ case TOP_NON_INITIATING:
+ return createTopShape(container, bandContainer, bpmnShape, false, showNames);
+ case MIDDLE_INITIATING:
+ return createMiddleShape(container, bandContainer, bpmnShape, true, showNames);
+ case MIDDLE_NON_INITIATING:
+ return createMiddleShape(container, bandContainer, bpmnShape, false, showNames);
+ case BOTTOM_INITIATING:
+ return createBottomShape(container, bandContainer, bpmnShape, true, showNames);
+ case BOTTOM_NON_INITIATING:
+ return createBottomShape(container, bandContainer, bpmnShape, false, showNames);
+ }
+
+ return bandContainer;
+ }
+
+ public static ContainerShape createParticipantBandContainerShape(ParticipantBandKind bandKind,
+ ContainerShape container, BPMNShape bpmnShape, boolean showNames) {
+ return createParticipantBandContainerShape(bandKind, container, null, bpmnShape, showNames);
+ }
+
+ public static void drawMessageLinks(IFeatureProvider fp, ContainerShape choreographyContainer) {
+
+ List<MessageFlow> messageFlows = new ArrayList<MessageFlow>();
+ ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
+ ChoreographyTask.class);
+ if (choreography != null) {
+ messageFlows.addAll(choreography.getMessageFlowRef());
+ }
+
+ List<ContainerShape> bandContainers = getParticipantBandContainerShapes(choreographyContainer);
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = getTopAndBottomBands(bandContainers);
+ List<ContainerShape> shapesWithVisibleMessages = new ArrayList<ContainerShape>();
+
+ Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(choreographyContainer);
+ BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
+ BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);
+ int topConnectionIndex = 0;
+ int bottomConnectionIndex = 0;
+
+ boolean hasTopMessage = false;
+ EList<Connection> topConnections = topBoundaryAnchor.anchor.getOutgoingConnections();
+ for (int i = 0; i < topConnections.size(); i++) {
+ Connection connection = topConnections.get(i);
+ EObject container = connection.getEnd().eContainer();
+ if (container instanceof PropertyContainer) {
+ String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
+ if (Boolean.parseBoolean(property)) {
+ topConnectionIndex = i;
+ hasTopMessage = true;
+ break;
+ }
+ }
+ }
+
+ boolean hasBottomMessage = false;
+ EList<Connection> bottomConnections = bottomBoundaryAnchor.anchor.getOutgoingConnections();
+ for (int i = 0; i < bottomConnections.size(); i++) {
+ Connection connection = bottomConnections.get(i);
+ EObject container = connection.getEnd().eContainer();
+ if (container instanceof PropertyContainer) {
+ String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
+ if (Boolean.parseBoolean(property)) {
+ bottomConnectionIndex = i;
+ hasBottomMessage = true;
+ break;
+ }
+ }
+ }
+
+ Iterator<ContainerShape> iterator = bandContainers.iterator();
+ while (iterator.hasNext()) {
+ ContainerShape bandContainer = iterator.next();
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(bandContainer, BPMNShape.class);
+ if (bpmnShape.isIsMessageVisible()) {
+ shapesWithVisibleMessages.add(bandContainer);
+ }
+ }
+
+ boolean shouldDrawTopMessage = !Collections.disjoint(topAndBottom.getFirst(), shapesWithVisibleMessages);
+ boolean shouldDrawBottomMessage = !Collections.disjoint(topAndBottom.getSecond(), shapesWithVisibleMessages);
+ ContainerShape envelope;
+
+ String topMessageName = null;
+ String bottomMessageName = null;
+ Message topMessage = null;
+ Message bottomMessage = null;
+
+ if (shouldDrawTopMessage) {
+ topMessage = getMessage(messageFlows, topAndBottom.getFirst(), false);
+ topMessageName = getMessageName(messageFlows, topAndBottom.getFirst());
+ }
+ if (topMessageName == null) {
+ topMessageName = new String();
+ }
+
+ if (shouldDrawBottomMessage) {
+ bottomMessage = getMessage(messageFlows, topAndBottom.getSecond(), false);
+ bottomMessageName = getMessageName(messageFlows, topAndBottom.getSecond());
+ }
+ if (bottomMessageName == null) {
+ bottomMessageName = new String();
+ }
+
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(choreographyContainer, BPMNShape.class);
+ Bounds bounds = bpmnShape.getBounds();
+ int x = (int) ((bounds.getX() + bounds.getWidth() / 2) - (ENV_W / 2));
+
+ MessageFlow flow = getMessageFlow(messageFlows, topAndBottom.getFirst());
+ envelope = null;
+ if (!hasTopMessage && shouldDrawTopMessage && flow!=null) {
+ int y = (int) (bounds.getY() - ENVELOPE_HEIGHT_MODIFIER - ENV_H);
+ envelope = drawMessageLink(topMessageName, topBoundaryAnchor, x, y, isFilled(topAndBottom.getFirst()));
+ if (topMessage!=null)
+ fp.link(envelope, topMessage);
+ peService.setPropertyValue(envelope, MESSAGE_NAME, topMessageName);
+ } else if (hasTopMessage && !shouldDrawTopMessage) {
+ envelope = (ContainerShape) topConnections.get(topConnectionIndex).getEnd().eContainer();
+ peService.deletePictogramElement(topConnections.get(topConnectionIndex));
+ peService.deletePictogramElement(envelope);
+ envelope = null;
+ } else if (hasTopMessage && shouldDrawTopMessage && flow!=null) {
+ envelope = (ContainerShape) topConnections.get(topConnectionIndex).getEnd().eContainer();
+ setMessageLabel(topMessageName, envelope);
+ }
+ if (envelope!=null) {
+ // link up the message flow
+ linkMessageFlow(fp, flow, envelope);
+ }
+
+ envelope = null;
+ flow = getMessageFlow(messageFlows, topAndBottom.getSecond());
+ if (!hasBottomMessage && shouldDrawBottomMessage && flow!=null) {
+ int y = (int) (bounds.getY() + bounds.getHeight() + ENVELOPE_HEIGHT_MODIFIER);
+ envelope = drawMessageLink(bottomMessageName, bottomBoundaryAnchor, x, y, isFilled(topAndBottom.getSecond()));
+ if (bottomMessage!=null)
+ fp.link(envelope, bottomMessage);
+ peService.setPropertyValue(envelope, MESSAGE_NAME, bottomMessageName);
+ } else if (hasBottomMessage && !shouldDrawBottomMessage) {
+ envelope = (ContainerShape) bottomConnections.get(bottomConnectionIndex).getEnd()
+ .eContainer();
+ peService.deletePictogramElement(bottomConnections.get(bottomConnectionIndex));
+ peService.deletePictogramElement(envelope);
+ envelope = null;
+ } else if (hasBottomMessage && shouldDrawBottomMessage && flow!=null) {
+ envelope = (ContainerShape) bottomConnections.get(bottomConnectionIndex).getEnd()
+ .eContainer();
+ setMessageLabel(bottomMessageName, envelope);
+ }
+ if (envelope!=null) {
+ // link up the message flow
+ linkMessageFlow(fp, flow, envelope);
+ }
+
+ return;
+ }
+
+ private static void linkMessageFlow(IFeatureProvider fp, MessageFlow flow,ContainerShape envelope) {
+ for (Anchor a : envelope.getAnchors()) {
+ for (Connection c : a.getIncomingConnections()) {
+ fp.link(c, flow);
+ }
+ for (Connection c : a.getOutgoingConnections()) {
+ fp.link(c, flow);
+ }
+ }
+ }
+
+ private static boolean isFilled(List<ContainerShape> bands) {
+ boolean filled = true;
+ for (ContainerShape band : bands) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
+ if (!bpmnShape.isIsMessageVisible()) {
+ continue;
+ }
+ ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
+ if (bandKind == ParticipantBandKind.TOP_INITIATING || bandKind == ParticipantBandKind.BOTTOM_INITIATING
+ || bandKind == ParticipantBandKind.MIDDLE_INITIATING) {
+ filled = false;
+ break;
+ }
+ }
+ return filled;
+ }
+
+ private static void setMessageLabel(String label, PictogramElement message) {
+ ContainerShape containerShape = (ContainerShape) message;
+ Iterator<Shape> iterator = peService.getAllContainedShapes(containerShape).iterator();
+ while (iterator.hasNext()) {
+ Shape shape = iterator.next();
+ if (shape.getGraphicsAlgorithm() instanceof Text) {
+ Text text = (Text) shape.getGraphicsAlgorithm();
+ text.setValue(label);
+ IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(label, text.getFont());
+ gaService.setSize(containerShape.getGraphicsAlgorithm(), ENV_W + size.getWidth() + 3, ENV_H);
+ gaService.setSize(text, size.getWidth(), size.getHeight());
+ peService.setPropertyValue(containerShape, MESSAGE_NAME, label);
+ break;
+ }
+ }
+ }
+
+ private static String getMessageName(List<MessageFlow> messageFlows, List<ContainerShape> bands) {
+ for (ContainerShape band : bands) {
+ Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
+ if (bpmnShape.isIsMessageVisible()) {
+ for (MessageFlow flow : messageFlows) {
+ if (flow.getSourceRef().equals(participant)) {
+ return getMessageFlowName(flow);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static MessageFlow getMessageFlow(List<MessageFlow> messageFlows, List<ContainerShape> bands) {
+ for (ContainerShape band : bands) {
+ Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
+ if (bpmnShape.isIsMessageVisible()) {
+ for (MessageFlow flow : messageFlows) {
+ if (flow.getSourceRef().equals(participant)) {
+ return flow;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static Message getMessage(List<MessageFlow> messageFlows, List<ContainerShape> bands, boolean create) {
+ MessageFlow flow = getMessageFlow(messageFlows, bands);
+ if (flow!=null) {
+ if (flow.getMessageRef()==null && create) {
+ Message msg = Bpmn2ModelerFactory.create(Message.class);
+ msg.setName("Undefined Message");
+ ModelUtil.getDefinitions(flow).getRootElements().add(msg);
+ flow.setMessageRef(msg);
+ ModelUtil.setID(msg);
+ }
+ return flow.getMessageRef();
+ }
+ return null;
+ }
+
+ public static String getMessageFlowName(MessageFlow flow) {
+ if (flow.getMessageRef() == null) {
+ return flow.getName();
+ } else if (flow.getMessageRef().getItemRef()==null ||
+ flow.getMessageRef().getItemRef().getStructureRef()==null) {
+ return flow.getMessageRef().getName();
+ } else {
+ String messageName = flow.getMessageRef().getName();
+ String itemDefinitionName = ModelUtil.getDisplayName(flow.getMessageRef().getItemRef());
+ String text = itemDefinitionName;
+ if (messageName!=null && !messageName.isEmpty())
+ text += "/" + messageName;
+ return text;
+ }
+ }
+
+ public static String getMessageName(Message mesg) {
+ if (mesg.getItemRef()==null ||
+ mesg.getItemRef().getStructureRef()==null) {
+ return mesg.getName();
+ } else {
+ String type = "(" + ModelUtil.getDisplayName(mesg.getItemRef()) +")";
+ if (mesg.getName()==null)
+ return type;
+ return mesg.getName() + type;
+ }
+ }
+
+ public static void moveChoreographyMessageLinks(ContainerShape choreographyContainer) {
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(choreographyContainer, BPMNShape.class);
+ Bounds bounds = bpmnShape.getBounds();
+ int x = (int) ((bounds.getX() + bounds.getWidth() / 2) - (ENV_W / 2));
+
+ Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(choreographyContainer);
+ BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
+ BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);
+
+ for (Connection connection : topBoundaryAnchor.anchor.getOutgoingConnections()) {
+ EObject container = connection.getEnd().eContainer();
+ if (container instanceof PropertyContainer) {
+ String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
+ if (property != null && new Boolean(property)) {
+ int y = (int) (bounds.getY() - ENVELOPE_HEIGHT_MODIFIER - ENV_H);
+ gaService.setLocation(((ContainerShape) container).getGraphicsAlgorithm(), x, y);
+ break;
+ }
+ }
+ }
+
+ for (Connection connection : bottomBoundaryAnchor.anchor.getOutgoingConnections()) {
+ EObject container = connection.getEnd().eContainer();
+ if (container instanceof PropertyContainer) {
+ String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
+ if (property != null && new Boolean(property)) {
+ int y = (int) (bounds.getY() + bounds.getHeight() + ENVELOPE_HEIGHT_MODIFIER);
+ gaService.setLocation(((ContainerShape) container).getGraphicsAlgorithm(), x, y);
+ break;
+ }
+ }
+ }
+ }
+
+ public static void drawChoreographyLoopType(ContainerShape markerShape, ChoreographyLoopType type) {
+ Collection<Shape> shapes = peService.getAllContainedShapes(markerShape);
+ Shape drawingShape = null;
+
+ if (shapes.size() == 1) { // remove previous shape
+ Iterator<Shape> iterator = shapes.iterator();
+ while (iterator.hasNext()) {
+ Shape shape = iterator.next();
+ drawingShape = shape;
+ break;
+ }
+ }
+
+ if (drawingShape != null) {
+ peService.deletePictogramElement(drawingShape);
+ }
+
+ drawingShape = peService.createShape(markerShape, false);
+ Rectangle rectangle = gaService.createInvisibleRectangle(drawingShape);
+ gaService.setLocationAndSize(rectangle, 0, 0, MARKER_H, MARKER_H);
+
+ if (type == null || type == ChoreographyLoopType.NONE) {
+ return;
+ }
+
+ switch (type) {
+ case STANDARD:
+ // TODO implement when property editors supports enums
+ break;
+ case MULTI_INSTANCE_PARALLEL:
+ // TODO implement when property editors supports enums
+ break;
+ case MULTI_INSTANCE_SEQUENTIAL:
+ // TODO implement when property editors supports enums
+ break;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/MoveChoreographyFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/MoveChoreographyFeature.java
index 25618aa..7afc8bf 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/MoveChoreographyFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/MoveChoreographyFeature.java
@@ -1,58 +1,58 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import java.util.Collection;
-
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.dd.dc.Bounds;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class MoveChoreographyFeature extends MoveFlowNodeFeature {
-
- public MoveChoreographyFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected void postMoveShape(final IMoveShapeContext context) {
- super.postMoveShape(context);
- IPeService peService = Graphiti.getPeService();
- Collection<Shape> shapes = peService.getAllContainedShapes((ContainerShape) context.getShape());
- for (Shape s : shapes) {
- Participant participant = BusinessObjectUtil.getFirstElementOfType(s, Participant.class);
- if (participant != null) {
- ContainerShape container = (ContainerShape) s;
- GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
-
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(s, BPMNShape.class);
- ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram(context.getShape());
-
- Bounds bounds = bpmnShape.getBounds();
- bounds.setX(loc.getX() + ga.getX());
- bounds.setY(loc.getY() + ga.getY());
- }
- }
- ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) context.getPictogramElement());
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.util.Collection;
+
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.dd.dc.Bounds;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class MoveChoreographyFeature extends MoveFlowNodeFeature {
+
+ public MoveChoreographyFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected void postMoveShape(final IMoveShapeContext context) {
+ super.postMoveShape(context);
+ IPeService peService = Graphiti.getPeService();
+ Collection<Shape> shapes = peService.getAllContainedShapes((ContainerShape) context.getShape());
+ for (Shape s : shapes) {
+ Participant participant = BusinessObjectUtil.getFirstElementOfType(s, Participant.class);
+ if (participant != null) {
+ ContainerShape container = (ContainerShape) s;
+ GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
+
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(s, BPMNShape.class);
+ ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram(context.getShape());
+
+ Bounds bounds = bpmnShape.getBounds();
+ bounds.setX(loc.getX() + ga.getX());
+ bounds.setY(loc.getY() + ga.getY());
+ }
+ }
+ ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) context.getPictogramElement());
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/RemoveChoreographyParticipantFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/RemoveChoreographyParticipantFeature.java
index b9c76f0..430c1c0 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/RemoveChoreographyParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/RemoveChoreographyParticipantFeature.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-/**
- * @author Bob Brodt
- *
- */
-public class RemoveChoreographyParticipantFeature extends DefaultRemoveFeature {
-
- /**
- * @param fp
- */
- public RemoveChoreographyParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canRemove(IRemoveContext context) {
- // participant bands in a ChoreographyTask CAN be "removed" (from the modelObject's
- // participantRef list) but not "deleted" (from the model)
- if (ChoreographyUtil.isChoreographyParticipantBand(context.getPictogramElement())) {
- return true;
- }
- return false;
- }
-
- @Override
- public void execute(IContext context) {
- IRemoveContext dc = (IRemoveContext)context;
- if (ChoreographyUtil.isChoreographyParticipantBand(dc.getPictogramElement())) {
- PictogramElement pe = dc.getPictogramElement();
- Participant participant = (Participant)getBusinessObjectForPictogramElement(pe);
- ContainerShape container = (ContainerShape)pe.eContainer();
- Object bo = getBusinessObjectForPictogramElement(container);
- if (bo instanceof ChoreographyTask) {
- ChoreographyTask task = (ChoreographyTask)bo;
- task.getParticipantRefs().remove(participant);
- if (task.getInitiatingParticipantRef() == participant) {
- task.setInitiatingParticipantRef(null);
- }
- }
- }
- super.execute(context);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IRemoveContext;
+import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class RemoveChoreographyParticipantFeature extends DefaultRemoveFeature {
+
+ /**
+ * @param fp
+ */
+ public RemoveChoreographyParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canRemove(IRemoveContext context) {
+ // participant bands in a ChoreographyTask CAN be "removed" (from the modelObject's
+ // participantRef list) but not "deleted" (from the model)
+ if (ChoreographyUtil.isChoreographyParticipantBand(context.getPictogramElement())) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void execute(IContext context) {
+ IRemoveContext dc = (IRemoveContext)context;
+ if (ChoreographyUtil.isChoreographyParticipantBand(dc.getPictogramElement())) {
+ PictogramElement pe = dc.getPictogramElement();
+ Participant participant = (Participant)getBusinessObjectForPictogramElement(pe);
+ ContainerShape container = (ContainerShape)pe.eContainer();
+ Object bo = getBusinessObjectForPictogramElement(container);
+ if (bo instanceof ChoreographyTask) {
+ ChoreographyTask task = (ChoreographyTask)bo;
+ task.getParticipantRefs().remove(participant);
+ if (task.getInitiatingParticipantRef() == participant) {
+ task.setInitiatingParticipantRef(null);
+ }
+ }
+ }
+ super.execute(context);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ResizeChoreographyFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ResizeChoreographyFeature.java
index c33cc35..c5fc6ef 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ResizeChoreographyFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ResizeChoreographyFeature.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.features.DefaultResizeBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class ResizeChoreographyFeature extends DefaultResizeBPMNShapeFeature {
-
- public ResizeChoreographyFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- try {
- List<BPMNShape> bands = ChoreographyUtil.getParicipantBandBpmnShapes((ContainerShape) context
- .getPictogramElement());
- int h = ChoreographyProperties.TEXT_H; // + ChoreographyProperties.MARKER_H;
-
- for (BPMNShape shape : bands) {
- h += shape.getBounds().getHeight();
- }
-
- return context.getHeight() > 0 ? context.getHeight() > h : true;
- } catch (Exception e) {
- Activator.logError(e);
- return true;
- }
- }
-
- @Override
- public void resizeShape(IResizeShapeContext context) {
- try {
- List<ContainerShape> bands = ChoreographyUtil.getParticipantBandContainerShapes((ContainerShape) context
- .getPictogramElement());
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = ChoreographyUtil
- .getTopAndBottomBands(bands);
- ChoreographyUtil.resizePartipantBandContainerShapes(context.getWidth(), context.getHeight(),
- topAndBottom.getFirst(), topAndBottom.getSecond(), getDiagram());
- } catch (Exception e) {
- Activator.logError(e);
- }
- super.resizeShape(context);
- ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) context.getPictogramElement());
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.features.DefaultResizeBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class ResizeChoreographyFeature extends DefaultResizeBPMNShapeFeature {
+
+ public ResizeChoreographyFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ try {
+ List<BPMNShape> bands = ChoreographyUtil.getParicipantBandBpmnShapes((ContainerShape) context
+ .getPictogramElement());
+ int h = ChoreographyProperties.TEXT_H; // + ChoreographyProperties.MARKER_H;
+
+ for (BPMNShape shape : bands) {
+ h += shape.getBounds().getHeight();
+ }
+
+ return context.getHeight() > 0 ? context.getHeight() > h : true;
+ } catch (Exception e) {
+ Activator.logError(e);
+ return true;
+ }
+ }
+
+ @Override
+ public void resizeShape(IResizeShapeContext context) {
+ try {
+ List<ContainerShape> bands = ChoreographyUtil.getParticipantBandContainerShapes((ContainerShape) context
+ .getPictogramElement());
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = ChoreographyUtil
+ .getTopAndBottomBands(bands);
+ ChoreographyUtil.resizePartipantBandContainerShapes(context.getWidth(), context.getHeight(),
+ topAndBottom.getFirst(), topAndBottom.getSecond(), getDiagram());
+ } catch (Exception e) {
+ Activator.logError(e);
+ }
+ super.resizeShape(context);
+ ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) context.getPictogramElement());
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ShowDiagramPageFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ShowDiagramPageFeature.java
new file mode 100644
index 0000000..0ebc0de
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/ShowDiagramPageFeature.java
@@ -0,0 +1,101 @@
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.IConstants;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditingDialog;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2MultiPageEditor;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+
+public class ShowDiagramPageFeature extends AbstractCustomFeature {
+
+ public ShowDiagramPageFeature(IFeatureProvider fp) {
+ super(fp);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public String getName() {
+ return "Show Diagram";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Switch to the Diagram Page that contains the details of this activity";
+ }
+
+ @Override
+ public boolean canExecute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ BaseElement baseElement = null;
+ if (bo instanceof Participant) {
+ Participant participant = (Participant)bo;
+ baseElement = participant.getProcessRef();
+ }
+ else if (bo instanceof BaseElement) {
+ baseElement = (BaseElement)bo;
+ }
+
+ return DIUtils.findBPMNDiagram(getDiagramEditor(), baseElement) != null;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isAvailable(IContext context) {
+ return true;
+ }
+
+ @Override
+ public void execute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ BaseElement baseElement = null;
+ if (bo instanceof Participant) {
+ Participant participant = (Participant)bo;
+ baseElement = participant.getProcessRef();
+ }
+ else if (bo instanceof BaseElement) {
+ baseElement = (BaseElement)bo;
+ }
+ BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(getDiagramEditor(), baseElement);
+ if (bpmnDiagram!=null) {
+ BPMN2MultiPageEditor mpe = ((BPMN2Editor)getDiagramEditor()).getMultipageEditor();
+ mpe.showDesignPage(bpmnDiagram);
+ }
+ }
+ }
+
+ @Override
+ public String getImageId() {
+ return null; //IConstants.ICON_PROPERTIES_16;
+ }
+
+ @Override
+ public boolean hasDoneChanges() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java
index 56b4673..360a7fa 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/SubChoreographyFeatureContainer.java
@@ -1,97 +1,97 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.TEXT_H;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ChoreographyLoopType;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.SubChoreography;
-import org.eclipse.bpmn2.modeler.core.features.activity.AbstractCreateExpandableFlowNodeFeature;
-import org.eclipse.bpmn2.modeler.core.features.choreography.LayoutChoreographyFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class SubChoreographyFeatureContainer extends AbstractChoreographyFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof SubChoreography;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateSubChoreographyFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddSubChoreographyFeature(fp);
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutChoreographyFeature(fp) {
- @Override
- protected void setTextLocation(ContainerShape choreographyContainer, Text text, int w, int h) {
- List<ContainerShape> bandContainers = ChoreographyUtil
- .getParticipantBandContainerShapes(choreographyContainer);
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottomBands = ChoreographyUtil
- .getTopAndBottomBands(bandContainers);
- List<ContainerShape> topBands = topAndBottomBands.getFirst();
-
- int y = 3;
- if (!topBands.isEmpty()) {
- ContainerShape containerShape = topBands.get(topBands.size() - 1);
- GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
- y = ga.getY() + ga.getHeight() + 3;
- }
-
- gaService.setLocationAndSize(text, 0, y, w, TEXT_H);
- }
- };
- }
-
- public static class CreateSubChoreographyFeature extends AbstractCreateExpandableFlowNodeFeature<SubChoreography> {
-
- public CreateSubChoreographyFeature(IFeatureProvider fp) {
- super(fp, "Sub-Choreography", "A compound activity that can contain other activities");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_CHOREOGRAPHY_TASK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getSubChoreography();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.TEXT_H;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ChoreographyLoopType;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.SubChoreography;
+import org.eclipse.bpmn2.modeler.core.features.activity.AbstractCreateExpandableFlowNodeFeature;
+import org.eclipse.bpmn2.modeler.core.features.choreography.LayoutChoreographyFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.algorithms.Text;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class SubChoreographyFeatureContainer extends AbstractChoreographyFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof SubChoreography;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateSubChoreographyFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddSubChoreographyFeature(fp);
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutChoreographyFeature(fp) {
+ @Override
+ protected void setTextLocation(ContainerShape choreographyContainer, Text text, int w, int h) {
+ List<ContainerShape> bandContainers = ChoreographyUtil
+ .getParticipantBandContainerShapes(choreographyContainer);
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottomBands = ChoreographyUtil
+ .getTopAndBottomBands(bandContainers);
+ List<ContainerShape> topBands = topAndBottomBands.getFirst();
+
+ int y = 3;
+ if (!topBands.isEmpty()) {
+ ContainerShape containerShape = topBands.get(topBands.size() - 1);
+ GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
+ y = ga.getY() + ga.getHeight() + 3;
+ }
+
+ gaService.setLocationAndSize(text, 0, y, w, TEXT_H);
+ }
+ };
+ }
+
+ public static class CreateSubChoreographyFeature extends AbstractCreateExpandableFlowNodeFeature<SubChoreography> {
+
+ public CreateSubChoreographyFeature(IFeatureProvider fp) {
+ super(fp, "Sub-Choreography", "A compound activity that can contain other activities");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_CHOREOGRAPHY_TASK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getSubChoreography();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyInitiatingParticipantFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyInitiatingParticipantFeature.java
index de108be..df7e9d1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyInitiatingParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyInitiatingParticipantFeature.java
@@ -1,111 +1,111 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.INITIATING_PARTICIPANT_REF;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.di.ParticipantBandKind;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.styles.Color;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-import org.eclipse.graphiti.util.IColorConstant;
-
-public class UpdateChoreographyInitiatingParticipantFeature extends AbstractUpdateFeature {
-
- private final IPeService peService = Graphiti.getPeService();
-
- public UpdateChoreographyInitiatingParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
-
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- ChoreographyActivity.class);
-
- String id = peService.getPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF);
- Participant participant = choreography.getInitiatingParticipantRef();
-
- if ((id == null || id.equals("null")) && participant == null) {
- return Reason.createFalseReason();
- }
-
- if (participant != null && (id != null && id.equals(participant.getId()))) {
- return Reason.createFalseReason();
- }
-
- return Reason.createTrueReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
-
- ContainerShape container = (ContainerShape) context.getPictogramElement();
-
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(container,
- ChoreographyActivity.class);
-
- boolean hasInitiatingParticipant = choreography.getInitiatingParticipantRef() != null;
-
- for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(container)) {
- Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
- boolean isInitiating = hasInitiatingParticipant
- && participant.equals(choreography.getInitiatingParticipantRef());
- Color color = manageColor(isInitiating ? IColorConstant.WHITE : IColorConstant.LIGHT_GRAY);
- band.getGraphicsAlgorithm().setBackground(color);
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
- bpmnShape.setParticipantBandKind(getParticipantBandKind(isInitiating, bpmnShape.getParticipantBandKind()));
- }
-
- Participant initiatingParticipant = choreography.getInitiatingParticipantRef();
- String id = initiatingParticipant == null ? "null" : initiatingParticipant.getId();
- peService.setPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF, id);
-
- return true;
- }
-
- private ParticipantBandKind getParticipantBandKind(boolean initiating, ParticipantBandKind currentBandKind) {
- switch (currentBandKind) {
- case TOP_INITIATING:
- return initiating ? currentBandKind : ParticipantBandKind.TOP_NON_INITIATING;
- case MIDDLE_INITIATING:
- return initiating ? currentBandKind : ParticipantBandKind.MIDDLE_NON_INITIATING;
- case BOTTOM_INITIATING:
- return initiating ? currentBandKind : ParticipantBandKind.BOTTOM_NON_INITIATING;
- case TOP_NON_INITIATING:
- return initiating ? ParticipantBandKind.TOP_INITIATING : currentBandKind;
- case MIDDLE_NON_INITIATING:
- return initiating ? ParticipantBandKind.MIDDLE_INITIATING : currentBandKind;
- case BOTTOM_NON_INITIATING:
- return initiating ? ParticipantBandKind.BOTTOM_INITIATING : currentBandKind;
- default:
- return currentBandKind;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.INITIATING_PARTICIPANT_REF;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.di.ParticipantBandKind;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.styles.Color;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+import org.eclipse.graphiti.util.IColorConstant;
+
+public class UpdateChoreographyInitiatingParticipantFeature extends AbstractUpdateFeature {
+
+ private final IPeService peService = Graphiti.getPeService();
+
+ public UpdateChoreographyInitiatingParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ ChoreographyActivity.class);
+
+ String id = peService.getPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF);
+ Participant participant = choreography.getInitiatingParticipantRef();
+
+ if ((id == null || id.equals("null")) && participant == null) {
+ return Reason.createFalseReason();
+ }
+
+ if (participant != null && (id != null && id.equals(participant.getId()))) {
+ return Reason.createFalseReason();
+ }
+
+ return Reason.createTrueReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+
+ ContainerShape container = (ContainerShape) context.getPictogramElement();
+
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(container,
+ ChoreographyActivity.class);
+
+ boolean hasInitiatingParticipant = choreography.getInitiatingParticipantRef() != null;
+
+ for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(container)) {
+ Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
+ boolean isInitiating = hasInitiatingParticipant
+ && participant.equals(choreography.getInitiatingParticipantRef());
+ Color color = manageColor(isInitiating ? IColorConstant.WHITE : IColorConstant.LIGHT_GRAY);
+ band.getGraphicsAlgorithm().setBackground(color);
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
+ bpmnShape.setParticipantBandKind(getParticipantBandKind(isInitiating, bpmnShape.getParticipantBandKind()));
+ }
+
+ Participant initiatingParticipant = choreography.getInitiatingParticipantRef();
+ String id = initiatingParticipant == null ? "null" : initiatingParticipant.getId();
+ peService.setPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF, id);
+
+ return true;
+ }
+
+ private ParticipantBandKind getParticipantBandKind(boolean initiating, ParticipantBandKind currentBandKind) {
+ switch (currentBandKind) {
+ case TOP_INITIATING:
+ return initiating ? currentBandKind : ParticipantBandKind.TOP_NON_INITIATING;
+ case MIDDLE_INITIATING:
+ return initiating ? currentBandKind : ParticipantBandKind.MIDDLE_NON_INITIATING;
+ case BOTTOM_INITIATING:
+ return initiating ? currentBandKind : ParticipantBandKind.BOTTOM_NON_INITIATING;
+ case TOP_NON_INITIATING:
+ return initiating ? ParticipantBandKind.TOP_INITIATING : currentBandKind;
+ case MIDDLE_NON_INITIATING:
+ return initiating ? ParticipantBandKind.MIDDLE_INITIATING : currentBandKind;
+ case BOTTOM_NON_INITIATING:
+ return initiating ? ParticipantBandKind.BOTTOM_INITIATING : currentBandKind;
+ default:
+ return currentBandKind;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMarkerFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMarkerFeature.java
index 450fe14..eee796a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMarkerFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMarkerFeature.java
@@ -1,76 +1,76 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class UpdateChoreographyMarkerFeature extends AbstractUpdateFeature {
-
- private final IPeService peService = Graphiti.getPeService();
-
- public UpdateChoreographyMarkerFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
- ChoreographyActivity.class);
-
- String loopType = choreography.getLoopType() == null ? "null" : choreography.getLoopType().getName();
- String property = peService.getPropertyValue(choreographyContainer, ChoreographyProperties.CHOREOGRAPHY_MARKER);
-
- if (!loopType.equals(property)) {
- return Reason.createTrueReason();
- } else {
- return Reason.createFalseReason();
- }
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
- ChoreographyActivity.class);
-
- for (Shape s : peService.getAllContainedShapes(choreographyContainer)) {
- String property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_MARKER_SHAPE);
- if (property != null && new Boolean(property)) {
- ChoreographyUtil.drawChoreographyLoopType((ContainerShape) s, choreography.getLoopType());
- }
- }
-
- String loopType = choreography.getLoopType() == null ? "null" : choreography.getLoopType().getName();
- peService.setPropertyValue(choreographyContainer, ChoreographyProperties.CHOREOGRAPHY_MARKER, loopType);
-
- return true;
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class UpdateChoreographyMarkerFeature extends AbstractUpdateFeature {
+
+ private final IPeService peService = Graphiti.getPeService();
+
+ public UpdateChoreographyMarkerFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
+ ChoreographyActivity.class);
+
+ String loopType = choreography.getLoopType() == null ? "null" : choreography.getLoopType().getName();
+ String property = peService.getPropertyValue(choreographyContainer, ChoreographyProperties.CHOREOGRAPHY_MARKER);
+
+ if (!loopType.equals(property)) {
+ return Reason.createTrueReason();
+ } else {
+ return Reason.createFalseReason();
+ }
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
+ ChoreographyActivity.class);
+
+ for (Shape s : peService.getAllContainedShapes(choreographyContainer)) {
+ String property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_MARKER_SHAPE);
+ if (property != null && new Boolean(property)) {
+ ChoreographyUtil.drawChoreographyLoopType((ContainerShape) s, choreography.getLoopType());
+ }
+ }
+
+ String loopType = choreography.getLoopType() == null ? "null" : choreography.getLoopType().getName();
+ peService.setPropertyValue(choreographyContainer, ChoreographyProperties.CHOREOGRAPHY_MARKER, loopType);
+
+ return true;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageFlowFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageFlowFeature.java
index aa5c5e5..4d7fa38 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageFlowFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageFlowFeature.java
@@ -1,165 +1,165 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.MESSAGE_REF_IDS;
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.MESSAGE_VISIBLE;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.InteractionNode;
-import org.eclipse.bpmn2.Message;
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.util.Bpmn2OppositeReferenceAdapter;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.ILinkService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class UpdateChoreographyMessageFlowFeature extends AbstractUpdateFeature {
-
- private final IPeService peService = Graphiti.getPeService();
-
- public UpdateChoreographyMessageFlowFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyTask.class);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- PictogramElement pe = context.getPictogramElement();
- if (isLinkedMessage(pe)) {
- Message message = BusinessObjectUtil.getFirstElementOfType(pe, Message.class);
- TreeIterator<EObject> iter = message.eContainer().eAllContents();
- while (iter.hasNext()) {
- EObject eo = iter.next();
- if (eo instanceof ChoreographyTask) {
- ChoreographyTask choreographyTask = (ChoreographyTask)eo;
- for (MessageFlow mf : choreographyTask.getMessageFlowRef()) {
- if (mf.getMessageRef()==message) {
- String oldLabel = peService.getPropertyValue(pe, ChoreographyProperties.MESSAGE_NAME);
- if (oldLabel==null || oldLabel.isEmpty())
- oldLabel = "";
- String newLabel = ChoreographyUtil.getMessageFlowName(mf);
- if (newLabel==null || newLabel.isEmpty())
- newLabel = "";
- if (!newLabel.equals(oldLabel))
- return Reason.createTrueReason();
- }
- }
- }
- }
- return Reason.createFalseReason();
- }
-
- if (!BusinessObjectUtil.containsElementOfType(pe, ChoreographyTask.class)) {
- return Reason.createFalseReason();
- }
-
- ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(pe,
- ChoreographyTask.class);
-
- String ids = peService.getPropertyValue(pe, MESSAGE_REF_IDS);
- String choreoIds = ChoreographyUtil.getMessageRefIds(choreography);
-
- if (ids.equals(choreoIds)) {
- return Reason.createFalseReason();
- }
-
- return Reason.createTrueReason();
- }
-
- private boolean isLinkedMessage(PictogramElement pe) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class);
- return be instanceof Message &&
- Boolean.parseBoolean(peService.getPropertyValue(pe, ChoreographyProperties.MESSAGE_LINK));
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- PictogramElement pe = context.getPictogramElement();
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(pe,BaseElement.class);
- if (be instanceof ChoreographyTask) {
- return update((ContainerShape)pe, (ChoreographyTask)be);
- }
- else if (isLinkedMessage(pe)) {
- ILinkService linkService = Graphiti.getLinkService();
- int result = 0;
- TreeIterator<EObject> iter = be.eContainer().eAllContents();
- while (iter.hasNext()) {
- EObject eo = iter.next();
- if (eo instanceof ChoreographyTask) {
- ChoreographyTask choreographyTask = (ChoreographyTask)eo;
- for (MessageFlow mf : choreographyTask.getMessageFlowRef()) {
- if (mf.getMessageRef()==be) {
- for (PictogramElement cs : linkService.getPictogramElements(getDiagram(), choreographyTask)) {
- if (cs instanceof ContainerShape) {
- if (update((ContainerShape)cs, choreographyTask))
- ++result;
- }
- }
- }
- }
- }
- }
- return result>0;
- }
- return false;
- }
-
- public boolean update(ContainerShape choreographyContainer, ChoreographyTask choreographyTask) {
- List<InteractionNode> sources = new ArrayList<InteractionNode>();
- for (MessageFlow message : choreographyTask.getMessageFlowRef()) {
- sources.add(message.getSourceRef());
- }
-
- for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer)) {
- Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
- if (!sources.contains(participant) && bpmnShape.isIsMessageVisible()) {
- bpmnShape.setIsMessageVisible(false);
- peService.setPropertyValue(choreographyContainer, MESSAGE_VISIBLE, Boolean.toString(false));
- } else if (sources.contains(participant) && !bpmnShape.isIsMessageVisible()) {
- bpmnShape.setIsMessageVisible(true);
- peService.setPropertyValue(choreographyContainer, MESSAGE_VISIBLE, Boolean.toString(true));
- }
- }
-
- ChoreographyUtil.drawMessageLinks(getFeatureProvider(),choreographyContainer);
-
- String choreoIds = ChoreographyUtil.getMessageRefIds(choreographyTask);
- peService.setPropertyValue(choreographyContainer, MESSAGE_REF_IDS, choreoIds);
- return false;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.MESSAGE_REF_IDS;
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.MESSAGE_VISIBLE;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.InteractionNode;
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.util.Bpmn2OppositeReferenceAdapter;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.ILinkService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class UpdateChoreographyMessageFlowFeature extends AbstractUpdateFeature {
+
+ private final IPeService peService = Graphiti.getPeService();
+
+ public UpdateChoreographyMessageFlowFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyTask.class);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ if (isLinkedMessage(pe)) {
+ Message message = BusinessObjectUtil.getFirstElementOfType(pe, Message.class);
+ TreeIterator<EObject> iter = message.eContainer().eAllContents();
+ while (iter.hasNext()) {
+ EObject eo = iter.next();
+ if (eo instanceof ChoreographyTask) {
+ ChoreographyTask choreographyTask = (ChoreographyTask)eo;
+ for (MessageFlow mf : choreographyTask.getMessageFlowRef()) {
+ if (mf.getMessageRef()==message) {
+ String oldLabel = peService.getPropertyValue(pe, ChoreographyProperties.MESSAGE_NAME);
+ if (oldLabel==null || oldLabel.isEmpty())
+ oldLabel = "";
+ String newLabel = ChoreographyUtil.getMessageFlowName(mf);
+ if (newLabel==null || newLabel.isEmpty())
+ newLabel = "";
+ if (!newLabel.equals(oldLabel))
+ return Reason.createTrueReason();
+ }
+ }
+ }
+ }
+ return Reason.createFalseReason();
+ }
+
+ if (!BusinessObjectUtil.containsElementOfType(pe, ChoreographyTask.class)) {
+ return Reason.createFalseReason();
+ }
+
+ ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(pe,
+ ChoreographyTask.class);
+
+ String ids = peService.getPropertyValue(pe, MESSAGE_REF_IDS);
+ String choreoIds = ChoreographyUtil.getMessageRefIds(choreography);
+
+ if (ids.equals(choreoIds)) {
+ return Reason.createFalseReason();
+ }
+
+ return Reason.createTrueReason();
+ }
+
+ private boolean isLinkedMessage(PictogramElement pe) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class);
+ return be instanceof Message &&
+ Boolean.parseBoolean(peService.getPropertyValue(pe, ChoreographyProperties.MESSAGE_LINK));
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ PictogramElement pe = context.getPictogramElement();
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(pe,BaseElement.class);
+ if (be instanceof ChoreographyTask) {
+ return update((ContainerShape)pe, (ChoreographyTask)be);
+ }
+ else if (isLinkedMessage(pe)) {
+ ILinkService linkService = Graphiti.getLinkService();
+ int result = 0;
+ TreeIterator<EObject> iter = be.eContainer().eAllContents();
+ while (iter.hasNext()) {
+ EObject eo = iter.next();
+ if (eo instanceof ChoreographyTask) {
+ ChoreographyTask choreographyTask = (ChoreographyTask)eo;
+ for (MessageFlow mf : choreographyTask.getMessageFlowRef()) {
+ if (mf.getMessageRef()==be) {
+ for (PictogramElement cs : linkService.getPictogramElements(getDiagram(), choreographyTask)) {
+ if (cs instanceof ContainerShape) {
+ if (update((ContainerShape)cs, choreographyTask))
+ ++result;
+ }
+ }
+ }
+ }
+ }
+ }
+ return result>0;
+ }
+ return false;
+ }
+
+ public boolean update(ContainerShape choreographyContainer, ChoreographyTask choreographyTask) {
+ List<InteractionNode> sources = new ArrayList<InteractionNode>();
+ for (MessageFlow message : choreographyTask.getMessageFlowRef()) {
+ sources.add(message.getSourceRef());
+ }
+
+ for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer)) {
+ Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
+ if (!sources.contains(participant) && bpmnShape.isIsMessageVisible()) {
+ bpmnShape.setIsMessageVisible(false);
+ peService.setPropertyValue(choreographyContainer, MESSAGE_VISIBLE, Boolean.toString(false));
+ } else if (sources.contains(participant) && !bpmnShape.isIsMessageVisible()) {
+ bpmnShape.setIsMessageVisible(true);
+ peService.setPropertyValue(choreographyContainer, MESSAGE_VISIBLE, Boolean.toString(true));
+ }
+ }
+
+ ChoreographyUtil.drawMessageLinks(getFeatureProvider(),choreographyContainer);
+
+ String choreoIds = ChoreographyUtil.getMessageRefIds(choreographyTask);
+ peService.setPropertyValue(choreographyContainer, MESSAGE_REF_IDS, choreoIds);
+ return false;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageLinkFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageLinkFeature.java
index 6717577..1fe0aeb 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageLinkFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyMessageLinkFeature.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.MESSAGE_VISIBLE;
-
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class UpdateChoreographyMessageLinkFeature extends AbstractUpdateFeature {
-
- public UpdateChoreographyMessageLinkFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return ChoreographyUtil.isChoreographyParticipantBand(context.getPictogramElement());
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- if (!ChoreographyUtil.isChoreographyParticipantBand(context.getPictogramElement())) {
- return Reason.createFalseReason();
- }
-
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BPMNShape.class);
- boolean visible = new Boolean(Graphiti.getPeService().getPropertyValue(context.getPictogramElement(),
- MESSAGE_VISIBLE));
-
- return bpmnShape.isIsMessageVisible() != visible ? Reason.createTrueReason() : Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
-
- ChoreographyUtil.drawMessageLinks(getFeatureProvider(), (ContainerShape) context.getPictogramElement().eContainer());
-
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BPMNShape.class);
- Graphiti.getPeService().setPropertyValue(context.getPictogramElement(), MESSAGE_VISIBLE,
- Boolean.toString(bpmnShape.isIsMessageVisible()));
-
- return true;
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.MESSAGE_VISIBLE;
+
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class UpdateChoreographyMessageLinkFeature extends AbstractUpdateFeature {
+
+ public UpdateChoreographyMessageLinkFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return ChoreographyUtil.isChoreographyParticipantBand(context.getPictogramElement());
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ if (!ChoreographyUtil.isChoreographyParticipantBand(context.getPictogramElement())) {
+ return Reason.createFalseReason();
+ }
+
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BPMNShape.class);
+ boolean visible = new Boolean(Graphiti.getPeService().getPropertyValue(context.getPictogramElement(),
+ MESSAGE_VISIBLE));
+
+ return bpmnShape.isIsMessageVisible() != visible ? Reason.createTrueReason() : Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+
+ ChoreographyUtil.drawMessageLinks(getFeatureProvider(), (ContainerShape) context.getPictogramElement().eContainer());
+
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BPMNShape.class);
+ Graphiti.getPeService().setPropertyValue(context.getPictogramElement(), MESSAGE_VISIBLE,
+ Boolean.toString(bpmnShape.isIsMessageVisible()));
+
+ return true;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyParticipantRefsFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyParticipantRefsFeature.java
index 78e7274..9545799 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyParticipantRefsFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/UpdateChoreographyParticipantRefsFeature.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.choreography;
-
-import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.PARTICIPANT_REF_IDS;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.ChoreographyActivity;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class UpdateChoreographyParticipantRefsFeature extends AbstractUpdateFeature {
-
- private final IPeService peService = Graphiti.getPeService();
-
- public UpdateChoreographyParticipantRefsFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- ChoreographyActivity.class);
-
- if (!ChoreographyUtil.getParticipantRefIds(choreography).equals(getParticipantRefIds(context))) {
- return Reason.createTrueReason();
- } else {
- return Reason.createFalseReason();
- }
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
- ChoreographyActivity.class);
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
- List<Participant> participants = choreography.getParticipantRefs();
- List<ContainerShape> bandContainerShapes = ChoreographyUtil
- .getParticipantBandContainerShapes((ContainerShape) context.getPictogramElement());
-
- ChoreographyUtil.updateParticipantReferences(containerShape, bandContainerShapes, participants,
- getFeatureProvider(), isShowNames());
-
- peService.setPropertyValue(context.getPictogramElement(), PARTICIPANT_REF_IDS,
- ChoreographyUtil.getParticipantRefIds(choreography));
-
- ChoreographyUtil.drawMessageLinks(getFeatureProvider(), (ContainerShape) context.getPictogramElement());
- return true;
- }
-
- private String getParticipantRefIds(IUpdateContext context) {
- String property = peService.getPropertyValue(context.getPictogramElement(), PARTICIPANT_REF_IDS);
- if (property == null) {
- return new String(); // return empty string
- }
- return property;
- }
-
- protected boolean isShowNames() {
- return true;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import static org.eclipse.bpmn2.modeler.core.features.choreography.ChoreographyProperties.PARTICIPANT_REF_IDS;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.ChoreographyActivity;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class UpdateChoreographyParticipantRefsFeature extends AbstractUpdateFeature {
+
+ private final IPeService peService = Graphiti.getPeService();
+
+ public UpdateChoreographyParticipantRefsFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ ChoreographyActivity.class);
+
+ if (!ChoreographyUtil.getParticipantRefIds(choreography).equals(getParticipantRefIds(context))) {
+ return Reason.createTrueReason();
+ } else {
+ return Reason.createFalseReason();
+ }
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ ChoreographyActivity.class);
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+ List<Participant> participants = choreography.getParticipantRefs();
+ List<ContainerShape> bandContainerShapes = ChoreographyUtil
+ .getParticipantBandContainerShapes((ContainerShape) context.getPictogramElement());
+
+ ChoreographyUtil.updateParticipantReferences(containerShape, bandContainerShapes, participants,
+ getFeatureProvider(), isShowNames());
+
+ peService.setPropertyValue(context.getPictogramElement(), PARTICIPANT_REF_IDS,
+ ChoreographyUtil.getParticipantRefIds(choreography));
+
+ ChoreographyUtil.drawMessageLinks(getFeatureProvider(), (ContainerShape) context.getPictogramElement());
+ return true;
+ }
+
+ private String getParticipantRefIds(IUpdateContext context) {
+ String property = peService.getPropertyValue(context.getPictogramElement(), PARTICIPANT_REF_IDS);
+ if (property == null) {
+ return new String(); // return empty string
+ }
+ return property;
+ }
+
+ protected boolean isShowNames() {
+ return true;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/WhiteboxFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/WhiteboxFeature.java
new file mode 100644
index 0000000..d06ce7f
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/choreography/WhiteboxFeature.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.choreography;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Choreography;
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.Collaboration;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.RootElement;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.di.BPMNPlane;
+import org.eclipse.bpmn2.di.BpmnDiFactory;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.ui.internal.util.ui.PopupMenu;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class WhiteboxFeature extends AbstractCustomFeature {
+
+ /**
+ * @param fp
+ */
+ public WhiteboxFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Whitebox";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Create a new Diagram for this Participant";
+ }
+
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_WHITEBOX;
+ }
+
+ @Override
+ public boolean isAvailable(IContext context) {
+ return true;
+ }
+
+ @Override
+ public boolean canExecute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof Participant) {
+ Participant participant = (Participant)bo;
+ Process process = participant.getProcessRef();
+ if (process!=null) {
+ try {
+ ModelHandler mh = ModelHandlerLocator.getModelHandler(participant.eResource());
+ DiagramElement de = mh.findDIElement(process);
+ return de==null;
+ }
+ catch (Exception e){
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
+ */
+ @Override
+ public void execute(ICustomContext context) {
+ PictogramElement[] pes = context.getPictogramElements();
+ if (pes != null && pes.length == 1) {
+ PictogramElement pe = pes[0];
+ Object bo = getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof Participant) {
+ Participant participant = (Participant)bo;
+ Definitions definitions = ModelUtil.getDefinitions(participant);
+ Resource resource = definitions.eResource();
+ Process process = participant.getProcessRef();
+
+ if (process==null) {
+ // create a Process for this Participant
+ process = (Process) ModelUtil.createObject(resource, Bpmn2Package.eINSTANCE.getProcess());
+ participant.setProcessRef(process);
+
+ // NOTE: this is needed because it fires the InsertionAdapter, which adds the new Process
+ // to Definitions.rootElements, otherwise the Process would be a dangling object
+ process.setName("Process for "+participant.getName());
+ }
+
+ // add the Participant to the first Choreography or Collaboration we find.
+ // TODO: when (and if) multipage editor allows additional Choreography or
+ // Collaboration diagrams to be created, this will be the specific diagram
+ // that is being rendered on the current page.
+ List<RootElement> rootElements = definitions.getRootElements();
+ for (RootElement element : rootElements) {
+ if (element instanceof Collaboration || element instanceof Choreography) {
+ ((Collaboration)element).getParticipants().add(participant);
+ break;
+ }
+ }
+
+ BPMNDiagram bpmnDiagram = BpmnDiFactory.eINSTANCE.createBPMNDiagram();
+ ModelUtil.setID(bpmnDiagram, resource);
+ bpmnDiagram.setName(process.getName());
+
+ definitions.getDiagrams().add(bpmnDiagram);
+
+ BPMNPlane plane = BpmnDiFactory.eINSTANCE.createBPMNPlane();
+ ModelUtil.setID(plane, resource);
+ plane.setBpmnElement(process);
+
+ bpmnDiagram.setPlane(plane);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java
index fa904c4..6308962 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationFeatureContainer.java
@@ -1,83 +1,83 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.conversation;
-
-import org.eclipse.bpmn2.Conversation;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.conversation.AddConversationFeature;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-
-public class ConversationFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof Conversation;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateConversationFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddConversationFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new DefaultMoveBPMNShapeFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeShapeFeature(fp) {
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.conversation;
+
+import org.eclipse.bpmn2.Conversation;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.conversation.AddConversationFeature;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+
+public class ConversationFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof Conversation;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateConversationFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddConversationFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new DefaultMoveBPMNShapeFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeShapeFeature(fp) {
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationLinkFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationLinkFeatureContainer.java
index 52607fc..7168a00 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationLinkFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/ConversationLinkFeatureContainer.java
@@ -1,142 +1,142 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.conversation;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Conversation;
-import org.eclipse.bpmn2.ConversationLink;
-import org.eclipse.bpmn2.InteractionNode;
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractReconnectFlowFeature;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReconnectionFeature;
-import org.eclipse.graphiti.features.context.ICreateConnectionContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-
-public class ConversationLinkFeatureContainer extends BaseElementConnectionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ConversationLink;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AbstractAddFlowFeature<ConversationLink>(fp) {
-
- @Override
- protected Polyline createConnectionLine(Connection connection) {
- Polyline connectionLine = super.createConnectionLine(connection);
- connectionLine.setLineWidth(3);
- return connectionLine;
- }
-
- @Override
- protected Class<? extends BaseElement> getBoClass() {
- return ConversationLink.class;
- }
- };
- }
-
- @Override
- public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
- return new CreateConversationLinkFeature(fp);
- }
-
- @Override
- public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
- return new ReconnectConversationLinkFeature(fp);
- }
-
- public static class CreateConversationLinkFeature extends AbstractCreateFlowFeature<ConversationLink, Participant, Conversation> {
-
- public CreateConversationLinkFeature(IFeatureProvider fp) {
- super(fp, "Conversation Link", "Connects Conversation nodes to and from Participants");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_CONVERSATION_LINK;
- }
-
- @Override
- protected Class<Participant> getSourceClass() {
- return Participant.class;
- }
-
- @Override
- protected Class<Conversation> getTargetClass() {
- return Conversation.class;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateConnectionFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getConversationLink();
- }
-
- @Override
- public ConversationLink createBusinessObject(ICreateConnectionContext context) {
- ConversationLink bo = null;
- try {
- ModelHandler mh = ModelHandler.getInstance(getDiagram());
- Participant source = getSourceBo(context);
- Conversation target = getTargetBo(context);
- bo = mh.createConversationLink(source, target);
- bo.setName("Conversation Link");
- putBusinessObject(context, bo);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return bo;
- }
- }
- public static class ReconnectConversationLinkFeature extends AbstractReconnectFlowFeature {
-
- public ReconnectConversationLinkFeature(IFeatureProvider fp) {
- super(fp);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- protected Class<? extends EObject> getTargetClass() {
- return Conversation.class;
- }
-
- @Override
- protected Class<? extends EObject> getSourceClass() {
- return Participant.class;
- }
-
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.conversation;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Conversation;
+import org.eclipse.bpmn2.ConversationLink;
+import org.eclipse.bpmn2.InteractionNode;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractReconnectFlowFeature;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReconnectionFeature;
+import org.eclipse.graphiti.features.context.ICreateConnectionContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+
+public class ConversationLinkFeatureContainer extends BaseElementConnectionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ConversationLink;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AbstractAddFlowFeature<ConversationLink>(fp) {
+
+ @Override
+ protected Polyline createConnectionLine(Connection connection) {
+ Polyline connectionLine = super.createConnectionLine(connection);
+ connectionLine.setLineWidth(3);
+ return connectionLine;
+ }
+
+ @Override
+ protected Class<? extends BaseElement> getBoClass() {
+ return ConversationLink.class;
+ }
+ };
+ }
+
+ @Override
+ public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
+ return new CreateConversationLinkFeature(fp);
+ }
+
+ @Override
+ public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
+ return new ReconnectConversationLinkFeature(fp);
+ }
+
+ public static class CreateConversationLinkFeature extends AbstractCreateFlowFeature<ConversationLink, Participant, Conversation> {
+
+ public CreateConversationLinkFeature(IFeatureProvider fp) {
+ super(fp, "Conversation Link", "Connects Conversation nodes to and from Participants");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_CONVERSATION_LINK;
+ }
+
+ @Override
+ protected Class<Participant> getSourceClass() {
+ return Participant.class;
+ }
+
+ @Override
+ protected Class<Conversation> getTargetClass() {
+ return Conversation.class;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateConnectionFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getConversationLink();
+ }
+
+ @Override
+ public ConversationLink createBusinessObject(ICreateConnectionContext context) {
+ ConversationLink bo = null;
+ try {
+ ModelHandler mh = ModelHandler.getInstance(getDiagram());
+ Participant source = getSourceBo(context);
+ Conversation target = getTargetBo(context);
+ bo = mh.createConversationLink(source, target);
+ bo.setName("Conversation Link");
+ putBusinessObject(context, bo);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return bo;
+ }
+ }
+ public static class ReconnectConversationLinkFeature extends AbstractReconnectFlowFeature {
+
+ public ReconnectConversationLinkFeature(IFeatureProvider fp) {
+ super(fp);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ protected Class<? extends EObject> getTargetClass() {
+ return Conversation.class;
+ }
+
+ @Override
+ protected Class<? extends EObject> getSourceClass() {
+ return Participant.class;
+ }
+
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/AbstractDataFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/AbstractDataFeatureContainer.java
index 26f80cb..ec9347e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/AbstractDataFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/AbstractDataFeatureContainer.java
@@ -1,74 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.data;
-
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.bpmn2.modeler.ui.features.LayoutBaseElementTextFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-
-public abstract class AbstractDataFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateBaseElementNameFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutBaseElementTextFeature(fp) {
-
- @Override
- public int getMinimumWidth() {
- return GraphicsUtil.DATA_WIDTH;
- }
- };
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new DefaultMoveBPMNShapeFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeShapeFeature(fp) {
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.data;
+
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.bpmn2.modeler.ui.features.LayoutBaseElementTextFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+
+public abstract class AbstractDataFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateBaseElementNameFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutBaseElementTextFeature(fp) {
+
+ @Override
+ public int getMinimumWidth() {
+ return GraphicsUtil.DATA_WIDTH;
+ }
+ };
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new DefaultMoveBPMNShapeFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeShapeFeature(fp) {
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataInputFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataInputFeatureContainer.java
index c99dbf0..7cea3d3 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataInputFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataInputFeatureContainer.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.data;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.features.data.AbstractCreateDataInputOutputFeature;
-import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-
-public class DataInputFeatureContainer extends AbstractDataFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof DataInput;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateDataInputFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddDataFeature<DataInput>(fp) {
- @Override
- protected boolean isSupportCollectionMarkers() {
- return false;
- }
-
- @Override
- protected void decorate(Polygon p) {
- Polygon arrow = GraphicsUtil.createDataArrow(p);
- arrow.setFilled(false);
- arrow.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- }
-
- @Override
- public String getName(DataInput t) {
- return t.getName();
- }
- };
- }
-
- public static class CreateDataInputFeature extends AbstractCreateDataInputOutputFeature<DataInput> {
-
- public CreateDataInputFeature(IFeatureProvider fp) {
- super(fp, "Data Input", "Declaration that a particular kind of data will be used as input");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_DATA_INPUT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getDataInput();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.data;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.features.data.AbstractCreateDataInputOutputFeature;
+import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+
+public class DataInputFeatureContainer extends AbstractDataFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof DataInput;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateDataInputFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddDataFeature<DataInput>(fp) {
+ @Override
+ protected boolean isSupportCollectionMarkers() {
+ return false;
+ }
+
+ @Override
+ protected void decorate(Polygon p) {
+ Polygon arrow = GraphicsUtil.createDataArrow(p);
+ arrow.setFilled(false);
+ arrow.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ }
+
+ @Override
+ public String getName(DataInput t) {
+ return t.getName();
+ }
+ };
+ }
+
+ public static class CreateDataInputFeature extends AbstractCreateDataInputOutputFeature<DataInput> {
+
+ public CreateDataInputFeature(IFeatureProvider fp) {
+ super(fp, "Data Input", "Declaration that a particular kind of data will be used as input");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_DATA_INPUT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getDataInput();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectFeatureContainer.java
index 21e709b..2986c83 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectFeatureContainer.java
@@ -1,237 +1,237 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.data;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataObject;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
-import org.eclipse.bpmn2.modeler.core.features.data.Properties;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-import org.eclipse.graphiti.ui.internal.util.ui.PopupMenu;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class DataObjectFeatureContainer extends AbstractDataFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof DataObject;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateDataObjectFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddDataFeature<DataObject>(fp) {
-
- @Override
- public String getName(DataObject t) {
- return t.getName();
- }
-
- };
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
- multiUpdate.addUpdateFeature(new UpdateMarkersFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateBaseElementNameFeature(fp));
- return multiUpdate;
- }
-
- private class UpdateMarkersFeature extends AbstractUpdateFeature {
-
- public UpdateMarkersFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- Object o = getBusinessObjectForPictogramElement(context.getPictogramElement());
- return o != null && o instanceof BaseElement && canApplyTo(o);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- IPeService peService = Graphiti.getPeService();
- ContainerShape container = (ContainerShape) context.getPictogramElement();
- DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);
- boolean isCollection = Boolean.parseBoolean(peService.getPropertyValue(container,
- Properties.COLLECTION_PROPERTY));
- return data.isIsCollection() != isCollection ? Reason.createTrueReason() : Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- IPeService peService = Graphiti.getPeService();
- ContainerShape container = (ContainerShape) context.getPictogramElement();
- DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);
-
- boolean drawCollectionMarker = data.isIsCollection();
-
- Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
- while (iterator.hasNext()) {
- Shape shape = iterator.next();
- String prop = peService.getPropertyValue(shape, Properties.HIDEABLE_PROPERTY);
- if (prop != null && new Boolean(prop)) {
- Polyline line = (Polyline) shape.getGraphicsAlgorithm();
- line.setLineVisible(drawCollectionMarker);
- }
- }
-
- peService.setPropertyValue(container, Properties.COLLECTION_PROPERTY,
- Boolean.toString(data.isIsCollection()));
- return true;
- }
- }
-
- public static class CreateDataObjectFeature extends AbstractCreateFlowElementFeature<FlowElement> {
-
- private static ILabelProvider labelProvider = new ILabelProvider() {
-
- public void removeListener(ILabelProviderListener listener) {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void dispose() {
-
- }
-
- public void addListener(ILabelProviderListener listener) {
-
- }
-
- public String getText(Object element) {
- if (((DataObject) element).getId() == null)
- return ((DataObject) element).getName();
- return "Reference existing \"" + ((DataObject) element).getName() + "\"";
- }
-
- public Image getImage(Object element) {
- return null;
- }
-
- };
-
- public CreateDataObjectFeature(IFeatureProvider fp) {
- super(fp, "Data Object",
- "Provides information about what activities require to be performed or what they produce");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_DATA_OBJECT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getDataObject();
- }
-
- @Override
- public FlowElement createBusinessObject(ICreateContext context) {
- FlowElement bo = null;
- try {
- DataObjectReference dataObjectReference = null;
- DataObject dataObject = null;
- ModelHandler mh = ModelHandler.getInstance(getDiagram());
- dataObjectReference = Bpmn2ModelerFactory.create(DataObjectReference.class);
- dataObject = Bpmn2ModelerFactory.create(DataObject.class);
- dataObject.setName("Create a new Data Object");
- Object container = getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- List<DataObject> dataObjectList = new ArrayList<DataObject>();
- dataObjectList.add(dataObject);
- TreeIterator<EObject> iter = mh.getDefinitions().eAllContents();
- while (iter.hasNext()) {
- EObject obj = iter.next();
- if (obj instanceof DataObject)
- dataObjectList.add((DataObject) obj);
- }
-
- DataObject result = dataObject;
- if (dataObjectList.size() > 1) {
- PopupMenu popupMenu = new PopupMenu(dataObjectList, labelProvider);
- boolean b = popupMenu.show(Display.getCurrent().getActiveShell());
- if (b) {
- result = (DataObject) popupMenu.getResult();
- }
- }
- if (result == dataObject) { // the new one
- mh.addFlowElement(container,dataObject);
- ModelUtil.setID(dataObject);
- dataObject.setIsCollection(false);
- dataObject.setName(ModelUtil.toDisplayName(dataObject.getId()));
- dataObjectReference.setName(dataObject.getName());
- bo = dataObject;
- } else {
- mh.addFlowElement(container,dataObjectReference);
- ModelUtil.setID(dataObjectReference);
- dataObjectReference.setName(result.getName() + " Ref");
- dataObjectReference.setDataObjectRef(result);
- dataObject = result;
- bo = dataObjectReference;
- }
- putBusinessObject(context, bo);
-
- } catch (IOException e) {
- Activator.showErrorWithLogging(e);
- }
- return bo;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.data;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataObject;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
+import org.eclipse.bpmn2.modeler.core.features.data.Properties;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+import org.eclipse.graphiti.ui.internal.util.ui.PopupMenu;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+public class DataObjectFeatureContainer extends AbstractDataFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof DataObject;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateDataObjectFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddDataFeature<DataObject>(fp) {
+
+ @Override
+ public String getName(DataObject t) {
+ return t.getName();
+ }
+
+ };
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
+ multiUpdate.addUpdateFeature(new UpdateMarkersFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateBaseElementNameFeature(fp));
+ return multiUpdate;
+ }
+
+ private class UpdateMarkersFeature extends AbstractUpdateFeature {
+
+ public UpdateMarkersFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ Object o = getBusinessObjectForPictogramElement(context.getPictogramElement());
+ return o != null && o instanceof BaseElement && canApplyTo(o);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ IPeService peService = Graphiti.getPeService();
+ ContainerShape container = (ContainerShape) context.getPictogramElement();
+ DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);
+ boolean isCollection = Boolean.parseBoolean(peService.getPropertyValue(container,
+ Properties.COLLECTION_PROPERTY));
+ return data.isIsCollection() != isCollection ? Reason.createTrueReason() : Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ IPeService peService = Graphiti.getPeService();
+ ContainerShape container = (ContainerShape) context.getPictogramElement();
+ DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);
+
+ boolean drawCollectionMarker = data.isIsCollection();
+
+ Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
+ while (iterator.hasNext()) {
+ Shape shape = iterator.next();
+ String prop = peService.getPropertyValue(shape, Properties.HIDEABLE_PROPERTY);
+ if (prop != null && new Boolean(prop)) {
+ Polyline line = (Polyline) shape.getGraphicsAlgorithm();
+ line.setLineVisible(drawCollectionMarker);
+ }
+ }
+
+ peService.setPropertyValue(container, Properties.COLLECTION_PROPERTY,
+ Boolean.toString(data.isIsCollection()));
+ return true;
+ }
+ }
+
+ public static class CreateDataObjectFeature extends AbstractCreateFlowElementFeature<FlowElement> {
+
+ private static ILabelProvider labelProvider = new ILabelProvider() {
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void dispose() {
+
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+
+ }
+
+ public String getText(Object element) {
+ if (((DataObject) element).getId() == null)
+ return ((DataObject) element).getName();
+ return "Reference existing \"" + ((DataObject) element).getName() + "\"";
+ }
+
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ };
+
+ public CreateDataObjectFeature(IFeatureProvider fp) {
+ super(fp, "Data Object",
+ "Provides information about what activities require to be performed or what they produce");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_DATA_OBJECT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getDataObject();
+ }
+
+ @Override
+ public FlowElement createBusinessObject(ICreateContext context) {
+ FlowElement bo = null;
+ try {
+ DataObjectReference dataObjectReference = null;
+ DataObject dataObject = null;
+ ModelHandler mh = ModelHandler.getInstance(getDiagram());
+ dataObjectReference = Bpmn2ModelerFactory.create(DataObjectReference.class);
+ dataObject = Bpmn2ModelerFactory.create(DataObject.class);
+ dataObject.setName("Create a new Data Object");
+ Object container = getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ List<DataObject> dataObjectList = new ArrayList<DataObject>();
+ dataObjectList.add(dataObject);
+ TreeIterator<EObject> iter = mh.getDefinitions().eAllContents();
+ while (iter.hasNext()) {
+ EObject obj = iter.next();
+ if (obj instanceof DataObject)
+ dataObjectList.add((DataObject) obj);
+ }
+
+ DataObject result = dataObject;
+ if (dataObjectList.size() > 1) {
+ PopupMenu popupMenu = new PopupMenu(dataObjectList, labelProvider);
+ boolean b = popupMenu.show(Display.getCurrent().getActiveShell());
+ if (b) {
+ result = (DataObject) popupMenu.getResult();
+ }
+ }
+ if (result == dataObject) { // the new one
+ mh.addFlowElement(container,dataObject);
+ ModelUtil.setID(dataObject);
+ dataObject.setIsCollection(false);
+ dataObject.setName(ModelUtil.toDisplayName(dataObject.getId()));
+ dataObjectReference.setName(dataObject.getName());
+ bo = dataObject;
+ } else {
+ mh.addFlowElement(container,dataObjectReference);
+ ModelUtil.setID(dataObjectReference);
+ dataObjectReference.setName(result.getName() + " Ref");
+ dataObjectReference.setDataObjectRef(result);
+ dataObject = result;
+ bo = dataObjectReference;
+ }
+ putBusinessObject(context, bo);
+
+ } catch (IOException e) {
+ Activator.showErrorWithLogging(e);
+ }
+ return bo;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectReferenceFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectReferenceFeatureContainer.java
index 14ddbd8..cce1072 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectReferenceFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataObjectReferenceFeatureContainer.java
@@ -1,77 +1,77 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.data;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.ICreateContext;
-
-public class DataObjectReferenceFeatureContainer extends AbstractDataFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof DataObjectReference;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateDataObjectReferenceFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddDataFeature<DataObjectReference>(fp) {
-
- @Override
- public String getName(DataObjectReference t) {
- return t.getName();
- }
- };
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateBaseElementNameFeature(fp);
- }
-
- public static class CreateDataObjectReferenceFeature extends AbstractCreateFlowElementFeature<DataObjectReference> {
-
- public CreateDataObjectReferenceFeature(IFeatureProvider fp) {
- super(fp, "Data Object Ref",
- "Provides ref information about what activities require to be performed or what they produce");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_DATA_OBJECT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getDataObjectReference();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.data;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.ICreateContext;
+
+public class DataObjectReferenceFeatureContainer extends AbstractDataFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof DataObjectReference;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateDataObjectReferenceFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddDataFeature<DataObjectReference>(fp) {
+
+ @Override
+ public String getName(DataObjectReference t) {
+ return t.getName();
+ }
+ };
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateBaseElementNameFeature(fp);
+ }
+
+ public static class CreateDataObjectReferenceFeature extends AbstractCreateFlowElementFeature<DataObjectReference> {
+
+ public CreateDataObjectReferenceFeature(IFeatureProvider fp) {
+ super(fp, "Data Object Ref",
+ "Provides ref information about what activities require to be performed or what they produce");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_DATA_OBJECT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getDataObjectReference();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataOutputFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataOutputFeatureContainer.java
index b821458..695f8b1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataOutputFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataOutputFeatureContainer.java
@@ -1,91 +1,91 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.data;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.ItemAwareElement;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.features.data.AbstractCreateDataInputOutputFeature;
-import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-
-public class DataOutputFeatureContainer extends AbstractDataFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof DataOutput;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateDataOutputFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddDataFeature<DataOutput>(fp) {
- @Override
- protected boolean isSupportCollectionMarkers() {
- return false;
- }
-
- @Override
- protected void decorate(Polygon p) {
- Polygon arrow = GraphicsUtil.createDataArrow(p);
- arrow.setFilled(true);
- arrow.setBackground(manageColor(StyleUtil.CLASS_FOREGROUND));
- arrow.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- }
-
- @Override
- public String getName(DataOutput t) {
- return t.getName();
- }
- };
- }
-
- public static class CreateDataOutputFeature extends AbstractCreateDataInputOutputFeature<DataOutput> {
-
- public CreateDataOutputFeature(IFeatureProvider fp) {
- super(fp, "Data Output", "Declaration that a particular kind of data can be produced as output");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_DATA_OUTPUT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getDataOutput();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.data;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.ItemAwareElement;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.features.data.AbstractCreateDataInputOutputFeature;
+import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+
+public class DataOutputFeatureContainer extends AbstractDataFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof DataOutput;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateDataOutputFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddDataFeature<DataOutput>(fp) {
+ @Override
+ protected boolean isSupportCollectionMarkers() {
+ return false;
+ }
+
+ @Override
+ protected void decorate(Polygon p) {
+ Polygon arrow = GraphicsUtil.createDataArrow(p);
+ arrow.setFilled(true);
+ arrow.setBackground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ arrow.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ }
+
+ @Override
+ public String getName(DataOutput t) {
+ return t.getName();
+ }
+ };
+ }
+
+ public static class CreateDataOutputFeature extends AbstractCreateDataInputOutputFeature<DataOutput> {
+
+ public CreateDataOutputFeature(IFeatureProvider fp) {
+ super(fp, "Data Output", "Declaration that a particular kind of data can be produced as output");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_DATA_OUTPUT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getDataOutput();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AbstractEventFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AbstractEventFeatureContainer.java
index 2c30583..905e649 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AbstractEventFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AbstractEventFeatureContainer.java
@@ -1,101 +1,101 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
-import org.eclipse.bpmn2.modeler.core.features.DirectEditFlowElementFeature;
-import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.bpmn2.modeler.ui.features.LayoutBaseElementTextFeature;
-import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
-import org.eclipse.bpmn2.modeler.ui.features.gateway.AppendGatewayFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-
-public abstract class AbstractEventFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context.getProperty(ContextConstants.LABEL_CONTEXT) == null
- || !((Boolean) context.getProperty(ContextConstants.LABEL_CONTEXT))) {
- return super.getApplyObject(context);
- }
- return null;
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateBaseElementNameFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return new DirectEditFlowElementFeature(fp);
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutBaseElementTextFeature(fp) {
-
- @Override
- public int getMinimumWidth() {
- return GraphicsUtil.EVENT_SIZE;
- }
- };
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new MoveFlowNodeFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeShapeFeature(fp) {
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
- ICustomFeature[] thisFeatures = new ICustomFeature[3 + superFeatures.length];
- int i;
- for (i=0; i<superFeatures.length; ++i)
- thisFeatures[i] = superFeatures[i];
- thisFeatures[i++] = new AppendActivityFeature(fp);
- thisFeatures[i++] = new AppendGatewayFeature(fp);
- thisFeatures[i++] = new AppendEventFeature(fp);
- return thisFeatures;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
+import org.eclipse.bpmn2.modeler.core.features.DirectEditFlowElementFeature;
+import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.bpmn2.modeler.ui.features.LayoutBaseElementTextFeature;
+import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
+import org.eclipse.bpmn2.modeler.ui.features.gateway.AppendGatewayFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+
+public abstract class AbstractEventFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context.getProperty(ContextConstants.LABEL_CONTEXT) == null
+ || !((Boolean) context.getProperty(ContextConstants.LABEL_CONTEXT))) {
+ return super.getApplyObject(context);
+ }
+ return null;
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateBaseElementNameFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return new DirectEditFlowElementFeature(fp);
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutBaseElementTextFeature(fp) {
+
+ @Override
+ public int getMinimumWidth() {
+ return GraphicsUtil.EVENT_SIZE;
+ }
+ };
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new MoveFlowNodeFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeShapeFeature(fp) {
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
+ ICustomFeature[] thisFeatures = new ICustomFeature[3 + superFeatures.length];
+ int i;
+ for (i=0; i<superFeatures.length; ++i)
+ thisFeatures[i] = superFeatures[i];
+ thisFeatures[i++] = new AppendActivityFeature(fp);
+ thisFeatures[i++] = new AppendGatewayFeature(fp);
+ thisFeatures[i++] = new AppendEventFeature(fp);
+ return thisFeatures;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AppendEventFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AppendEventFeature.java
index fcc58c3..dbf8e8e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AppendEventFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/AppendEventFeature.java
@@ -1,61 +1,61 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class AppendEventFeature extends AbstractAppendNodeNodeFeature<Event> {
-
- /**
- * @param fp
- */
- public AppendEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public String getName() {
- return "Append Event";
- }
-
- @Override
- public String getDescription() {
- return "Create a new Event and connect it to this item";
- }
-
- @Override
- public String getImageId() {
- return ImageProvider.IMG_16_END_EVENT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getEvent();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class AppendEventFeature extends AbstractAppendNodeNodeFeature<Event> {
+
+ /**
+ * @param fp
+ */
+ public AppendEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Append Event";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Create a new Event and connect it to this item";
+ }
+
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_END_EVENT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getEvent();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventFeatureContainer.java
index 3d3b41f..48b76eb 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventFeatureContainer.java
@@ -1,84 +1,84 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-
-public class BoundaryEventFeatureContainer extends BaseElementFeatureContainer {
-
- public static String BOUNDARY_EVENT_CANCEL = "cancel.activity";
- public static String BOUNDARY_EVENT_DISTANCE = "boundary.distance";
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof BoundaryEvent;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateBoundaryEventFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddBoundaryEventFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateBoundaryEventFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutBoundaryEventFeature(fp);
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new MoveBoundaryEventFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeShapeFeature(fp) {
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+
+public class BoundaryEventFeatureContainer extends BaseElementFeatureContainer {
+
+ public static String BOUNDARY_EVENT_CANCEL = "cancel.activity";
+ public static String BOUNDARY_EVENT_DISTANCE = "boundary.distance";
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof BoundaryEvent;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateBoundaryEventFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddBoundaryEventFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateBoundaryEventFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutBoundaryEventFeature(fp);
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new MoveBoundaryEventFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeShapeFeature(fp) {
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventPositionHelper.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventPositionHelper.java
index 018d7ed..4c9319a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventPositionHelper.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventPositionHelper.java
@@ -1,154 +1,154 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.dd.dc.Bounds;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.mm.PropertyContainer;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class BoundaryEventPositionHelper {
-
- public static final String BOUNDARY_EVENT_RELATIVE_POS = "boundary.event.relative.pos";
-
- public static boolean canCreateEventAt(ICreateContext context, GraphicsAlgorithm ga, int padding) {
- return canCreateEventAt(context.getX(), context.getY(), ga.getWidth(), ga.getHeight(), padding);
- }
-
- public static boolean canCreateEventAt(int x, int y, GraphicsAlgorithm ga, int padding) {
- return canCreateEventAt(x, y, ga.getWidth(), ga.getHeight(), padding);
- }
-
- public static boolean canCreateEventAt(int x, int y, int w, int h, int padding) {
- int x1 = 0;
- int x2 = 0 + padding;
- int x3 = w - padding;
- int x4 = w;
-
- int y1 = 0;
- int y2 = 0 + padding;
- int y3 = h - padding;
- int y4 = h;
-
- if ((y >= y1 && y <= y2) || (y >= y3 && y <= y4)) {
- return true;
- }
- if ((x >= x1 && x <= x2) || (x >= x3 && x <= x4)) {
- return true;
- }
- return false;
- }
-
- public static boolean canMoveTo(IMoveShapeContext context, Diagram diagram) {
- IPeService peService = Graphiti.getPeService();
-
- int x = context.getX();
- int y = context.getY();
-
- if (!(context.getTargetContainer() instanceof Diagram)) {
- ILocation loc = peService.getLocationRelativeToDiagram(context.getTargetContainer());
- x += loc.getX();
- y += loc.getY();
- }
-
- BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(context.getShape(), BoundaryEvent.class);
- GraphicsAlgorithm eventGa = context.getShape().getGraphicsAlgorithm();
- ContainerShape activityContainer = (ContainerShape) BusinessObjectUtil.getFirstBaseElementFromDiagram(diagram,
- event.getAttachedToRef());
- GraphicsAlgorithm activityGa = activityContainer.getGraphicsAlgorithm();
- ILocation activityLoc = peService.getLocationRelativeToDiagram(activityContainer);
-
- if (!activityContainer.equals(context.getTargetContainer())) {
- if (activityContainer.eContainer().equals(context.getTargetContainer())) {
- ContainerShape parent = (ContainerShape)activityContainer.eContainer();
- // FIXME: what's going on here?
- if (parent instanceof Diagram) {
- return false;
- }
- }
- }
-
- PositionOnLine pos = getPositionOnLine(x, y, eventGa.getWidth(), eventGa.getHeight(), activityLoc.getX(),
- activityLoc.getY(), activityGa.getWidth(), activityGa.getHeight());
- return pos.isLegalPosition();
- }
-
- public static PositionOnLine getPositionOnLineUsingBPMNShape(Shape eventShape, Shape activityShape) {
- BPMNShape event = BusinessObjectUtil.getFirstElementOfType(eventShape, BPMNShape.class);
- Bounds eventBounds = event.getBounds();
- BPMNShape activity = BusinessObjectUtil.getFirstElementOfType(activityShape, BPMNShape.class);
- Bounds activityBounds = activity.getBounds();
-
- return getPositionOnLine((int) eventBounds.getX(), (int) eventBounds.getY(), (int) eventBounds.getWidth(),
- (int) eventBounds.getHeight(), (int) activityBounds.getX(), (int) activityBounds.getY(),
- (int) activityBounds.getWidth(), (int) activityBounds.getHeight());
- }
-
- public static PositionOnLine getPositionOnLineUsingAbsoluteCoordinates(Shape eventShape, Shape activityShape) {
- IPeService peService = Graphiti.getPeService();
- GraphicsAlgorithm eventGa = eventShape.getGraphicsAlgorithm();
- ILocation eventLoc = peService.getLocationRelativeToDiagram(eventShape);
- GraphicsAlgorithm activityGa = activityShape.getGraphicsAlgorithm();
- ILocation activityLoc = peService.getLocationRelativeToDiagram(activityShape);
-
- return getPositionOnLine(eventLoc.getX(), eventLoc.getY(), eventGa.getWidth(), eventGa.getHeight(),
- activityLoc.getX(), activityLoc.getY(), activityGa.getWidth(), activityGa.getHeight());
- }
-
- public static PositionOnLine getPositionOnLine(int eventX, int eventY, int eventW, int eventH, int activityX,
- int activityY, int activityW, int activityH) {
-
- int x = eventX + eventW / 2;
- int y = eventY + eventH / 2;
-
- int x1 = activityX;
- int x2 = x1 + 10;
- int x3 = x1 + activityW - 10;
- int x4 = x1 + activityW + 10;
-
- int y1 = activityY;
- int y2 = y1 + 10;
- int y3 = y1 + activityH - 10;
- int y4 = y1 + activityH + 10;
-
- boolean alongLeftX = x >= x1 && x <= x2;
- boolean alongRightX = x >= x3 && x <= x4;
- boolean alongTopY = y >= y1 && y <= y2;
- boolean alongBottomY = y >= y3 && y <= y4;
-
- PositionOnLine pos = new PositionOnLine(alongLeftX, alongRightX, alongTopY, alongBottomY);
-
- return pos;
- }
-
- public static void assignPositionOnLineProperty(PropertyContainer propertyContainer, PositionOnLine pos) {
- IPeService peService = Graphiti.getPeService();
- peService.setPropertyValue(propertyContainer, BOUNDARY_EVENT_RELATIVE_POS, pos.toString());
- }
-
- public static PositionOnLine getPositionOnLineProperty(PropertyContainer propertyContainer) {
- IPeService peService = Graphiti.getPeService();
- String value = peService.getPropertyValue(propertyContainer, BOUNDARY_EVENT_RELATIVE_POS);
- return PositionOnLine.fromString(value);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.dd.dc.Bounds;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.mm.PropertyContainer;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class BoundaryEventPositionHelper {
+
+ public static final String BOUNDARY_EVENT_RELATIVE_POS = "boundary.event.relative.pos";
+
+ public static boolean canCreateEventAt(ICreateContext context, GraphicsAlgorithm ga, int padding) {
+ return canCreateEventAt(context.getX(), context.getY(), ga.getWidth(), ga.getHeight(), padding);
+ }
+
+ public static boolean canCreateEventAt(int x, int y, GraphicsAlgorithm ga, int padding) {
+ return canCreateEventAt(x, y, ga.getWidth(), ga.getHeight(), padding);
+ }
+
+ public static boolean canCreateEventAt(int x, int y, int w, int h, int padding) {
+ int x1 = 0;
+ int x2 = 0 + padding;
+ int x3 = w - padding;
+ int x4 = w;
+
+ int y1 = 0;
+ int y2 = 0 + padding;
+ int y3 = h - padding;
+ int y4 = h;
+
+ if ((y >= y1 && y <= y2) || (y >= y3 && y <= y4)) {
+ return true;
+ }
+ if ((x >= x1 && x <= x2) || (x >= x3 && x <= x4)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean canMoveTo(IMoveShapeContext context, Diagram diagram) {
+ IPeService peService = Graphiti.getPeService();
+
+ int x = context.getX();
+ int y = context.getY();
+
+ if (!(context.getTargetContainer() instanceof Diagram)) {
+ ILocation loc = peService.getLocationRelativeToDiagram(context.getTargetContainer());
+ x += loc.getX();
+ y += loc.getY();
+ }
+
+ BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(context.getShape(), BoundaryEvent.class);
+ GraphicsAlgorithm eventGa = context.getShape().getGraphicsAlgorithm();
+ ContainerShape activityContainer = (ContainerShape) BusinessObjectUtil.getFirstBaseElementFromDiagram(diagram,
+ event.getAttachedToRef());
+ GraphicsAlgorithm activityGa = activityContainer.getGraphicsAlgorithm();
+ ILocation activityLoc = peService.getLocationRelativeToDiagram(activityContainer);
+
+ if (!activityContainer.equals(context.getTargetContainer())) {
+ if (activityContainer.eContainer().equals(context.getTargetContainer())) {
+ ContainerShape parent = (ContainerShape)activityContainer.eContainer();
+ // FIXME: what's going on here?
+ if (parent instanceof Diagram) {
+ return false;
+ }
+ }
+ }
+
+ PositionOnLine pos = getPositionOnLine(x, y, eventGa.getWidth(), eventGa.getHeight(), activityLoc.getX(),
+ activityLoc.getY(), activityGa.getWidth(), activityGa.getHeight());
+ return pos.isLegalPosition();
+ }
+
+ public static PositionOnLine getPositionOnLineUsingBPMNShape(Shape eventShape, Shape activityShape) {
+ BPMNShape event = BusinessObjectUtil.getFirstElementOfType(eventShape, BPMNShape.class);
+ Bounds eventBounds = event.getBounds();
+ BPMNShape activity = BusinessObjectUtil.getFirstElementOfType(activityShape, BPMNShape.class);
+ Bounds activityBounds = activity.getBounds();
+
+ return getPositionOnLine((int) eventBounds.getX(), (int) eventBounds.getY(), (int) eventBounds.getWidth(),
+ (int) eventBounds.getHeight(), (int) activityBounds.getX(), (int) activityBounds.getY(),
+ (int) activityBounds.getWidth(), (int) activityBounds.getHeight());
+ }
+
+ public static PositionOnLine getPositionOnLineUsingAbsoluteCoordinates(Shape eventShape, Shape activityShape) {
+ IPeService peService = Graphiti.getPeService();
+ GraphicsAlgorithm eventGa = eventShape.getGraphicsAlgorithm();
+ ILocation eventLoc = peService.getLocationRelativeToDiagram(eventShape);
+ GraphicsAlgorithm activityGa = activityShape.getGraphicsAlgorithm();
+ ILocation activityLoc = peService.getLocationRelativeToDiagram(activityShape);
+
+ return getPositionOnLine(eventLoc.getX(), eventLoc.getY(), eventGa.getWidth(), eventGa.getHeight(),
+ activityLoc.getX(), activityLoc.getY(), activityGa.getWidth(), activityGa.getHeight());
+ }
+
+ public static PositionOnLine getPositionOnLine(int eventX, int eventY, int eventW, int eventH, int activityX,
+ int activityY, int activityW, int activityH) {
+
+ int x = eventX + eventW / 2;
+ int y = eventY + eventH / 2;
+
+ int x1 = activityX;
+ int x2 = x1 + 10;
+ int x3 = x1 + activityW - 10;
+ int x4 = x1 + activityW + 10;
+
+ int y1 = activityY;
+ int y2 = y1 + 10;
+ int y3 = y1 + activityH - 10;
+ int y4 = y1 + activityH + 10;
+
+ boolean alongLeftX = x >= x1 && x <= x2;
+ boolean alongRightX = x >= x3 && x <= x4;
+ boolean alongTopY = y >= y1 && y <= y2;
+ boolean alongBottomY = y >= y3 && y <= y4;
+
+ PositionOnLine pos = new PositionOnLine(alongLeftX, alongRightX, alongTopY, alongBottomY);
+
+ return pos;
+ }
+
+ public static void assignPositionOnLineProperty(PropertyContainer propertyContainer, PositionOnLine pos) {
+ IPeService peService = Graphiti.getPeService();
+ peService.setPropertyValue(propertyContainer, BOUNDARY_EVENT_RELATIVE_POS, pos.toString());
+ }
+
+ public static PositionOnLine getPositionOnLineProperty(PropertyContainer propertyContainer) {
+ IPeService peService = Graphiti.getPeService();
+ String value = peService.getPropertyValue(propertyContainer, BOUNDARY_EVENT_RELATIVE_POS);
+ return PositionOnLine.fromString(value);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/EndEventFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/EndEventFeatureContainer.java
index 047c787..67f83a3 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/EndEventFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/EndEventFeatureContainer.java
@@ -1,115 +1,115 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractCreateEventFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AddEventFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class EndEventFeatureContainer extends AbstractEventFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof EndEvent;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateEndEventFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddEventFeature<EndEvent>(fp) {
- @Override
- protected void decorateEllipse(Ellipse e) {
- e.setLineWidth(3);
- }
-
- @Override
- protected void hook(ContainerShape container) {
- IPeService peService = Graphiti.getPeService();
- EndEvent event = BusinessObjectUtil.getFirstElementOfType(container, EndEvent.class);
- peService.setPropertyValue(container,
- UpdateEndEventFeature.END_EVENT_MARKER,
- AbstractUpdateEventFeature.getEventDefinitionsValue(event));
- }
- };
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature updateFeature = new MultiUpdateFeature(fp);
- updateFeature.addUpdateFeature(super.getUpdateFeature(fp));
- updateFeature.addUpdateFeature(new UpdateEndEventFeature(fp));
- return updateFeature;
- }
-
- public static class CreateEndEventFeature extends AbstractCreateEventFeature<EndEvent> {
-
- public CreateEndEventFeature(IFeatureProvider fp) {
- super(fp, "End Event", "Indicates the end of a process or choreography");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_END_EVENT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getEndEvent();
- }
- }
-
- protected static class UpdateEndEventFeature extends AbstractUpdateEventFeature {
-
- public static String END_EVENT_MARKER = "marker.end.event";
-
- /**
- * @param fp
- */
- public UpdateEndEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
- */
- @Override
- protected String getPropertyKey() {
- return END_EVENT_MARKER;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractCreateEventFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AddEventFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class EndEventFeatureContainer extends AbstractEventFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof EndEvent;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateEndEventFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddEventFeature<EndEvent>(fp) {
+ @Override
+ protected void decorateEllipse(Ellipse e) {
+ e.setLineWidth(3);
+ }
+
+ @Override
+ protected void hook(ContainerShape container) {
+ IPeService peService = Graphiti.getPeService();
+ EndEvent event = BusinessObjectUtil.getFirstElementOfType(container, EndEvent.class);
+ peService.setPropertyValue(container,
+ UpdateEndEventFeature.END_EVENT_MARKER,
+ AbstractUpdateEventFeature.getEventDefinitionsValue(event));
+ }
+ };
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature updateFeature = new MultiUpdateFeature(fp);
+ updateFeature.addUpdateFeature(super.getUpdateFeature(fp));
+ updateFeature.addUpdateFeature(new UpdateEndEventFeature(fp));
+ return updateFeature;
+ }
+
+ public static class CreateEndEventFeature extends AbstractCreateEventFeature<EndEvent> {
+
+ public CreateEndEventFeature(IFeatureProvider fp) {
+ super(fp, "End Event", "Indicates the end of a process or choreography");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_END_EVENT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getEndEvent();
+ }
+ }
+
+ protected static class UpdateEndEventFeature extends AbstractUpdateEventFeature {
+
+ public static String END_EVENT_MARKER = "marker.end.event";
+
+ /**
+ * @param fp
+ */
+ public UpdateEndEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
+ */
+ @Override
+ protected String getPropertyKey() {
+ return END_EVENT_MARKER;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateCatchEventFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateCatchEventFeatureContainer.java
index 509cc7c..840309b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateCatchEventFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateCatchEventFeatureContainer.java
@@ -1,117 +1,117 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.InclusiveGateway;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractCreateEventFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AddEventFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class IntermediateCatchEventFeatureContainer extends AbstractEventFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof IntermediateCatchEvent;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateIntermediateCatchEventFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
- multiUpdate.addUpdateFeature(super.getUpdateFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateIntermediateCatchEventFeature(fp));
- return multiUpdate;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddEventFeature<IntermediateCatchEvent>(fp) {
- @Override
- protected void decorateEllipse(Ellipse e) {
- Ellipse circle = GraphicsUtil.createIntermediateEventCircle(e);
- circle.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- }
-
- @Override
- protected void hook(ContainerShape container) {
- IPeService peService = Graphiti.getPeService();
- IntermediateCatchEvent event = BusinessObjectUtil.getFirstElementOfType(container, IntermediateCatchEvent.class);
- peService.setPropertyValue(container,
- UpdateIntermediateCatchEventFeature.INTERMEDIATE_CATCH_EVENT_MARKER,
- AbstractUpdateEventFeature.getEventDefinitionsValue(event));
- }
- };
- }
-
- public static class CreateIntermediateCatchEventFeature extends AbstractCreateEventFeature<IntermediateCatchEvent> {
-
- public CreateIntermediateCatchEventFeature(IFeatureProvider fp) {
- super(fp, "Catch Event", "Token remains at the event until event trigger will occur");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_INTERMEDIATE_CATCH_EVENT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getIntermediateCatchEvent();
- }
- }
-
- public static class UpdateIntermediateCatchEventFeature extends AbstractUpdateEventFeature {
-
- public static String INTERMEDIATE_CATCH_EVENT_MARKER = "marker.intermediate.catch.event";
-
- /**
- * @param fp
- */
- public UpdateIntermediateCatchEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
- */
- @Override
- protected String getPropertyKey() {
- return INTERMEDIATE_CATCH_EVENT_MARKER;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.InclusiveGateway;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractCreateEventFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AddEventFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class IntermediateCatchEventFeatureContainer extends AbstractEventFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof IntermediateCatchEvent;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateIntermediateCatchEventFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
+ multiUpdate.addUpdateFeature(super.getUpdateFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateIntermediateCatchEventFeature(fp));
+ return multiUpdate;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddEventFeature<IntermediateCatchEvent>(fp) {
+ @Override
+ protected void decorateEllipse(Ellipse e) {
+ Ellipse circle = GraphicsUtil.createIntermediateEventCircle(e);
+ circle.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ }
+
+ @Override
+ protected void hook(ContainerShape container) {
+ IPeService peService = Graphiti.getPeService();
+ IntermediateCatchEvent event = BusinessObjectUtil.getFirstElementOfType(container, IntermediateCatchEvent.class);
+ peService.setPropertyValue(container,
+ UpdateIntermediateCatchEventFeature.INTERMEDIATE_CATCH_EVENT_MARKER,
+ AbstractUpdateEventFeature.getEventDefinitionsValue(event));
+ }
+ };
+ }
+
+ public static class CreateIntermediateCatchEventFeature extends AbstractCreateEventFeature<IntermediateCatchEvent> {
+
+ public CreateIntermediateCatchEventFeature(IFeatureProvider fp) {
+ super(fp, "Catch Event", "Token remains at the event until event trigger will occur");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_INTERMEDIATE_CATCH_EVENT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getIntermediateCatchEvent();
+ }
+ }
+
+ public static class UpdateIntermediateCatchEventFeature extends AbstractUpdateEventFeature {
+
+ public static String INTERMEDIATE_CATCH_EVENT_MARKER = "marker.intermediate.catch.event";
+
+ /**
+ * @param fp
+ */
+ public UpdateIntermediateCatchEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
+ */
+ @Override
+ protected String getPropertyKey() {
+ return INTERMEDIATE_CATCH_EVENT_MARKER;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateThrowEventFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateThrowEventFeatureContainer.java
index 738c277..7aa0564 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateThrowEventFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/IntermediateThrowEventFeatureContainer.java
@@ -1,117 +1,117 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractCreateEventFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
-import org.eclipse.bpmn2.modeler.core.features.event.AddEventFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class IntermediateThrowEventFeatureContainer extends AbstractEventFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof IntermediateThrowEvent;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateIntermediateThrowEventFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
- multiUpdate.addUpdateFeature(super.getUpdateFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateIntermediateThrowEventFeature(fp));
- return multiUpdate;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddEventFeature<IntermediateThrowEvent>(fp) {
- @Override
- protected void decorateEllipse(Ellipse e) {
- Ellipse circle = GraphicsUtil.createIntermediateEventCircle(e);
- circle.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
- }
-
- @Override
- protected void hook(ContainerShape container) {
- IPeService peService = Graphiti.getPeService();
- IntermediateThrowEvent event = BusinessObjectUtil.getFirstElementOfType(container, IntermediateThrowEvent.class);
- peService.setPropertyValue(container,
- UpdateIntermediateThrowEventFeature.INTERMEDIATE_THROW_EVENT_MARKER,
- AbstractUpdateEventFeature.getEventDefinitionsValue(event));
- }
- };
- }
-
- public static class CreateIntermediateThrowEventFeature extends AbstractCreateEventFeature<IntermediateThrowEvent> {
-
- public CreateIntermediateThrowEventFeature(IFeatureProvider fp) {
- super(fp, "Throw Event", "Throws the event trigger and the event immediately occurs");
- }
-
- @Override
- public String getStencilImageId() {
- return ImageProvider.IMG_16_INTERMEDIATE_THORW_EVENT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getIntermediateThrowEvent();
- }
- }
-
- public static class UpdateIntermediateThrowEventFeature extends AbstractUpdateEventFeature {
-
- public static String INTERMEDIATE_THROW_EVENT_MARKER = "marker.intermediate.throw.event";
-
- /**
- * @param fp
- */
- public UpdateIntermediateThrowEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
- */
- @Override
- protected String getPropertyKey() {
- return INTERMEDIATE_THROW_EVENT_MARKER;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractCreateEventFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
+import org.eclipse.bpmn2.modeler.core.features.event.AddEventFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class IntermediateThrowEventFeatureContainer extends AbstractEventFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof IntermediateThrowEvent;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateIntermediateThrowEventFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
+ multiUpdate.addUpdateFeature(super.getUpdateFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateIntermediateThrowEventFeature(fp));
+ return multiUpdate;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddEventFeature<IntermediateThrowEvent>(fp) {
+ @Override
+ protected void decorateEllipse(Ellipse e) {
+ Ellipse circle = GraphicsUtil.createIntermediateEventCircle(e);
+ circle.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
+ }
+
+ @Override
+ protected void hook(ContainerShape container) {
+ IPeService peService = Graphiti.getPeService();
+ IntermediateThrowEvent event = BusinessObjectUtil.getFirstElementOfType(container, IntermediateThrowEvent.class);
+ peService.setPropertyValue(container,
+ UpdateIntermediateThrowEventFeature.INTERMEDIATE_THROW_EVENT_MARKER,
+ AbstractUpdateEventFeature.getEventDefinitionsValue(event));
+ }
+ };
+ }
+
+ public static class CreateIntermediateThrowEventFeature extends AbstractCreateEventFeature<IntermediateThrowEvent> {
+
+ public CreateIntermediateThrowEventFeature(IFeatureProvider fp) {
+ super(fp, "Throw Event", "Throws the event trigger and the event immediately occurs");
+ }
+
+ @Override
+ public String getStencilImageId() {
+ return ImageProvider.IMG_16_INTERMEDIATE_THORW_EVENT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getIntermediateThrowEvent();
+ }
+ }
+
+ public static class UpdateIntermediateThrowEventFeature extends AbstractUpdateEventFeature {
+
+ public static String INTERMEDIATE_THROW_EVENT_MARKER = "marker.intermediate.throw.event";
+
+ /**
+ * @param fp
+ */
+ public UpdateIntermediateThrowEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
+ */
+ @Override
+ protected String getPropertyKey() {
+ return INTERMEDIATE_THROW_EVENT_MARKER;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/LayoutBoundaryEventFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/LayoutBoundaryEventFeature.java
index c5d62f0..65d407b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/LayoutBoundaryEventFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/LayoutBoundaryEventFeature.java
@@ -1,106 +1,106 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.modeler.core.di.DIUtils;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.features.event.PositionOnLine.LocationType;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-
-public class LayoutBoundaryEventFeature extends AbstractLayoutFeature {
-
- public LayoutBoundaryEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
- return true;
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- boolean layout = false;
-
- PictogramElement element = context.getPictogramElement();
- GraphicsAlgorithm eventGa = element.getGraphicsAlgorithm();
- BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(element, BoundaryEvent.class);
-
- PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
- event.getAttachedToRef());
- GraphicsAlgorithm activityGa = activityContainer.getGraphicsAlgorithm();
-
- PositionOnLine pos = BoundaryEventPositionHelper.getPositionOnLineProperty(element);
-
- switch (pos.getLineType()) {
- case X:
- moveX(eventGa, activityGa, pos.getLocationType());
- layout = true;
- break;
- case Y:
- moveY(eventGa, activityGa, pos.getLocationType());
- layout = true;
- break;
- case XY:
- moveX(eventGa, activityGa, pos.getLocationType());
- moveY(eventGa, activityGa, pos.getLocationType());
- layout = true;
- break;
- default:
- layout = false;
- break;
- }
-
- DIUtils.updateDIShape(element);
- if (layout) {
- PositionOnLine newPos = BoundaryEventPositionHelper.getPositionOnLineUsingAbsoluteCoordinates(
- (Shape) element, (Shape) activityContainer);
- BoundaryEventPositionHelper.assignPositionOnLineProperty(element, newPos);
- }
- return layout;
- }
-
- private void moveX(GraphicsAlgorithm ga, GraphicsAlgorithm parentGa, LocationType locType) {
- IGaService gaService = Graphiti.getGaService();
- if (isLeft(locType)) {
- gaService.setLocation(ga, parentGa.getX() - (ga.getWidth() / 2), ga.getY());
- } else {
- gaService.setLocation(ga, parentGa.getX() + parentGa.getWidth() - (ga.getWidth() / 2), ga.getY());
- }
- }
-
- private boolean isLeft(LocationType locType) {
- return locType == LocationType.TOP_LEFT || locType == LocationType.LEFT || locType == LocationType.BOTTOM_LEFT;
- }
-
- private void moveY(GraphicsAlgorithm ga, GraphicsAlgorithm parentGa, LocationType locType) {
- IGaService gaService = Graphiti.getGaService();
- if (isTop(locType)) {
- gaService.setLocation(ga, ga.getX(), parentGa.getY() - (ga.getHeight() / 2));
- } else {
- gaService.setLocation(ga, ga.getX(), parentGa.getY() + parentGa.getHeight() - (ga.getHeight() / 2));
- }
- }
-
- private boolean isTop(LocationType locType) {
- return locType == LocationType.TOP_LEFT || locType == LocationType.TOP || locType == LocationType.TOP_RIGHT;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.features.event.PositionOnLine.LocationType;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+public class LayoutBoundaryEventFeature extends AbstractLayoutFeature {
+
+ public LayoutBoundaryEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+ return true;
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ boolean layout = false;
+
+ PictogramElement element = context.getPictogramElement();
+ GraphicsAlgorithm eventGa = element.getGraphicsAlgorithm();
+ BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(element, BoundaryEvent.class);
+
+ PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
+ event.getAttachedToRef());
+ GraphicsAlgorithm activityGa = activityContainer.getGraphicsAlgorithm();
+
+ PositionOnLine pos = BoundaryEventPositionHelper.getPositionOnLineProperty(element);
+
+ switch (pos.getLineType()) {
+ case X:
+ moveX(eventGa, activityGa, pos.getLocationType());
+ layout = true;
+ break;
+ case Y:
+ moveY(eventGa, activityGa, pos.getLocationType());
+ layout = true;
+ break;
+ case XY:
+ moveX(eventGa, activityGa, pos.getLocationType());
+ moveY(eventGa, activityGa, pos.getLocationType());
+ layout = true;
+ break;
+ default:
+ layout = false;
+ break;
+ }
+
+ DIUtils.updateDIShape(element);
+ if (layout) {
+ PositionOnLine newPos = BoundaryEventPositionHelper.getPositionOnLineUsingAbsoluteCoordinates(
+ (Shape) element, (Shape) activityContainer);
+ BoundaryEventPositionHelper.assignPositionOnLineProperty(element, newPos);
+ }
+ return layout;
+ }
+
+ private void moveX(GraphicsAlgorithm ga, GraphicsAlgorithm parentGa, LocationType locType) {
+ IGaService gaService = Graphiti.getGaService();
+ if (isLeft(locType)) {
+ gaService.setLocation(ga, parentGa.getX() - (ga.getWidth() / 2), ga.getY());
+ } else {
+ gaService.setLocation(ga, parentGa.getX() + parentGa.getWidth() - (ga.getWidth() / 2), ga.getY());
+ }
+ }
+
+ private boolean isLeft(LocationType locType) {
+ return locType == LocationType.TOP_LEFT || locType == LocationType.LEFT || locType == LocationType.BOTTOM_LEFT;
+ }
+
+ private void moveY(GraphicsAlgorithm ga, GraphicsAlgorithm parentGa, LocationType locType) {
+ IGaService gaService = Graphiti.getGaService();
+ if (isTop(locType)) {
+ gaService.setLocation(ga, ga.getX(), parentGa.getY() - (ga.getHeight() / 2));
+ } else {
+ gaService.setLocation(ga, ga.getX(), parentGa.getY() + parentGa.getHeight() - (ga.getHeight() / 2));
+ }
+ }
+
+ private boolean isTop(LocationType locType) {
+ return locType == LocationType.TOP_LEFT || locType == LocationType.TOP || locType == LocationType.TOP_RIGHT;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/MoveBoundaryEventFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/MoveBoundaryEventFeature.java
index 1331aed..e5aa92f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/MoveBoundaryEventFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/MoveBoundaryEventFeature.java
@@ -1,130 +1,130 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
-import org.eclipse.bpmn2.modeler.core.features.activity.MoveActivityFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.graphiti.datatypes.ILocation;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.context.impl.MoveShapeContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class MoveBoundaryEventFeature extends MoveFlowNodeFeature {
-
- public MoveBoundaryEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected void preMoveShape(IMoveShapeContext context) {
- ContainerShape targetContainer = context.getTargetContainer();
- Activity activity = BusinessObjectUtil.getFirstElementOfType(targetContainer, Activity.class);
- Object property = context.getProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY);
-
- if (activity != null && property == null) {
- ContainerShape taskContainer = context.getTargetContainer();
- ContainerShape parentContainer = (ContainerShape) context.getPictogramElement().eContainer();
-
- IPeService peService = Graphiti.getPeService();
-
- ILocation loc = peService.getLocationRelativeToDiagram(taskContainer);
- MoveShapeContext c = (MoveShapeContext) context;
- int eventX = loc.getX() + context.getX();
- int eventY = loc.getY() + context.getY();
-
- if (!(parentContainer instanceof Diagram)) {
- loc = peService.getLocationRelativeToDiagram(parentContainer);
- eventX = eventX - loc.getX();
- eventY = eventY - loc.getY();
- }
-
- c.setLocation(eventX, eventY);
- c.setTargetContainer(parentContainer);
- }
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
- Object property = context.getProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY);
- PictogramElement[] selection = getDiagramEditor().getSelectedPictogramElements();
- boolean singleSelection = selection != null && selection.length == 1;
-
- BoundaryEvent event = (BoundaryEvent) context.getShape().getLink().getBusinessObjects().get(0);
- List<PictogramElement> activityPictogramElements = Graphiti.getLinkService().getPictogramElements(getDiagram(), event.getAttachedToRef());
- for (PictogramElement activityElement : activityPictogramElements) {
- if (!singleSelection && ModelUtil.isElementSelected(getDiagramEditor().getSelectedPictogramElements(), activityElement)){
- if (!ModelUtil.isElementSelected(getDiagramEditor().getSelectedPictogramElements(), context.getPictogramElement())) {
- context.putProperty(MoveActivityFeature.SELECTION_MOVE_PROPERTY, false);
- context.putProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY, true);
- } else {
- context.putProperty(MoveActivityFeature.SELECTION_MOVE_PROPERTY, true);
- context.putProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY, false);
- }
- return true;
- }
- }
-
- boolean movedByActivity = property != null && (Boolean) property;
- if (!movedByActivity && !BoundaryEventPositionHelper.canMoveTo(context, getDiagram())) {
- return false;
- }
- return super.canMoveShape(context);
- }
-
- @Override
- protected boolean onMoveAlgorithmNotFound(IMoveShapeContext context) {
- return true;
- }
-
- @Override
- protected void postMoveShape(IMoveShapeContext context) {
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
-
- Object property = context.getProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY);
- Object selectionFlag = context.getProperty(MoveActivityFeature.SELECTION_MOVE_PROPERTY);
- if (property != null && (Boolean) property) {
- IGaService gaService = Graphiti.getGaService();
- GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
- gaService.setLocation(ga, ga.getX() + context.getDeltaX(), ga.getY() + context.getDeltaY());
- }
- else if (selectionFlag != null && (Boolean) selectionFlag) {
- // do nothing, let base class do the job
- }
- else {
- BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(containerShape, BoundaryEvent.class);
- PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
- event.getAttachedToRef());
- PositionOnLine newPos = BoundaryEventPositionHelper.getPositionOnLineUsingAbsoluteCoordinates(
- containerShape, (Shape) activityContainer);
- BoundaryEventPositionHelper.assignPositionOnLineProperty(containerShape, newPos);
- }
-
- Graphiti.getPeService().sendToFront(context.getShape());
-
- super.postMoveShape(context);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
+import org.eclipse.bpmn2.modeler.core.features.activity.MoveActivityFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.graphiti.datatypes.ILocation;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.context.impl.MoveShapeContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class MoveBoundaryEventFeature extends MoveFlowNodeFeature {
+
+ public MoveBoundaryEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected void preMoveShape(IMoveShapeContext context) {
+ ContainerShape targetContainer = context.getTargetContainer();
+ Activity activity = BusinessObjectUtil.getFirstElementOfType(targetContainer, Activity.class);
+ Object property = context.getProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY);
+
+ if (activity != null && property == null) {
+ ContainerShape taskContainer = context.getTargetContainer();
+ ContainerShape parentContainer = (ContainerShape) context.getPictogramElement().eContainer();
+
+ IPeService peService = Graphiti.getPeService();
+
+ ILocation loc = peService.getLocationRelativeToDiagram(taskContainer);
+ MoveShapeContext c = (MoveShapeContext) context;
+ int eventX = loc.getX() + context.getX();
+ int eventY = loc.getY() + context.getY();
+
+ if (!(parentContainer instanceof Diagram)) {
+ loc = peService.getLocationRelativeToDiagram(parentContainer);
+ eventX = eventX - loc.getX();
+ eventY = eventY - loc.getY();
+ }
+
+ c.setLocation(eventX, eventY);
+ c.setTargetContainer(parentContainer);
+ }
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+ Object property = context.getProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY);
+ PictogramElement[] selection = getDiagramEditor().getSelectedPictogramElements();
+ boolean singleSelection = selection != null && selection.length == 1;
+
+ BoundaryEvent event = (BoundaryEvent) context.getShape().getLink().getBusinessObjects().get(0);
+ List<PictogramElement> activityPictogramElements = Graphiti.getLinkService().getPictogramElements(getDiagram(), event.getAttachedToRef());
+ for (PictogramElement activityElement : activityPictogramElements) {
+ if (!singleSelection && ModelUtil.isElementSelected(getDiagramEditor().getSelectedPictogramElements(), activityElement)){
+ if (!ModelUtil.isElementSelected(getDiagramEditor().getSelectedPictogramElements(), context.getPictogramElement())) {
+ context.putProperty(MoveActivityFeature.SELECTION_MOVE_PROPERTY, false);
+ context.putProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY, true);
+ } else {
+ context.putProperty(MoveActivityFeature.SELECTION_MOVE_PROPERTY, true);
+ context.putProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY, false);
+ }
+ return true;
+ }
+ }
+
+ boolean movedByActivity = property != null && (Boolean) property;
+ if (!movedByActivity && !BoundaryEventPositionHelper.canMoveTo(context, getDiagram())) {
+ return false;
+ }
+ return super.canMoveShape(context);
+ }
+
+ @Override
+ protected boolean onMoveAlgorithmNotFound(IMoveShapeContext context) {
+ return true;
+ }
+
+ @Override
+ protected void postMoveShape(IMoveShapeContext context) {
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+
+ Object property = context.getProperty(MoveActivityFeature.ACTIVITY_MOVE_PROPERTY);
+ Object selectionFlag = context.getProperty(MoveActivityFeature.SELECTION_MOVE_PROPERTY);
+ if (property != null && (Boolean) property) {
+ IGaService gaService = Graphiti.getGaService();
+ GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
+ gaService.setLocation(ga, ga.getX() + context.getDeltaX(), ga.getY() + context.getDeltaY());
+ }
+ else if (selectionFlag != null && (Boolean) selectionFlag) {
+ // do nothing, let base class do the job
+ }
+ else {
+ BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(containerShape, BoundaryEvent.class);
+ PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
+ event.getAttachedToRef());
+ PositionOnLine newPos = BoundaryEventPositionHelper.getPositionOnLineUsingAbsoluteCoordinates(
+ containerShape, (Shape) activityContainer);
+ BoundaryEventPositionHelper.assignPositionOnLineProperty(containerShape, newPos);
+ }
+
+ Graphiti.getPeService().sendToFront(context.getShape());
+
+ super.postMoveShape(context);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/PositionOnLine.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/PositionOnLine.java
index 64047f2..362e601 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/PositionOnLine.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/PositionOnLine.java
@@ -1,122 +1,122 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-public class PositionOnLine {
-
- public enum LineType {
- X, Y, XY, UNKNOWN
- }
-
- public enum LocationType {
- TOP, TOP_LEFT, TOP_RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, RIGHT, UNKNOWN
- }
-
- private LineType lineType;
- private LocationType locationType;
-
- public PositionOnLine(LineType lineType, LocationType locationType) {
- this.lineType = lineType;
- this.locationType = locationType;
- }
-
- public PositionOnLine(boolean alongLeftX, boolean alongRightX, boolean alongTopY, boolean alongBottomY) {
- boolean alongX = alongLeftX || alongRightX;
- boolean alongY = alongTopY || alongBottomY;
-
- if (alongX && alongY) {
- lineType = LineType.XY;
- } else if (alongX) {
- lineType = LineType.X;
- } else if (alongY) {
- lineType = LineType.Y;
- } else {
- lineType = LineType.UNKNOWN;
- }
-
- if (lineType != null) {
- switch (lineType) {
- case XY:
- if (alongLeftX) {
- if (alongTopY) {
- locationType = LocationType.TOP_LEFT;
- } else {
- locationType = LocationType.BOTTOM_LEFT;
- }
- } else if (alongRightX) {
- if (alongTopY) {
- locationType = LocationType.TOP_RIGHT;
- } else {
- locationType = LocationType.BOTTOM_RIGHT;
- }
- }
- break;
- case X:
- if (alongLeftX) {
- locationType = LocationType.LEFT;
- } else {
- locationType = LocationType.RIGHT;
- }
- break;
- case Y:
- if (alongTopY) {
- locationType = LocationType.TOP;
- } else {
- locationType = LocationType.BOTTOM;
- }
- break;
- default:
- locationType = LocationType.UNKNOWN;
- break;
- }
- }
-
- if (locationType == null) {
- locationType = LocationType.UNKNOWN;
- }
- }
-
- public LineType getLineType() {
- return lineType;
- }
-
- public LocationType getLocationType() {
- return locationType;
- }
-
- public boolean isLegalPosition() {
- return lineType != LineType.UNKNOWN && locationType != LocationType.UNKNOWN;
- }
-
- public static PositionOnLine fromString(String s) {
- if (s == null) {
- return null;
- }
- String[] arr = s.split(":");
- if (!arr[0].equals(PositionOnLine.class.getSimpleName().toLowerCase())) {
- return null;
- }
-
- return new PositionOnLine(LineType.valueOf(arr[1]), LocationType.valueOf(arr[2]));
- }
-
- @Override
- public String toString() {
- String prefix = PositionOnLine.class.getSimpleName().toLowerCase();
- String lineType = this.lineType.toString();
- String locationType = this.locationType.toString();
- String colon = ":";
- return new StringBuilder().append(prefix).append(colon).append(lineType).append(colon).append(locationType)
- .toString();
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+public class PositionOnLine {
+
+ public enum LineType {
+ X, Y, XY, UNKNOWN
+ }
+
+ public enum LocationType {
+ TOP, TOP_LEFT, TOP_RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, RIGHT, UNKNOWN
+ }
+
+ private LineType lineType;
+ private LocationType locationType;
+
+ public PositionOnLine(LineType lineType, LocationType locationType) {
+ this.lineType = lineType;
+ this.locationType = locationType;
+ }
+
+ public PositionOnLine(boolean alongLeftX, boolean alongRightX, boolean alongTopY, boolean alongBottomY) {
+ boolean alongX = alongLeftX || alongRightX;
+ boolean alongY = alongTopY || alongBottomY;
+
+ if (alongX && alongY) {
+ lineType = LineType.XY;
+ } else if (alongX) {
+ lineType = LineType.X;
+ } else if (alongY) {
+ lineType = LineType.Y;
+ } else {
+ lineType = LineType.UNKNOWN;
+ }
+
+ if (lineType != null) {
+ switch (lineType) {
+ case XY:
+ if (alongLeftX) {
+ if (alongTopY) {
+ locationType = LocationType.TOP_LEFT;
+ } else {
+ locationType = LocationType.BOTTOM_LEFT;
+ }
+ } else if (alongRightX) {
+ if (alongTopY) {
+ locationType = LocationType.TOP_RIGHT;
+ } else {
+ locationType = LocationType.BOTTOM_RIGHT;
+ }
+ }
+ break;
+ case X:
+ if (alongLeftX) {
+ locationType = LocationType.LEFT;
+ } else {
+ locationType = LocationType.RIGHT;
+ }
+ break;
+ case Y:
+ if (alongTopY) {
+ locationType = LocationType.TOP;
+ } else {
+ locationType = LocationType.BOTTOM;
+ }
+ break;
+ default:
+ locationType = LocationType.UNKNOWN;
+ break;
+ }
+ }
+
+ if (locationType == null) {
+ locationType = LocationType.UNKNOWN;
+ }
+ }
+
+ public LineType getLineType() {
+ return lineType;
+ }
+
+ public LocationType getLocationType() {
+ return locationType;
+ }
+
+ public boolean isLegalPosition() {
+ return lineType != LineType.UNKNOWN && locationType != LocationType.UNKNOWN;
+ }
+
+ public static PositionOnLine fromString(String s) {
+ if (s == null) {
+ return null;
+ }
+ String[] arr = s.split(":");
+ if (!arr[0].equals(PositionOnLine.class.getSimpleName().toLowerCase())) {
+ return null;
+ }
+
+ return new PositionOnLine(LineType.valueOf(arr[1]), LocationType.valueOf(arr[2]));
+ }
+
+ @Override
+ public String toString() {
+ String prefix = PositionOnLine.class.getSimpleName().toLowerCase();
+ String lineType = this.lineType.toString();
+ String locationType = this.locationType.toString();
+ String colon = ":";
+ return new StringBuilder().append(prefix).append(colon).append(lineType).append(colon).append(locationType)
+ .toString();
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/UpdateBoundaryEventFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/UpdateBoundaryEventFeature.java
index 091734f..8ed1e1d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/UpdateBoundaryEventFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/UpdateBoundaryEventFeature.java
@@ -1,79 +1,79 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event;
-
-import static org.eclipse.bpmn2.modeler.ui.features.event.BoundaryEventFeatureContainer.BOUNDARY_EVENT_CANCEL;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class UpdateBoundaryEventFeature extends AbstractUpdateEventFeature {
-
- public static String BOUNDARY_EVENT_MARKER = "marker.boundary.event";
-
- public UpdateBoundaryEventFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- if (super.updateNeeded(context).toBoolean())
- return Reason.createTrueReason();
-
- String cancelProperty = Graphiti.getPeService().getPropertyValue(context.getPictogramElement(),
- BOUNDARY_EVENT_CANCEL);
- BoundaryEvent event = (BoundaryEvent) getBusinessObjectForPictogramElement(context.getPictogramElement());
- boolean changed = Boolean.parseBoolean(cancelProperty) != event.isCancelActivity();
- IReason reason = changed ? Reason.createTrueReason("Boundary description changed") : Reason.createFalseReason();
- return reason;
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- super.update(context);
-
- BoundaryEvent event = (BoundaryEvent) getBusinessObjectForPictogramElement(context.getPictogramElement());
-
- Graphiti.getPeService().setPropertyValue(context.getPictogramElement(), BOUNDARY_EVENT_CANCEL,
- Boolean.toString(event.isCancelActivity()));
-
- Ellipse ellipse = (Ellipse) context.getPictogramElement().getGraphicsAlgorithm();
- Ellipse innerEllipse = (Ellipse) ellipse.getGraphicsAlgorithmChildren().get(0);
- LineStyle lineStyle = event.isCancelActivity() ? LineStyle.SOLID : LineStyle.DASH;
-
- ellipse.setLineStyle(lineStyle);
- innerEllipse.setLineStyle(lineStyle);
-
- return true;
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof BoundaryEvent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
- */
- @Override
- protected String getPropertyKey() {
- return BOUNDARY_EVENT_MARKER;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event;
+
+import static org.eclipse.bpmn2.modeler.ui.features.event.BoundaryEventFeatureContainer.BOUNDARY_EVENT_CANCEL;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.modeler.core.features.event.AbstractUpdateEventFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class UpdateBoundaryEventFeature extends AbstractUpdateEventFeature {
+
+ public static String BOUNDARY_EVENT_MARKER = "marker.boundary.event";
+
+ public UpdateBoundaryEventFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ if (super.updateNeeded(context).toBoolean())
+ return Reason.createTrueReason();
+
+ String cancelProperty = Graphiti.getPeService().getPropertyValue(context.getPictogramElement(),
+ BOUNDARY_EVENT_CANCEL);
+ BoundaryEvent event = (BoundaryEvent) getBusinessObjectForPictogramElement(context.getPictogramElement());
+ boolean changed = Boolean.parseBoolean(cancelProperty) != event.isCancelActivity();
+ IReason reason = changed ? Reason.createTrueReason("Boundary description changed") : Reason.createFalseReason();
+ return reason;
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ super.update(context);
+
+ BoundaryEvent event = (BoundaryEvent) getBusinessObjectForPictogramElement(context.getPictogramElement());
+
+ Graphiti.getPeService().setPropertyValue(context.getPictogramElement(), BOUNDARY_EVENT_CANCEL,
+ Boolean.toString(event.isCancelActivity()));
+
+ Ellipse ellipse = (Ellipse) context.getPictogramElement().getGraphicsAlgorithm();
+ Ellipse innerEllipse = (Ellipse) ellipse.getGraphicsAlgorithmChildren().get(0);
+ LineStyle lineStyle = event.isCancelActivity() ? LineStyle.SOLID : LineStyle.DASH;
+
+ ellipse.setLineStyle(lineStyle);
+ innerEllipse.setLineStyle(lineStyle);
+
+ return true;
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ return getBusinessObjectForPictogramElement(context.getPictogramElement()) instanceof BoundaryEvent;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.activity.AbstractUpdateMarkerFeature#getPropertyKey()
+ */
+ @Override
+ protected String getPropertyKey() {
+ return BOUNDARY_EVENT_MARKER;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CancelEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CancelEventDefinitionContainer.java
index cdf7054..56d4812 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CancelEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CancelEventDefinitionContainer.java
@@ -1,136 +1,136 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CancelEventDefinition;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class CancelEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof CancelEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateCancelEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape cancelShape = Graphiti.getPeService().createShape(shape, false);
- Polygon link = GraphicsUtil.createEventCancel(cancelShape);
- StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(link, be);
- return cancelShape;
- }
-
- private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape cancelShape = Graphiti.getPeService().createShape(shape, false);
- Polygon link = GraphicsUtil.createEventCancel(cancelShape);
- StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(link, be);
- return cancelShape;
- }
-
- public static class CreateCancelEventDefinition extends CreateEventDefinition<CancelEventDefinition> {
-
- public CreateCancelEventDefinition(IFeatureProvider fp) {
- super(fp, "Cancel Definition", "Adds cancel trigger to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (e instanceof BoundaryEvent) {
- BoundaryEvent be = (BoundaryEvent) e;
- return be.isCancelActivity();
- }
-
- if (e instanceof CatchEvent || e instanceof IntermediateThrowEvent) {
- return false;
- }
-
- return true;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_CANCEL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getCancelEventDefinition();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CancelEventDefinition;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class CancelEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof CancelEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateCancelEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape cancelShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon link = GraphicsUtil.createEventCancel(cancelShape);
+ StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(link, be);
+ return cancelShape;
+ }
+
+ private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape cancelShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon link = GraphicsUtil.createEventCancel(cancelShape);
+ StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(link, be);
+ return cancelShape;
+ }
+
+ public static class CreateCancelEventDefinition extends CreateEventDefinition<CancelEventDefinition> {
+
+ public CreateCancelEventDefinition(IFeatureProvider fp) {
+ super(fp, "Cancel Definition", "Adds cancel trigger to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (e instanceof BoundaryEvent) {
+ BoundaryEvent be = (BoundaryEvent) e;
+ return be.isCancelActivity();
+ }
+
+ if (e instanceof CatchEvent || e instanceof IntermediateThrowEvent) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_CANCEL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getCancelEventDefinition();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CompensateEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CompensateEventDefinitionContainer.java
index 73078d5..782422f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CompensateEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CompensateEventDefinitionContainer.java
@@ -1,155 +1,155 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.CompensateEventDefinition;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Compensation;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class CompensateEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof CompensateEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateCompensateEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape compensateShape = Graphiti.getPeService().createShape(shape, false);
- Compensation compensation = GraphicsUtil.createEventCompensation(compensateShape);
- StyleUtil.setFillStyle(compensation.arrow1, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(compensation.arrow1, be);
- StyleUtil.setFillStyle(compensation.arrow2, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(compensation.arrow2, be);
- return compensateShape;
- }
-
- private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape compensateShape = Graphiti.getPeService().createShape(shape, false);
- Compensation compensation = GraphicsUtil.createEventCompensation(compensateShape);
- StyleUtil.setFillStyle(compensation.arrow1, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(compensation.arrow1, be);
- StyleUtil.setFillStyle(compensation.arrow2, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(compensation.arrow2, be);
- return compensateShape;
- }
-
- public static class CreateCompensateEventDefinition extends CreateEventDefinition<CompensateEventDefinition> {
-
- public CreateCompensateEventDefinition(IFeatureProvider fp) {
- super(fp, "Compensate Definition", "Adds compensate trigger to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (e instanceof BoundaryEvent) {
- BoundaryEvent be = (BoundaryEvent) e;
- return be.isCancelActivity();
- }
-
- if (e instanceof StartEvent) {
- if (((StartEvent) e).isIsInterrupting() == false) {
- return false;
- }
-
- EObject container = context.getTargetContainer().eContainer();
- if (container instanceof Shape) {
- Object o = getBusinessObjectForPictogramElement((Shape) container);
- return o != null && o instanceof SubProcess;
- }
-
- return false;
- }
-
- if (e instanceof CatchEvent) {
- return false;
- }
-
- return true;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_COMPENSATE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getCompensateEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.CompensateEventDefinition;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Compensation;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class CompensateEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof CompensateEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateCompensateEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape compensateShape = Graphiti.getPeService().createShape(shape, false);
+ Compensation compensation = GraphicsUtil.createEventCompensation(compensateShape);
+ StyleUtil.setFillStyle(compensation.arrow1, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(compensation.arrow1, be);
+ StyleUtil.setFillStyle(compensation.arrow2, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(compensation.arrow2, be);
+ return compensateShape;
+ }
+
+ private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape compensateShape = Graphiti.getPeService().createShape(shape, false);
+ Compensation compensation = GraphicsUtil.createEventCompensation(compensateShape);
+ StyleUtil.setFillStyle(compensation.arrow1, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(compensation.arrow1, be);
+ StyleUtil.setFillStyle(compensation.arrow2, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(compensation.arrow2, be);
+ return compensateShape;
+ }
+
+ public static class CreateCompensateEventDefinition extends CreateEventDefinition<CompensateEventDefinition> {
+
+ public CreateCompensateEventDefinition(IFeatureProvider fp) {
+ super(fp, "Compensate Definition", "Adds compensate trigger to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (e instanceof BoundaryEvent) {
+ BoundaryEvent be = (BoundaryEvent) e;
+ return be.isCancelActivity();
+ }
+
+ if (e instanceof StartEvent) {
+ if (((StartEvent) e).isIsInterrupting() == false) {
+ return false;
+ }
+
+ EObject container = context.getTargetContainer().eContainer();
+ if (container instanceof Shape) {
+ Object o = getBusinessObjectForPictogramElement((Shape) container);
+ return o != null && o instanceof SubProcess;
+ }
+
+ return false;
+ }
+
+ if (e instanceof CatchEvent) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_COMPENSATE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getCompensateEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ConditionalEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ConditionalEventDefinitionContainer.java
index da432aa..0418483 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ConditionalEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ConditionalEventDefinitionContainer.java
@@ -1,110 +1,110 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ConditionalEventDefinition;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class ConditionalEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ConditionalEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateConditionalEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- private Shape draw(ContainerShape shape) {
- Shape conditionShape = Graphiti.getPeService().createShape(shape, false);
- GraphicsUtil.createEventImage(conditionShape, ImageProvider.IMG_20_CONDITION);
- return conditionShape;
- }
-
- public static class CreateConditionalEventDefinition extends CreateEventDefinition<ConditionalEventDefinition> {
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
- if (e instanceof ThrowEvent) {
- return false;
- }
-
- return true;
- }
-
- public CreateConditionalEventDefinition(IFeatureProvider fp) {
- super(fp, "Conditional Event Definition", "Conditional trigger");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_CONDITION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getConditionalEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ConditionalEventDefinition;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class ConditionalEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ConditionalEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateConditionalEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ private Shape draw(ContainerShape shape) {
+ Shape conditionShape = Graphiti.getPeService().createShape(shape, false);
+ GraphicsUtil.createEventImage(conditionShape, ImageProvider.IMG_20_CONDITION);
+ return conditionShape;
+ }
+
+ public static class CreateConditionalEventDefinition extends CreateEventDefinition<ConditionalEventDefinition> {
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+ if (e instanceof ThrowEvent) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public CreateConditionalEventDefinition(IFeatureProvider fp) {
+ super(fp, "Conditional Event Definition", "Conditional trigger");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_CONDITION;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getConditionalEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ErrorEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ErrorEventDefinitionContainer.java
index 74a96e5..8ae8380 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ErrorEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/ErrorEventDefinitionContainer.java
@@ -1,153 +1,153 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.ErrorEventDefinition;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class ErrorEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ErrorEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateErrorEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape errorShape = Graphiti.getPeService().createShape(shape, false);
- Polygon error = GraphicsUtil.createEventError(errorShape);
- StyleUtil.setFillStyle(error, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(error, be);
- return errorShape;
- }
-
- private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape errorShape = Graphiti.getPeService().createShape(shape, false);
- Polygon error = GraphicsUtil.createEventError(errorShape);
- StyleUtil.setFillStyle(error, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(error, be);
- return errorShape;
- }
-
- public static class CreateErrorEventDefinition extends CreateEventDefinition<ErrorEventDefinition> {
-
- public CreateErrorEventDefinition(IFeatureProvider fp) {
- super(fp, "Error Definition", "Adds error trigger to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (e instanceof BoundaryEvent) {
- BoundaryEvent be = (BoundaryEvent) e;
- return be.isCancelActivity();
- }
-
- if (e instanceof StartEvent) {
- if (((StartEvent) e).isIsInterrupting() == false) {
- return false;
- }
-
- EObject container = context.getTargetContainer().eContainer();
- if (container instanceof Shape) {
- Object o = getBusinessObjectForPictogramElement((Shape) container);
- return o != null && o instanceof SubProcess;
- }
-
- return false;
- }
-
- if (e instanceof CatchEvent || e instanceof IntermediateThrowEvent) {
- return false;
- }
-
- return true;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_ERROR;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getErrorEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.ErrorEventDefinition;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class ErrorEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ErrorEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateErrorEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape errorShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon error = GraphicsUtil.createEventError(errorShape);
+ StyleUtil.setFillStyle(error, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(error, be);
+ return errorShape;
+ }
+
+ private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape errorShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon error = GraphicsUtil.createEventError(errorShape);
+ StyleUtil.setFillStyle(error, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(error, be);
+ return errorShape;
+ }
+
+ public static class CreateErrorEventDefinition extends CreateEventDefinition<ErrorEventDefinition> {
+
+ public CreateErrorEventDefinition(IFeatureProvider fp) {
+ super(fp, "Error Definition", "Adds error trigger to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (e instanceof BoundaryEvent) {
+ BoundaryEvent be = (BoundaryEvent) e;
+ return be.isCancelActivity();
+ }
+
+ if (e instanceof StartEvent) {
+ if (((StartEvent) e).isIsInterrupting() == false) {
+ return false;
+ }
+
+ EObject container = context.getTargetContainer().eContainer();
+ if (container instanceof Shape) {
+ Object o = getBusinessObjectForPictogramElement((Shape) container);
+ return o != null && o instanceof SubProcess;
+ }
+
+ return false;
+ }
+
+ if (e instanceof CatchEvent || e instanceof IntermediateThrowEvent) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_ERROR;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getErrorEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/EscalationEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/EscalationEventDefinitionContainer.java
index e025021..aab357a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/EscalationEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/EscalationEventDefinitionContainer.java
@@ -1,142 +1,142 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ErrorEventDefinition;
-import org.eclipse.bpmn2.EscalationEventDefinition;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class EscalationEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof EscalationEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateEscalationEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(shape);
- Shape escalationShape = Graphiti.getPeService().createShape(shape, false);
- Polygon escalation = GraphicsUtil.createEventEscalation(escalationShape);
- StyleUtil.setFillStyle(escalation, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(escalation, be);
- return escalationShape;
- }
-
- private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(shape);
- Shape escalationShape = Graphiti.getPeService().createShape(shape, false);
- Polygon escalation = GraphicsUtil.createEventEscalation(escalationShape);
- StyleUtil.setFillStyle(escalation, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(escalation, be);
- return escalationShape;
- }
-
- public static class CreateEscalationEventDefinition extends CreateEventDefinition<EscalationEventDefinition> {
-
- public CreateEscalationEventDefinition(IFeatureProvider fp) {
- super(fp, "Escalation Definition", "Adds escalation trigger to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (e instanceof StartEvent) {
- EObject container = context.getTargetContainer().eContainer();
- if (container instanceof Shape) {
- Object o = getBusinessObjectForPictogramElement((Shape) container);
- return o != null && o instanceof SubProcess;
- }
-
- return false;
- }
-
- if (e instanceof IntermediateCatchEvent) {
- return false;
- }
-
- return true;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_ESCAlATION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getEscalationEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ErrorEventDefinition;
+import org.eclipse.bpmn2.EscalationEventDefinition;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class EscalationEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof EscalationEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateEscalationEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(shape);
+ Shape escalationShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon escalation = GraphicsUtil.createEventEscalation(escalationShape);
+ StyleUtil.setFillStyle(escalation, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(escalation, be);
+ return escalationShape;
+ }
+
+ private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(shape);
+ Shape escalationShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon escalation = GraphicsUtil.createEventEscalation(escalationShape);
+ StyleUtil.setFillStyle(escalation, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(escalation, be);
+ return escalationShape;
+ }
+
+ public static class CreateEscalationEventDefinition extends CreateEventDefinition<EscalationEventDefinition> {
+
+ public CreateEscalationEventDefinition(IFeatureProvider fp) {
+ super(fp, "Escalation Definition", "Adds escalation trigger to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (e instanceof StartEvent) {
+ EObject container = context.getTargetContainer().eContainer();
+ if (container instanceof Shape) {
+ Object o = getBusinessObjectForPictogramElement((Shape) container);
+ return o != null && o instanceof SubProcess;
+ }
+
+ return false;
+ }
+
+ if (e instanceof IntermediateCatchEvent) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_ESCAlATION;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getEscalationEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/LinkEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/LinkEventDefinitionContainer.java
index 73503d9..80e631b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/LinkEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/LinkEventDefinitionContainer.java
@@ -1,131 +1,131 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EscalationEventDefinition;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.LinkEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class LinkEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof LinkEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateLinkEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- // TODO Auto-generated method stub
- return null;
- }
-
- private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape linkShape = Graphiti.getPeService().createShape(shape, false);
- Polygon link = GraphicsUtil.createEventLink(linkShape);
- StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(link, be);
- return linkShape;
- }
-
- private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape linkShape = Graphiti.getPeService().createShape(shape, false);
- Polygon link = GraphicsUtil.createEventLink(linkShape);
- StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(link, be);
- return linkShape;
- }
-
- public static class CreateLinkEventDefinition extends CreateEventDefinition<LinkEventDefinition> {
-
- public CreateLinkEventDefinition(IFeatureProvider fp) {
- super(fp, "Link Definition", "Adds link trigger to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- if (e instanceof IntermediateCatchEvent || e instanceof IntermediateThrowEvent) {
- return true;
- }
-
- return false;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_LINK;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getLinkEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EscalationEventDefinition;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.LinkEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class LinkEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof LinkEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateLinkEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape linkShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon link = GraphicsUtil.createEventLink(linkShape);
+ StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(link, be);
+ return linkShape;
+ }
+
+ private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape linkShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon link = GraphicsUtil.createEventLink(linkShape);
+ StyleUtil.setFillStyle(link, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(link, be);
+ return linkShape;
+ }
+
+ public static class CreateLinkEventDefinition extends CreateEventDefinition<LinkEventDefinition> {
+
+ public CreateLinkEventDefinition(IFeatureProvider fp) {
+ super(fp, "Link Definition", "Adds link trigger to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ if (e instanceof IntermediateCatchEvent || e instanceof IntermediateThrowEvent) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_LINK;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getLinkEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/MessageEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/MessageEventDefinitionContainer.java
index 4869256..90b131b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/MessageEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/MessageEventDefinitionContainer.java
@@ -1,117 +1,117 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.LinkEventDefinition;
-import org.eclipse.bpmn2.MessageEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Envelope;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.util.IColorConstant;
-
-public class MessageEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof MessageEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateMessageEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawEnvleope(algorithm, shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilledEnvelope(algorithm, shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilledEnvelope(algorithm, shape);
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawEnvleope(algorithm, shape);
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawEnvleope(algorithm, shape);
- }
-
- private Shape drawEnvleope(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape envelopeShape = Graphiti.getPeService().createShape(shape, false);
- Envelope env = GraphicsUtil.createEventEnvelope(envelopeShape);
- StyleUtil.setFillStyle(env.rect, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(env.rect, be);
- StyleUtil.setFillStyle(env.line, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(env.line, be);
- return envelopeShape;
- }
-
- private Shape drawFilledEnvelope(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape envelopeShape = Graphiti.getPeService().createShape(shape, false);
- Envelope env = GraphicsUtil.createEventEnvelope(envelopeShape);
- StyleUtil.setFillStyle(env.rect, FillStyle.FILL_STYLE_INVERT);
- StyleUtil.applyStyle(env.rect, be);
- StyleUtil.setFillStyle(env.line, FillStyle.FILL_STYLE_INVERT);
- StyleUtil.applyStyle(env.line, be);
- return envelopeShape;
- }
-
- public static class CreateMessageEventDefinition extends CreateEventDefinition<MessageEventDefinition> {
-
- public CreateMessageEventDefinition(IFeatureProvider fp) {
- super(fp, "Message Definition", "Marks that event expects a message");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_MESSAGE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getMessageEventDefinition();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.LinkEventDefinition;
+import org.eclipse.bpmn2.MessageEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Envelope;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.util.IColorConstant;
+
+public class MessageEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof MessageEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateMessageEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawEnvleope(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilledEnvelope(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilledEnvelope(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawEnvleope(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawEnvleope(algorithm, shape);
+ }
+
+ private Shape drawEnvleope(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape envelopeShape = Graphiti.getPeService().createShape(shape, false);
+ Envelope env = GraphicsUtil.createEventEnvelope(envelopeShape);
+ StyleUtil.setFillStyle(env.rect, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(env.rect, be);
+ StyleUtil.setFillStyle(env.line, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(env.line, be);
+ return envelopeShape;
+ }
+
+ private Shape drawFilledEnvelope(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape envelopeShape = Graphiti.getPeService().createShape(shape, false);
+ Envelope env = GraphicsUtil.createEventEnvelope(envelopeShape);
+ StyleUtil.setFillStyle(env.rect, FillStyle.FILL_STYLE_INVERT);
+ StyleUtil.applyStyle(env.rect, be);
+ StyleUtil.setFillStyle(env.line, FillStyle.FILL_STYLE_INVERT);
+ StyleUtil.applyStyle(env.line, be);
+ return envelopeShape;
+ }
+
+ public static class CreateMessageEventDefinition extends CreateEventDefinition<MessageEventDefinition> {
+
+ public CreateMessageEventDefinition(IFeatureProvider fp) {
+ super(fp, "Message Definition", "Marks that event expects a message");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_MESSAGE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getMessageEventDefinition();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/SignalEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/SignalEventDefinitionContainer.java
index 786f6c9..efe250e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/SignalEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/SignalEventDefinitionContainer.java
@@ -1,112 +1,112 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.MessageEventDefinition;
-import org.eclipse.bpmn2.SignalEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class SignalEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof SignalEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateSignalEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return drawFilled(algorithm, shape);
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(algorithm, shape);
- }
-
- private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape signalShape = Graphiti.getPeService().createShape(shape, false);
- Polygon signal = GraphicsUtil.createEventSignal(signalShape);
- StyleUtil.setFillStyle(signal, FillStyle.FILL_STYLE_BACKGROUND);
- StyleUtil.applyStyle(signal, be);
- return signalShape;
- }
-
- private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape signalShape = Graphiti.getPeService().createShape(shape, false);
- Polygon signal = GraphicsUtil.createEventSignal(signalShape);
- StyleUtil.setFillStyle(signal, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(signal, be);
- return signalShape;
- }
-
- public static class CreateSignalEventDefinition extends CreateEventDefinition<SignalEventDefinition> {
-
- public CreateSignalEventDefinition(IFeatureProvider fp) {
- super(fp, "Signal Definition", "Adds signal definition to event");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_SIGNAL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getSignalEventDefinition();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.MessageEventDefinition;
+import org.eclipse.bpmn2.SignalEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class SignalEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof SignalEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateSignalEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return drawFilled(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(algorithm, shape);
+ }
+
+ private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape signalShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon signal = GraphicsUtil.createEventSignal(signalShape);
+ StyleUtil.setFillStyle(signal, FillStyle.FILL_STYLE_BACKGROUND);
+ StyleUtil.applyStyle(signal, be);
+ return signalShape;
+ }
+
+ private Shape drawFilled(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape signalShape = Graphiti.getPeService().createShape(shape, false);
+ Polygon signal = GraphicsUtil.createEventSignal(signalShape);
+ StyleUtil.setFillStyle(signal, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(signal, be);
+ return signalShape;
+ }
+
+ public static class CreateSignalEventDefinition extends CreateEventDefinition<SignalEventDefinition> {
+
+ public CreateSignalEventDefinition(IFeatureProvider fp) {
+ super(fp, "Signal Definition", "Adds signal definition to event");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_SIGNAL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getSignalEventDefinition();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TerminateEventDefinitionFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TerminateEventDefinitionFeatureContainer.java
index 6f7c342..1d82a42 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TerminateEventDefinitionFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TerminateEventDefinitionFeatureContainer.java
@@ -1,112 +1,112 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.SignalEventDefinition;
-import org.eclipse.bpmn2.TerminateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class TerminateEventDefinitionFeatureContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof TerminateEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateTerminateEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape terminateShape = Graphiti.getPeService().createShape(shape, false);
- Ellipse ellispe = GraphicsUtil.createEventTerminate(terminateShape);
- StyleUtil.setFillStyle(ellispe, FillStyle.FILL_STYLE_FOREGROUND);
- StyleUtil.applyStyle(ellispe, be);
- return terminateShape;
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- public static class CreateTerminateEventDefinition extends CreateEventDefinition<TerminateEventDefinition> {
-
- public CreateTerminateEventDefinition(IFeatureProvider fp) {
- super(fp, "Terminate Definition", "Adds terminate trigger to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
-
- return e instanceof EndEvent;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_TERMINATE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getTerminateEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.SignalEventDefinition;
+import org.eclipse.bpmn2.TerminateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+
+public class TerminateEventDefinitionFeatureContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof TerminateEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateTerminateEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape terminateShape = Graphiti.getPeService().createShape(shape, false);
+ Ellipse ellispe = GraphicsUtil.createEventTerminate(terminateShape);
+ StyleUtil.setFillStyle(ellispe, FillStyle.FILL_STYLE_FOREGROUND);
+ StyleUtil.applyStyle(ellispe, be);
+ return terminateShape;
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ public static class CreateTerminateEventDefinition extends CreateEventDefinition<TerminateEventDefinition> {
+
+ public CreateTerminateEventDefinition(IFeatureProvider fp) {
+ super(fp, "Terminate Definition", "Adds terminate trigger to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+
+ return e instanceof EndEvent;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_TERMINATE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getTerminateEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TimerEventDefinitionContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TimerEventDefinitionContainer.java
index cb36bca..2d18a84 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TimerEventDefinitionContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/TimerEventDefinitionContainer.java
@@ -1,127 +1,127 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.EventDefinition;
-import org.eclipse.bpmn2.TerminateEventDefinition;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.TimerEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
-import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.util.IColorConstant;
-
-public class TimerEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof TimerEventDefinition;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateTimerEventDefinition(fp);
- }
-
- @Override
- protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- @Override
- protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- @Override
- protected Shape drawForThrow(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
- return null; // NOT ALLOWED ACCORDING TO SPEC
- }
-
- @Override
- public Shape drawForCatch(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- @Override
- protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
- return draw(shape);
- }
-
- private Shape draw(ContainerShape shape) {
- BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
- Shape timerShape = Graphiti.getPeService().createShape(shape, false);
- Image image = GraphicsUtil.createEventImage(timerShape, ImageProvider.IMG_20_TIMER);
-
- // TODO: can't change foreground color of an Image?
-// Diagram diagram = StyleUtil.findDiagram(image);
-// IGaService gaService = Graphiti.getGaService();
-// image.setForeground(gaService.manageColor(diagram, IColorConstant.GREEN));
-// StyleUtil.setFillStyle(image, FillStyle.FILL_STYLE_NONE);
-// StyleUtil.applyStyle(image, be);
- return timerShape;
- }
-
- public static class CreateTimerEventDefinition extends CreateEventDefinition<TimerEventDefinition> {
-
- public CreateTimerEventDefinition(IFeatureProvider fp) {
- super(fp, "Timer Definition", "Adds time condition to event");
- }
-
- @Override
- public boolean canCreate(ICreateContext context) {
- if (!super.canCreate(context)) {
- return false;
- }
-
- Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
- if (e instanceof ThrowEvent) {
- return false;
- }
-
- return true;
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_TIMER;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getTimerEventDefinition();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.event.definitions;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.TerminateEventDefinition;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.TimerEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
+import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Image;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.util.IColorConstant;
+
+public class TimerEventDefinitionContainer extends AbstractEventDefinitionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof TimerEventDefinition;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateTimerEventDefinition(fp);
+ }
+
+ @Override
+ protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ @Override
+ protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ @Override
+ protected Shape drawForThrow(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
+ return null; // NOT ALLOWED ACCORDING TO SPEC
+ }
+
+ @Override
+ public Shape drawForCatch(DecorationAlgorithm decorationAlgorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ @Override
+ protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
+ return draw(shape);
+ }
+
+ private Shape draw(ContainerShape shape) {
+ BaseElement be = BusinessObjectUtil.getFirstElementOfType(shape, BaseElement.class, true);
+ Shape timerShape = Graphiti.getPeService().createShape(shape, false);
+ Image image = GraphicsUtil.createEventImage(timerShape, ImageProvider.IMG_20_TIMER);
+
+ // TODO: can't change foreground color of an Image?
+// Diagram diagram = StyleUtil.findDiagram(image);
+// IGaService gaService = Graphiti.getGaService();
+// image.setForeground(gaService.manageColor(diagram, IColorConstant.GREEN));
+// StyleUtil.setFillStyle(image, FillStyle.FILL_STYLE_NONE);
+// StyleUtil.applyStyle(image, be);
+ return timerShape;
+ }
+
+ public static class CreateTimerEventDefinition extends CreateEventDefinition<TimerEventDefinition> {
+
+ public CreateTimerEventDefinition(IFeatureProvider fp) {
+ super(fp, "Timer Definition", "Adds time condition to event");
+ }
+
+ @Override
+ public boolean canCreate(ICreateContext context) {
+ if (!super.canCreate(context)) {
+ return false;
+ }
+
+ Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
+ if (e instanceof ThrowEvent) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_TIMER;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getTimerEventDefinition();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java
index 506a113..cd7953d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java
@@ -1,74 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.flow;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.DataInputAssociation;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class DataInputAssociationFeatureContainer extends BaseElementConnectionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof DataInputAssociation;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AbstractAddFlowFeature<DataInputAssociation>(fp) {
-
- @Override
- protected Polyline createConnectionLine(Connection connection) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
-
- Polyline connectionLine = super.createConnectionLine(connection);
- connectionLine.setLineStyle(LineStyle.DOT);
-
- ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
-
- int w = 5;
- int l = 10;
-
- Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
- StyleUtil.applyStyle(arrowhead, be);
-
- return connectionLine;
- }
-
- @Override
- protected Class<? extends BaseElement> getBoClass() {
- return DataInputAssociation.class;
- }
- };
- }
-
- @Override
- public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.flow;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.DataInputAssociation;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class DataInputAssociationFeatureContainer extends BaseElementConnectionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof DataInputAssociation;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AbstractAddFlowFeature<DataInputAssociation>(fp) {
+
+ @Override
+ protected Polyline createConnectionLine(Connection connection) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
+
+ Polyline connectionLine = super.createConnectionLine(connection);
+ connectionLine.setLineStyle(LineStyle.DOT);
+
+ ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
+
+ int w = 5;
+ int l = 10;
+
+ Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
+ StyleUtil.applyStyle(arrowhead, be);
+
+ return connectionLine;
+ }
+
+ @Override
+ protected Class<? extends BaseElement> getBoClass() {
+ return DataInputAssociation.class;
+ }
+ };
+ }
+
+ @Override
+ public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java
index b7d2506..56a5272 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java
@@ -1,74 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.flow;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.DataOutputAssociation;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class DataOutputAssociationFeatureContainer extends BaseElementConnectionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof DataOutputAssociation;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AbstractAddFlowFeature<DataOutputAssociation>(fp) {
-
- @Override
- protected Polyline createConnectionLine(Connection connection) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
-
- Polyline connectionLine = super.createConnectionLine(connection);
- connectionLine.setLineStyle(LineStyle.DOT);
-
- ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
-
- int w = 5;
- int l = 10;
-
- Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
- StyleUtil.applyStyle(arrowhead, be);
-
- return connectionLine;
- }
-
- @Override
- protected Class<? extends BaseElement> getBoClass() {
- return DataOutputAssociation.class;
- }
- };
- }
-
- @Override
- public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.flow;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.DataOutputAssociation;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class DataOutputAssociationFeatureContainer extends BaseElementConnectionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof DataOutputAssociation;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AbstractAddFlowFeature<DataOutputAssociation>(fp) {
+
+ @Override
+ protected Polyline createConnectionLine(Connection connection) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
+
+ Polyline connectionLine = super.createConnectionLine(connection);
+ connectionLine.setLineStyle(LineStyle.DOT);
+
+ ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
+
+ int w = 5;
+ int l = 10;
+
+ Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
+ StyleUtil.applyStyle(arrowhead, be);
+
+ return connectionLine;
+ }
+
+ @Override
+ protected Class<? extends BaseElement> getBoClass() {
+ return DataOutputAssociation.class;
+ }
+ };
+ }
+
+ @Override
+ public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java
index 8f9d7c8..13dcc6a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java
@@ -1,220 +1,220 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.flow;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.InteractionNode;
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractReconnectFlowFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReconnectionFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.ICreateConnectionContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-import org.eclipse.graphiti.util.IColorConstant;
-
-public class MessageFlowFeatureContainer extends BaseElementConnectionFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof MessageFlow;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AbstractAddFlowFeature<MessageFlow>(fp) {
-
- @Override
- protected Polyline createConnectionLine(Connection connection) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
- BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
-
- Polyline connectionLine = super.createConnectionLine(connection);
- connectionLine.setLineStyle(LineStyle.DASH);
- connectionLine.setLineWidth(2);
-
- ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
- ConnectionDecorator startDecorator = peService.createConnectionDecorator(connection, false, 0, true);
-
- int w = 5;
- int l = 10;
-
- Polyline arrowhead = gaService.createPolygon(endDecorator, new int[] { -l, w, 0, 0, -l, -w, -l, w });
- StyleUtil.applyStyle(arrowhead, be);
- arrowhead.setBackground(manageColor(IColorConstant.WHITE));
-
- Ellipse circle = gaService.createEllipse(startDecorator);
- gaService.setSize(circle, 10, 10);
- StyleUtil.applyStyle(circle, be);
- circle.setBackground(manageColor(IColorConstant.WHITE));
-
- return connectionLine;
- }
-
- @Override
- protected Class<? extends BaseElement> getBoClass() {
- return MessageFlow.class;
- }
- };
- }
-
- @Override
- public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
- return new CreateMessageFlowFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateBaseElementNameFeature(fp);
- }
-
- @Override
- public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
- return new ReconnectMessageFlowFeature(fp);
- }
-
- public static class CreateMessageFlowFeature extends AbstractCreateFlowFeature<MessageFlow, InteractionNode, InteractionNode> {
-
- public CreateMessageFlowFeature(IFeatureProvider fp) {
- super(fp, "Message Flow", "Represents message between two participants");
- }
-
- @Override
- public boolean canStartConnection(ICreateConnectionContext context) {
- if (ChoreographyUtil.isChoreographyParticipantBand(context.getSourcePictogramElement()))
- return false;
- return true;
- }
-
- @Override
- public boolean canCreate(ICreateConnectionContext context) {
- if (ChoreographyUtil.isChoreographyParticipantBand(context.getSourcePictogramElement()))
- return false;
- if (context.getTargetPictogramElement()!=null) {
- if (ChoreographyUtil.isChoreographyParticipantBand(context.getTargetPictogramElement()))
- return false;
- }
- InteractionNode source = getSourceBo(context);
- InteractionNode target = getTargetBo(context);
- return super.canCreate(context) && isDifferentParticipants(source, target);
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_MESSAGE_FLOW;
- }
-
- @Override
- public MessageFlow createBusinessObject(ICreateConnectionContext context) {
- MessageFlow bo = null;
- try {
- ModelHandler mh = ModelHandler.getInstance(getDiagram());
- InteractionNode source = getSourceBo(context);
- InteractionNode target = getTargetBo(context);
- bo = mh.createMessageFlow(source, target);
- bo.setName("");
- putBusinessObject(context, bo);
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return bo;
- }
-
- @Override
- protected Class<InteractionNode> getSourceClass() {
- return InteractionNode.class;
- }
-
- @Override
- protected Class<InteractionNode> getTargetClass() {
- return InteractionNode.class;
- }
-
- private boolean isDifferentParticipants(InteractionNode source, InteractionNode target) {
- if (source == null || target == null) {
- return true;
- }
- boolean different = false;
- try {
- ModelHandler handler = ModelHandler.getInstance(getDiagram());
- Participant sourceParticipant = handler.getParticipant(source);
- Participant targetParticipant = handler.getParticipant(target);
- if (sourceParticipant==null) {
- if (targetParticipant==null)
- return true;
- return false;
- }
- different = !sourceParticipant.equals(targetParticipant);
- } catch (IOException e) {
- Activator.logError(e);
- }
- return different;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateConnectionFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getMessageFlow();
- }
- }
-
- public static class ReconnectMessageFlowFeature extends AbstractReconnectFlowFeature {
-
- public ReconnectMessageFlowFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- protected Class<? extends EObject> getTargetClass() {
- return InteractionNode.class;
- }
-
- @Override
- protected Class<? extends EObject> getSourceClass() {
- return InteractionNode.class;
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.flow;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.InteractionNode;
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractReconnectFlowFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReconnectionFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.ICreateConnectionContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.algorithms.Polyline;
+import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+import org.eclipse.graphiti.util.IColorConstant;
+
+public class MessageFlowFeatureContainer extends BaseElementConnectionFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof MessageFlow;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AbstractAddFlowFeature<MessageFlow>(fp) {
+
+ @Override
+ protected Polyline createConnectionLine(Connection connection) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+ BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection);
+
+ Polyline connectionLine = super.createConnectionLine(connection);
+ connectionLine.setLineStyle(LineStyle.DASH);
+ connectionLine.setLineWidth(2);
+
+ ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
+ ConnectionDecorator startDecorator = peService.createConnectionDecorator(connection, false, 0, true);
+
+ int w = 5;
+ int l = 10;
+
+ Polyline arrowhead = gaService.createPolygon(endDecorator, new int[] { -l, w, 0, 0, -l, -w, -l, w });
+ StyleUtil.applyStyle(arrowhead, be);
+ arrowhead.setBackground(manageColor(IColorConstant.WHITE));
+
+ Ellipse circle = gaService.createEllipse(startDecorator);
+ gaService.setSize(circle, 10, 10);
+ StyleUtil.applyStyle(circle, be);
+ circle.setBackground(manageColor(IColorConstant.WHITE));
+
+ return connectionLine;
+ }
+
+ @Override
+ protected Class<? extends BaseElement> getBoClass() {
+ return MessageFlow.class;
+ }
+ };
+ }
+
+ @Override
+ public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
+ return new CreateMessageFlowFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateBaseElementNameFeature(fp);
+ }
+
+ @Override
+ public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) {
+ return new ReconnectMessageFlowFeature(fp);
+ }
+
+ public static class CreateMessageFlowFeature extends AbstractCreateFlowFeature<MessageFlow, InteractionNode, InteractionNode> {
+
+ public CreateMessageFlowFeature(IFeatureProvider fp) {
+ super(fp, "Message Flow", "Represents message between two participants");
+ }
+
+ @Override
+ public boolean canStartConnection(ICreateConnectionContext context) {
+ if (ChoreographyUtil.isChoreographyParticipantBand(context.getSourcePictogramElement()))
+ return false;
+ return true;
+ }
+
+ @Override
+ public boolean canCreate(ICreateConnectionContext context) {
+ if (ChoreographyUtil.isChoreographyParticipantBand(context.getSourcePictogramElement()))
+ return false;
+ if (context.getTargetPictogramElement()!=null) {
+ if (ChoreographyUtil.isChoreographyParticipantBand(context.getTargetPictogramElement()))
+ return false;
+ }
+ InteractionNode source = getSourceBo(context);
+ InteractionNode target = getTargetBo(context);
+ return super.canCreate(context) && isDifferentParticipants(source, target);
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_MESSAGE_FLOW;
+ }
+
+ @Override
+ public MessageFlow createBusinessObject(ICreateConnectionContext context) {
+ MessageFlow bo = null;
+ try {
+ ModelHandler mh = ModelHandler.getInstance(getDiagram());
+ InteractionNode source = getSourceBo(context);
+ InteractionNode target = getTargetBo(context);
+ bo = mh.createMessageFlow(source, target);
+ bo.setName("");
+ putBusinessObject(context, bo);
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return bo;
+ }
+
+ @Override
+ protected Class<InteractionNode> getSourceClass() {
+ return InteractionNode.class;
+ }
+
+ @Override
+ protected Class<InteractionNode> getTargetClass() {
+ return InteractionNode.class;
+ }
+
+ private boolean isDifferentParticipants(InteractionNode source, InteractionNode target) {
+ if (source == null || target == null) {
+ return true;
+ }
+ boolean different = false;
+ try {
+ ModelHandler handler = ModelHandler.getInstance(getDiagram());
+ Participant sourceParticipant = handler.getParticipant(source);
+ Participant targetParticipant = handler.getParticipant(target);
+ if (sourceParticipant==null) {
+ if (targetParticipant==null)
+ return true;
+ return false;
+ }
+ different = !sourceParticipant.equals(targetParticipant);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+ return different;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateConnectionFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getMessageFlow();
+ }
+ }
+
+ public static class ReconnectMessageFlowFeature extends AbstractReconnectFlowFeature {
+
+ public ReconnectMessageFlowFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ protected Class<? extends EObject> getTargetClass() {
+ return InteractionNode.class;
+ }
+
+ @Override
+ protected Class<? extends EObject> getSourceClass() {
+ return InteractionNode.class;
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AbstractGatewayFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AbstractGatewayFeatureContainer.java
index 2e5f765..2829ab3 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AbstractGatewayFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AbstractGatewayFeatureContainer.java
@@ -1,199 +1,199 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
-import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.bpmn2.modeler.ui.features.LayoutBaseElementTextFeature;
-import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
-import org.eclipse.bpmn2.modeler.ui.features.choreography.AddChoreographyMessageFeature;
-import org.eclipse.bpmn2.modeler.ui.features.event.AppendEventFeature;
-import org.eclipse.bpmn2.modeler.ui.features.participant.RotatePoolFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.context.impl.UpdateContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public abstract class AbstractGatewayFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context.getProperty(ContextConstants.LABEL_CONTEXT) == null
- || !((Boolean) context.getProperty(ContextConstants.LABEL_CONTEXT))) {
- return super.getApplyObject(context);
- }
- return null;
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateAbstractGatewayFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null; // TODO
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutBaseElementTextFeature(fp) {
-
- @Override
- public int getMinimumWidth() {
- return 2 * GraphicsUtil.GATEWAY_RADIUS;
- }
- };
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new MoveFlowNodeFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new DefaultResizeShapeFeature(fp) {
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
- };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new AbstractDefaultDeleteFeature(fp);
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
- ICustomFeature[] thisFeatures = new ICustomFeature[3 + superFeatures.length];
- int i;
- for (i=0; i<superFeatures.length; ++i)
- thisFeatures[i] = superFeatures[i];
- thisFeatures[i++] = new AppendActivityFeature(fp);
- thisFeatures[i++] = new AppendGatewayFeature(fp);
- thisFeatures[i++] = new AppendEventFeature(fp);
- return thisFeatures;
- }
-
- private class UpdateAbstractGatewayFeature extends UpdateBaseElementNameFeature {
-
- public UpdateAbstractGatewayFeature(IFeatureProvider fp) {
- super(fp);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();
-
- Shape gatewayShape = (Shape) context.getPictogramElement();
- for (Anchor anchor : gatewayShape.getAnchors()) {
- for (Connection connection : anchor.getIncomingConnections() ) {
- IUpdateContext updateCtx = new UpdateContext(connection);
- IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
- if (updateFeature != null) {
- boolean ret = updateFeature.canUpdate(updateCtx);
- if (ret)
- return ret;
- }
- }
- for (Connection connection : anchor.getOutgoingConnections() ) {
- IUpdateContext updateCtx = new UpdateContext(connection);
- IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
- if (updateFeature != null) {
- boolean ret = updateFeature.canUpdate(updateCtx);
- if (ret)
- return ret;
- }
- }
- }
-
- return super.canUpdate(context);
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();
-
- Shape gatewayShape = (Shape) context.getPictogramElement();
- for (Anchor anchor : gatewayShape.getAnchors()) {
- for (Connection connection : anchor.getIncomingConnections() ) {
- IUpdateContext updateCtx = new UpdateContext(connection);
- IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
- if (updateFeature != null) {
- IReason ret = updateFeature.updateNeeded(updateCtx);
- if (ret.toBoolean())
- return ret;
- }
- }
- for (Connection connection : anchor.getOutgoingConnections() ) {
- IUpdateContext updateCtx = new UpdateContext(connection);
- IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
- if (updateFeature != null) {
- IReason ret = updateFeature.updateNeeded(updateCtx);
- if (ret.toBoolean())
- return ret;
- }
- }
- }
-
- return super.updateNeeded(context);
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();
-
- ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
- for (Anchor anchor : gatewayShape.getAnchors()) {
- for (Connection connection : anchor.getIncomingConnections() ) {
- IUpdateContext updateCtx = new UpdateContext(connection);
- IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
- if (updateFeature != null) {
- updateFeature.update(updateCtx);
- }
- }
- for (Connection connection : anchor.getOutgoingConnections() ) {
- IUpdateContext updateCtx = new UpdateContext(connection);
- IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
- if (updateFeature != null) {
- updateFeature.update(updateCtx);
- }
- }
- }
- return super.update(context);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
+import org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.bpmn2.modeler.ui.features.LayoutBaseElementTextFeature;
+import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.AddChoreographyMessageFeature;
+import org.eclipse.bpmn2.modeler.ui.features.event.AppendEventFeature;
+import org.eclipse.bpmn2.modeler.ui.features.participant.RotatePoolFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.context.impl.UpdateContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public abstract class AbstractGatewayFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context.getProperty(ContextConstants.LABEL_CONTEXT) == null
+ || !((Boolean) context.getProperty(ContextConstants.LABEL_CONTEXT))) {
+ return super.getApplyObject(context);
+ }
+ return null;
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateAbstractGatewayFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null; // TODO
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutBaseElementTextFeature(fp) {
+
+ @Override
+ public int getMinimumWidth() {
+ return 2 * GraphicsUtil.GATEWAY_RADIUS;
+ }
+ };
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new MoveFlowNodeFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new DefaultResizeShapeFeature(fp) {
+ @Override
+ public boolean canResizeShape(IResizeShapeContext context) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new AbstractDefaultDeleteFeature(fp);
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
+ ICustomFeature[] thisFeatures = new ICustomFeature[3 + superFeatures.length];
+ int i;
+ for (i=0; i<superFeatures.length; ++i)
+ thisFeatures[i] = superFeatures[i];
+ thisFeatures[i++] = new AppendActivityFeature(fp);
+ thisFeatures[i++] = new AppendGatewayFeature(fp);
+ thisFeatures[i++] = new AppendEventFeature(fp);
+ return thisFeatures;
+ }
+
+ private class UpdateAbstractGatewayFeature extends UpdateBaseElementNameFeature {
+
+ public UpdateAbstractGatewayFeature(IFeatureProvider fp) {
+ super(fp);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();
+
+ Shape gatewayShape = (Shape) context.getPictogramElement();
+ for (Anchor anchor : gatewayShape.getAnchors()) {
+ for (Connection connection : anchor.getIncomingConnections() ) {
+ IUpdateContext updateCtx = new UpdateContext(connection);
+ IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
+ if (updateFeature != null) {
+ boolean ret = updateFeature.canUpdate(updateCtx);
+ if (ret)
+ return ret;
+ }
+ }
+ for (Connection connection : anchor.getOutgoingConnections() ) {
+ IUpdateContext updateCtx = new UpdateContext(connection);
+ IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
+ if (updateFeature != null) {
+ boolean ret = updateFeature.canUpdate(updateCtx);
+ if (ret)
+ return ret;
+ }
+ }
+ }
+
+ return super.canUpdate(context);
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();
+
+ Shape gatewayShape = (Shape) context.getPictogramElement();
+ for (Anchor anchor : gatewayShape.getAnchors()) {
+ for (Connection connection : anchor.getIncomingConnections() ) {
+ IUpdateContext updateCtx = new UpdateContext(connection);
+ IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
+ if (updateFeature != null) {
+ IReason ret = updateFeature.updateNeeded(updateCtx);
+ if (ret.toBoolean())
+ return ret;
+ }
+ }
+ for (Connection connection : anchor.getOutgoingConnections() ) {
+ IUpdateContext updateCtx = new UpdateContext(connection);
+ IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
+ if (updateFeature != null) {
+ IReason ret = updateFeature.updateNeeded(updateCtx);
+ if (ret.toBoolean())
+ return ret;
+ }
+ }
+ }
+
+ return super.updateNeeded(context);
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();
+
+ ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
+ for (Anchor anchor : gatewayShape.getAnchors()) {
+ for (Connection connection : anchor.getIncomingConnections() ) {
+ IUpdateContext updateCtx = new UpdateContext(connection);
+ IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
+ if (updateFeature != null) {
+ updateFeature.update(updateCtx);
+ }
+ }
+ for (Connection connection : anchor.getOutgoingConnections() ) {
+ IUpdateContext updateCtx = new UpdateContext(connection);
+ IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
+ if (updateFeature != null) {
+ updateFeature.update(updateCtx);
+ }
+ }
+ }
+ return super.update(context);
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AppendGatewayFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AppendGatewayFeature.java
index c72a9a6..468579e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AppendGatewayFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/AppendGatewayFeature.java
@@ -1,61 +1,61 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-
-/**
- * @author Bob Brodt
- *
- */
-public class AppendGatewayFeature extends AbstractAppendNodeNodeFeature<Gateway> {
-
- /**
- * @param fp
- */
- public AppendGatewayFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public String getName() {
- return "Append Gateway";
- }
-
- @Override
- public String getDescription() {
- return "Create a new Gateway and connect it to this item";
- }
-
- @Override
- public String getImageId() {
- return ImageProvider.IMG_16_EXCLUSIVE_GATEWAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature#getBusinessObjectClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getGateway();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class AppendGatewayFeature extends AbstractAppendNodeNodeFeature<Gateway> {
+
+ /**
+ * @param fp
+ */
+ public AppendGatewayFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Append Gateway";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Create a new Gateway and connect it to this item";
+ }
+
+ @Override
+ public String getImageId() {
+ return ImageProvider.IMG_16_EXCLUSIVE_GATEWAY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.features.AbstractAppendNodeNodeFeature#getBusinessObjectClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getGateway();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ComplexGatewayFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ComplexGatewayFeatureContainer.java
index 5b94c6a..06f9a9d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ComplexGatewayFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ComplexGatewayFeatureContainer.java
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ComplexGateway;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Asterisk;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class ComplexGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ComplexGateway;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateComplexGatewayFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddGatewayFeature<ComplexGateway>(fp) {
- @Override
- protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
- GraphicsUtil.createGatewayAsterisk(container);
- }
- };
- }
-
- public class CreateComplexGatewayFeature extends AbstractCreateGatewayFeature<ComplexGateway> {
-
- public CreateComplexGatewayFeature(IFeatureProvider fp) {
- super(fp, "Complex Gateway", "Used for modeling complex synchronization behavior");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_COMPLEX_GATEWAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getComplexGateway();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ComplexGateway;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Asterisk;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class ComplexGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ComplexGateway;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateComplexGatewayFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddGatewayFeature<ComplexGateway>(fp) {
+ @Override
+ protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
+ GraphicsUtil.createGatewayAsterisk(container);
+ }
+ };
+ }
+
+ public class CreateComplexGatewayFeature extends AbstractCreateGatewayFeature<ComplexGateway> {
+
+ public CreateComplexGatewayFeature(IFeatureProvider fp) {
+ super(fp, "Complex Gateway", "Used for modeling complex synchronization behavior");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_COMPLEX_GATEWAY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getComplexGateway();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/EventBasedGatewayFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/EventBasedGatewayFeatureContainer.java
index 9c41076..9018e5e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/EventBasedGatewayFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/EventBasedGatewayFeatureContainer.java
@@ -1,107 +1,107 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EventBasedGateway;
-import org.eclipse.bpmn2.EventBasedGatewayType;
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class EventBasedGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
-
- static final String INSTANTIATE_PROPERTY = "instantiate";
- static final String EVENT_GATEWAY_TYPE_PROPERTY = "eventGatewayType";
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof EventBasedGateway;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateEventBasedGatewayFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddGatewayFeature<EventBasedGateway>(fp) {
- @Override
- protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
- Ellipse outer = GraphicsUtil.createGatewayOuterCircle(container);
- Ellipse inner = GraphicsUtil.createGatewayInnerCircle(outer);
- Polygon pentagon = GraphicsUtil.createGatewayPentagon(container);
- pentagon.setFilled(false);
- }
-
- @Override
- public PictogramElement add(IAddContext context) {
- PictogramElement element = super.add(context);
- IPeService service = Graphiti.getPeService();
- EventBasedGateway gateway = getBusinessObject(context);
- service.setPropertyValue(element, INSTANTIATE_PROPERTY, Boolean.toString(gateway.isInstantiate()));
- service.setPropertyValue(element, EVENT_GATEWAY_TYPE_PROPERTY,
- EventBasedGatewayType.EXCLUSIVE.getName());
- return element;
- }
- };
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
- multiUpdate.addUpdateFeature(super.getUpdateFeature(fp));
- multiUpdate.addUpdateFeature(new UpdateEventBasedGatewayFeature(fp));
- return multiUpdate;
- }
-
- public static class CreateEventBasedGatewayFeature extends AbstractCreateGatewayFeature<EventBasedGateway> {
-
- public CreateEventBasedGatewayFeature(IFeatureProvider fp) {
- super(fp, "Event-Based Gateway", "Represents a branching point in the process");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_EVENT_BASED_GATEWAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getEventBasedGateway();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EventBasedGateway;
+import org.eclipse.bpmn2.EventBasedGatewayType;
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class EventBasedGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
+
+ static final String INSTANTIATE_PROPERTY = "instantiate";
+ static final String EVENT_GATEWAY_TYPE_PROPERTY = "eventGatewayType";
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof EventBasedGateway;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateEventBasedGatewayFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddGatewayFeature<EventBasedGateway>(fp) {
+ @Override
+ protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
+ Ellipse outer = GraphicsUtil.createGatewayOuterCircle(container);
+ Ellipse inner = GraphicsUtil.createGatewayInnerCircle(outer);
+ Polygon pentagon = GraphicsUtil.createGatewayPentagon(container);
+ pentagon.setFilled(false);
+ }
+
+ @Override
+ public PictogramElement add(IAddContext context) {
+ PictogramElement element = super.add(context);
+ IPeService service = Graphiti.getPeService();
+ EventBasedGateway gateway = getBusinessObject(context);
+ service.setPropertyValue(element, INSTANTIATE_PROPERTY, Boolean.toString(gateway.isInstantiate()));
+ service.setPropertyValue(element, EVENT_GATEWAY_TYPE_PROPERTY,
+ EventBasedGatewayType.EXCLUSIVE.getName());
+ return element;
+ }
+ };
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
+ multiUpdate.addUpdateFeature(super.getUpdateFeature(fp));
+ multiUpdate.addUpdateFeature(new UpdateEventBasedGatewayFeature(fp));
+ return multiUpdate;
+ }
+
+ public static class CreateEventBasedGatewayFeature extends AbstractCreateGatewayFeature<EventBasedGateway> {
+
+ public CreateEventBasedGatewayFeature(IFeatureProvider fp) {
+ super(fp, "Event-Based Gateway", "Represents a branching point in the process");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_EVENT_BASED_GATEWAY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getEventBasedGateway();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ExclusiveGatewayFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ExclusiveGatewayFeatureContainer.java
index ad108ad..09a9b31 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ExclusiveGatewayFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ExclusiveGatewayFeatureContainer.java
@@ -1,80 +1,80 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.EventBasedGateway;
-import org.eclipse.bpmn2.ExclusiveGateway;
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.DiagonalCross;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class ExclusiveGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ExclusiveGateway;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddGatewayFeature<ExclusiveGateway>(fp) {
- @Override
- protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
- // TODO: handle showExclusiveGatewayMarker property change event in BPMN2Editor
- // and override the default gateway UpdateFeature to show/hide the "X" marker.
- if (bpmnShape.isIsMarkerVisible()) {
- GraphicsUtil.createGatewayDiagonalCross(container);
- }
- }
- };
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateExclusiveGatewayFeature(fp);
- }
-
- public static class CreateExclusiveGatewayFeature extends AbstractCreateGatewayFeature<ExclusiveGateway> {
-
- public CreateExclusiveGatewayFeature(IFeatureProvider fp) {
- super(fp, "Exclusive Gateway", "Exclusive decision and merging");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_EXCLUSIVE_GATEWAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getExclusiveGateway();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.EventBasedGateway;
+import org.eclipse.bpmn2.ExclusiveGateway;
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.DiagonalCross;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class ExclusiveGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ExclusiveGateway;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddGatewayFeature<ExclusiveGateway>(fp) {
+ @Override
+ protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
+ // TODO: handle showExclusiveGatewayMarker property change event in BPMN2Editor
+ // and override the default gateway UpdateFeature to show/hide the "X" marker.
+ if (bpmnShape.isIsMarkerVisible()) {
+ GraphicsUtil.createGatewayDiagonalCross(container);
+ }
+ }
+ };
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateExclusiveGatewayFeature(fp);
+ }
+
+ public static class CreateExclusiveGatewayFeature extends AbstractCreateGatewayFeature<ExclusiveGateway> {
+
+ public CreateExclusiveGatewayFeature(IFeatureProvider fp) {
+ super(fp, "Exclusive Gateway", "Exclusive decision and merging");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_EXCLUSIVE_GATEWAY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getExclusiveGateway();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/InclusiveGatewayFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/InclusiveGatewayFeatureContainer.java
index 94f6cd5..1058b13 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/InclusiveGatewayFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/InclusiveGatewayFeatureContainer.java
@@ -1,76 +1,76 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.ExclusiveGateway;
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.InclusiveGateway;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class InclusiveGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof InclusiveGateway;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddGatewayFeature<InclusiveGateway>(fp) {
- @Override
- protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
- Ellipse ellipse = GraphicsUtil.createGatewayOuterCircle(container);
- ellipse.setLineWidth(3);
- }
- };
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateInclusiveGatewayFeature(fp);
- }
-
- public static class CreateInclusiveGatewayFeature extends AbstractCreateGatewayFeature<InclusiveGateway> {
-
- public CreateInclusiveGatewayFeature(IFeatureProvider fp) {
- super(fp, "Inclusive Gateway", "Used for creating alternative button also parallel paths");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_INCLUSIVE_GATEWAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getInclusiveGateway();
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ExclusiveGateway;
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.InclusiveGateway;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class InclusiveGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof InclusiveGateway;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddGatewayFeature<InclusiveGateway>(fp) {
+ @Override
+ protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
+ Ellipse ellipse = GraphicsUtil.createGatewayOuterCircle(container);
+ ellipse.setLineWidth(3);
+ }
+ };
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateInclusiveGatewayFeature(fp);
+ }
+
+ public static class CreateInclusiveGatewayFeature extends AbstractCreateGatewayFeature<InclusiveGateway> {
+
+ public CreateInclusiveGatewayFeature(IFeatureProvider fp) {
+ super(fp, "Inclusive Gateway", "Used for creating alternative button also parallel paths");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_INCLUSIVE_GATEWAY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getInclusiveGateway();
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ParallelGatewayFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ParallelGatewayFeatureContainer.java
index 0117682..ce7b5d9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ParallelGatewayFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/ParallelGatewayFeatureContainer.java
@@ -1,75 +1,75 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.ManualTask;
-import org.eclipse.bpmn2.ParallelGateway;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Cross;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.bpmn2.modeler.ui.ImageProvider;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class ParallelGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof ParallelGateway;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateParallelGatewayFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddGatewayFeature<ParallelGateway>(fp) {
- @Override
- protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
- GraphicsUtil.createGatewayCross(container);
- }
- };
- }
-
- public static class CreateParallelGatewayFeature extends AbstractCreateGatewayFeature<ParallelGateway> {
-
- public CreateParallelGatewayFeature(IFeatureProvider fp) {
- super(fp, "Parallel Gateway", "Used to combine or create parallel flows");
- }
-
- @Override
- protected String getStencilImageId() {
- return ImageProvider.IMG_16_PARALLEL_GATEWAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
- */
- @Override
- public EClass getBusinessObjectClass() {
- return Bpmn2Package.eINSTANCE.getParallelGateway();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.ManualTask;
+import org.eclipse.bpmn2.ParallelGateway;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AbstractCreateGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.features.gateway.AddGatewayFeature;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.Cross;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.bpmn2.modeler.ui.ImageProvider;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class ParallelGatewayFeatureContainer extends AbstractGatewayFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof ParallelGateway;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateParallelGatewayFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddGatewayFeature<ParallelGateway>(fp) {
+ @Override
+ protected void decorateGateway(ContainerShape container, BPMNShape bpmnShape) {
+ GraphicsUtil.createGatewayCross(container);
+ }
+ };
+ }
+
+ public static class CreateParallelGatewayFeature extends AbstractCreateGatewayFeature<ParallelGateway> {
+
+ public CreateParallelGatewayFeature(IFeatureProvider fp) {
+ super(fp, "Parallel Gateway", "Used to combine or create parallel flows");
+ }
+
+ @Override
+ protected String getStencilImageId() {
+ return ImageProvider.IMG_16_PARALLEL_GATEWAY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature#getFlowElementClass()
+ */
+ @Override
+ public EClass getBusinessObjectClass() {
+ return Bpmn2Package.eINSTANCE.getParallelGateway();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/UpdateEventBasedGatewayFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/UpdateEventBasedGatewayFeature.java
index da1b57b..c81dd47 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/UpdateEventBasedGatewayFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/gateway/UpdateEventBasedGatewayFeature.java
@@ -1,106 +1,106 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.gateway;
-
-import org.eclipse.bpmn2.EventBasedGateway;
-import org.eclipse.bpmn2.EventBasedGatewayType;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.context.IUpdateContext;
-import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.mm.algorithms.Ellipse;
-import org.eclipse.graphiti.mm.algorithms.Polygon;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IPeService;
-
-public class UpdateEventBasedGatewayFeature extends AbstractUpdateFeature {
-
- public UpdateEventBasedGatewayFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canUpdate(IUpdateContext context) {
- Object o = getBusinessObjectForPictogramElement(context.getPictogramElement());
- return o != null && o instanceof EventBasedGateway;
- }
-
- @Override
- public IReason updateNeeded(IUpdateContext context) {
- IPeService service = Graphiti.getPeService();
-
- boolean instantiate = Boolean.parseBoolean(service.getPropertyValue(context.getPictogramElement(),
- EventBasedGatewayFeatureContainer.INSTANTIATE_PROPERTY));
- EventBasedGatewayType gatewayType = EventBasedGatewayType.getByName(service.getPropertyValue(
- context.getPictogramElement(), EventBasedGatewayFeatureContainer.EVENT_GATEWAY_TYPE_PROPERTY));
-
- EventBasedGateway gateway = (EventBasedGateway) getBusinessObjectForPictogramElement(context
- .getPictogramElement());
-
- boolean changed = instantiate != gateway.isInstantiate() || gatewayType != gateway.getEventGatewayType();
- return changed ? Reason.createTrueReason() : Reason.createFalseReason();
- }
-
- @Override
- public boolean update(IUpdateContext context) {
- IPeService service = Graphiti.getPeService();
-
- EventBasedGateway gateway = (EventBasedGateway) getBusinessObjectForPictogramElement(context
- .getPictogramElement());
-
- clearGateway(context.getPictogramElement());
-
- if (gateway.isInstantiate()) {
- if (gateway.getEventGatewayType() == EventBasedGatewayType.PARALLEL) {
- drawParallelMultipleEventBased((ContainerShape) context.getPictogramElement());
- } else {
- drawExclusiveEventBased((ContainerShape) context.getPictogramElement());
- }
- } else {
- drawEventBased((ContainerShape) context.getPictogramElement());
- }
-
- service.setPropertyValue(context.getPictogramElement(), EventBasedGatewayFeatureContainer.INSTANTIATE_PROPERTY,
- Boolean.toString(gateway.isInstantiate()));
- service.setPropertyValue(context.getPictogramElement(),
- EventBasedGatewayFeatureContainer.EVENT_GATEWAY_TYPE_PROPERTY, gateway.getEventGatewayType().getName());
- return true;
- }
-
- private void clearGateway(PictogramElement element) {
- GraphicsUtil.clearGateway(element);
- }
-
- private void drawEventBased(ContainerShape container) {
- Ellipse outer = GraphicsUtil.createGatewayOuterCircle(container);
- Ellipse inner = GraphicsUtil.createGatewayInnerCircle(outer);
- Polygon pentagon = GraphicsUtil.createGatewayPentagon(container);
- pentagon.setFilled(false);
- }
-
- private void drawExclusiveEventBased(ContainerShape container) {
- Ellipse ellipse = GraphicsUtil.createGatewayOuterCircle(container);
- Polygon pentagon = GraphicsUtil.createGatewayPentagon(container);
- pentagon.setFilled(false);
- }
-
- private void drawParallelMultipleEventBased(ContainerShape container) {
- Ellipse ellipse = GraphicsUtil.createGatewayOuterCircle(container);
- Polygon cross = GraphicsUtil.createEventGatewayParallelCross(container);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.gateway;
+
+import org.eclipse.bpmn2.EventBasedGateway;
+import org.eclipse.bpmn2.EventBasedGatewayType;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.algorithms.Ellipse;
+import org.eclipse.graphiti.mm.algorithms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IPeService;
+
+public class UpdateEventBasedGatewayFeature extends AbstractUpdateFeature {
+
+ public UpdateEventBasedGatewayFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canUpdate(IUpdateContext context) {
+ Object o = getBusinessObjectForPictogramElement(context.getPictogramElement());
+ return o != null && o instanceof EventBasedGateway;
+ }
+
+ @Override
+ public IReason updateNeeded(IUpdateContext context) {
+ IPeService service = Graphiti.getPeService();
+
+ boolean instantiate = Boolean.parseBoolean(service.getPropertyValue(context.getPictogramElement(),
+ EventBasedGatewayFeatureContainer.INSTANTIATE_PROPERTY));
+ EventBasedGatewayType gatewayType = EventBasedGatewayType.getByName(service.getPropertyValue(
+ context.getPictogramElement(), EventBasedGatewayFeatureContainer.EVENT_GATEWAY_TYPE_PROPERTY));
+
+ EventBasedGateway gateway = (EventBasedGateway) getBusinessObjectForPictogramElement(context
+ .getPictogramElement());
+
+ boolean changed = instantiate != gateway.isInstantiate() || gatewayType != gateway.getEventGatewayType();
+ return changed ? Reason.createTrueReason() : Reason.createFalseReason();
+ }
+
+ @Override
+ public boolean update(IUpdateContext context) {
+ IPeService service = Graphiti.getPeService();
+
+ EventBasedGateway gateway = (EventBasedGateway) getBusinessObjectForPictogramElement(context
+ .getPictogramElement());
+
+ clearGateway(context.getPictogramElement());
+
+ if (gateway.isInstantiate()) {
+ if (gateway.getEventGatewayType() == EventBasedGatewayType.PARALLEL) {
+ drawParallelMultipleEventBased((ContainerShape) context.getPictogramElement());
+ } else {
+ drawExclusiveEventBased((ContainerShape) context.getPictogramElement());
+ }
+ } else {
+ drawEventBased((ContainerShape) context.getPictogramElement());
+ }
+
+ service.setPropertyValue(context.getPictogramElement(), EventBasedGatewayFeatureContainer.INSTANTIATE_PROPERTY,
+ Boolean.toString(gateway.isInstantiate()));
+ service.setPropertyValue(context.getPictogramElement(),
+ EventBasedGatewayFeatureContainer.EVENT_GATEWAY_TYPE_PROPERTY, gateway.getEventGatewayType().getName());
+ return true;
+ }
+
+ private void clearGateway(PictogramElement element) {
+ GraphicsUtil.clearGateway(element);
+ }
+
+ private void drawEventBased(ContainerShape container) {
+ Ellipse outer = GraphicsUtil.createGatewayOuterCircle(container);
+ Ellipse inner = GraphicsUtil.createGatewayInnerCircle(outer);
+ Polygon pentagon = GraphicsUtil.createGatewayPentagon(container);
+ pentagon.setFilled(false);
+ }
+
+ private void drawExclusiveEventBased(ContainerShape container) {
+ Ellipse ellipse = GraphicsUtil.createGatewayOuterCircle(container);
+ Polygon pentagon = GraphicsUtil.createGatewayPentagon(container);
+ pentagon.setFilled(false);
+ }
+
+ private void drawParallelMultipleEventBased(ContainerShape container) {
+ Ellipse ellipse = GraphicsUtil.createGatewayOuterCircle(container);
+ Polygon cross = GraphicsUtil.createEventGatewayParallelCross(container);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/AddLabelFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/AddLabelFeature.java
index 00c5ce5..221fbb9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/AddLabelFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/AddLabelFeature.java
@@ -1,105 +1,105 @@
-package org.eclipse.bpmn2.modeler.ui.features.label;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.modeler.core.di.DIImport;
-import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.MultiText;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.graphiti.services.IPeService;
-
-public class AddLabelFeature extends AbstractAddShapeFeature {
-
- public AddLabelFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canAdd(IAddContext context) {
- boolean intoDiagram = context.getTargetContainer().equals(getDiagram());
- boolean intoLane = FeatureSupport.isTargetLane(context) && FeatureSupport.isTargetLaneOnTop(context);
- boolean intoParticipant = FeatureSupport.isTargetParticipant(context);
- boolean intoFlowELementContainer = BusinessObjectUtil.containsElementOfType(context.getTargetContainer(),
- FlowElementsContainer.class);
- return intoDiagram || intoLane || intoParticipant || intoFlowELementContainer;
- }
-
- @Override
- public PictogramElement add(IAddContext context) {
- IGaService gaService = Graphiti.getGaService();
- IPeService peService = Graphiti.getPeService();
-
- int width = (Integer) context.getProperty(ContextConstants.WIDTH);
- int height = (Integer) context.getProperty(ContextConstants.HEIGHT);
-
- int x = context.getX();
- int y = context.getY();
-
- BaseElement baseElement = (BaseElement) context.getProperty(ContextConstants.BUSINESS_OBJECT);
-
- final ContainerShape textContainerShape = peService.createContainerShape(getTargetContainer(context), true);
- gaService.createInvisibleRectangle(textContainerShape);
-
- Shape textShape = peService.createShape(textContainerShape, false);
- peService.setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
- String name = ModelUtil.getDisplayName(baseElement);
- MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, name);
- StyleUtil.applyStyle(text, baseElement);
- text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
- text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
-
- // Boundary events get a different add context, so use the context coodinates relative
- if ( (baseElement instanceof BoundaryEvent) && !isImport(context) ){
- x = context.getTargetContainer().getGraphicsAlgorithm().getX() + context.getX()-width/2;
- y = context.getTargetContainer().getGraphicsAlgorithm().getY() + context.getY()-height/2;
- }
-
- GraphicsUtil.alignWithShape(text, textContainerShape, width, height, x, y, 0, 0);
-
- this.link(textContainerShape, baseElement);
- Graphiti.getPeService().setPropertyValue(textContainerShape, GraphicsUtil.LABEL_PROPERTY, "true");
-
- updatePictogramElement(textContainerShape);
- layoutPictogramElement(textContainerShape);
-
- return textContainerShape;
- }
-
- private boolean isImport(IAddContext context) {
- return context.getProperty(DIImport.IMPORT_PROPERTY) == null ? false : (Boolean) context.getProperty(DIImport.IMPORT_PROPERTY);
- }
-
- /**
- * Get the correct target control, boundary events need special handling, because we need to find a parent,
- * where the label is visible.
- *
- * @param context
- * @return the target control for the current context
- */
- ContainerShape getTargetContainer(IAddContext context) {
- boolean isBoundary = context.getProperty(ContextConstants.BUSINESS_OBJECT) instanceof BoundaryEvent;
-
- if ( isBoundary && !isImport(context) ){
- if (context.getTargetContainer()!=null){
- return context.getTargetContainer().getContainer();
- }
- }
- return context.getTargetContainer();
- }
-
-}
+package org.eclipse.bpmn2.modeler.ui.features.label;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.FlowElementsContainer;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
+import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
+import org.eclipse.graphiti.mm.algorithms.MultiText;
+import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeService;
+
+public class AddLabelFeature extends AbstractAddShapeFeature {
+
+ public AddLabelFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canAdd(IAddContext context) {
+ boolean intoDiagram = context.getTargetContainer().equals(getDiagram());
+ boolean intoLane = FeatureSupport.isTargetLane(context) && FeatureSupport.isTargetLaneOnTop(context);
+ boolean intoParticipant = FeatureSupport.isTargetParticipant(context);
+ boolean intoFlowELementContainer = BusinessObjectUtil.containsElementOfType(context.getTargetContainer(),
+ FlowElementsContainer.class);
+ return intoDiagram || intoLane || intoParticipant || intoFlowELementContainer;
+ }
+
+ @Override
+ public PictogramElement add(IAddContext context) {
+ IGaService gaService = Graphiti.getGaService();
+ IPeService peService = Graphiti.getPeService();
+
+ int width = (Integer) context.getProperty(ContextConstants.WIDTH);
+ int height = (Integer) context.getProperty(ContextConstants.HEIGHT);
+
+ int x = context.getX();
+ int y = context.getY();
+
+ BaseElement baseElement = (BaseElement) context.getProperty(ContextConstants.BUSINESS_OBJECT);
+
+ final ContainerShape textContainerShape = peService.createContainerShape(getTargetContainer(context), true);
+ gaService.createInvisibleRectangle(textContainerShape);
+
+ Shape textShape = peService.createShape(textContainerShape, false);
+ peService.setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
+ String name = ModelUtil.getDisplayName(baseElement);
+ MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, name);
+ StyleUtil.applyStyle(text, baseElement);
+ text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
+ text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
+
+ // Boundary events get a different add context, so use the context coodinates relative
+ if ( (baseElement instanceof BoundaryEvent) && !isImport(context) ){
+ x = context.getTargetContainer().getGraphicsAlgorithm().getX() + context.getX()-width/2;
+ y = context.getTargetContainer().getGraphicsAlgorithm().getY() + context.getY()-height/2;
+ }
+
+ GraphicsUtil.alignWithShape(text, textContainerShape, width, height, x, y, 0, 0);
+
+ this.link(textContainerShape, baseElement);
+ Graphiti.getPeService().setPropertyValue(textContainerShape, GraphicsUtil.LABEL_PROPERTY, "true");
+
+ updatePictogramElement(textContainerShape);
+ layoutPictogramElement(textContainerShape);
+
+ return textContainerShape;
+ }
+
+ private boolean isImport(IAddContext context) {
+ return context.getProperty(DIImport.IMPORT_PROPERTY) == null ? false : (Boolean) context.getProperty(DIImport.IMPORT_PROPERTY);
+ }
+
+ /**
+ * Get the correct target control, boundary events need special handling, because we need to find a parent,
+ * where the label is visible.
+ *
+ * @param context
+ * @return the target control for the current context
+ */
+ ContainerShape getTargetContainer(IAddContext context) {
+ boolean isBoundary = context.getProperty(ContextConstants.BUSINESS_OBJECT) instanceof BoundaryEvent;
+
+ if ( isBoundary && !isImport(context) ){
+ if (context.getTargetContainer()!=null){
+ return context.getTargetContainer().getContainer();
+ }
+ }
+ return context.getTargetContainer();
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LabelFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LabelFeatureContainer.java
index a29750c..9f97212 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LabelFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LabelFeatureContainer.java
@@ -1,127 +1,127 @@
-package org.eclipse.bpmn2.modeler.ui.features.label;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataObject;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.DataStore;
-import org.eclipse.bpmn2.DataStoreReference;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.Message;
-import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
-import org.eclipse.bpmn2.modeler.core.features.FeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.AbstractText;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public class LabelFeatureContainer implements FeatureContainer {
-
- @Override
- public Object getApplyObject(IContext context) {
- if (context.getProperty(ContextConstants.LABEL_CONTEXT) != null
- && (Boolean) context.getProperty(ContextConstants.LABEL_CONTEXT) == true) {
- if (context instanceof IAddContext) {
- IAddContext addContext = (IAddContext) context;
- return addContext.getNewObject();
- }
- } else if (context instanceof IPictogramElementContext) {
- IPictogramElementContext peContext = (IPictogramElementContext) context;
- BaseElement o = BusinessObjectUtil.getFirstElementOfType(peContext.getPictogramElement(), BaseElement.class);
- if (o != null && (o instanceof Gateway || o instanceof Event)) {
- if (peContext.getPictogramElement() instanceof ContainerShape) {
- ContainerShape container = (ContainerShape) peContext.getPictogramElement();
- if (container.getChildren().size() == 1) {
- Shape shape = container.getChildren().get(0);
- if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
- return o;
- }
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public boolean canApplyTo(Object o) {
- // these all have Label features
- return o instanceof Gateway ||
- o instanceof Event ||
- o instanceof Message ||
- o instanceof DataInput ||
- o instanceof DataOutput ||
- o instanceof DataObject ||
- o instanceof DataObjectReference ||
- o instanceof DataStore ||
- o instanceof DataStoreReference;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddLabelFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateBaseElementNameFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutLabelFeature(fp);
- }
-
- @Override
- public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new DefaultMoveShapeFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return null;
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- return null;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.features.label;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataObject;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.DataStore;
+import org.eclipse.bpmn2.DataStoreReference;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.modeler.core.features.ContextConstants;
+import org.eclipse.bpmn2.modeler.core.features.FeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IRemoveFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
+import org.eclipse.graphiti.mm.algorithms.AbstractText;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+public class LabelFeatureContainer implements FeatureContainer {
+
+ @Override
+ public Object getApplyObject(IContext context) {
+ if (context.getProperty(ContextConstants.LABEL_CONTEXT) != null
+ && (Boolean) context.getProperty(ContextConstants.LABEL_CONTEXT) == true) {
+ if (context instanceof IAddContext) {
+ IAddContext addContext = (IAddContext) context;
+ return addContext.getNewObject();
+ }
+ } else if (context instanceof IPictogramElementContext) {
+ IPictogramElementContext peContext = (IPictogramElementContext) context;
+ BaseElement o = BusinessObjectUtil.getFirstElementOfType(peContext.getPictogramElement(), BaseElement.class);
+ if (o != null && (o instanceof Gateway || o instanceof Event)) {
+ if (peContext.getPictogramElement() instanceof ContainerShape) {
+ ContainerShape container = (ContainerShape) peContext.getPictogramElement();
+ if (container.getChildren().size() == 1) {
+ Shape shape = container.getChildren().get(0);
+ if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
+ return o;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ // these all have Label features
+ return o instanceof Gateway ||
+ o instanceof Event ||
+ o instanceof Message ||
+ o instanceof DataInput ||
+ o instanceof DataOutput ||
+ o instanceof DataObject ||
+ o instanceof DataObjectReference ||
+ o instanceof DataStore ||
+ o instanceof DataStoreReference;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddLabelFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateBaseElementNameFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutLabelFeature(fp);
+ }
+
+ @Override
+ public IRemoveFeature getRemoveFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new DefaultMoveShapeFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return null;
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LayoutLabelFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LayoutLabelFeature.java
index 71235c1..5e95d3c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LayoutLabelFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/label/LayoutLabelFeature.java
@@ -1,93 +1,93 @@
-package org.eclipse.bpmn2.modeler.ui.features.label;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
-import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public class LayoutLabelFeature extends AbstractLayoutFeature {
-
- public LayoutLabelFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canLayout(ILayoutContext context) {
-// Object bo = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
-// return bo != null && bo instanceof Activity;
- // TODO Auto-generated method stub
-// return false;
- return true;
- }
-
- @Override
- public boolean layout(ILayoutContext context) {
- ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
- SubProcess subProcess = BusinessObjectUtil.getFirstElementOfType(containerShape, SubProcess.class);
- if (subProcess!=null) {
- try {
- BPMNShape shape = (BPMNShape) ModelHandlerLocator.getModelHandler(getDiagram().eResource()).findDIElement(subProcess);
-
- if (shape.isIsExpanded()) {
-
- // SubProcess is expanded
-
- boolean needResize = false;
- GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
-
- for (PictogramElement pe : FeatureSupport.getContainerChildren(containerShape)) {
- GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
- if (ga!=null) {
- if (ga.getX() < 0 || ga.getY() < 0) {
- needResize = true;
- break;
- }
- if (ga.getX() + ga.getWidth() > parentGa.getWidth()) {
- needResize = true;
- break;
- }
- if (ga.getY() + ga.getHeight() > parentGa.getHeight()) {
- needResize = true;
- break;
- }
- }
- }
- if (needResize) {
- ResizeShapeContext resizeContext = new ResizeShapeContext(containerShape);
- resizeContext.setX(parentGa.getX());
- resizeContext.setY(parentGa.getY());
- resizeContext.setWidth(parentGa.getWidth());
- resizeContext.setHeight(parentGa.getHeight());
- IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(resizeContext);
- resizeFeature.resizeShape(resizeContext);
- }
-
- FeatureSupport.setContainerChildrenVisible(containerShape, true);
- }
- else {
-
- // SubProcess is collapsed
-
- FeatureSupport.setContainerChildrenVisible(containerShape, false);
- }
-
- } catch (Exception e) {
- // It's OK, I've played a programmer before...
- // e.printStackTrace();
- }
- }
- return true;
- }
-
-}
+package org.eclipse.bpmn2.modeler.ui.features.label;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
+import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public class LayoutLabelFeature extends AbstractLayoutFeature {
+
+ public LayoutLabelFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canLayout(ILayoutContext context) {
+// Object bo = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
+// return bo != null && bo instanceof Activity;
+ // TODO Auto-generated method stub
+// return false;
+ return true;
+ }
+
+ @Override
+ public boolean layout(ILayoutContext context) {
+ ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+ SubProcess subProcess = BusinessObjectUtil.getFirstElementOfType(containerShape, SubProcess.class);
+ if (subProcess!=null) {
+ try {
+ BPMNShape shape = (BPMNShape) ModelHandlerLocator.getModelHandler(getDiagram().eResource()).findDIElement(subProcess);
+
+ if (shape.isIsExpanded()) {
+
+ // SubProcess is expanded
+
+ boolean needResize = false;
+ GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
+
+ for (PictogramElement pe : FeatureSupport.getContainerChildren(containerShape)) {
+ GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
+ if (ga!=null) {
+ if (ga.getX() < 0 || ga.getY() < 0) {
+ needResize = true;
+ break;
+ }
+ if (ga.getX() + ga.getWidth() > parentGa.getWidth()) {
+ needResize = true;
+ break;
+ }
+ if (ga.getY() + ga.getHeight() > parentGa.getHeight()) {
+ needResize = true;
+ break;
+ }
+ }
+ }
+ if (needResize) {
+ ResizeShapeContext resizeContext = new ResizeShapeContext(containerShape);
+ resizeContext.setX(parentGa.getX());
+ resizeContext.setY(parentGa.getY());
+ resizeContext.setWidth(parentGa.getWidth());
+ resizeContext.setHeight(parentGa.getHeight());
+ IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(resizeContext);
+ resizeFeature.resizeShape(resizeContext);
+ }
+
+ FeatureSupport.setContainerChildrenVisible(containerShape, true);
+ }
+ else {
+
+ // SubProcess is collapsed
+
+ FeatureSupport.setContainerChildrenVisible(containerShape, false);
+ }
+
+ } catch (Exception e) {
+ // It's OK, I've played a programmer before...
+ // e.printStackTrace();
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java
index e47bb1f..15d84db 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/DeleteLaneFeature.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.lane;
-
-import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.services.Graphiti;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DeleteLaneFeature extends AbstractDefaultDeleteFeature {
-
- /**
- * @param fp
- */
- public DeleteLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public void delete(IDeleteContext context) {
- ContainerShape laneContainerShape = (ContainerShape) context.getPictogramElement();
- ContainerShape parentContainerShape = laneContainerShape.getContainer();
-
- if (parentContainerShape != null) {
- boolean before = false;
- ContainerShape neighborContainerShape = FeatureSupport.getLaneAfter(laneContainerShape);
- if (neighborContainerShape == null) {
- neighborContainerShape = FeatureSupport.getLaneBefore(laneContainerShape);
- if (neighborContainerShape == null) {
- super.delete(context);
- return;
- } else {
- before = true;
- }
- }
- boolean isHorizontal = FeatureSupport.isHorizontal(laneContainerShape);
- GraphicsAlgorithm ga = laneContainerShape.getGraphicsAlgorithm();
- GraphicsAlgorithm neighborGA = neighborContainerShape.getGraphicsAlgorithm();
- ResizeShapeContext newContext = new ResizeShapeContext(neighborContainerShape);
- if (!before) {
- Graphiti.getGaService().setLocation(neighborGA, ga.getX(), ga.getY());
- }
- newContext.setLocation(neighborGA.getX(), neighborGA.getY());
- if (isHorizontal) {
- newContext.setHeight(neighborGA.getHeight() + ga.getHeight());
- newContext.setWidth(neighborGA.getWidth());
- } else {
- newContext.setHeight(neighborGA.getHeight());
- newContext.setWidth(neighborGA.getWidth() + ga.getWidth());
- }
-
- IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
- if (resizeFeature.canResizeShape(newContext)) {
- super.delete(context);
- resizeFeature.resizeShape(newContext);
- return;
- }
- }
- super.delete(context);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.lane;
+
+import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.context.IDeleteContext;
+import org.eclipse.graphiti.features.context.impl.ResizeShapeContext;
+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.services.Graphiti;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DeleteLaneFeature extends AbstractDefaultDeleteFeature {
+
+ /**
+ * @param fp
+ */
+ public DeleteLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public void delete(IDeleteContext context) {
+ ContainerShape laneContainerShape = (ContainerShape) context.getPictogramElement();
+ ContainerShape parentContainerShape = laneContainerShape.getContainer();
+
+ if (parentContainerShape != null) {
+ boolean before = false;
+ ContainerShape neighborContainerShape = FeatureSupport.getLaneAfter(laneContainerShape);
+ if (neighborContainerShape == null) {
+ neighborContainerShape = FeatureSupport.getLaneBefore(laneContainerShape);
+ if (neighborContainerShape == null) {
+ super.delete(context);
+ return;
+ } else {
+ before = true;
+ }
+ }
+ boolean isHorizontal = FeatureSupport.isHorizontal(laneContainerShape);
+ GraphicsAlgorithm ga = laneContainerShape.getGraphicsAlgorithm();
+ GraphicsAlgorithm neighborGA = neighborContainerShape.getGraphicsAlgorithm();
+ ResizeShapeContext newContext = new ResizeShapeContext(neighborContainerShape);
+ if (!before) {
+ Graphiti.getGaService().setLocation(neighborGA, ga.getX(), ga.getY());
+ }
+ newContext.setLocation(neighborGA.getX(), neighborGA.getY());
+ if (isHorizontal) {
+ newContext.setHeight(neighborGA.getHeight() + ga.getHeight());
+ newContext.setWidth(neighborGA.getWidth());
+ } else {
+ newContext.setHeight(neighborGA.getHeight());
+ newContext.setWidth(neighborGA.getWidth() + ga.getWidth());
+ }
+
+ IResizeShapeFeature resizeFeature = getFeatureProvider().getResizeShapeFeature(newContext);
+ if (resizeFeature.canResizeShape(newContext)) {
+ super.delete(context);
+ resizeFeature.resizeShape(newContext);
+ return;
+ }
+ }
+ super.delete(context);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/LaneFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/LaneFeatureContainer.java
index 25fa2ce..480a364 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/LaneFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/LaneFeatureContainer.java
@@ -1,95 +1,95 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.lane;
-
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
-import org.eclipse.bpmn2.modeler.core.features.lane.AddLaneFeature;
-import org.eclipse.bpmn2.modeler.core.features.lane.DirectEditLaneFeature;
-import org.eclipse.bpmn2.modeler.core.features.lane.LayoutLaneFeature;
-import org.eclipse.bpmn2.modeler.core.features.lane.MoveLaneFeature;
-import org.eclipse.bpmn2.modeler.core.features.lane.ResizeLaneFeature;
-import org.eclipse.bpmn2.modeler.core.features.lane.UpdateLaneFeature;
-import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
-import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
-import org.eclipse.bpmn2.modeler.ui.features.choreography.AddChoreographyMessageFeature;
-import org.eclipse.bpmn2.modeler.ui.features.participant.RotatePoolFeature;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.IUpdateFeature;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-
-public class LaneFeatureContainer extends BaseElementFeatureContainer {
-
- @Override
- public boolean canApplyTo(Object o) {
- return super.canApplyTo(o) && o instanceof Lane;
- }
-
- @Override
- public ICreateFeature getCreateFeature(IFeatureProvider fp) {
- return new CreateLaneFeature(fp);
- }
-
- @Override
- public IAddFeature getAddFeature(IFeatureProvider fp) {
- return new AddLaneFeature(fp);
- }
-
- @Override
- public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
- return new UpdateLaneFeature(fp);
- }
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
- return new DirectEditLaneFeature(fp);
- }
-
- @Override
- public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
- return new LayoutLaneFeature(fp);
- }
-
- @Override
- public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
- return new MoveLaneFeature(fp);
- }
-
- @Override
- public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
- return new ResizeLaneFeature(fp);
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
- return new DeleteLaneFeature(fp);
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
- ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
- ICustomFeature[] thisFeatures = new ICustomFeature[1 + superFeatures.length];
- int i;
- for (i=0; i<superFeatures.length; ++i)
- thisFeatures[i] = superFeatures[i];
- thisFeatures[i++] = new RotateLaneFeature(fp);
- return thisFeatures;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.lane;
+
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
+import org.eclipse.bpmn2.modeler.core.features.lane.AddLaneFeature;
+import org.eclipse.bpmn2.modeler.core.features.lane.DirectEditLaneFeature;
+import org.eclipse.bpmn2.modeler.core.features.lane.LayoutLaneFeature;
+import org.eclipse.bpmn2.modeler.core.features.lane.MoveLaneFeature;
+import org.eclipse.bpmn2.modeler.core.features.lane.ResizeLaneFeature;
+import org.eclipse.bpmn2.modeler.core.features.lane.UpdateLaneFeature;
+import org.eclipse.bpmn2.modeler.ui.features.AbstractDefaultDeleteFeature;
+import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.AddChoreographyMessageFeature;
+import org.eclipse.bpmn2.modeler.ui.features.participant.RotatePoolFeature;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDeleteFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+
+public class LaneFeatureContainer extends BaseElementFeatureContainer {
+
+ @Override
+ public boolean canApplyTo(Object o) {
+ return super.canApplyTo(o) && o instanceof Lane;
+ }
+
+ @Override
+ public ICreateFeature getCreateFeature(IFeatureProvider fp) {
+ return new CreateLaneFeature(fp);
+ }
+
+ @Override
+ public IAddFeature getAddFeature(IFeatureProvider fp) {
+ return new AddLaneFeature(fp);
+ }
+
+ @Override
+ public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
+ return new UpdateLaneFeature(fp);
+ }
+
+ @Override
+ public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
+ return new DirectEditLaneFeature(fp);
+ }
+
+ @Override
+ public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
+ return new LayoutLaneFeature(fp);
+ }
+
+ @Override
+ public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
+ return new MoveLaneFeature(fp);
+ }
+
+ @Override
+ public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
+ return new ResizeLaneFeature(fp);
+ }
+
+ @Override
+ public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
+ return new DeleteLaneFeature(fp);
+ }
+
+ @Override
+ public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
+ ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
+ ICustomFeature[] thisFeatures = new ICustomFeature[1 + superFeatures.length];
+ int i;
+ for (i=0; i<superFeatures.length; ++i)
+ thisFeatures[i] = superFeatures[i];
+ thisFeatures[i++] = new RotateLaneFeature(fp);
+ return thisFeatures;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/RotateLaneFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/RotateLaneFeature.java
index 5ba4297..0b5ec6b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/RotateLaneFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/lane/RotateLaneFeature.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.lane;
-
-import org.eclipse.bpmn2.modeler.ui.features.AbstractRotateContainerFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-
-/**
- * @author Bob Brodt
- *
- */
-public class RotateLaneFeature extends AbstractRotateContainerFeature {
-
- /**
- * @param fp
- */
- public RotateLaneFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public String getName() {
- return "Change Lane Orientation";
- }
-
- @Override
- public String getDescription() {
- return "Switch the orientation of this Lane between horizontal and vertical";
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.lane;
+
+import org.eclipse.bpmn2.modeler.ui.features.AbstractRotateContainerFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class RotateLaneFeature extends AbstractRotateContainerFeature {
+
+ /**
+ * @param fp
+ */
+ public RotateLaneFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Change Lane Orientation";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Switch the orientation of this Lane between horizontal and vertical";
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/DeleteParticipantFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/DeleteParticipantFeature.java
index abfe208..cf3dd03 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/DeleteParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/DeleteParticipantFeature.java
@@ -17,6 +17,8 @@
import org.eclipse.bpmn2.Definitions;
import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.di.BPMNPlane;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
import org.eclipse.bpmn2.modeler.core.features.DefaultDeleteBPMNShapeFeature;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
@@ -41,9 +43,22 @@
@Override
public void delete(IDeleteContext context) {
Participant participant = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), Participant.class);
+ Definitions defs = ModelUtil.getDefinitions(participant);
Process process = participant.getProcessRef();
if (process!=null) {
+ BPMNDiagram bpmnDiagram = null;
+ if (defs!=null) {
+ for (BPMNDiagram d : defs.getDiagrams()) {
+ BPMNPlane plane = d.getPlane();
+ if (plane.getBpmnElement() == process) {
+ bpmnDiagram = d;
+ break;
+ }
+ }
+ }
deleteBusinessObject(process);
+ if (bpmnDiagram!=null)
+ deleteBusinessObject(bpmnDiagram);
}
super.delete(context);
}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/MoveParticipantFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/MoveParticipantFeature.java
index fdbb33b..9cdf3ee 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/MoveParticipantFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/MoveParticipantFeature.java
@@ -1,127 +1,127 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.features.participant;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.di.ParticipantBandKind;
-import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.Tuple;
-import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class MoveParticipantFeature extends DefaultMoveBPMNShapeFeature {
-
- public MoveParticipantFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canMoveShape(IMoveShapeContext context) {
-// if (ChoreographyUtil.isChoreographyParticipantBand(context.getShape())) {
-// return false;
-// }
- return super.canMoveShape(context);
- }
-
- @Override
- protected void postMoveShape(IMoveShapeContext context) {
- super.postMoveShape(context);
-
- if (ChoreographyUtil.isChoreographyParticipantBand(context.getShape())) {
- ContainerShape container = context.getTargetContainer();
- ContainerShape shape = (ContainerShape)context.getShape();
- // collect all participant bands into top, middle and bottom
- List<ContainerShape> bands = ChoreographyUtil.getParticipantBandContainerShapes(container);
- Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = ChoreographyUtil.getTopAndBottomBands(bands);
- List<ContainerShape> top = topAndBottom.getFirst();
- List<ContainerShape> bottom = topAndBottom.getSecond();
- BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(shape, BPMNShape.class);
- int height = container.getGraphicsAlgorithm().getHeight();
- int width = container.getGraphicsAlgorithm().getWidth();
-
- for (ContainerShape cs : bottom) {
- if ( cs == shape) {
- bottom.remove(cs);
- break;
- }
- }
- for (ContainerShape cs : top) {
- if ( cs == shape) {
- top.remove(cs);
- break;
- }
- }
- if (context.getY()<height/2) {
- // move up
- top.add(shape);
- }
- else {
- // move down
- bottom.add(0,shape);
- }
-
- // reassign TOP/MIDDLE/BOTTOM bandKinds
- for (int i=0; i<bottom.size(); ++i) {
- bpmnShape = BusinessObjectUtil.getFirstElementOfType(bottom.get(i), BPMNShape.class);
- ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
- if (i==bottom.size()-1) {
- if (isInitiating(bandKind))
- bandKind = ParticipantBandKind.BOTTOM_INITIATING;
- else
- bandKind = ParticipantBandKind.BOTTOM_NON_INITIATING;
- }
- else
- {
- if (isInitiating(bandKind))
- bandKind = ParticipantBandKind.MIDDLE_INITIATING;
- else
- bandKind = ParticipantBandKind.MIDDLE_NON_INITIATING;
- }
- bpmnShape.setParticipantBandKind(bandKind);
- }
- for (int i=0; i<top.size(); ++i) {
- bpmnShape = BusinessObjectUtil.getFirstElementOfType(top.get(i), BPMNShape.class);
- ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
- if (i==0) {
- if (isInitiating(bandKind))
- bandKind = ParticipantBandKind.TOP_INITIATING;
- else
- bandKind = ParticipantBandKind.TOP_NON_INITIATING;
- }
- else
- {
- if (isInitiating(bandKind))
- bandKind = ParticipantBandKind.MIDDLE_INITIATING;
- else
- bandKind = ParticipantBandKind.MIDDLE_NON_INITIATING;
- }
- bpmnShape.setParticipantBandKind(bandKind);
- }
-
- ChoreographyUtil.resizePartipantBandContainerShapes(width, height,
- top, bottom, getDiagram());
- }
- }
-
- boolean isInitiating(ParticipantBandKind bandKind) {
- return bandKind==ParticipantBandKind.TOP_INITIATING ||
- bandKind==ParticipantBandKind.BOTTOM_INITIATING ||
- bandKind==ParticipantBandKind.MIDDLE_INITIATING;
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.features.participant;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.di.ParticipantBandKind;
+import org.eclipse.bpmn2.modeler.core.features.DefaultMoveBPMNShapeFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.Tuple;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+
+public class MoveParticipantFeature extends DefaultMoveBPMNShapeFeature {
+
+ public MoveParticipantFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public boolean canMoveShape(IMoveShapeContext context) {
+// if (ChoreographyUtil.isChoreographyParticipantBand(context.getShape())) {
+// return false;
+// }
+ return super.canMoveShape(context);
+ }
+
+ @Override
+ protected void postMoveShape(IMoveShapeContext context) {
+ super.postMoveShape(context);
+
+ if (ChoreographyUtil.isChoreographyParticipantBand(context.getShape())) {
+ ContainerShape container = context.getTargetContainer();
+ ContainerShape shape = (ContainerShape)context.getShape();
+ // collect all participant bands into top, middle and bottom
+ List<ContainerShape> bands = ChoreographyUtil.getParticipantBandContainerShapes(container);
+ Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = ChoreographyUtil.getTopAndBottomBands(bands);
+ List<ContainerShape> top = topAndBottom.getFirst();
+ List<ContainerShape> bottom = topAndBottom.getSecond();
+ BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(shape, BPMNShape.class);
+ int height = container.getGraphicsAlgorithm().getHeight();
+ int width = container.getGraphicsAlgorithm().getWidth();
+
+ for (ContainerShape cs : bottom) {
+ if ( cs == shape) {
+ bottom.remove(cs);
+ break;
+ }
+ }
+ for (ContainerShape cs : top) {
+ if ( cs == shape) {
+ top.remove(cs);
+ break;
+ }
+ }
+ if (context.getY()<height/2) {
+ // move up
+ top.add(shape);
+ }
+ else {
+ // move down
+ bottom.add(0,shape);
+ }
+
+ // reassign TOP/MIDDLE/BOTTOM bandKinds
+ for (int i=0; i<bottom.size(); ++i) {
+ bpmnShape = BusinessObjectUtil.getFirstElementOfType(bottom.get(i), BPMNShape.class);
+ ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
+ if (i==bottom.size()-1) {
+ if (isInitiating(bandKind))
+ bandKind = ParticipantBandKind.BOTTOM_INITIATING;
+ else
+ bandKind = ParticipantBandKind.BOTTOM_NON_INITIATING;
+ }
+ else
+ {
+ if (isInitiating(bandKind))
+ bandKind = ParticipantBandKind.MIDDLE_INITIATING;
+ else
+ bandKind = ParticipantBandKind.MIDDLE_NON_INITIATING;
+ }
+ bpmnShape.setParticipantBandKind(bandKind);
+ }
+ for (int i=0; i<top.size(); ++i) {
+ bpmnShape = BusinessObjectUtil.getFirstElementOfType(top.get(i), BPMNShape.class);
+ ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
+ if (i==0) {
+ if (isInitiating(bandKind))
+ bandKind = ParticipantBandKind.TOP_INITIATING;
+ else
+ bandKind = ParticipantBandKind.TOP_NON_INITIATING;
+ }
+ else
+ {
+ if (isInitiating(bandKind))
+ bandKind = ParticipantBandKind.MIDDLE_INITIATING;
+ else
+ bandKind = ParticipantBandKind.MIDDLE_NON_INITIATING;
+ }
+ bpmnShape.setParticipantBandKind(bandKind);
+ }
+
+ ChoreographyUtil.resizePartipantBandContainerShapes(width, height,
+ top, bottom, getDiagram());
+ }
+ }
+
+ boolean isInitiating(ParticipantBandKind bandKind) {
+ return bandKind==ParticipantBandKind.TOP_INITIATING ||
+ bandKind==ParticipantBandKind.BOTTOM_INITIATING ||
+ bandKind==ParticipantBandKind.MIDDLE_INITIATING;
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/ParticipantFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/ParticipantFeatureContainer.java
index 9adfcf6..48e91e5 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/ParticipantFeatureContainer.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/ParticipantFeatureContainer.java
@@ -24,8 +24,11 @@
import org.eclipse.bpmn2.modeler.ui.features.activity.AppendActivityFeature;
import org.eclipse.bpmn2.modeler.ui.features.choreography.AddChoreographyMessageFeature;
import org.eclipse.bpmn2.modeler.ui.features.choreography.AddChoreographyParticipantFeature;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.BlackboxFeature;
import org.eclipse.bpmn2.modeler.ui.features.choreography.RemoveChoreographyParticipantFeature;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.ShowDiagramPageFeature;
import org.eclipse.bpmn2.modeler.ui.features.choreography.UpdateChoreographyMessageLinkFeature;
+import org.eclipse.bpmn2.modeler.ui.features.choreography.WhiteboxFeature;
import org.eclipse.bpmn2.modeler.ui.features.event.AppendEventFeature;
import org.eclipse.bpmn2.modeler.ui.features.gateway.AppendGatewayFeature;
import org.eclipse.graphiti.features.IAddFeature;
@@ -99,12 +102,15 @@
@Override
public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
- ICustomFeature[] thisFeatures = new ICustomFeature[2 + superFeatures.length];
+ ICustomFeature[] thisFeatures = new ICustomFeature[5 + superFeatures.length];
+ thisFeatures[0] = new ShowDiagramPageFeature(fp);
int i;
for (i=0; i<superFeatures.length; ++i)
- thisFeatures[i] = superFeatures[i];
- thisFeatures[i++] = new AddChoreographyMessageFeature(fp);
- thisFeatures[i++] = new RotatePoolFeature(fp);
+ thisFeatures[i+1] = superFeatures[i];
+ thisFeatures[++i] = new AddChoreographyMessageFeature(fp);
+ thisFeatures[++i] = new RotatePoolFeature(fp);
+ thisFeatures[++i] = new WhiteboxFeature(fp);
+ thisFeatures[++i] = new BlackboxFeature(fp);
return thisFeatures;
}
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/RotatePoolFeature.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/RotatePoolFeature.java
index c2a30fb..a661768 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/RotatePoolFeature.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/participant/RotatePoolFeature.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.features.participant;
-
-import org.eclipse.bpmn2.modeler.ui.features.AbstractRotateContainerFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-
-/**
- * @author Bob Brodt
- *
- */
-public class RotatePoolFeature extends AbstractRotateContainerFeature {
-
- /**
- * @param fp
- */
- public RotatePoolFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public String getName() {
- return "Change Pool Orientation";
- }
-
- @Override
- public String getDescription() {
- return "Switch the orientation of this Pool between horizontal and vertical";
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.features.participant;
+
+import org.eclipse.bpmn2.modeler.ui.features.AbstractRotateContainerFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class RotatePoolFeature extends AbstractRotateContainerFeature {
+
+ /**
+ * @param fp
+ */
+ public RotatePoolFeature(IFeatureProvider fp) {
+ super(fp);
+ }
+
+ @Override
+ public String getName() {
+ return "Change Pool Orientation";
+ }
+
+ @Override
+ public String getDescription() {
+ return "Switch the orientation of this Pool between horizontal and vertical";
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties
index 730b272..daa1cbe 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties
@@ -1,222 +1,222 @@
-InputMessageAdapter_0=Input Message
-MessageAdapter_Message_1=Message
-OperationAdapter_Operation_1=Operation
-OperationAdapter_0={0} - {1}
-OutputMessageAdapter_0=Output Message
-PartAdapter_Part_1=Part
-PortTypeAdapter_Port_Type_2=Interface
-FaultAdapter_Fault_1=Fault
-XSDAttributeDeclarationAdapter_XSD_Attribute_1=XSD Attribute
-XSDElementDeclarationAdapter_XSD_Element_1=XSD Element
-XSDTypeDefinitionAdapter_XSD_Type_1=XSD Type
-XSDSimpleTypeDefinitionAdapter_0=Simple Type Definition
-XSDComplexTypeDefinitionAdapter_0=Complex Type Definition
-XSDSchemaAdapter_0=Schema
-XSDSchemaAdapter_1=Schema targetNamespace={0}
-XSDSchemaTreeNode_0=Schema
-XSDSchemaTreeNode_1=Schema targetNamespace={0}
-
-SchemaImportDialog_0=Browse for a WSDL File to Import
-SchemaImportDialog_1=Browse for an XML File to Import
-SchemaImportDialog_2=Browse for an XML Schema File to Import
-SchemaImportDialog_3=Import Type
-SchemaImportDialog_4=Import Source
-SchemaImportDialog_5=Workspace
-SchemaImportDialog_6=File System
-SchemaImportDialog_7=URL
-SchemaImportDialog_8=Location:
-SchemaImportDialog_9=Browse ...
-SchemaImportDialog_10=Select a Workspace Resource to Import
-SchemaImportDialog_11=Available Types:
-SchemaImportDialog_12=Structure:
-SchemaImportDialog_13=Invalid location syntax.
-SchemaImportDialog_14=Ports and Partner Links:
-SchemaImportDialog_15=WSIL
-SchemaImportDialog_16=Filter by name
-SchemaImportDialog_17=Loading {0} ...
-SchemaImportDialog_18=Loaded {0} [{1}ms]
-SchemaImportDialog_19=Failed to load {0} [{1}ms]
-
-SchemaImportDialog_20=XML
-SchemaImportDialog_21=XML Schema (XSD)
-SchemaImportDialog_22=Web Service Definition (WSDL)
-SchemaImportDialog_23=Java
-SchemaImportDialog_24=Browse for a Java type to Import
-SchemaImportDialog_25=Public Java types and members:
-SchemaImportDialog_26=Load
-SchemaImportDialog_27=Type:
-SchemaImportDialog_28=BPMN 2.0 Diagram (BPMN2)
-SchemaImportDialog_29=Browse for a BPMN2 File to Import
-SchemaImportDialog_30=Interfaces and Participants:
-SchemaImportDialog_31=Please select a Java Type
-
-ModelTreeLabelProvider_s1_s2={0} \: {1}
-
-
-Bpmn2PreferencePage_HomePage_Description General settings for the BPMN2 Modeler
-Bpmn2PreferencePage_EditorPage_Description BPMN2 Modeler Appearance
-
-WSILPreferencePage_WSIL_1 = Document URL:
-WSILPreferencePage_WSIL_2 = Browse ...
-WSILPreferencePage_WSIL_Abstract = Abstract
-WSILPreferencePage_WSIL_Namespace = Ref Namespace
-WSILPreferencePage_WSIL_Location = Location
-WSILPreferencePage_WSIL_Add = Add
-WSILPreferencePage_WSIL_Remove = Remove
-WSILPreferencePage_WSIL_Index = #
-WSILPreferencePage_WSIL_DocumentNotLoaded = WSIL Document not loaded.
-WSILPreferencePage_WSIL_NameLimit = WSIL Document's name should be ended with .wsil
-WSILPreferencePage_WSIL_MoveDown = Move Down
-WSILPreferencePage_WSIL_MoveUp = Move Up
-WSILPreferencePage_WSIL_OpenInBrowser = Open in Browser
-WSILPreferencePage_WSIL_EnterDescription = <enter description>
-WSILPreferencePage_WSIL_EnterLocation = <enter location>
-#
-# This has \n for a reason. The wrapping in the widget works, but not as expected.
-WSILPreferencePage_WSIL_Description = The document above contains links to other WSIL documents shown below.\nYou can add or remove WSIL links to/from the above document.\nThe result will be shown in the WSIL browser of the editor.
-
-#
-# Long descriptions of BPMN2 elements
-UI_UnknownDiagram_long_description = The Diagram Type has not yet been defined.
-UI_ProcessDiagram_long_description = A Process Diagram describes a sequence or flow of Activities in an organization with the objective of carrying out work. \
- A Process is depicted as a graph of Flow Elements, which are a set of Activities, Events, Gateways, and \
- Sequence Flows that define finite execution semantics. Processes can be defined at any level from \
- enterprise-wide Processes to Processes performed by a single person. Low-level Processes can be grouped \
- together to achieve a common business goal.
-UI_ChoreographyDiagram_long_description = A Choreography Diagram formalizes the way business \
- Participants coordinate their interactions. The focus is not on orchestrations of the work performed within these \
- Participants, but rather on the exchange of information (Messages) between these Participants.
-UI_CollaborationDiagram_long_description = A Collaboration usually contains two or more Pools, representing the Participants in the Collaboration. \
- The Message exchange between the Participants is shown by a Message Flow that connects two Pools (or the objects \
- within the Pools). The Messages associated with the Message Flows MAY also be shown. \
- A Pool MAY be empty, a "black box", or MAY show a Process within ("white box"). Choreographies MAY be shown in \
- between the Pools as they bisect the Message Flows between the Pools. All combinations of Pools, Processes, \
- and a Choreography are allowed in a Collaboration.
-UI_SequenceFlow_long_description = A Sequence Flow is used to show the order that \
- Activities will be performed in a Process or a Choreography. \
- A Sequence Flow can optionally define a condition Expression, indicating that control will be passed down the \
- Sequence Flow only if the Expression evaluates to true. This Expression is typically used when the source of \
- the Sequence Flow is a Gateway or an Activity. \
- A Sequence Flow that has an Exclusive, Inclusive, or Complex Gateway or an Activity as its source can also be \
- defined as "default". Such a Sequence Flow will have a marker to show that it is a default flow. The default \
- Sequence Flow is taken only if all the other outgoing Sequence Flows from the Activity or \
- Gateway are not valid (i.e., their condition Expressions are false).
-UI_MessageFlow_long_description = A Message Flow is used to show the flow of Messages between two Participants that are \
- prepared to send and receive them. In BPMN, two separate Pools in a Collaboration Diagram will represent the two \
- Participants (e.g., PartnerEntities and/or PartnerRoles).
-UI_Association_long_description = An Association is used to link information and Artifacts with BPMN graphical elements. \
- Text Annotations and other Artifacts can be Associated with the graphical elements. An arrowhead on the Association indicates \
- a direction of flow (e.g., data), when appropriate.
-UI_Annotation_long_description = Text Annotations are a mechanism for providing additional information to the reader of a BPMN Diagram. \
- The Text Annotation object can be connected to a specific object on the Diagram with an Association, but does not \
- affect the flow of the Process.
-
-UI_Task_long_description = A Task is an atomic Activity that is included within a Process. \
- A Task is used when the work in the Process is not broken down to a finer level of Process detail.
-UI_ManualTask_long_description = A Manual Task is a Task that is not managed by any business process engine. It can be considered as an unmanaged \
- Task, unmanaged in the sense of that the business process engine does not track the start and completion of such a Task. \
- An example of this could be a paper based instruction for a telephone technician to install a telephone at a customer location.
-UI_UserTask_long_description = A User Task is a typical workflow Task where a human performer performs the Task with the assistance of a \
- software application. The lifecycle of the Task is managed by a software component (called task manager) and is \
- typically executed in the context of a Process. \
- The User Task can be implemented using different technologies, specified by the implementation attribute. Besides \
- the Web service technology, any technology can be used. A User Task for instance can be implemented using WSHumanTask \
- by setting the implementation attribute to http://docs.oasis-open.org/ns/bpel4people/ws-humantask/protocol/200803.
-UI_BusinessRuleTask_long_description = A Business Rule Task provides a mechanism for the Process to provide input to a Business Rules Engine and to get \
- the output of calculations that the Business Rules Engine might provide.
-UI_ServiceTask_long_description = A Service Task is a Task that uses some sort of service, which could be a Web service or an automated application.
-UI_SendTask_long_description = A Send Task is a simple Task that is designed to send a Message to an external Participant (relative to the \
- Process). Once the Message has been sent, the Task is completed.
-UI_ReceiveTask_long_description = A Receive Task is a simple Task that is designed to wait for a Message to arrive from an external Participant \
- (relative to the Process). Once the Message has been received, the Task is completed.
-UI_ChoreographyTask_long_description = A Choreography Task is an atomic Activity in a Choreography Process. It represents an Interaction, which is one \
- or two Message exchanges between two Participants.
-UI_ScriptTask_long_description = A Script Task is executed by a business process engine.\
- The modeler or implementer defines a script in a language that the engine can interpret.\
- When the Task is ready to start, the engine will execute the script.\
- When the script is completed, the Task will also be completed.
-
-UI_StartEvent_long_description = As the name implies, the Start Event indicates where a particular Process will start. In terms of Sequence Flows, the\
- Start Event starts the flow of the Process, and thus, will not have any incoming Sequence Flows and no Sequence\
- Flow can connect to a Start Event. \
- A Start Event may have one or more event triggers (Event Definitions) which cause the Process to be initiated.
-UI_EndEvent_long_description = As the name implies, the End Event indicates where a Process will end. In terms of Sequence Flows, the End \
- Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flows and no Sequence Flow can \
- connect from an End Event. \
- An End Event may have one or more triggers (Event Definitions), which are passed back to an invoking or containing Process (if any).
-UI_IntermediateThrowEvent_long_description = The Intermediate Throw Event is used to report some kind of condition (Event Definition) to \
- an invoking or containing Process. The receiving Process should be designed so that it is prepared to handle the event with either a \
- Start Event, Intermediate Catch Event or a Boundary Event.
-UI_IntermediateCatchEvent_long_description = The Intermediate Catch Event is used to handle some kind of condition (Event Definition) \
- that has occurred within the process or in an external process.
-UI_BoundaryEvent_long_description = Boundary Events are attached to the borders of an Activity and are used to handle conditions (Event Definitions) \
- that may have resulted during execution of the Activity.
-
-UI_DataStore_long_description = A DataStore provides a mechanism for Activities to retrieve or update stored information that will persist beyond the scope of the Process. \
- The same DataStore can be visualized, through a Data Store Reference, in one or more places in the Process.
-UI_DataInput_long_description = Activities and Processes often required data in order to execute. In addition they may produce data during or as a result of execution. \
- Data requirements are captured as Data Inputs and Input Sets.
-UI_DataOutput_long_description = Activities and Processes often required data in order to execute. In addition they may produce data during or as a result of execution. \
- Data that is produced is captured using Data Outputs and Output Sets.
-UI_Message_long_description = A Message represents the content of a communication between two Participants.
-
-UI_ExclusiveGateway_long_description = A diverging Exclusive Gateway (Decision) is used to create alternative paths within a Process flow. This is basically \
- the "diversion point in the road" for a Process. For a given instance of the Process, only one of the paths can be taken. \
- A Decision can be thought of as a question that is asked at a particular point in the Process. The question has a defined \
- set of alternative answers. Each answer is associated with a condition Expression that is associated with a Gateway's \
- outgoing Sequence Flows.
-UI_InclusiveGateway_long_description = A diverging Inclusive Gateway (Inclusive Decision) can be used to create alternative but also parallel paths within a \
- Process flow. Unlike the Exclusive Gateway, all condition Expressions are evaluated. The true evaluation of one \
- condition Expression does not exclude the evaluation of other condition Expressions. All Sequence Flows with \
- a true evaluation will be traversed by a token. Since each path is considered to be independent, all combinations of the \
- paths MAY be taken, from zero to all. However, it should be designed so that at least one path is taken.
-UI_ParallelGateway_long_description = A Parallel Gateway is used to synchronize (combine) parallel flows and to create parallel flows. \
- A Parallel Gateway creates parallel paths without checking any conditions; each outgoing Sequence Flow is passed control upon execution of this Gateway. \
- For incoming flows, the Parallel Gateway will wait for all incoming flows before triggering the flow through its outgoing Sequence Flows.
-UI_EventBasedGateway_long_description = The Event-Based Gateway represents a branching point in the Process where the alternative paths that follow the \
- Gateway are based on Events that occur, rather than the evaluation of Expressions using Process data (as with an \
- Exclusive or Inclusive Gateway). A specific Event, usually the receipt of a Message, determines the path that will \
- be taken. Basically, the decision is made by another Participant, based on data that is not visible to Process, thus, \
- requiring the use of the Event-Based Gateway.
-UI_ComplexGateway_long_description = The Complex Gateway can be used to model complex synchronization behavior. An Expression \
- is used to describe the precise behavior. For example, this Expression could specify that \
- three out of five incoming Sequence Flows are needed to activate the Gateway. The outgoing paths that are taken \
- by the Gateway is determined by conditions on the outgoing Sequence Flows as in the split behavior of the Inclusive Gateway.
-
-UI_CallActivity_long_description = A Call Activity identifies a point in the Process where a global Process or a Global Task is used.\
- The Call Activity acts as a "wrapper" for the invocation of a global Process or Global Task within the execution.\
- The activation of a call Activity results in the transfer of control to the called global Process or Global Task.
-UI_Participant_long_description = A Pool is the graphical representation of a Participant in a Collaboration or Choreography and can be a \
- specific PartnerEntity (e.g., a company) or can be a more general PartnerRole (e.g., a buyer, seller, or \
- manufacturer). A Pool MAY or MAY NOT reference a Process. A Pool is NOT REQUIRED to contain a Process, \
- i.e., it can be a black box.
-UI_Lane_long_description = A Lane is a sub-partition within a Process (often within a Pool) used to organize and categorize Activities within a Pool. \
- Lanes are often used for such things as internal roles (e.g., Manager, \
- Associate), systems (e.g., an enterprise application), an internal department (e.g., shipping, finance), etc. In addition, \
- Lanes can be nested or defined in a matrix. For example, there could be an outer set of Lanes for \
- company departments and then an inner set of Lanes for roles within each department.
-UI_SubProcess_long_description = A Sub-Process is an Activity whose internal details have been modeled using Activities, Gateways, Events, and \
- Sequence Flows. Sub-Processes define a contextual scope that can be used for attribute visibility, transactional \
- scope, for the handling of exceptions, of Events, or for compensation. A Sub-Process can be in a collapsed view that hides its details \
- or in an expanded view that shows its details within the view of the Process in which it is contained.
-UI_Group_long_description = The Group object is an Artifact that provides a visual mechanism to group elements of a diagram informally. \
- A Group is not an Activity or any Flow Object, and, therefore, cannot connect to Sequence \
- Flows or Message Flows. In addition, Groups are not constrained by restrictions of Pools and Lanes. This means \
- that a Group can stretch across the boundaries of a Pool to surround Diagram elements (see Figure 8.14), often to \
- identify Activities that exist within a distributed business-to-business transaction. \
- Groups are often used to highlight certain sections of a Diagram and do not affect the flow of the Process.
-UI_SubChoreography_long_description = A Sub-Choreography is a compound Activity in that it has detail that is defined as a flow of other Activities, in this \
- case, a Choreography. Each Sub-Choreography involves two or more Participants. The name of the Sub-Choreography and each of the Participants are all displayed \
- in the different bands that make up the graphical notation. There are two or more Participant Bands and one Sub-Process Name Band.
-UI_CallActivity_long_description = A Call Activity identifies a point in the Process where a global Process or a Global Task is used. The Call \
- Activity acts as a wrapper for the invocation of a global Process or Global Task within the execution. The \
- activation of a call Activity results in the transfer of control to the called global Process or Global Task.
-UI_Conversation_long_description = A Conversation is an atomic element for a Conversation (Collaboration) diagram. It represents a set of Message \
- Flows grouped together based on a concept and/or a CorrelationKey. A Conversation will involve two or more Participants.
-UI_CallConversation_long_description = A Call Conversation identifies a place in the Conversation (Collaboration) where a global Conversation or a \
- GlobalConversation is used.
-UI_SubConversation_long_description = A Sub-Conversation is a ConversationNode that is a hierarchical division within the parent Collaboration. \
- A Sub-Conversation is a graphical object within a Collaboration, but it also can be expanded to show the lower level \
- details of the Conversation, which consist of Message Flows, Conversations, and/or other Sub-Conversations. \
- The Sub-Conversation shares the Participants of its parent Conversation.
+InputMessageAdapter_0=Input Message
+MessageAdapter_Message_1=Message
+OperationAdapter_Operation_1=Operation
+OperationAdapter_0={0} - {1}
+OutputMessageAdapter_0=Output Message
+PartAdapter_Part_1=Part
+PortTypeAdapter_Port_Type_2=Interface
+FaultAdapter_Fault_1=Fault
+XSDAttributeDeclarationAdapter_XSD_Attribute_1=XSD Attribute
+XSDElementDeclarationAdapter_XSD_Element_1=XSD Element
+XSDTypeDefinitionAdapter_XSD_Type_1=XSD Type
+XSDSimpleTypeDefinitionAdapter_0=Simple Type Definition
+XSDComplexTypeDefinitionAdapter_0=Complex Type Definition
+XSDSchemaAdapter_0=Schema
+XSDSchemaAdapter_1=Schema targetNamespace={0}
+XSDSchemaTreeNode_0=Schema
+XSDSchemaTreeNode_1=Schema targetNamespace={0}
+
+SchemaImportDialog_0=Browse for a WSDL File to Import
+SchemaImportDialog_1=Browse for an XML File to Import
+SchemaImportDialog_2=Browse for an XML Schema File to Import
+SchemaImportDialog_3=Import Type
+SchemaImportDialog_4=Import Source
+SchemaImportDialog_5=Workspace
+SchemaImportDialog_6=File System
+SchemaImportDialog_7=URL
+SchemaImportDialog_8=Location:
+SchemaImportDialog_9=Browse ...
+SchemaImportDialog_10=Select a Workspace Resource to Import
+SchemaImportDialog_11=Available Types:
+SchemaImportDialog_12=Structure:
+SchemaImportDialog_13=Invalid location syntax.
+SchemaImportDialog_14=Ports and Partner Links:
+SchemaImportDialog_15=WSIL
+SchemaImportDialog_16=Filter by name
+SchemaImportDialog_17=Loading {0} ...
+SchemaImportDialog_18=Loaded {0} [{1}ms]
+SchemaImportDialog_19=Failed to load {0} [{1}ms]
+
+SchemaImportDialog_20=XML
+SchemaImportDialog_21=XML Schema (XSD)
+SchemaImportDialog_22=Web Service Definition (WSDL)
+SchemaImportDialog_23=Java
+SchemaImportDialog_24=Browse for a Java type to Import
+SchemaImportDialog_25=Public Java types and members:
+SchemaImportDialog_26=Load
+SchemaImportDialog_27=Type:
+SchemaImportDialog_28=BPMN 2.0 Diagram (BPMN2)
+SchemaImportDialog_29=Browse for a BPMN2 File to Import
+SchemaImportDialog_30=Interfaces and Participants:
+SchemaImportDialog_31=Please select a Java Type
+
+ModelTreeLabelProvider_s1_s2={0} \: {1}
+
+
+Bpmn2PreferencePage_HomePage_Description General settings for the BPMN2 Modeler
+Bpmn2PreferencePage_EditorPage_Description BPMN2 Modeler Appearance
+
+WSILPreferencePage_WSIL_1 = Document URL:
+WSILPreferencePage_WSIL_2 = Browse ...
+WSILPreferencePage_WSIL_Abstract = Abstract
+WSILPreferencePage_WSIL_Namespace = Ref Namespace
+WSILPreferencePage_WSIL_Location = Location
+WSILPreferencePage_WSIL_Add = Add
+WSILPreferencePage_WSIL_Remove = Remove
+WSILPreferencePage_WSIL_Index = #
+WSILPreferencePage_WSIL_DocumentNotLoaded = WSIL Document not loaded.
+WSILPreferencePage_WSIL_NameLimit = WSIL Document's name should be ended with .wsil
+WSILPreferencePage_WSIL_MoveDown = Move Down
+WSILPreferencePage_WSIL_MoveUp = Move Up
+WSILPreferencePage_WSIL_OpenInBrowser = Open in Browser
+WSILPreferencePage_WSIL_EnterDescription = <enter description>
+WSILPreferencePage_WSIL_EnterLocation = <enter location>
+#
+# This has \n for a reason. The wrapping in the widget works, but not as expected.
+WSILPreferencePage_WSIL_Description = The document above contains links to other WSIL documents shown below.\nYou can add or remove WSIL links to/from the above document.\nThe result will be shown in the WSIL browser of the editor.
+
+#
+# Long descriptions of BPMN2 elements
+UI_UnknownDiagram_long_description = The Diagram Type has not yet been defined.
+UI_ProcessDiagram_long_description = A Process Diagram describes a sequence or flow of Activities in an organization with the objective of carrying out work. \
+ A Process is depicted as a graph of Flow Elements, which are a set of Activities, Events, Gateways, and \
+ Sequence Flows that define finite execution semantics. Processes can be defined at any level from \
+ enterprise-wide Processes to Processes performed by a single person. Low-level Processes can be grouped \
+ together to achieve a common business goal.
+UI_ChoreographyDiagram_long_description = A Choreography Diagram formalizes the way business \
+ Participants coordinate their interactions. The focus is not on orchestrations of the work performed within these \
+ Participants, but rather on the exchange of information (Messages) between these Participants.
+UI_CollaborationDiagram_long_description = A Collaboration usually contains two or more Pools, representing the Participants in the Collaboration. \
+ The Message exchange between the Participants is shown by a Message Flow that connects two Pools (or the objects \
+ within the Pools). The Messages associated with the Message Flows MAY also be shown. \
+ A Pool MAY be empty, a "black box", or MAY show a Process within ("white box"). Choreographies MAY be shown in \
+ between the Pools as they bisect the Message Flows between the Pools. All combinations of Pools, Processes, \
+ and a Choreography are allowed in a Collaboration.
+UI_SequenceFlow_long_description = A Sequence Flow is used to show the order that \
+ Activities will be performed in a Process or a Choreography. \
+ A Sequence Flow can optionally define a condition Expression, indicating that control will be passed down the \
+ Sequence Flow only if the Expression evaluates to true. This Expression is typically used when the source of \
+ the Sequence Flow is a Gateway or an Activity. \
+ A Sequence Flow that has an Exclusive, Inclusive, or Complex Gateway or an Activity as its source can also be \
+ defined as "default". Such a Sequence Flow will have a marker to show that it is a default flow. The default \
+ Sequence Flow is taken only if all the other outgoing Sequence Flows from the Activity or \
+ Gateway are not valid (i.e., their condition Expressions are false).
+UI_MessageFlow_long_description = A Message Flow is used to show the flow of Messages between two Participants that are \
+ prepared to send and receive them. In BPMN, two separate Pools in a Collaboration Diagram will represent the two \
+ Participants (e.g., PartnerEntities and/or PartnerRoles).
+UI_Association_long_description = An Association is used to link information and Artifacts with BPMN graphical elements. \
+ Text Annotations and other Artifacts can be Associated with the graphical elements. An arrowhead on the Association indicates \
+ a direction of flow (e.g., data), when appropriate.
+UI_Annotation_long_description = Text Annotations are a mechanism for providing additional information to the reader of a BPMN Diagram. \
+ The Text Annotation object can be connected to a specific object on the Diagram with an Association, but does not \
+ affect the flow of the Process.
+
+UI_Task_long_description = A Task is an atomic Activity that is included within a Process. \
+ A Task is used when the work in the Process is not broken down to a finer level of Process detail.
+UI_ManualTask_long_description = A Manual Task is a Task that is not managed by any business process engine. It can be considered as an unmanaged \
+ Task, unmanaged in the sense of that the business process engine does not track the start and completion of such a Task. \
+ An example of this could be a paper based instruction for a telephone technician to install a telephone at a customer location.
+UI_UserTask_long_description = A User Task is a typical workflow Task where a human performer performs the Task with the assistance of a \
+ software application. The lifecycle of the Task is managed by a software component (called task manager) and is \
+ typically executed in the context of a Process. \
+ The User Task can be implemented using different technologies, specified by the implementation attribute. Besides \
+ the Web service technology, any technology can be used. A User Task for instance can be implemented using WSHumanTask \
+ by setting the implementation attribute to http://docs.oasis-open.org/ns/bpel4people/ws-humantask/protocol/200803.
+UI_BusinessRuleTask_long_description = A Business Rule Task provides a mechanism for the Process to provide input to a Business Rules Engine and to get \
+ the output of calculations that the Business Rules Engine might provide.
+UI_ServiceTask_long_description = A Service Task is a Task that uses some sort of service, which could be a Web service or an automated application.
+UI_SendTask_long_description = A Send Task is a simple Task that is designed to send a Message to an external Participant (relative to the \
+ Process). Once the Message has been sent, the Task is completed.
+UI_ReceiveTask_long_description = A Receive Task is a simple Task that is designed to wait for a Message to arrive from an external Participant \
+ (relative to the Process). Once the Message has been received, the Task is completed.
+UI_ChoreographyTask_long_description = A Choreography Task is an atomic Activity in a Choreography Process. It represents an Interaction, which is one \
+ or two Message exchanges between two Participants.
+UI_ScriptTask_long_description = A Script Task is executed by a business process engine.\
+ The modeler or implementer defines a script in a language that the engine can interpret.\
+ When the Task is ready to start, the engine will execute the script.\
+ When the script is completed, the Task will also be completed.
+
+UI_StartEvent_long_description = As the name implies, the Start Event indicates where a particular Process will start. In terms of Sequence Flows, the\
+ Start Event starts the flow of the Process, and thus, will not have any incoming Sequence Flows and no Sequence\
+ Flow can connect to a Start Event. \
+ A Start Event may have one or more event triggers (Event Definitions) which cause the Process to be initiated.
+UI_EndEvent_long_description = As the name implies, the End Event indicates where a Process will end. In terms of Sequence Flows, the End \
+ Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flows and no Sequence Flow can \
+ connect from an End Event. \
+ An End Event may have one or more triggers (Event Definitions), which are passed back to an invoking or containing Process (if any).
+UI_IntermediateThrowEvent_long_description = The Intermediate Throw Event is used to report some kind of condition (Event Definition) to \
+ an invoking or containing Process. The receiving Process should be designed so that it is prepared to handle the event with either a \
+ Start Event, Intermediate Catch Event or a Boundary Event.
+UI_IntermediateCatchEvent_long_description = The Intermediate Catch Event is used to handle some kind of condition (Event Definition) \
+ that has occurred within the process or in an external process.
+UI_BoundaryEvent_long_description = Boundary Events are attached to the borders of an Activity and are used to handle conditions (Event Definitions) \
+ that may have resulted during execution of the Activity.
+
+UI_DataStore_long_description = A DataStore provides a mechanism for Activities to retrieve or update stored information that will persist beyond the scope of the Process. \
+ The same DataStore can be visualized, through a Data Store Reference, in one or more places in the Process.
+UI_DataInput_long_description = Activities and Processes often required data in order to execute. In addition they may produce data during or as a result of execution. \
+ Data requirements are captured as Data Inputs and Input Sets.
+UI_DataOutput_long_description = Activities and Processes often required data in order to execute. In addition they may produce data during or as a result of execution. \
+ Data that is produced is captured using Data Outputs and Output Sets.
+UI_Message_long_description = A Message represents the content of a communication between two Participants.
+
+UI_ExclusiveGateway_long_description = A diverging Exclusive Gateway (Decision) is used to create alternative paths within a Process flow. This is basically \
+ the "diversion point in the road" for a Process. For a given instance of the Process, only one of the paths can be taken. \
+ A Decision can be thought of as a question that is asked at a particular point in the Process. The question has a defined \
+ set of alternative answers. Each answer is associated with a condition Expression that is associated with a Gateway's \
+ outgoing Sequence Flows.
+UI_InclusiveGateway_long_description = A diverging Inclusive Gateway (Inclusive Decision) can be used to create alternative but also parallel paths within a \
+ Process flow. Unlike the Exclusive Gateway, all condition Expressions are evaluated. The true evaluation of one \
+ condition Expression does not exclude the evaluation of other condition Expressions. All Sequence Flows with \
+ a true evaluation will be traversed by a token. Since each path is considered to be independent, all combinations of the \
+ paths MAY be taken, from zero to all. However, it should be designed so that at least one path is taken.
+UI_ParallelGateway_long_description = A Parallel Gateway is used to synchronize (combine) parallel flows and to create parallel flows. \
+ A Parallel Gateway creates parallel paths without checking any conditions; each outgoing Sequence Flow is passed control upon execution of this Gateway. \
+ For incoming flows, the Parallel Gateway will wait for all incoming flows before triggering the flow through its outgoing Sequence Flows.
+UI_EventBasedGateway_long_description = The Event-Based Gateway represents a branching point in the Process where the alternative paths that follow the \
+ Gateway are based on Events that occur, rather than the evaluation of Expressions using Process data (as with an \
+ Exclusive or Inclusive Gateway). A specific Event, usually the receipt of a Message, determines the path that will \
+ be taken. Basically, the decision is made by another Participant, based on data that is not visible to Process, thus, \
+ requiring the use of the Event-Based Gateway.
+UI_ComplexGateway_long_description = The Complex Gateway can be used to model complex synchronization behavior. An Expression \
+ is used to describe the precise behavior. For example, this Expression could specify that \
+ three out of five incoming Sequence Flows are needed to activate the Gateway. The outgoing paths that are taken \
+ by the Gateway is determined by conditions on the outgoing Sequence Flows as in the split behavior of the Inclusive Gateway.
+
+UI_CallActivity_long_description = A Call Activity identifies a point in the Process where a global Process or a Global Task is used.\
+ The Call Activity acts as a "wrapper" for the invocation of a global Process or Global Task within the execution.\
+ The activation of a call Activity results in the transfer of control to the called global Process or Global Task.
+UI_Participant_long_description = A Pool is the graphical representation of a Participant in a Collaboration or Choreography and can be a \
+ specific PartnerEntity (e.g., a company) or can be a more general PartnerRole (e.g., a buyer, seller, or \
+ manufacturer). A Pool MAY or MAY NOT reference a Process. A Pool is NOT REQUIRED to contain a Process, \
+ i.e., it can be a black box.
+UI_Lane_long_description = A Lane is a sub-partition within a Process (often within a Pool) used to organize and categorize Activities within a Pool. \
+ Lanes are often used for such things as internal roles (e.g., Manager, \
+ Associate), systems (e.g., an enterprise application), an internal department (e.g., shipping, finance), etc. In addition, \
+ Lanes can be nested or defined in a matrix. For example, there could be an outer set of Lanes for \
+ company departments and then an inner set of Lanes for roles within each department.
+UI_SubProcess_long_description = A Sub-Process is an Activity whose internal details have been modeled using Activities, Gateways, Events, and \
+ Sequence Flows. Sub-Processes define a contextual scope that can be used for attribute visibility, transactional \
+ scope, for the handling of exceptions, of Events, or for compensation. A Sub-Process can be in a collapsed view that hides its details \
+ or in an expanded view that shows its details within the view of the Process in which it is contained.
+UI_Group_long_description = The Group object is an Artifact that provides a visual mechanism to group elements of a diagram informally. \
+ A Group is not an Activity or any Flow Object, and, therefore, cannot connect to Sequence \
+ Flows or Message Flows. In addition, Groups are not constrained by restrictions of Pools and Lanes. This means \
+ that a Group can stretch across the boundaries of a Pool to surround Diagram elements (see Figure 8.14), often to \
+ identify Activities that exist within a distributed business-to-business transaction. \
+ Groups are often used to highlight certain sections of a Diagram and do not affect the flow of the Process.
+UI_SubChoreography_long_description = A Sub-Choreography is a compound Activity in that it has detail that is defined as a flow of other Activities, in this \
+ case, a Choreography. Each Sub-Choreography involves two or more Participants. The name of the Sub-Choreography and each of the Participants are all displayed \
+ in the different bands that make up the graphical notation. There are two or more Participant Bands and one Sub-Process Name Band.
+UI_CallActivity_long_description = A Call Activity identifies a point in the Process where a global Process or a Global Task is used. The Call \
+ Activity acts as a wrapper for the invocation of a global Process or Global Task within the execution. The \
+ activation of a call Activity results in the transfer of control to the called global Process or Global Task.
+UI_Conversation_long_description = A Conversation is an atomic element for a Conversation (Collaboration) diagram. It represents a set of Message \
+ Flows grouped together based on a concept and/or a CorrelationKey. A Conversation will involve two or more Participants.
+UI_CallConversation_long_description = A Call Conversation identifies a place in the Conversation (Collaboration) where a global Conversation or a \
+ GlobalConversation is used.
+UI_SubConversation_long_description = A Sub-Conversation is a ConversationNode that is a hierarchical division within the parent Collaboration. \
+ A Sub-Conversation is a graphical object within a Collaboration, but it also can be expanded to show the lower level \
+ details of the Conversation, which consist of Message Flows, Conversations, and/or other Sub-Conversations. \
+ The Sub-Conversation shares the Participants of its parent Conversation.
UI_TextAnnotation_long_description = Text Annotations provide additional information to the reader about a BPMN diagram.
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorPreferencePage.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorPreferencePage.java
index 49ee9a8..04129b7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorPreferencePage.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorPreferencePage.java
@@ -1,499 +1,499 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.preferences;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map.Entry;
-
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.preferences.ShapeStyle;
-import org.eclipse.bpmn2.modeler.ui.FeatureMap;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.graphiti.mm.algorithms.styles.Font;
-import org.eclipse.graphiti.util.IColorConstant;
-import org.eclipse.jface.preference.ColorSelector;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.resource.StringConverter;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FontDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.osgi.service.prefs.BackingStoreException;
-
-
-@SuppressWarnings("nls")
-public class Bpmn2EditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- Bpmn2Preferences preferences;
- ListViewer elementsListViewer;
- List<Class> allElements;
- Composite styleEditors;
- Composite container;
- LinkedHashMap<Class, ShapeStyle> shapeStyles;
- Class currentSelection;
- ColorControl shapeBackground;
- ColorControl shapePrimarySelectedColor;
- ColorControl shapeSecondarySelectedColor;
- ColorControl shapeForeground;
- FontControl textFont;
- ColorControl textColor;
- boolean debug;
-
- public Bpmn2EditorPreferencePage() {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
- setDescription(Messages.Bpmn2PreferencePage_EditorPage_Description);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- @Override
- public void init(IWorkbench workbench) {
-
- preferences = Bpmn2Preferences.getInstance();
-
- allElements = new ArrayList<Class>();
- allElements.addAll(FeatureMap.CONNECTORS);
- allElements.addAll(FeatureMap.EVENTS);
- allElements.addAll(FeatureMap.GATEWAYS);
- allElements.addAll(FeatureMap.TASKS);
- allElements.addAll(FeatureMap.DATA);
- allElements.addAll(FeatureMap.OTHER);
- Collections.sort(allElements, new Comparator<Class>() {
-
- @Override
- public int compare(Class arg0, Class arg1) {
- return arg0.getSimpleName().compareTo(arg1.getSimpleName());
- }
-
- });
- }
-
- @Override
- protected Control createContents(Composite parent) {
- container = new Composite(parent, SWT.NONE);
- container.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false,1,1));
- container.setLayout(new GridLayout(2, false));
- container.setFont(parent.getFont());
-
- elementsListViewer = new ListViewer(container, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- elementsListViewer.getControl().setFont(parent.getFont());
- GridData data = new GridData(SWT.FILL,SWT.TOP,true,false,1,1);
- data.heightHint = 200;
- elementsListViewer.getControl().setLayoutData(data);
-
- elementsListViewer.setContentProvider(new BEListContentProvider());
- elementsListViewer.setLabelProvider(new BEListLabelProvider());
- elementsListViewer.addSelectionChangedListener(new BEListSelectionChangedListener());
-
- styleEditors = new Composite(container, SWT.NONE);
- styleEditors.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false,1,1));
- GridLayout layout = new GridLayout(1,false);
- layout.verticalSpacing = 0;
- styleEditors.setLayout(layout);
- styleEditors.setFont(parent.getFont());
- styleEditors.setVisible(false);
-
- shapeBackground = new ColorControl("&Fill Color:",styleEditors);
- shapeBackground.addSelectionListener( new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- ShapeStyle ss = shapeStyles.get(currentSelection);
- IColorConstant c = shapeBackground.getSelectedColor();
- if (!ShapeStyle.compare(ss.getShapeBackground(),c)) {
- // update secondary colors
- ss.setDefaultColors(c);
- shapePrimarySelectedColor.setSelectedColor(ss.getShapePrimarySelectedColor());
- shapeSecondarySelectedColor.setSelectedColor(ss.getShapeSecondarySelectedColor());
- shapeForeground.setSelectedColor(ss.getShapeForeground());
- textColor.setSelectedColor(ss.getTextColor());
- }
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- });
- shapeForeground = new ColorControl("&Foreground Color:",styleEditors);
- shapePrimarySelectedColor = new ColorControl("&Selected Color:",styleEditors);
- shapeSecondarySelectedColor = new ColorControl("&Multi-Selected Color:",styleEditors);
- textColor = new ColorControl("&Label Color:",styleEditors);
- textFont = new FontControl("Label &Font:",styleEditors);
-
- loadStyleEditors();
-
- return container;
- }
-
- private void saveStyleEditors() {
- if (currentSelection!=null) {
- ShapeStyle ss = shapeStyles.get(currentSelection);
- ss.setShapeBackground(shapeBackground.getSelectedColor());
- ss.setShapePrimarySelectedColor(shapePrimarySelectedColor.getSelectedColor());
- ss.setShapeSecondarySelectedColor(shapeSecondarySelectedColor.getSelectedColor());
- ss.setShapeForeground(shapeForeground.getSelectedColor());
- ss.setTextFont(textFont.getSelectedFont());
- ss.setTextColor(textColor.getSelectedColor());
- }
- }
-
- private void loadStyleEditors() {
- if (shapeStyles==null) {
- shapeStyles = new LinkedHashMap<Class, ShapeStyle>();
- for (Class c : allElements) {
- ShapeStyle ss = preferences.getShapeStyle(c);
- shapeStyles.put(c, ss);
- if (debug) {
- IColorConstant foreground = ss.getShapeForeground();
- IColorConstant background = ss.getShapeBackground();
- IColorConstant textColor = ss.getTextColor();
- Font font = ss.getTextFont();
- System.out.println("\t\t<style object=\""+c.getSimpleName()+"\""+
- " foreground=\""+ShapeStyle.colorToString(foreground)+"\""+
- " background=\""+ShapeStyle.colorToString(background)+"\""+
- " textColor=\""+ShapeStyle.colorToString(textColor)+"\""+
- " font=\""+ShapeStyle.fontToString(font)+"\"/>");
- }
- }
- elementsListViewer.setInput(shapeStyles);
- currentSelection = null;
- elementsListViewer.setSelection(null);
- styleEditors.setVisible(false);
- }
-
- IStructuredSelection sel = (IStructuredSelection)elementsListViewer.getSelection();
- if (sel!=null && sel.getFirstElement()!=null) {
- Class c = (Class)sel.getFirstElement();
- ShapeStyle ss = shapeStyles.get(c);
-
- shapeBackground.setSelectedColor(ss.getShapeBackground());
- shapePrimarySelectedColor.setSelectedColor(ss.getShapePrimarySelectedColor());
- shapeSecondarySelectedColor.setSelectedColor(ss.getShapeSecondarySelectedColor());
- shapeForeground.setSelectedColor(ss.getShapeForeground());
- textFont.setSelectedFont(ss.getTextFont());
- textColor.setSelectedColor(ss.getTextColor());
-
- boolean visible = true;
- if (FeatureMap.CONNECTORS.contains(c)) {
- visible = false;
- }
- shapeBackground.setVisible(visible);
- ((GridData)shapeBackground.getLayoutData()).exclude = !visible;
- shapePrimarySelectedColor.setVisible(visible);
- ((GridData)shapePrimarySelectedColor.getLayoutData()).exclude = !visible;
- shapeSecondarySelectedColor.setVisible(visible);
- ((GridData)shapeSecondarySelectedColor.getLayoutData()).exclude = !visible;
- container.layout();
- }
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- try {
- preferences.restoreDefaults(false);
- shapeStyles = null;
- loadStyleEditors();
- preferences.save();
- }
- catch(Exception e) {
- }
- }
-
- @Override
- public boolean performOk() {
- saveStyleEditors();
- for (Entry<Class, ShapeStyle> entry : shapeStyles.entrySet()) {
- preferences.setShapeStyle(entry.getKey(), entry.getValue());
- }
- try {
- preferences.save();
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- return super.performOk();
- }
-
- public class BEListContentProvider implements IStructuredContentProvider {
-
- List<Class> list;
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput!=null) {
- list = new ArrayList<Class>();
- list.addAll( ((LinkedHashMap<Class, ShapeStyle>)newInput).keySet() );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements(Object inputElement) {
- if (list!=null) {
- return list.toArray();
- }
- return null;
- }
-
- }
-
- public class BEListLabelProvider extends LabelProvider {
-
- @Override
- public String getText(Object element) {
- if (element instanceof Class)
- return ((Class)element).getSimpleName();
- return "";
- }
- }
-
- public class BEListSelectionChangedListener implements ISelectionChangedListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection sel = (IStructuredSelection)elementsListViewer.getSelection();
- if (currentSelection!=null) {
- saveStyleEditors();
- }
-
- if (sel!=null && sel.getFirstElement()!=null) {
- styleEditors.setVisible(true);
- currentSelection = (Class)sel.getFirstElement();
- }
- else
- styleEditors.setVisible(false);
-
- loadStyleEditors();
- }
-
- }
-
- public class ColorControl extends Composite {
- private ColorSelector colorSelector;
- private Label selectorLabel;
- private List<SelectionListener> listeners;
-
- public ColorControl(String labelText, Composite parent) {
- super(parent, SWT.NONE);
- this.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
- this.setLayout(new GridLayout(2, false));
-
- selectorLabel = new Label(this, SWT.LEFT);
- selectorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
- selectorLabel.setFont(parent.getFont());
- selectorLabel.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- selectorLabel = null;
- }
- });
- selectorLabel.setText(labelText);
-
- colorSelector = new ColorSelector(this);
- colorSelector.getButton().setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
- colorSelector.getButton().addSelectionListener( new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (listeners!=null) {
- for (SelectionListener listener : listeners)
- listener.widgetSelected(e);
- }
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- });
- }
-
- public void addSelectionListener(SelectionListener listener) {
- if (listeners==null)
- listeners = new ArrayList<SelectionListener>();
- listeners.add(listener);
- }
-
- public void removeSelectionListener(SelectionListener listener) {
- if (listeners==null)
- return;
- listeners.remove(listener);
- if (listeners.size()==0)
- listeners = null;
- }
-
- /**
- * @return
- */
- public IColorConstant getSelectedColor() {
- return ShapeStyle.RGBToColor(colorSelector.getColorValue());
- }
-
- public void setSelectedColor(IColorConstant c) {
- RGB rgb = ShapeStyle.colorToRGB(c);
- colorSelector.setColorValue(rgb);
- }
- }
-
- public class FontControl extends Composite {
-
- /**
- * The change font button, or <code>null</code> if none
- * (before creation and after disposal).
- */
- private Button changeFontButton = null;
-
- /**
- * Font data for the chosen font button, or <code>null</code> if none.
- */
- private FontData[] selectedFont;
-
- /**
- * The label that displays the selected font, or <code>null</code> if none.
- */
- private Label previewLabel;
- private Label selectorLabel;
-
- public FontControl(String labelText, Composite parent) {
- super(parent, SWT.NONE);
- this.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
- this.setLayout(new GridLayout(3, false));
-
- selectorLabel = new Label(this, SWT.LEFT);
- selectorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
- selectorLabel.setFont(parent.getFont());
- selectorLabel.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- selectorLabel = null;
- }
- });
- selectorLabel.setText(labelText);
-
- previewLabel = new Label(this, SWT.LEFT);
- previewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- previewLabel.setFont(parent.getFont());
- previewLabel.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- previewLabel = null;
- }
- });
-
- changeFontButton = new Button(this, SWT.PUSH);
- changeFontButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
- changeFontButton.setText("Change");
- changeFontButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- FontDialog fontDialog = new FontDialog(changeFontButton
- .getShell());
- if (selectedFont != null) {
- fontDialog.setFontList(selectedFont);
- }
- FontData font = fontDialog.open();
- if (font != null) {
- FontData[] oldFont = selectedFont;
- if (oldFont == null) {
- oldFont = JFaceResources.getDefaultFont().getFontData();
- }
- setSelectedFont(font);
-// fireValueChanged(VALUE, oldFont[0], font);
- }
-
- }
- });
- changeFontButton.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- changeFontButton = null;
- }
- });
- changeFontButton.setFont(parent.getFont());
-
- }
-
- public Font getSelectedFont() {
- if (selectedFont!=null && selectedFont.length>0)
- return ShapeStyle.fontDataToFont(selectedFont[0]);
- return null;
- }
-
- public void setSelectedFont(Font f) {
- setSelectedFont(ShapeStyle.fontToFontData(f));
- }
-
- public void setSelectedFont(FontData fd) {
-
- FontData[] bestFont = JFaceResources.getFontRegistry().filterData(
- new FontData[]{fd}, previewLabel.getDisplay());
-
- //if we have nothing valid do as best we can
- if (bestFont == null) {
- bestFont = getDefaultFontData();
- }
-
- //Now cache this value in the receiver
- this.selectedFont = bestFont;
-
- if (previewLabel != null) {
- previewLabel.setText(StringConverter.asString(selectedFont[0]));
- }
- }
-
- /**
- * Get the system default font data.
- * @return FontData[]
- */
- private FontData[] getDefaultFontData() {
- return previewLabel.getDisplay().getSystemFont().getFontData();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.preferences;
+
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.preferences.ShapeStyle;
+import org.eclipse.bpmn2.modeler.ui.FeatureMap;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.graphiti.mm.algorithms.styles.Font;
+import org.eclipse.graphiti.util.IColorConstant;
+import org.eclipse.jface.preference.ColorSelector;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.StringConverter;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FontDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.osgi.service.prefs.BackingStoreException;
+
+
+@SuppressWarnings("nls")
+public class Bpmn2EditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ Bpmn2Preferences preferences;
+ ListViewer elementsListViewer;
+ List<Class> allElements;
+ Composite styleEditors;
+ Composite container;
+ LinkedHashMap<Class, ShapeStyle> shapeStyles;
+ Class currentSelection;
+ ColorControl shapeBackground;
+ ColorControl shapePrimarySelectedColor;
+ ColorControl shapeSecondarySelectedColor;
+ ColorControl shapeForeground;
+ FontControl textFont;
+ ColorControl textColor;
+ boolean debug;
+
+ public Bpmn2EditorPreferencePage() {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription(Messages.Bpmn2PreferencePage_EditorPage_Description);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init(IWorkbench workbench) {
+
+ preferences = Bpmn2Preferences.getInstance();
+
+ allElements = new ArrayList<Class>();
+ allElements.addAll(FeatureMap.CONNECTORS);
+ allElements.addAll(FeatureMap.EVENTS);
+ allElements.addAll(FeatureMap.GATEWAYS);
+ allElements.addAll(FeatureMap.TASKS);
+ allElements.addAll(FeatureMap.DATA);
+ allElements.addAll(FeatureMap.OTHER);
+ Collections.sort(allElements, new Comparator<Class>() {
+
+ @Override
+ public int compare(Class arg0, Class arg1) {
+ return arg0.getSimpleName().compareTo(arg1.getSimpleName());
+ }
+
+ });
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ container = new Composite(parent, SWT.NONE);
+ container.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false,1,1));
+ container.setLayout(new GridLayout(2, false));
+ container.setFont(parent.getFont());
+
+ elementsListViewer = new ListViewer(container, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ elementsListViewer.getControl().setFont(parent.getFont());
+ GridData data = new GridData(SWT.FILL,SWT.TOP,true,false,1,1);
+ data.heightHint = 200;
+ elementsListViewer.getControl().setLayoutData(data);
+
+ elementsListViewer.setContentProvider(new BEListContentProvider());
+ elementsListViewer.setLabelProvider(new BEListLabelProvider());
+ elementsListViewer.addSelectionChangedListener(new BEListSelectionChangedListener());
+
+ styleEditors = new Composite(container, SWT.NONE);
+ styleEditors.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false,1,1));
+ GridLayout layout = new GridLayout(1,false);
+ layout.verticalSpacing = 0;
+ styleEditors.setLayout(layout);
+ styleEditors.setFont(parent.getFont());
+ styleEditors.setVisible(false);
+
+ shapeBackground = new ColorControl("&Fill Color:",styleEditors);
+ shapeBackground.addSelectionListener( new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ShapeStyle ss = shapeStyles.get(currentSelection);
+ IColorConstant c = shapeBackground.getSelectedColor();
+ if (!ShapeStyle.compare(ss.getShapeBackground(),c)) {
+ // update secondary colors
+ ss.setDefaultColors(c);
+ shapePrimarySelectedColor.setSelectedColor(ss.getShapePrimarySelectedColor());
+ shapeSecondarySelectedColor.setSelectedColor(ss.getShapeSecondarySelectedColor());
+ shapeForeground.setSelectedColor(ss.getShapeForeground());
+ textColor.setSelectedColor(ss.getTextColor());
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ });
+ shapeForeground = new ColorControl("&Foreground Color:",styleEditors);
+ shapePrimarySelectedColor = new ColorControl("&Selected Color:",styleEditors);
+ shapeSecondarySelectedColor = new ColorControl("&Multi-Selected Color:",styleEditors);
+ textColor = new ColorControl("&Label Color:",styleEditors);
+ textFont = new FontControl("Label &Font:",styleEditors);
+
+ loadStyleEditors();
+
+ return container;
+ }
+
+ private void saveStyleEditors() {
+ if (currentSelection!=null) {
+ ShapeStyle ss = shapeStyles.get(currentSelection);
+ ss.setShapeBackground(shapeBackground.getSelectedColor());
+ ss.setShapePrimarySelectedColor(shapePrimarySelectedColor.getSelectedColor());
+ ss.setShapeSecondarySelectedColor(shapeSecondarySelectedColor.getSelectedColor());
+ ss.setShapeForeground(shapeForeground.getSelectedColor());
+ ss.setTextFont(textFont.getSelectedFont());
+ ss.setTextColor(textColor.getSelectedColor());
+ }
+ }
+
+ private void loadStyleEditors() {
+ if (shapeStyles==null) {
+ shapeStyles = new LinkedHashMap<Class, ShapeStyle>();
+ for (Class c : allElements) {
+ ShapeStyle ss = preferences.getShapeStyle(c);
+ shapeStyles.put(c, ss);
+ if (debug) {
+ IColorConstant foreground = ss.getShapeForeground();
+ IColorConstant background = ss.getShapeBackground();
+ IColorConstant textColor = ss.getTextColor();
+ Font font = ss.getTextFont();
+ System.out.println("\t\t<style object=\""+c.getSimpleName()+"\""+
+ " foreground=\""+ShapeStyle.colorToString(foreground)+"\""+
+ " background=\""+ShapeStyle.colorToString(background)+"\""+
+ " textColor=\""+ShapeStyle.colorToString(textColor)+"\""+
+ " font=\""+ShapeStyle.fontToString(font)+"\"/>");
+ }
+ }
+ elementsListViewer.setInput(shapeStyles);
+ currentSelection = null;
+ elementsListViewer.setSelection(null);
+ styleEditors.setVisible(false);
+ }
+
+ IStructuredSelection sel = (IStructuredSelection)elementsListViewer.getSelection();
+ if (sel!=null && sel.getFirstElement()!=null) {
+ Class c = (Class)sel.getFirstElement();
+ ShapeStyle ss = shapeStyles.get(c);
+
+ shapeBackground.setSelectedColor(ss.getShapeBackground());
+ shapePrimarySelectedColor.setSelectedColor(ss.getShapePrimarySelectedColor());
+ shapeSecondarySelectedColor.setSelectedColor(ss.getShapeSecondarySelectedColor());
+ shapeForeground.setSelectedColor(ss.getShapeForeground());
+ textFont.setSelectedFont(ss.getTextFont());
+ textColor.setSelectedColor(ss.getTextColor());
+
+ boolean visible = true;
+ if (FeatureMap.CONNECTORS.contains(c)) {
+ visible = false;
+ }
+ shapeBackground.setVisible(visible);
+ ((GridData)shapeBackground.getLayoutData()).exclude = !visible;
+ shapePrimarySelectedColor.setVisible(visible);
+ ((GridData)shapePrimarySelectedColor.getLayoutData()).exclude = !visible;
+ shapeSecondarySelectedColor.setVisible(visible);
+ ((GridData)shapeSecondarySelectedColor.getLayoutData()).exclude = !visible;
+ container.layout();
+ }
+ }
+
+ @Override
+ protected void performDefaults() {
+ super.performDefaults();
+ try {
+ preferences.restoreDefaults(false);
+ shapeStyles = null;
+ loadStyleEditors();
+ preferences.save();
+ }
+ catch(Exception e) {
+ }
+ }
+
+ @Override
+ public boolean performOk() {
+ saveStyleEditors();
+ for (Entry<Class, ShapeStyle> entry : shapeStyles.entrySet()) {
+ preferences.setShapeStyle(entry.getKey(), entry.getValue());
+ }
+ try {
+ preferences.save();
+ } catch (BackingStoreException e) {
+ e.printStackTrace();
+ }
+ return super.performOk();
+ }
+
+ public class BEListContentProvider implements IStructuredContentProvider {
+
+ List<Class> list;
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (newInput!=null) {
+ list = new ArrayList<Class>();
+ list.addAll( ((LinkedHashMap<Class, ShapeStyle>)newInput).keySet() );
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (list!=null) {
+ return list.toArray();
+ }
+ return null;
+ }
+
+ }
+
+ public class BEListLabelProvider extends LabelProvider {
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof Class)
+ return ((Class)element).getSimpleName();
+ return "";
+ }
+ }
+
+ public class BEListSelectionChangedListener implements ISelectionChangedListener {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection sel = (IStructuredSelection)elementsListViewer.getSelection();
+ if (currentSelection!=null) {
+ saveStyleEditors();
+ }
+
+ if (sel!=null && sel.getFirstElement()!=null) {
+ styleEditors.setVisible(true);
+ currentSelection = (Class)sel.getFirstElement();
+ }
+ else
+ styleEditors.setVisible(false);
+
+ loadStyleEditors();
+ }
+
+ }
+
+ public class ColorControl extends Composite {
+ private ColorSelector colorSelector;
+ private Label selectorLabel;
+ private List<SelectionListener> listeners;
+
+ public ColorControl(String labelText, Composite parent) {
+ super(parent, SWT.NONE);
+ this.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ this.setLayout(new GridLayout(2, false));
+
+ selectorLabel = new Label(this, SWT.LEFT);
+ selectorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ selectorLabel.setFont(parent.getFont());
+ selectorLabel.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ selectorLabel = null;
+ }
+ });
+ selectorLabel.setText(labelText);
+
+ colorSelector = new ColorSelector(this);
+ colorSelector.getButton().setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
+ colorSelector.getButton().addSelectionListener( new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (listeners!=null) {
+ for (SelectionListener listener : listeners)
+ listener.widgetSelected(e);
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ });
+ }
+
+ public void addSelectionListener(SelectionListener listener) {
+ if (listeners==null)
+ listeners = new ArrayList<SelectionListener>();
+ listeners.add(listener);
+ }
+
+ public void removeSelectionListener(SelectionListener listener) {
+ if (listeners==null)
+ return;
+ listeners.remove(listener);
+ if (listeners.size()==0)
+ listeners = null;
+ }
+
+ /**
+ * @return
+ */
+ public IColorConstant getSelectedColor() {
+ return ShapeStyle.RGBToColor(colorSelector.getColorValue());
+ }
+
+ public void setSelectedColor(IColorConstant c) {
+ RGB rgb = ShapeStyle.colorToRGB(c);
+ colorSelector.setColorValue(rgb);
+ }
+ }
+
+ public class FontControl extends Composite {
+
+ /**
+ * The change font button, or <code>null</code> if none
+ * (before creation and after disposal).
+ */
+ private Button changeFontButton = null;
+
+ /**
+ * Font data for the chosen font button, or <code>null</code> if none.
+ */
+ private FontData[] selectedFont;
+
+ /**
+ * The label that displays the selected font, or <code>null</code> if none.
+ */
+ private Label previewLabel;
+ private Label selectorLabel;
+
+ public FontControl(String labelText, Composite parent) {
+ super(parent, SWT.NONE);
+ this.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ this.setLayout(new GridLayout(3, false));
+
+ selectorLabel = new Label(this, SWT.LEFT);
+ selectorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ selectorLabel.setFont(parent.getFont());
+ selectorLabel.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ selectorLabel = null;
+ }
+ });
+ selectorLabel.setText(labelText);
+
+ previewLabel = new Label(this, SWT.LEFT);
+ previewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ previewLabel.setFont(parent.getFont());
+ previewLabel.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ previewLabel = null;
+ }
+ });
+
+ changeFontButton = new Button(this, SWT.PUSH);
+ changeFontButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ changeFontButton.setText("Change");
+ changeFontButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ FontDialog fontDialog = new FontDialog(changeFontButton
+ .getShell());
+ if (selectedFont != null) {
+ fontDialog.setFontList(selectedFont);
+ }
+ FontData font = fontDialog.open();
+ if (font != null) {
+ FontData[] oldFont = selectedFont;
+ if (oldFont == null) {
+ oldFont = JFaceResources.getDefaultFont().getFontData();
+ }
+ setSelectedFont(font);
+// fireValueChanged(VALUE, oldFont[0], font);
+ }
+
+ }
+ });
+ changeFontButton.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ changeFontButton = null;
+ }
+ });
+ changeFontButton.setFont(parent.getFont());
+
+ }
+
+ public Font getSelectedFont() {
+ if (selectedFont!=null && selectedFont.length>0)
+ return ShapeStyle.fontDataToFont(selectedFont[0]);
+ return null;
+ }
+
+ public void setSelectedFont(Font f) {
+ setSelectedFont(ShapeStyle.fontToFontData(f));
+ }
+
+ public void setSelectedFont(FontData fd) {
+
+ FontData[] bestFont = JFaceResources.getFontRegistry().filterData(
+ new FontData[]{fd}, previewLabel.getDisplay());
+
+ //if we have nothing valid do as best we can
+ if (bestFont == null) {
+ bestFont = getDefaultFontData();
+ }
+
+ //Now cache this value in the receiver
+ this.selectedFont = bestFont;
+
+ if (previewLabel != null) {
+ previewLabel.setText(StringConverter.asString(selectedFont[0]));
+ }
+ }
+
+ /**
+ * Get the system default font data.
+ * @return FontData[]
+ */
+ private FontData[] getDefaultFontData() {
+ return previewLabel.getDisplay().getSystemFont().getFontData();
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/SelectableComboFieldEditor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/SelectableComboFieldEditor.java
index 1e49897..429b1a4 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/SelectableComboFieldEditor.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/SelectableComboFieldEditor.java
@@ -1,21 +1,21 @@
-package org.eclipse.bpmn2.modeler.ui.preferences;
-
-import org.eclipse.jface.preference.ComboFieldEditor;
-import org.eclipse.swt.widgets.Composite;
-
-public class SelectableComboFieldEditor extends ComboFieldEditor {
-
- public SelectableComboFieldEditor(String name, String labelText, String[][] entryNamesAndValues, Composite parent) {
- super(name, labelText, entryNamesAndValues, parent);
- }
-
- public String getSelectedValue() {
- doStore();
- return getPreferenceStore().getString(getPreferenceName());
- }
-
- public void setSelectedValue(String newValue) {
- getPreferenceStore().setValue(getPreferenceName(), newValue);
- doLoad();
- }
-}
+package org.eclipse.bpmn2.modeler.ui.preferences;
+
+import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+
+public class SelectableComboFieldEditor extends ComboFieldEditor {
+
+ public SelectableComboFieldEditor(String name, String labelText, String[][] entryNamesAndValues, Composite parent) {
+ super(name, labelText, entryNamesAndValues, parent);
+ }
+
+ public String getSelectedValue() {
+ doStore();
+ return getPreferenceStore().getString(getPreferenceName());
+ }
+
+ public void setSelectedValue(String newValue) {
+ getPreferenceStore().setValue(getPreferenceName(), newValue);
+ doLoad();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolEnablementPropertyPage.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolEnablementPropertyPage.java
index 0e307a4..28a3179 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolEnablementPropertyPage.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolEnablementPropertyPage.java
@@ -1,361 +1,361 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.preferences.ToolEnablement;
-import org.eclipse.bpmn2.modeler.core.preferences.ToolEnablementPreferences;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.IElementComparer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class ToolEnablementPropertyPage extends PropertyPage {
-
- private DataBindingContext m_bindingContext;
-
- private ToolEnablementPreferences toolEnablementPreferences;
- private Bpmn2Preferences bpmn2Preferences;
- private final List<ToolEnablement> tools = new ArrayList<ToolEnablement>();
- private Object[] toolsEnabled;
- private CheckboxTreeViewer checkboxTreeViewer;
- private Tree checkboxTree;
-
- private WritableList writableList;
-
- /**
- * Create the property page.
- */
- public ToolEnablementPropertyPage() {
- setTitle("Tool Enablement");
- }
-
- /**
- * Create contents of the property page.
- *
- * @param parent
- */
- @Override
- public Control createContents(Composite parent) {
- initData();
-
- Composite container = new Composite(parent, SWT.NULL);
- container.setLayout(new GridLayout(3, false));
- container.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false, 1, 1));
-
- final Button btnOverride = new Button(container,SWT.CHECK);
- btnOverride.setText("Override default tool enablements with these settings:");
- btnOverride.setSelection(bpmn2Preferences.getOverrideModelEnablements());
- btnOverride.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 3, 1));
-
- checkboxTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
- checkboxTree = checkboxTreeViewer.getTree();
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
- data.heightHint = 200;
- checkboxTree.setLayoutData(data);
-
- final Button btnCopy = new Button(container,SWT.FLAT);
- btnCopy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
- btnCopy.setText("Copy");
-
- final Label lblCopy = new Label(container, SWT.NONE);
- lblCopy.setText("all enablements from Target Runtime:");
- lblCopy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
-
- final Combo cboCopy = new Combo(container, SWT.READ_ONLY);
- cboCopy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
- TargetRuntime cr = bpmn2Preferences.getRuntime();
- int i = 0;
- int iSelected = -1;
- for (TargetRuntime rt : TargetRuntime.getAllRuntimes()) {
- for (ModelEnablementDescriptor md : rt.getModelEnablements()) {
- String text = rt.getName();
- if (md.getType()!=null)
- text += " - " + md.getType();
- if (md.getProfile()!=null)
- text += " (" + md.getProfile() + ")";
- cboCopy.add(text);
- cboCopy.setData(Integer.toString(i), md);
- if (rt == cr && iSelected<0)
- cboCopy.select(iSelected = i);
- ++i;
- }
- }
-
- Composite importExportButtons = new Composite(container, SWT.NONE);
- importExportButtons.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 3, 1));
- importExportButtons.setLayout(new FillLayout());
-
- Button btnImportProfile = new Button(importExportButtons, SWT.NONE);
- btnImportProfile.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- FileDialog dialog = new FileDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.NULL);
- String path = dialog.open();
- if (path != null) {
- try {
- tools.clear();
- toolEnablementPreferences.importPreferences(path);
- reloadPreferences();
- checkboxTreeViewer.refresh();
- restoreDefaults();
- } catch (Exception e1) {
- Activator.showErrorWithLogging(e1);
- }
- }
- }
- });
- btnImportProfile.setText("Import Profile ...");
-
- Button btnExportProfile = new Button(importExportButtons, SWT.NONE);
- btnExportProfile.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- FileDialog dialog = new FileDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.SAVE);
- String path = dialog.open();
- if (path != null) {
- try {
- toolEnablementPreferences.export(path);
- } catch (Exception e1) {
- Activator.showErrorWithLogging(e1);
- }
- }
- }
- });
- btnExportProfile.setText("Export Profile ...");
-
- checkboxTreeViewer.setComparer(new IElementComparer() {
-
- @Override
- public boolean equals(Object a, Object b) {
- return a == b;
- }
-
- @Override
- public int hashCode(Object element) {
- return System.identityHashCode(element);
- }
- });
- checkboxTreeViewer.setUseHashlookup(true);
- m_bindingContext = initDataBindings();
-
- boolean enable = btnOverride.getSelection();
- checkboxTree.setEnabled(enable);
- btnCopy.setEnabled(enable);
- lblCopy.setEnabled(enable);
- cboCopy.setEnabled(enable);
-
- btnOverride.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean enable = btnOverride.getSelection();
- checkboxTree.setEnabled(enable);
- bpmn2Preferences.setOverrideModelEnablements(enable);
- btnCopy.setEnabled(enable);
- lblCopy.setEnabled(enable);
- cboCopy.setEnabled(enable);
- }
- });
-
- btnCopy.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- int i = cboCopy.getSelectionIndex();
- ModelEnablementDescriptor md = (ModelEnablementDescriptor) cboCopy.getData(Integer.toString(i));
- toolEnablementPreferences.setEnablements(md);
-
- reloadPreferences();
- checkboxTreeViewer.refresh();
- restoreDefaults();
- }
- });
-
-
- restoreDefaults();
-
- return container;
- }
-
- private void restoreDefaults() {
- checkboxTreeViewer.setCheckedElements(toolsEnabled);
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- restoreDefaults();
- }
-
- private void initData() {
- toolEnablementPreferences = ToolEnablementPreferences.getPreferences((IProject) getElement().getAdapter(IProject.class));
- IProject project = (IProject)getElement().getAdapter(IProject.class);
- bpmn2Preferences = Bpmn2Preferences.getInstance(project);
-
- reloadPreferences();
- }
-
- private void reloadPreferences() {
- tools.clear();
- tools.addAll(toolEnablementPreferences.getAllElements());
- ArrayList<ToolEnablement> tEnabled = new ArrayList<ToolEnablement>();
- for (ToolEnablement tool : tools) {
- if (tool.getEnabled()) {
- tEnabled.add(tool);
- }
- ArrayList<ToolEnablement> children = tool.getChildren();
- for (ToolEnablement t : children) {
- if (t.getEnabled()) {
- tEnabled.add(t);
- }
- }
- }
- toolsEnabled = tEnabled.toArray();
- }
-
- @Override
- public boolean performOk() {
- setErrorMessage(null);
- try {
- updateToolEnablement(tools, Arrays.asList(checkboxTreeViewer.getCheckedElements()));
- bpmn2Preferences.save();
- } catch (BackingStoreException e) {
- Activator.showErrorWithLogging(e);
- }
- return true;
- }
-
- private void updateToolEnablement(List<ToolEnablement> saveables, List<Object> enabled)
- throws BackingStoreException {
- for (ToolEnablement t : saveables) {
- toolEnablementPreferences.setEnabled(t, enabled.contains(t));
- for (ToolEnablement c : t.getChildren()) {
- toolEnablementPreferences.setEnabled(c, enabled.contains(c));
- }
- }
- toolEnablementPreferences.flush();
- }
-
- protected DataBindingContext initDataBindings() {
- DataBindingContext bindingContext = new DataBindingContext();
- //
- checkboxTreeViewer.setContentProvider(new ITreeContentProvider() {
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public boolean hasChildren(Object element) {
- if (element instanceof ToolEnablement) {
- return !((ToolEnablement) element).getChildren().isEmpty();
- }
- return false;
- }
-
- @Override
- public Object getParent(Object element) {
- if (element instanceof ToolEnablement) {
- return ((ToolEnablement) element).getParent();
- }
- return null;
- }
-
- @Override
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof WritableList) {
- return ((WritableList) inputElement).toArray();
- }
- return null;
- }
-
- @Override
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof ToolEnablement) {
- return ((ToolEnablement) parentElement).getChildren().toArray();
- }
- return null;
- }
- });
-
- checkboxTreeViewer.setLabelProvider(new ILabelProvider() {
- @Override
- public void removeListener(ILabelProviderListener listener) {
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- @Override
- public void dispose() {
-
- }
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- }
-
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof ToolEnablement) {
- return ((ToolEnablement) element).getName();
- }
- return null;
- }
- });
- writableList = new WritableList(tools, ToolEnablement.class);
- checkboxTreeViewer.setInput(writableList);
- //
- return bindingContext;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.preferences.ToolEnablement;
+import org.eclipse.bpmn2.modeler.core.preferences.ToolEnablementPreferences;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.IElementComparer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PropertyPage;
+import org.osgi.service.prefs.BackingStoreException;
+
+public class ToolEnablementPropertyPage extends PropertyPage {
+
+ private DataBindingContext m_bindingContext;
+
+ private ToolEnablementPreferences toolEnablementPreferences;
+ private Bpmn2Preferences bpmn2Preferences;
+ private final List<ToolEnablement> tools = new ArrayList<ToolEnablement>();
+ private Object[] toolsEnabled;
+ private CheckboxTreeViewer checkboxTreeViewer;
+ private Tree checkboxTree;
+
+ private WritableList writableList;
+
+ /**
+ * Create the property page.
+ */
+ public ToolEnablementPropertyPage() {
+ setTitle("Tool Enablement");
+ }
+
+ /**
+ * Create contents of the property page.
+ *
+ * @param parent
+ */
+ @Override
+ public Control createContents(Composite parent) {
+ initData();
+
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayout(new GridLayout(3, false));
+ container.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false, 1, 1));
+
+ final Button btnOverride = new Button(container,SWT.CHECK);
+ btnOverride.setText("Override default tool enablements with these settings:");
+ btnOverride.setSelection(bpmn2Preferences.getOverrideModelEnablements());
+ btnOverride.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 3, 1));
+
+ checkboxTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
+ checkboxTree = checkboxTreeViewer.getTree();
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
+ data.heightHint = 200;
+ checkboxTree.setLayoutData(data);
+
+ final Button btnCopy = new Button(container,SWT.FLAT);
+ btnCopy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
+ btnCopy.setText("Copy");
+
+ final Label lblCopy = new Label(container, SWT.NONE);
+ lblCopy.setText("all enablements from Target Runtime:");
+ lblCopy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
+
+ final Combo cboCopy = new Combo(container, SWT.READ_ONLY);
+ cboCopy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
+ TargetRuntime cr = bpmn2Preferences.getRuntime();
+ int i = 0;
+ int iSelected = -1;
+ for (TargetRuntime rt : TargetRuntime.getAllRuntimes()) {
+ for (ModelEnablementDescriptor md : rt.getModelEnablements()) {
+ String text = rt.getName();
+ if (md.getType()!=null)
+ text += " - " + md.getType();
+ if (md.getProfile()!=null)
+ text += " (" + md.getProfile() + ")";
+ cboCopy.add(text);
+ cboCopy.setData(Integer.toString(i), md);
+ if (rt == cr && iSelected<0)
+ cboCopy.select(iSelected = i);
+ ++i;
+ }
+ }
+
+ Composite importExportButtons = new Composite(container, SWT.NONE);
+ importExportButtons.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 3, 1));
+ importExportButtons.setLayout(new FillLayout());
+
+ Button btnImportProfile = new Button(importExportButtons, SWT.NONE);
+ btnImportProfile.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.NULL);
+ String path = dialog.open();
+ if (path != null) {
+ try {
+ tools.clear();
+ toolEnablementPreferences.importPreferences(path);
+ reloadPreferences();
+ checkboxTreeViewer.refresh();
+ restoreDefaults();
+ } catch (Exception e1) {
+ Activator.showErrorWithLogging(e1);
+ }
+ }
+ }
+ });
+ btnImportProfile.setText("Import Profile ...");
+
+ Button btnExportProfile = new Button(importExportButtons, SWT.NONE);
+ btnExportProfile.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.SAVE);
+ String path = dialog.open();
+ if (path != null) {
+ try {
+ toolEnablementPreferences.export(path);
+ } catch (Exception e1) {
+ Activator.showErrorWithLogging(e1);
+ }
+ }
+ }
+ });
+ btnExportProfile.setText("Export Profile ...");
+
+ checkboxTreeViewer.setComparer(new IElementComparer() {
+
+ @Override
+ public boolean equals(Object a, Object b) {
+ return a == b;
+ }
+
+ @Override
+ public int hashCode(Object element) {
+ return System.identityHashCode(element);
+ }
+ });
+ checkboxTreeViewer.setUseHashlookup(true);
+ m_bindingContext = initDataBindings();
+
+ boolean enable = btnOverride.getSelection();
+ checkboxTree.setEnabled(enable);
+ btnCopy.setEnabled(enable);
+ lblCopy.setEnabled(enable);
+ cboCopy.setEnabled(enable);
+
+ btnOverride.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean enable = btnOverride.getSelection();
+ checkboxTree.setEnabled(enable);
+ bpmn2Preferences.setOverrideModelEnablements(enable);
+ btnCopy.setEnabled(enable);
+ lblCopy.setEnabled(enable);
+ cboCopy.setEnabled(enable);
+ }
+ });
+
+ btnCopy.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int i = cboCopy.getSelectionIndex();
+ ModelEnablementDescriptor md = (ModelEnablementDescriptor) cboCopy.getData(Integer.toString(i));
+ toolEnablementPreferences.setEnablements(md);
+
+ reloadPreferences();
+ checkboxTreeViewer.refresh();
+ restoreDefaults();
+ }
+ });
+
+
+ restoreDefaults();
+
+ return container;
+ }
+
+ private void restoreDefaults() {
+ checkboxTreeViewer.setCheckedElements(toolsEnabled);
+ }
+
+ @Override
+ protected void performDefaults() {
+ super.performDefaults();
+ restoreDefaults();
+ }
+
+ private void initData() {
+ toolEnablementPreferences = ToolEnablementPreferences.getPreferences((IProject) getElement().getAdapter(IProject.class));
+ IProject project = (IProject)getElement().getAdapter(IProject.class);
+ bpmn2Preferences = Bpmn2Preferences.getInstance(project);
+
+ reloadPreferences();
+ }
+
+ private void reloadPreferences() {
+ tools.clear();
+ tools.addAll(toolEnablementPreferences.getAllElements());
+ ArrayList<ToolEnablement> tEnabled = new ArrayList<ToolEnablement>();
+ for (ToolEnablement tool : tools) {
+ if (tool.getEnabled()) {
+ tEnabled.add(tool);
+ }
+ ArrayList<ToolEnablement> children = tool.getChildren();
+ for (ToolEnablement t : children) {
+ if (t.getEnabled()) {
+ tEnabled.add(t);
+ }
+ }
+ }
+ toolsEnabled = tEnabled.toArray();
+ }
+
+ @Override
+ public boolean performOk() {
+ setErrorMessage(null);
+ try {
+ updateToolEnablement(tools, Arrays.asList(checkboxTreeViewer.getCheckedElements()));
+ bpmn2Preferences.save();
+ } catch (BackingStoreException e) {
+ Activator.showErrorWithLogging(e);
+ }
+ return true;
+ }
+
+ private void updateToolEnablement(List<ToolEnablement> saveables, List<Object> enabled)
+ throws BackingStoreException {
+ for (ToolEnablement t : saveables) {
+ toolEnablementPreferences.setEnabled(t, enabled.contains(t));
+ for (ToolEnablement c : t.getChildren()) {
+ toolEnablementPreferences.setEnabled(c, enabled.contains(c));
+ }
+ }
+ toolEnablementPreferences.flush();
+ }
+
+ protected DataBindingContext initDataBindings() {
+ DataBindingContext bindingContext = new DataBindingContext();
+ //
+ checkboxTreeViewer.setContentProvider(new ITreeContentProvider() {
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof ToolEnablement) {
+ return !((ToolEnablement) element).getChildren().isEmpty();
+ }
+ return false;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ if (element instanceof ToolEnablement) {
+ return ((ToolEnablement) element).getParent();
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof WritableList) {
+ return ((WritableList) inputElement).toArray();
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof ToolEnablement) {
+ return ((ToolEnablement) parentElement).getChildren().toArray();
+ }
+ return null;
+ }
+ });
+
+ checkboxTreeViewer.setLabelProvider(new ILabelProvider() {
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ToolEnablement) {
+ return ((ToolEnablement) element).getName();
+ }
+ return null;
+ }
+ });
+ writableList = new WritableList(tools, ToolEnablement.class);
+ checkboxTreeViewer.setInput(writableList);
+ //
+ return bindingContext;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/WSILPreferencePage.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/WSILPreferencePage.java
index 2f5db1f..8401f2a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/WSILPreferencePage.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/WSILPreferencePage.java
@@ -1,849 +1,849 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.preferences;
-
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.bpel.wsil.model.inspection.Inspection;
-import org.eclipse.bpel.wsil.model.inspection.InspectionFactory;
-import org.eclipse.bpel.wsil.model.inspection.InspectionPackage;
-import org.eclipse.bpel.wsil.model.inspection.Link;
-import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
-import org.eclipse.bpel.wsil.model.inspection.WSILDocument;
-import org.eclipse.bpmn2.modeler.core.merrimac.providers.ColumnTableProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.providers.TableCursor;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.bpmn2.modeler.ui.property.providers.WSILContentProvider;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-
-/**
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 2, 2007
- *
- */
-
-
-@SuppressWarnings({"nls","boxing","unchecked"})
-
-public class WSILPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- Bpmn2ModelerResourceSetImpl resourceSet = new Bpmn2ModelerResourceSetImpl();
-
- Text wsilURL;
-
- Table linkTable;
- ColumnTableProvider tableProvider;
-
- TableViewer linkTableViewer;
-
- TableCursor tableCursor;
-
- Link fLinkSelection;
-
- WSILDocument fWsilDocument;
-
- Button addButton;
- Button removeButton;
- Button moveUpButton;
- Button moveDownButton;
- Button openInBrowserButton;
-
- private static String WSIL = "wsil";
-
- // Track the modification of any parameter in the WSIL model.
- // we don't use commands and stacks here.
- EContentAdapter fContentAdapter = new EContentAdapter() {
-
- /**
- * @see org.eclipse.emf.ecore.util.EContentAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
-
- @Override
- public void notifyChanged(Notification arg0) {
-
- super.notifyChanged(arg0);
- int eventId = arg0.getEventType();
- if (eventId == Notification.ADD || eventId == Notification.SET ||
- eventId == Notification.MOVE || eventId == Notification.REMOVE ) {
-
- linkTableViewer.refresh();
- updateButtons();
- }
- }
- };
-
-
-
- @Override
- protected Control createContents (Composite parent) {
-
- Composite result = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout( );
- layout.numColumns = 3;
- layout.verticalSpacing = 15;
- layout.makeColumnsEqualWidth = false;
-
- result.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- // result.setLayoutData(data);
-
- // WSIL directory
- Label wsilLabel = new Label(result, SWT.NONE);
- wsilLabel.setText(Messages.WSILPreferencePage_WSIL_1);
- wsilLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- wsilURL = new Text(result, SWT.BORDER);
- wsilURL.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- wsilURL.addFocusListener( new FocusListener () {
-
-
- public void focusGained(FocusEvent e) {
- wsilURL.setData("lastValue",wsilURL.getText());
- }
-
- public void focusLost(FocusEvent e) {
- String url = wsilURL.getText();
-
- // no change.
- if (url.equals(wsilURL.getData("lastValue"))) {
- return ;
- }
- attemptLoad( url );
- }
-
- });
-
- Button browse = new Button(result, SWT.NONE);
- browse.setText(Messages.WSILPreferencePage_WSIL_2);
- data = new GridData(SWT.RIGHT);
- data.widthHint = 100;
-
- browse.setLayoutData(data);
- browse.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- FileDialog fd = new FileDialog(getShell(), SWT.OPEN);
- fd.setFilterExtensions(new String[]{"*."+WSIL});
- String fileName = fd.open();
- if ((fileName != null) && (fileName.length() > 0)) {
- // parse to file url
- File file = new File(fileName);
- String uri = file.toURI().toString();
- wsilURL.setText( uri );
- attemptLoad(uri);
-
- }
- }
- }
- );
-
-
- // 2nd row of the 3 cell grid
-
- Label txt = new Label ( result, SWT.NO_BACKGROUND | SWT.WRAP );
-
- txt.setText( Messages.WSILPreferencePage_WSIL_Description );
- data = new GridData( GridData.GRAB_HORIZONTAL );
- data.horizontalSpan = 3;
- txt.setLayoutData(data);
-
- //
- //
-
- // create table
- linkTable = new Table(result, SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.BORDER );
-
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
-
- linkTable.setLayoutData(data);
-
- // set up table
- linkTable.setLinesVisible(true);
- linkTable.setHeaderVisible(true);
-
- tableProvider = new ColumnTableProvider();
- tableProvider.add(new IndexColumn());
- tableProvider.add(new AbstractColumn());
- tableProvider.add(new LocationColumn());
- // columnProvider.add(new NamespaceColumn());
-
- linkTableViewer = new TableViewer(linkTable);
- tableProvider.createTableLayout(linkTable);
- linkTableViewer.setLabelProvider(tableProvider);
- linkTableViewer.setCellModifier(tableProvider);
-
- WSILContentProvider wsilContentProvider = new WSILContentProvider();
- wsilContentProvider.setMode( WSILContentProvider.FLATTEN );
-
- linkTableViewer.setContentProvider( wsilContentProvider );
-
- linkTableViewer.addFilter(new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return element instanceof Link;
- }
- });
-
- linkTableViewer.setColumnProperties(tableProvider.getColumnProperties());
- linkTableViewer.setCellEditors(tableProvider.createCellEditors(linkTable));
-
-
- tableCursor = TableCursor.create(linkTable, linkTableViewer);
-
- ///
-
-
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.verticalSpacing = 5;
-
- Composite buttonList = new Composite ( result , SWT.NONE );
- buttonList.setLayout(layout);
-
- data = new GridData( GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_CENTER );
- buttonList.setLayoutData( data );
-
- addButton = new Button(buttonList, SWT.NONE);
- addButton.setText(Messages.WSILPreferencePage_WSIL_Add);
- data = new GridData( GridData.FILL_HORIZONTAL );
-
- addButton.setLayoutData(data);
- addButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
-
- Link link = InspectionFactory.eINSTANCE.createLink();
-
- link.setLocation(Messages.WSILPreferencePage_WSIL_EnterLocation);
- link.setReferencedNamespace( InspectionPackage.eNS_URI );
-
- TypeOfAbstract toa = InspectionFactory.eINSTANCE.createTypeOfAbstract();
- toa.setValue(Messages.WSILPreferencePage_WSIL_EnterDescription);
- link.getAbstract().add( toa );
-
- // modify the document
- EList links = fWsilDocument.getInspection().getLinks();
- links.add ( link );
-
- // notifications of modifications are sent back to us via the EContentAdapter
- // on the WSIL Document resource.
- }
- });
-
-
- removeButton = new Button(buttonList, SWT.NONE);
- removeButton.setText(Messages.WSILPreferencePage_WSIL_Remove);
- data = new GridData( GridData.FILL_HORIZONTAL );
-
- removeButton.setLayoutData(data);
-
- removeButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (fLinkSelection == null) {
- return ;
- }
- // modify the document
- EList links = fWsilDocument.getInspection().getLinks();
- links.remove(fLinkSelection);
- }
- });
-
-
-
- moveUpButton = new Button(buttonList, SWT.NONE);
- moveUpButton.setText(Messages.WSILPreferencePage_WSIL_MoveUp);
- data = new GridData( GridData.FILL_HORIZONTAL );
-
- moveUpButton.setLayoutData(data);
-
- moveUpButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (fLinkSelection == null) {
- return ;
- }
- // modify the document
- EList links = fWsilDocument.getInspection().getLinks();
- int idx = links.indexOf(fLinkSelection);
- if (idx < 0) {
- return ;
- }
- links.move(idx,idx-1);
- }
- });
-
-
- moveDownButton = new Button(buttonList, SWT.NONE);
- moveDownButton.setText(Messages.WSILPreferencePage_WSIL_MoveDown);
- data = new GridData( GridData.FILL_HORIZONTAL );
-
- moveDownButton.setLayoutData(data);
-
- moveDownButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (fLinkSelection == null) {
- return ;
- }
- // modify the document
- EList links = fWsilDocument.getInspection().getLinks();
- int idx = links.indexOf(fLinkSelection);
- if (idx < 0) {
- return ;
- }
- links.move(idx, idx+1);
- }
- });
-
- openInBrowserButton = new Button(buttonList, SWT.NONE);
- openInBrowserButton.setText(Messages.WSILPreferencePage_WSIL_OpenInBrowser);
- data = new GridData( GridData.FILL_HORIZONTAL );
-
- openInBrowserButton.setLayoutData(data);
-
- openInBrowserButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (fLinkSelection == null) {
- return ;
- }
-
- // TODO:
- }
- });
-
-
-
- linkTableViewer.addPostSelectionChangedListener( new ISelectionChangedListener () {
-
-
- public void selectionChanged (SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Object obj = ss.getFirstElement();
- fLinkSelection = obj instanceof Link ? (Link) obj : null;
- }
- updateButtons();
- }
-
- });
-
- updateButtons();
-
- initializeValues();
-
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(
-// parent, IHelpContextIds.PREFERENCES_PAGE);
-
- return result;
- }
-
-
- /**
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
-
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- @Override
- public boolean performOk() {
- storeValues();
- return true;
- }
-
- @Override
- protected void performApply() {
- performOk();
- }
-
- /**
- * Initializes states of the controls using default values in the preference store.
- */
- private void initializeDefaults() {
-
- }
-
- /**
- * Initializes states of the controls from the preference store.
- */
- private void initializeValues() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-
- wsilURL.setText(store.getString(Bpmn2Preferences.PREF_WSIL_URL));
-
- attemptLoad (wsilURL.getText() );
- }
-
-
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-
- store.setValue(Bpmn2Preferences.PREF_WSIL_URL, wsilURL.getText());
-
- if (fWsilDocument != null) {
-
- Resource resource = fWsilDocument.eResource();
-
- try {
- resource.save(null);
- } catch (IOException e) {
- Activator.logError(e);
- }
- }
- }
-
-
- void updateButtons ( ) {
-
- List linkList = (fWsilDocument == null ? Collections.EMPTY_LIST : fWsilDocument.getInspection().getLinks());
-
- int idx = linkList.indexOf(fLinkSelection);
- // -1 if not found ...
- moveUpButton.setEnabled(idx > 0);
- moveDownButton.setEnabled(idx >= 0 && idx < linkList.size() - 1);
- removeButton.setEnabled( fLinkSelection != null );
- openInBrowserButton.setEnabled( fLinkSelection != null );
- addButton.setEnabled( fWsilDocument != null );
- }
-
-
-
- /**
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- @Override
- public void dispose() {
-
- Iterator it = resourceSet.getResources().iterator();
- while (it.hasNext()) {
- Resource r = (Resource) it.next();
- r.eAdapters().clear();
- }
- // TODO Auto-generated method stub
- super.dispose();
- }
-
-
- void attemptLoad ( String url ) {
-
- url = url.trim();
-
- if (url.length() < 1) {
- return ;
- }
- if(!url.endsWith(WSIL)){
- setMessage(Messages.WSILPreferencePage_WSIL_NameLimit, ERROR);
- return;
- }
-
- if (fWsilDocument != null) {
- fWsilDocument.eResource().eAdapters().remove( fContentAdapter );
- fWsilDocument = null;
- }
-
- org.eclipse.emf.common.util.URI uri = org.eclipse.emf.common.util.URI.createURI(url);
-
- Resource resource = null;
- try {
-
- resource = resourceSet.getResource(uri, true, WSIL);
-
- List contents = resource.getContents();
-
- if (contents.size() > 0) {
- if (contents.get(0) instanceof WSILDocument ) {
- fWsilDocument = (WSILDocument ) contents.get(0);
- }
- }
- setMessage(null);
-
- } catch (Exception e) {
- setMessage(Messages.WSILPreferencePage_WSIL_DocumentNotLoaded, ERROR);
- Activator.logError(e);
- }
-
- linkTableViewer.setInput( fWsilDocument );
-
- // Track the modification of any parameter in the WSIL model.
- // we don't use commands and stacks here.
- if (fWsilDocument != null) {
- fWsilDocument.eResource().eAdapters().add( fContentAdapter );
- }
- updateButtons();
- }
-
-
-
- /**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 4, 2007
- *
- */
- public class AbstractColumn extends ColumnTableProvider.Column implements
- ILabelProvider, ICellModifier {
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
- */
- @Override
- public String getHeaderText() {
- return Messages.WSILPreferencePage_WSIL_Abstract;
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
- */
- @Override
- public String getProperty() {
- return "abstract"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
- */
- @Override
- public int getInitialWeight() {
- return 50;
- }
-
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText (Object element) {
- if (element instanceof Link) {
- Link link = (Link) element;
- List abs = link.getAbstract();
- // TODO: Do this based on language ?
- if (abs.size() > 0) {
- TypeOfAbstract absType = (TypeOfAbstract) abs.get(0);
- return absType.getValue();
- }
- }
- return "";
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#createCellEditor(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public CellEditor createCellEditor (Composite parent) {
- return new TextCellEditor(parent, SWT.NO_BACKGROUND );
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- return true;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
- */
- public Object getValue(Object element, String property) {
- return getText(element);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void modify(Object element, String property, Object value) {
- if (element instanceof Link) {
- Link link = (Link) element;
- List abs = link.getAbstract();
- // TODO: Do this based on language ?
- if (abs.size() > 0) {
- TypeOfAbstract absType = (TypeOfAbstract) abs.get(0);
-
- // noop, do not needlessly modify
- if (value.equals(absType.getValue())) {
- return ;
- }
-
- absType.setValue( (String) value);
- }
- }
- }
- }
-
-
-
- /**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 4, 2007
- *
- */
- public class LocationColumn extends ColumnTableProvider.Column
- implements ILabelProvider, ICellModifier {
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
- */
- @Override
- public String getHeaderText() {
- return Messages.WSILPreferencePage_WSIL_Location;
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
- */
- @Override
- public String getProperty() {
- return "location"; //$NON-NLS-1$
- }
-
-
- /** (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
- */
- @Override
- public int getInitialWeight() {
- return 50;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText (Object element) {
- if (element instanceof Link) {
- Link link = (Link) element;
- return link.getLocation();
- }
- return "";
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#createCellEditor(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public CellEditor createCellEditor (Composite parent) {
- return new TextCellEditor(parent, SWT.NO_BACKGROUND );
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- return true;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
- */
- public Object getValue(Object element, String property) {
- return getText(element);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void modify (Object element, String property, Object value) {
-
- if (element instanceof Link) {
- Link link = (Link) element;
-
- //noop, do not needlessly modify
- if (value.equals(link.getLocation())) {
- return ;
- }
-
- org.eclipse.emf.common.util.URI linkURI = null;
- try {
-
- linkURI = org.eclipse.emf.common.util.URI.createURI( (String) value );
- if (linkURI.isRelative()) {
- // path is relative to me ...
- URI parentURI = link.eResource().getURI();
- linkURI = linkURI.resolve(parentURI);
- }
-
- // so far, so good !
- // VZ: so why not use linkURI? To be reviewed later!
- link.setLocation( (String) value);
-
- // all goes well
- setMessage(null);
-
- } catch (java.lang.IllegalArgumentException ex) {
-
- setMessage(ex.getLocalizedMessage(), ERROR);
-
- }
-
-
- }
- }
-
- }
-
- /**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 4, 2007
- */
- public class NamespaceColumn extends ColumnTableProvider.Column implements
- ILabelProvider {
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
- */
-
- @Override
- public String getHeaderText() {
- return Messages.WSILPreferencePage_WSIL_Namespace;
- }
-
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
- */
- @Override
- public String getProperty() {
- return "namespace"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
- */
- @Override
- public int getInitialWeight() {
- return 30;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText (Object element) {
-
- if (element instanceof Link) {
- Link link = (Link) element;
- // TODO: do we need to support namespace templates in modelEnablement?
-// return NamespaceUtils.convertUriToNamespace( link.getReferencedNamespace() );
- return link.getReferencedNamespace();
- }
- return "";
- }
-
- }
-
-
- /**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 4, 2007
- */
- public class IndexColumn extends ColumnTableProvider.Column implements
- ILabelProvider {
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
- */
-
- @Override
- public String getHeaderText() {
- return Messages.WSILPreferencePage_WSIL_Index;
- }
-
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
- */
- @Override
- public String getProperty() {
- return "index"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
- */
- @Override
- public int getInitialWeight() {
- return 5;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText (Object element) {
-
- if (element instanceof Link) {
- Link link = (Link) element;
- Inspection insp = (Inspection) link.eContainer();
- return Integer.toString( insp.getLinks().indexOf(link) + 1 );
- }
-
- return "";
- }
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.preferences;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.bpel.wsil.model.inspection.Inspection;
+import org.eclipse.bpel.wsil.model.inspection.InspectionFactory;
+import org.eclipse.bpel.wsil.model.inspection.InspectionPackage;
+import org.eclipse.bpel.wsil.model.inspection.Link;
+import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
+import org.eclipse.bpel.wsil.model.inspection.WSILDocument;
+import org.eclipse.bpmn2.modeler.core.merrimac.providers.ColumnTableProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.providers.TableCursor;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.bpmn2.modeler.ui.property.providers.WSILContentProvider;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+/**
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 2, 2007
+ *
+ */
+
+
+@SuppressWarnings({"nls","boxing","unchecked"})
+
+public class WSILPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ Bpmn2ModelerResourceSetImpl resourceSet = new Bpmn2ModelerResourceSetImpl();
+
+ Text wsilURL;
+
+ Table linkTable;
+ ColumnTableProvider tableProvider;
+
+ TableViewer linkTableViewer;
+
+ TableCursor tableCursor;
+
+ Link fLinkSelection;
+
+ WSILDocument fWsilDocument;
+
+ Button addButton;
+ Button removeButton;
+ Button moveUpButton;
+ Button moveDownButton;
+ Button openInBrowserButton;
+
+ private static String WSIL = "wsil";
+
+ // Track the modification of any parameter in the WSIL model.
+ // we don't use commands and stacks here.
+ EContentAdapter fContentAdapter = new EContentAdapter() {
+
+ /**
+ * @see org.eclipse.emf.ecore.util.EContentAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+
+ @Override
+ public void notifyChanged(Notification arg0) {
+
+ super.notifyChanged(arg0);
+ int eventId = arg0.getEventType();
+ if (eventId == Notification.ADD || eventId == Notification.SET ||
+ eventId == Notification.MOVE || eventId == Notification.REMOVE ) {
+
+ linkTableViewer.refresh();
+ updateButtons();
+ }
+ }
+ };
+
+
+
+ @Override
+ protected Control createContents (Composite parent) {
+
+ Composite result = new Composite(parent, SWT.NONE);
+
+ GridLayout layout = new GridLayout( );
+ layout.numColumns = 3;
+ layout.verticalSpacing = 15;
+ layout.makeColumnsEqualWidth = false;
+
+ result.setLayout(layout);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ // result.setLayoutData(data);
+
+ // WSIL directory
+ Label wsilLabel = new Label(result, SWT.NONE);
+ wsilLabel.setText(Messages.WSILPreferencePage_WSIL_1);
+ wsilLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+
+ wsilURL = new Text(result, SWT.BORDER);
+ wsilURL.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ wsilURL.addFocusListener( new FocusListener () {
+
+
+ public void focusGained(FocusEvent e) {
+ wsilURL.setData("lastValue",wsilURL.getText());
+ }
+
+ public void focusLost(FocusEvent e) {
+ String url = wsilURL.getText();
+
+ // no change.
+ if (url.equals(wsilURL.getData("lastValue"))) {
+ return ;
+ }
+ attemptLoad( url );
+ }
+
+ });
+
+ Button browse = new Button(result, SWT.NONE);
+ browse.setText(Messages.WSILPreferencePage_WSIL_2);
+ data = new GridData(SWT.RIGHT);
+ data.widthHint = 100;
+
+ browse.setLayoutData(data);
+ browse.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog fd = new FileDialog(getShell(), SWT.OPEN);
+ fd.setFilterExtensions(new String[]{"*."+WSIL});
+ String fileName = fd.open();
+ if ((fileName != null) && (fileName.length() > 0)) {
+ // parse to file url
+ File file = new File(fileName);
+ String uri = file.toURI().toString();
+ wsilURL.setText( uri );
+ attemptLoad(uri);
+
+ }
+ }
+ }
+ );
+
+
+ // 2nd row of the 3 cell grid
+
+ Label txt = new Label ( result, SWT.NO_BACKGROUND | SWT.WRAP );
+
+ txt.setText( Messages.WSILPreferencePage_WSIL_Description );
+ data = new GridData( GridData.GRAB_HORIZONTAL );
+ data.horizontalSpan = 3;
+ txt.setLayoutData(data);
+
+ //
+ //
+
+ // create table
+ linkTable = new Table(result, SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.BORDER );
+
+ data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 2;
+
+ linkTable.setLayoutData(data);
+
+ // set up table
+ linkTable.setLinesVisible(true);
+ linkTable.setHeaderVisible(true);
+
+ tableProvider = new ColumnTableProvider();
+ tableProvider.add(new IndexColumn());
+ tableProvider.add(new AbstractColumn());
+ tableProvider.add(new LocationColumn());
+ // columnProvider.add(new NamespaceColumn());
+
+ linkTableViewer = new TableViewer(linkTable);
+ tableProvider.createTableLayout(linkTable);
+ linkTableViewer.setLabelProvider(tableProvider);
+ linkTableViewer.setCellModifier(tableProvider);
+
+ WSILContentProvider wsilContentProvider = new WSILContentProvider();
+ wsilContentProvider.setMode( WSILContentProvider.FLATTEN );
+
+ linkTableViewer.setContentProvider( wsilContentProvider );
+
+ linkTableViewer.addFilter(new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return element instanceof Link;
+ }
+ });
+
+ linkTableViewer.setColumnProperties(tableProvider.getColumnProperties());
+ linkTableViewer.setCellEditors(tableProvider.createCellEditors(linkTable));
+
+
+ tableCursor = TableCursor.create(linkTable, linkTableViewer);
+
+ ///
+
+
+ layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 5;
+
+ Composite buttonList = new Composite ( result , SWT.NONE );
+ buttonList.setLayout(layout);
+
+ data = new GridData( GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_CENTER );
+ buttonList.setLayoutData( data );
+
+ addButton = new Button(buttonList, SWT.NONE);
+ addButton.setText(Messages.WSILPreferencePage_WSIL_Add);
+ data = new GridData( GridData.FILL_HORIZONTAL );
+
+ addButton.setLayoutData(data);
+ addButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+
+ Link link = InspectionFactory.eINSTANCE.createLink();
+
+ link.setLocation(Messages.WSILPreferencePage_WSIL_EnterLocation);
+ link.setReferencedNamespace( InspectionPackage.eNS_URI );
+
+ TypeOfAbstract toa = InspectionFactory.eINSTANCE.createTypeOfAbstract();
+ toa.setValue(Messages.WSILPreferencePage_WSIL_EnterDescription);
+ link.getAbstract().add( toa );
+
+ // modify the document
+ EList links = fWsilDocument.getInspection().getLinks();
+ links.add ( link );
+
+ // notifications of modifications are sent back to us via the EContentAdapter
+ // on the WSIL Document resource.
+ }
+ });
+
+
+ removeButton = new Button(buttonList, SWT.NONE);
+ removeButton.setText(Messages.WSILPreferencePage_WSIL_Remove);
+ data = new GridData( GridData.FILL_HORIZONTAL );
+
+ removeButton.setLayoutData(data);
+
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fLinkSelection == null) {
+ return ;
+ }
+ // modify the document
+ EList links = fWsilDocument.getInspection().getLinks();
+ links.remove(fLinkSelection);
+ }
+ });
+
+
+
+ moveUpButton = new Button(buttonList, SWT.NONE);
+ moveUpButton.setText(Messages.WSILPreferencePage_WSIL_MoveUp);
+ data = new GridData( GridData.FILL_HORIZONTAL );
+
+ moveUpButton.setLayoutData(data);
+
+ moveUpButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fLinkSelection == null) {
+ return ;
+ }
+ // modify the document
+ EList links = fWsilDocument.getInspection().getLinks();
+ int idx = links.indexOf(fLinkSelection);
+ if (idx < 0) {
+ return ;
+ }
+ links.move(idx,idx-1);
+ }
+ });
+
+
+ moveDownButton = new Button(buttonList, SWT.NONE);
+ moveDownButton.setText(Messages.WSILPreferencePage_WSIL_MoveDown);
+ data = new GridData( GridData.FILL_HORIZONTAL );
+
+ moveDownButton.setLayoutData(data);
+
+ moveDownButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fLinkSelection == null) {
+ return ;
+ }
+ // modify the document
+ EList links = fWsilDocument.getInspection().getLinks();
+ int idx = links.indexOf(fLinkSelection);
+ if (idx < 0) {
+ return ;
+ }
+ links.move(idx, idx+1);
+ }
+ });
+
+ openInBrowserButton = new Button(buttonList, SWT.NONE);
+ openInBrowserButton.setText(Messages.WSILPreferencePage_WSIL_OpenInBrowser);
+ data = new GridData( GridData.FILL_HORIZONTAL );
+
+ openInBrowserButton.setLayoutData(data);
+
+ openInBrowserButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fLinkSelection == null) {
+ return ;
+ }
+
+ // TODO:
+ }
+ });
+
+
+
+ linkTableViewer.addPostSelectionChangedListener( new ISelectionChangedListener () {
+
+
+ public void selectionChanged (SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ Object obj = ss.getFirstElement();
+ fLinkSelection = obj instanceof Link ? (Link) obj : null;
+ }
+ updateButtons();
+ }
+
+ });
+
+ updateButtons();
+
+ initializeValues();
+
+// PlatformUI.getWorkbench().getHelpSystem().setHelp(
+// parent, IHelpContextIds.PREFERENCES_PAGE);
+
+ return result;
+ }
+
+
+ /**
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+
+ }
+
+ @Override
+ protected void performDefaults() {
+ super.performDefaults();
+ initializeDefaults();
+ }
+
+ /**
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ storeValues();
+ return true;
+ }
+
+ @Override
+ protected void performApply() {
+ performOk();
+ }
+
+ /**
+ * Initializes states of the controls using default values in the preference store.
+ */
+ private void initializeDefaults() {
+
+ }
+
+ /**
+ * Initializes states of the controls from the preference store.
+ */
+ private void initializeValues() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+ wsilURL.setText(store.getString(Bpmn2Preferences.PREF_WSIL_URL));
+
+ attemptLoad (wsilURL.getText() );
+ }
+
+
+
+ /**
+ * Stores the values of the controls back to the preference store.
+ */
+ private void storeValues() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+ store.setValue(Bpmn2Preferences.PREF_WSIL_URL, wsilURL.getText());
+
+ if (fWsilDocument != null) {
+
+ Resource resource = fWsilDocument.eResource();
+
+ try {
+ resource.save(null);
+ } catch (IOException e) {
+ Activator.logError(e);
+ }
+ }
+ }
+
+
+ void updateButtons ( ) {
+
+ List linkList = (fWsilDocument == null ? Collections.EMPTY_LIST : fWsilDocument.getInspection().getLinks());
+
+ int idx = linkList.indexOf(fLinkSelection);
+ // -1 if not found ...
+ moveUpButton.setEnabled(idx > 0);
+ moveDownButton.setEnabled(idx >= 0 && idx < linkList.size() - 1);
+ removeButton.setEnabled( fLinkSelection != null );
+ openInBrowserButton.setEnabled( fLinkSelection != null );
+ addButton.setEnabled( fWsilDocument != null );
+ }
+
+
+
+ /**
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ @Override
+ public void dispose() {
+
+ Iterator it = resourceSet.getResources().iterator();
+ while (it.hasNext()) {
+ Resource r = (Resource) it.next();
+ r.eAdapters().clear();
+ }
+ // TODO Auto-generated method stub
+ super.dispose();
+ }
+
+
+ void attemptLoad ( String url ) {
+
+ url = url.trim();
+
+ if (url.length() < 1) {
+ return ;
+ }
+ if(!url.endsWith(WSIL)){
+ setMessage(Messages.WSILPreferencePage_WSIL_NameLimit, ERROR);
+ return;
+ }
+
+ if (fWsilDocument != null) {
+ fWsilDocument.eResource().eAdapters().remove( fContentAdapter );
+ fWsilDocument = null;
+ }
+
+ org.eclipse.emf.common.util.URI uri = org.eclipse.emf.common.util.URI.createURI(url);
+
+ Resource resource = null;
+ try {
+
+ resource = resourceSet.getResource(uri, true, WSIL);
+
+ List contents = resource.getContents();
+
+ if (contents.size() > 0) {
+ if (contents.get(0) instanceof WSILDocument ) {
+ fWsilDocument = (WSILDocument ) contents.get(0);
+ }
+ }
+ setMessage(null);
+
+ } catch (Exception e) {
+ setMessage(Messages.WSILPreferencePage_WSIL_DocumentNotLoaded, ERROR);
+ Activator.logError(e);
+ }
+
+ linkTableViewer.setInput( fWsilDocument );
+
+ // Track the modification of any parameter in the WSIL model.
+ // we don't use commands and stacks here.
+ if (fWsilDocument != null) {
+ fWsilDocument.eResource().eAdapters().add( fContentAdapter );
+ }
+ updateButtons();
+ }
+
+
+
+ /**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 4, 2007
+ *
+ */
+ public class AbstractColumn extends ColumnTableProvider.Column implements
+ ILabelProvider, ICellModifier {
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
+ */
+ @Override
+ public String getHeaderText() {
+ return Messages.WSILPreferencePage_WSIL_Abstract;
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
+ */
+ @Override
+ public String getProperty() {
+ return "abstract"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
+ */
+ @Override
+ public int getInitialWeight() {
+ return 50;
+ }
+
+
+ /**
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText (Object element) {
+ if (element instanceof Link) {
+ Link link = (Link) element;
+ List abs = link.getAbstract();
+ // TODO: Do this based on language ?
+ if (abs.size() > 0) {
+ TypeOfAbstract absType = (TypeOfAbstract) abs.get(0);
+ return absType.getValue();
+ }
+ }
+ return "";
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#createCellEditor(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public CellEditor createCellEditor (Composite parent) {
+ return new TextCellEditor(parent, SWT.NO_BACKGROUND );
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
+ */
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
+ */
+ public Object getValue(Object element, String property) {
+ return getText(element);
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
+ */
+ public void modify(Object element, String property, Object value) {
+ if (element instanceof Link) {
+ Link link = (Link) element;
+ List abs = link.getAbstract();
+ // TODO: Do this based on language ?
+ if (abs.size() > 0) {
+ TypeOfAbstract absType = (TypeOfAbstract) abs.get(0);
+
+ // noop, do not needlessly modify
+ if (value.equals(absType.getValue())) {
+ return ;
+ }
+
+ absType.setValue( (String) value);
+ }
+ }
+ }
+ }
+
+
+
+ /**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 4, 2007
+ *
+ */
+ public class LocationColumn extends ColumnTableProvider.Column
+ implements ILabelProvider, ICellModifier {
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
+ */
+ @Override
+ public String getHeaderText() {
+ return Messages.WSILPreferencePage_WSIL_Location;
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
+ */
+ @Override
+ public String getProperty() {
+ return "location"; //$NON-NLS-1$
+ }
+
+
+ /** (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
+ */
+ @Override
+ public int getInitialWeight() {
+ return 50;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText (Object element) {
+ if (element instanceof Link) {
+ Link link = (Link) element;
+ return link.getLocation();
+ }
+ return "";
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#createCellEditor(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public CellEditor createCellEditor (Composite parent) {
+ return new TextCellEditor(parent, SWT.NO_BACKGROUND );
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
+ */
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
+ */
+ public Object getValue(Object element, String property) {
+ return getText(element);
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
+ */
+ public void modify (Object element, String property, Object value) {
+
+ if (element instanceof Link) {
+ Link link = (Link) element;
+
+ //noop, do not needlessly modify
+ if (value.equals(link.getLocation())) {
+ return ;
+ }
+
+ org.eclipse.emf.common.util.URI linkURI = null;
+ try {
+
+ linkURI = org.eclipse.emf.common.util.URI.createURI( (String) value );
+ if (linkURI.isRelative()) {
+ // path is relative to me ...
+ URI parentURI = link.eResource().getURI();
+ linkURI = linkURI.resolve(parentURI);
+ }
+
+ // so far, so good !
+ // VZ: so why not use linkURI? To be reviewed later!
+ link.setLocation( (String) value);
+
+ // all goes well
+ setMessage(null);
+
+ } catch (java.lang.IllegalArgumentException ex) {
+
+ setMessage(ex.getLocalizedMessage(), ERROR);
+
+ }
+
+
+ }
+ }
+
+ }
+
+ /**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 4, 2007
+ */
+ public class NamespaceColumn extends ColumnTableProvider.Column implements
+ ILabelProvider {
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
+ */
+
+ @Override
+ public String getHeaderText() {
+ return Messages.WSILPreferencePage_WSIL_Namespace;
+ }
+
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
+ */
+ @Override
+ public String getProperty() {
+ return "namespace"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
+ */
+ @Override
+ public int getInitialWeight() {
+ return 30;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText (Object element) {
+
+ if (element instanceof Link) {
+ Link link = (Link) element;
+ // TODO: do we need to support namespace templates in modelEnablement?
+// return NamespaceUtils.convertUriToNamespace( link.getReferencedNamespace() );
+ return link.getReferencedNamespace();
+ }
+ return "";
+ }
+
+ }
+
+
+ /**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 4, 2007
+ */
+ public class IndexColumn extends ColumnTableProvider.Column implements
+ ILabelProvider {
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getHeaderText()
+ */
+
+ @Override
+ public String getHeaderText() {
+ return Messages.WSILPreferencePage_WSIL_Index;
+ }
+
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getProperty()
+ */
+ @Override
+ public String getProperty() {
+ return "index"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.bpmn2.modeler.core.merrimac.providers.ui.details.providers.ColumnTableProvider.Column#getInitialWeight()
+ */
+ @Override
+ public int getInitialWeight() {
+ return 5;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText (Object element) {
+
+ if (element instanceof Link) {
+ Link link = (Link) element;
+ Inspection insp = (Inspection) link.eContainer();
+ return Integer.toString( insp.getLinks().indexOf(link) + 1 );
+ }
+
+ return "";
+ }
+ }
+
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/AdvancedPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/AdvancedPropertySection.java
index 40201fd..98a7dcf 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/AdvancedPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/AdvancedPropertySection.java
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.di.impl.BPMNDiagramImpl;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class AdvancedPropertySection extends AbstractBpmn2PropertySection {
-
- private AdvancedDetailComposite composite;
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new AdvancedDetailComposite(this);
- }
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new AdvancedDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class,true);
- if (be==null) {
- // maybe it's the Diagram (editor canvas)?
- be = BusinessObjectUtil.getFirstElementOfType(pe, BPMNDiagram.class);
- }
- if (be instanceof BPMNDiagramImpl) {
- try {
- be = ModelHandlerLocator.getModelHandler(be.eResource()).getDefinitions();
- } catch (IOException e) {
- Activator.showErrorWithLogging(e);
- }
- }
- return be;
- }
-
- @Override
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- BPMN2Editor editor = (BPMN2Editor)part.getAdapter(BPMN2Editor.class);
- if (editor!=null)
- return editor.getPreferences().getShowAdvancedPropertiesTab();
- return false;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.di.impl.BPMNDiagramImpl;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class AdvancedPropertySection extends AbstractBpmn2PropertySection {
+
+ private AdvancedDetailComposite composite;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new AdvancedDetailComposite(this);
+ }
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new AdvancedDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class,true);
+ if (be==null) {
+ // maybe it's the Diagram (editor canvas)?
+ be = BusinessObjectUtil.getFirstElementOfType(pe, BPMNDiagram.class);
+ }
+ if (be instanceof BPMNDiagramImpl) {
+ try {
+ be = ModelHandlerLocator.getModelHandler(be.eResource()).getDefinitions();
+ } catch (IOException e) {
+ Activator.showErrorWithLogging(e);
+ }
+ }
+ return be;
+ }
+
+ @Override
+ public boolean shouldUseExtraSpace() {
+ return false;
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ BPMN2Editor editor = (BPMN2Editor)part.getAdapter(BPMN2Editor.class);
+ if (editor!=null)
+ return editor.getPreferences().getShowAdvancedPropertiesTab();
+ return false;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/Bpmn2PropertyFilter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/Bpmn2PropertyFilter.java
index 7ad1a73..3cbb87b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/Bpmn2PropertyFilter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/Bpmn2PropertyFilter.java
@@ -1,31 +1,31 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.di.impl.BPMNDiagramImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.platform.AbstractPropertySectionFilter;
-
-public class Bpmn2PropertyFilter extends AbstractPropertySectionFilter {
-
- @Override
- protected boolean accept(PictogramElement pe) {
- EObject eObject = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
- boolean enabled = eObject instanceof BaseElement || eObject instanceof BPMNDiagramImpl;
- return enabled;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.di.impl.BPMNDiagramImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.ui.platform.AbstractPropertySectionFilter;
+
+public class Bpmn2PropertyFilter extends AbstractPropertySectionFilter {
+
+ @Override
+ protected boolean accept(PictogramElement pe) {
+ EObject eObject = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
+ boolean enabled = eObject instanceof BaseElement || eObject instanceof BPMNDiagramImpl;
+ return enabled;
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/ExtensionValueListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/ExtensionValueListComposite.java
index 29a2912..126cbe4 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/ExtensionValueListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/ExtensionValueListComposite.java
@@ -1,210 +1,210 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.ExtensionAttributeValue;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeContentProvider;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.util.FeatureMap.Entry;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class ExtensionValueListComposite extends DefaultListComposite {
-
- EStructuralFeature extensionValueFeature;
-
- /**
- * @param parent
- * @param style
- */
- public ExtensionValueListComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- public void bindList(EObject object, EStructuralFeature feature) {
- extensionValueFeature = feature;
- listItemClass = (EClass)feature.getEType();
- EStructuralFeature evf = object.eClass().getEStructuralFeature("extensionValues");
- super.bindList(object,evf);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.DefaultListComposite#addListItem(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
- */
- protected abstract EObject addListItem(EObject object, EStructuralFeature feature);
-
- @SuppressWarnings("unchecked")
- protected void addExtensionValue(EObject value) {
- ModelUtil.addExtensionAttributeValue(businessObject, extensionValueFeature, value);
- }
-
- protected Object removeListItem(EObject object, EStructuralFeature feature, int index) {
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- int i = 0;
- int iRemove = -1;
- FeatureMap fmRemove = null;
- Entry result = null;
- for (EObject o : list) {
- ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
- FeatureMap fm = eav.getValue();
- for (Entry e : fm) {
- EStructuralFeature sf = e.getEStructuralFeature();
- if (sf == extensionValueFeature) {
- if (i==index) {
- iRemove = fm.indexOf(e);
- fmRemove = fm;
- }
- else if (i==index-1 || i==index+1)
- result = e;
- ++i;
- }
- }
- }
- if (fmRemove!=null) {
- fmRemove.remove(iRemove);
- }
- return result==null ? null : result.getValue();
- }
-
- protected Object moveListItemUp(EObject object, EStructuralFeature feature, int index) {
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- Entry result = null;
- int i = 0;
- int iFrom = -1;
- int iTo = -1;
- FeatureMap fmFrom = null;
- FeatureMap fmTo = null;
- for (int iList=0; iList<list.size(); ++iList) {
- EObject o = list.get(iList);
- ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
- FeatureMap fm = eav.getValue();
- for (int iMap=0; iMap<fm.size(); ++iMap) {
- Entry e = fm.get(iMap);
- EStructuralFeature sf = e.getEStructuralFeature();
- if (sf == extensionValueFeature) {
- if (i==index-1) {
- fmTo = fm;
- iTo = fm.indexOf(e);
- }
- else if (i==index) {
- fmFrom = fm;
- iFrom = fm.indexOf(e);
- break;
- }
- ++i;
- }
- }
- if (iFrom>=0 && iTo>=0) {
- if (fmFrom == fmTo) {
- result = fmTo.get(iFrom);
- fmTo.move(iTo, iFrom);
- }
- else {
- result = fmFrom.remove(iFrom);
- fmTo.add(iTo,result);
- }
- break;
- }
- }
- return result==null ? null : result.getValue();
- }
-
- protected Object moveListItemDown(EObject object, EStructuralFeature feature, int index) {
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- Entry result = null;
-
- int i = 0;
- for (EObject o : list) {
- ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
- FeatureMap fm = eav.getValue();
- for (Entry e : fm) {
- EStructuralFeature sf = e.getEStructuralFeature();
- if (sf == extensionValueFeature) {
- ++i;
- }
- }
- }
-
- int iFrom = -1;
- int iTo = -1;
- FeatureMap fmFrom = null;
- FeatureMap fmTo = null;
- for (int iList=list.size()-1; iList>=0; --iList) {
- EObject o = list.get(iList);
- ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
- FeatureMap fm = eav.getValue();
- for (int iMap=fm.size()-1; iMap>=0; --iMap) {
- Entry e = fm.get(iMap);
- EStructuralFeature sf = e.getEStructuralFeature();
- if (sf == extensionValueFeature) {
- --i;
- if (i==index+1) {
- fmTo = fm;
- iTo = fm.indexOf(e);
- }
- else if (i==index) {
- fmFrom = fm;
- iFrom = fm.indexOf(e);
- break;
- }
- }
- }
- if (iFrom>=0 && iTo>=0) {
- if (fmFrom == fmTo) {
- result = fmTo.get(iFrom);
- fmTo.move(iTo, iFrom);
- }
- else {
- result = fmFrom.remove(iFrom);
- fmTo.add(iTo,result);
- }
- break;
- }
- }
- return result==null ? null : result.getValue();
- }
-
- @Override
- public ListCompositeContentProvider getContentProvider(EObject object, EStructuralFeature feature, EList<EObject>list) {
- if (contentProvider==null) {
- contentProvider = new ListCompositeContentProvider(this, object, feature, list) {
-
- @Override
- public Object[] getElements(Object inputElement) {
- List<EObject> elements = new ArrayList<EObject>();
- for (EObject o : list) {
- ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
- FeatureMap fm = eav.getValue();
- for (Entry e : fm) {
- EStructuralFeature sf = e.getEStructuralFeature();
- if (sf == extensionValueFeature)
- elements.add((EObject) e.getValue());
- }
- }
- return elements.toArray(new EObject[elements.size()]);
- }
-
- };
- }
- return contentProvider;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.ExtensionAttributeValue;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeContentProvider;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMap.Entry;
+import org.eclipse.swt.widgets.Composite;
+
+public abstract class ExtensionValueListComposite extends DefaultListComposite {
+
+ EStructuralFeature extensionValueFeature;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public ExtensionValueListComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public void bindList(EObject object, EStructuralFeature feature) {
+ extensionValueFeature = feature;
+ listItemClass = (EClass)feature.getEType();
+ EStructuralFeature evf = object.eClass().getEStructuralFeature("extensionValues");
+ super.bindList(object,evf);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.DefaultListComposite#addListItem(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
+ */
+ protected abstract EObject addListItem(EObject object, EStructuralFeature feature);
+
+ @SuppressWarnings("unchecked")
+ protected void addExtensionValue(EObject value) {
+ ModelUtil.addExtensionAttributeValue(businessObject, extensionValueFeature, value);
+ }
+
+ protected Object removeListItem(EObject object, EStructuralFeature feature, int index) {
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ int i = 0;
+ int iRemove = -1;
+ FeatureMap fmRemove = null;
+ Entry result = null;
+ for (EObject o : list) {
+ ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
+ FeatureMap fm = eav.getValue();
+ for (Entry e : fm) {
+ EStructuralFeature sf = e.getEStructuralFeature();
+ if (sf == extensionValueFeature) {
+ if (i==index) {
+ iRemove = fm.indexOf(e);
+ fmRemove = fm;
+ }
+ else if (i==index-1 || i==index+1)
+ result = e;
+ ++i;
+ }
+ }
+ }
+ if (fmRemove!=null) {
+ fmRemove.remove(iRemove);
+ }
+ return result==null ? null : result.getValue();
+ }
+
+ protected Object moveListItemUp(EObject object, EStructuralFeature feature, int index) {
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ Entry result = null;
+ int i = 0;
+ int iFrom = -1;
+ int iTo = -1;
+ FeatureMap fmFrom = null;
+ FeatureMap fmTo = null;
+ for (int iList=0; iList<list.size(); ++iList) {
+ EObject o = list.get(iList);
+ ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
+ FeatureMap fm = eav.getValue();
+ for (int iMap=0; iMap<fm.size(); ++iMap) {
+ Entry e = fm.get(iMap);
+ EStructuralFeature sf = e.getEStructuralFeature();
+ if (sf == extensionValueFeature) {
+ if (i==index-1) {
+ fmTo = fm;
+ iTo = fm.indexOf(e);
+ }
+ else if (i==index) {
+ fmFrom = fm;
+ iFrom = fm.indexOf(e);
+ break;
+ }
+ ++i;
+ }
+ }
+ if (iFrom>=0 && iTo>=0) {
+ if (fmFrom == fmTo) {
+ result = fmTo.get(iFrom);
+ fmTo.move(iTo, iFrom);
+ }
+ else {
+ result = fmFrom.remove(iFrom);
+ fmTo.add(iTo,result);
+ }
+ break;
+ }
+ }
+ return result==null ? null : result.getValue();
+ }
+
+ protected Object moveListItemDown(EObject object, EStructuralFeature feature, int index) {
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ Entry result = null;
+
+ int i = 0;
+ for (EObject o : list) {
+ ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
+ FeatureMap fm = eav.getValue();
+ for (Entry e : fm) {
+ EStructuralFeature sf = e.getEStructuralFeature();
+ if (sf == extensionValueFeature) {
+ ++i;
+ }
+ }
+ }
+
+ int iFrom = -1;
+ int iTo = -1;
+ FeatureMap fmFrom = null;
+ FeatureMap fmTo = null;
+ for (int iList=list.size()-1; iList>=0; --iList) {
+ EObject o = list.get(iList);
+ ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
+ FeatureMap fm = eav.getValue();
+ for (int iMap=fm.size()-1; iMap>=0; --iMap) {
+ Entry e = fm.get(iMap);
+ EStructuralFeature sf = e.getEStructuralFeature();
+ if (sf == extensionValueFeature) {
+ --i;
+ if (i==index+1) {
+ fmTo = fm;
+ iTo = fm.indexOf(e);
+ }
+ else if (i==index) {
+ fmFrom = fm;
+ iFrom = fm.indexOf(e);
+ break;
+ }
+ }
+ }
+ if (iFrom>=0 && iTo>=0) {
+ if (fmFrom == fmTo) {
+ result = fmTo.get(iFrom);
+ fmTo.move(iTo, iFrom);
+ }
+ else {
+ result = fmFrom.remove(iFrom);
+ fmTo.add(iTo,result);
+ }
+ break;
+ }
+ }
+ return result==null ? null : result.getValue();
+ }
+
+ @Override
+ public ListCompositeContentProvider getContentProvider(EObject object, EStructuralFeature feature, EList<EObject>list) {
+ if (contentProvider==null) {
+ contentProvider = new ListCompositeContentProvider(this, object, feature, list) {
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ List<EObject> elements = new ArrayList<EObject>();
+ for (EObject o : list) {
+ ExtensionAttributeValue eav = (ExtensionAttributeValue)o;
+ FeatureMap fm = eav.getValue();
+ for (Entry e : fm) {
+ EStructuralFeature sf = e.getEStructuralFeature();
+ if (sf == extensionValueFeature)
+ elements.add((EObject) e.getValue());
+ }
+ }
+ return elements.toArray(new EObject[elements.size()]);
+ }
+
+ };
+ }
+ return contentProvider;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyLabelProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyLabelProvider.java
index c98a09c..86dc534 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyLabelProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyLabelProvider.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature;
-import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.diagram.BPMNFeatureProvider;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.features.IFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-import org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPart;
-import org.eclipse.graphiti.ui.services.GraphitiUi;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Bob Brodt
- *
- */
-public class PropertyLabelProvider extends LabelProvider {
-
- @Override
- public Image getImage(Object element) {
- EObject be = BusinessObjectUtil.getBusinessObjectForSelection((ISelection)element);
- DiagramEditor editor = ModelUtil.getEditor( be );
-
- if (editor!=null) {
- BPMNFeatureProvider fp = (BPMNFeatureProvider)editor.getDiagramTypeProvider().getFeatureProvider();
- PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection((ISelection)element);
- IFeature cf = fp.getCreateFeatureForPictogramElement(pe);
- if (cf instanceof AbstractBpmn2CreateFeature) {
- return GraphitiUi.getImageService().getImageForId(
- ((AbstractBpmn2CreateFeature)cf).getCreateImageId());
- }
- if (cf instanceof AbstractCreateFlowFeature) {
- return GraphitiUi.getImageService().getImageForId(
- ((AbstractCreateFlowFeature)cf).getCreateImageId());
- }
- }
- return super.getImage(element);
- }
-
- @Override
- public String getText(Object element) {
- EObject be = BusinessObjectUtil.getBusinessObjectForSelection((ISelection)element);
- if (be!=null) {
- if (be instanceof BPMNDiagram) {
- BaseElement bpmnElement = ((BPMNDiagram)be).getPlane().getBpmnElement();
- if (bpmnElement instanceof Process) {
- be = bpmnElement;
- }
- }
- return ModelUtil.getDisplayName(be);
- }
- PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection((ISelection)element);
- if (pe!=null && pe.getGraphicsAlgorithm()!=null) {
- return ModelUtil.getLabel( pe.getGraphicsAlgorithm() );
- }
- return super.getText(element);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature;
+import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.diagram.BPMNFeatureProvider;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.features.IFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.ui.editor.DiagramEditor;
+import org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPart;
+import org.eclipse.graphiti.ui.services.GraphitiUi;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class PropertyLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ EObject be = BusinessObjectUtil.getBusinessObjectForSelection((ISelection)element);
+ DiagramEditor editor = ModelUtil.getEditor( be );
+
+ if (editor!=null) {
+ BPMNFeatureProvider fp = (BPMNFeatureProvider)editor.getDiagramTypeProvider().getFeatureProvider();
+ PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection((ISelection)element);
+ IFeature cf = fp.getCreateFeatureForPictogramElement(pe);
+ if (cf instanceof AbstractBpmn2CreateFeature) {
+ return GraphitiUi.getImageService().getImageForId(
+ ((AbstractBpmn2CreateFeature)cf).getCreateImageId());
+ }
+ if (cf instanceof AbstractCreateFlowFeature) {
+ return GraphitiUi.getImageService().getImageForId(
+ ((AbstractCreateFlowFeature)cf).getCreateImageId());
+ }
+ }
+ return super.getImage(element);
+ }
+
+ @Override
+ public String getText(Object element) {
+ EObject be = BusinessObjectUtil.getBusinessObjectForSelection((ISelection)element);
+ if (be!=null) {
+ if (be instanceof BPMNDiagram) {
+ BaseElement bpmnElement = ((BPMNDiagram)be).getPlane().getBpmnElement();
+ if (bpmnElement instanceof Process) {
+ be = bpmnElement;
+ }
+ }
+ return ModelUtil.getDisplayName(be);
+ }
+ PictogramElement pe = BusinessObjectUtil.getPictogramElementForSelection((ISelection)element);
+ if (pe!=null && pe.getGraphicsAlgorithm()!=null) {
+ return ModelUtil.getLabel( pe.getGraphicsAlgorithm() );
+ }
+ return super.getText(element);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTreeContentProvider.java
index 8c36351..8e2a792 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/PropertyTreeContentProvider.java
@@ -1,87 +1,87 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.dd.di.DiagramElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-final class PropertyTreeContentProvider implements ITreeContentProvider {
- /**
- *
- */
- private final AdvancedDetailComposite advancedDetailComposite;
-
- /**
- * @param advancedDetailComposite
- */
- PropertyTreeContentProvider(AdvancedDetailComposite improvedAdvancedDetailComposite) {
- this.advancedDetailComposite = improvedAdvancedDetailComposite;
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- @Override
- public void dispose() {
-
- }
-
- @Override
- public boolean hasChildren(Object element) {
- if (element instanceof EObject && !(element instanceof DiagramElement)) {
- List<EObject> ret = getFilteredElements(element);
- return !ret.isEmpty();
- }
- return false;
- }
-
- @Override
- public Object getParent(Object element) {
- return null;
- }
-
- @Override
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof EObject && !(inputElement instanceof DiagramElement)) {
- return getFilteredElements(inputElement).toArray();
- }
- return null;
- }
-
- @Override
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof EObject && !(parentElement instanceof DiagramElement)) {
- return getFilteredElements(parentElement).toArray();
- }
- return null;
- }
-
- private List<EObject> getFilteredElements(Object element) {
- List<EObject> ret = new ArrayList<EObject>();
-
- for (EObject eObject : ((EObject) element).eContents()) {
- if (!(eObject instanceof DiagramElement) && !(eObject instanceof BPMNDiagram)) {
- ret.add(eObject);
- }
- }
- return ret;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.dd.di.DiagramElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+final class PropertyTreeContentProvider implements ITreeContentProvider {
+ /**
+ *
+ */
+ private final AdvancedDetailComposite advancedDetailComposite;
+
+ /**
+ * @param advancedDetailComposite
+ */
+ PropertyTreeContentProvider(AdvancedDetailComposite improvedAdvancedDetailComposite) {
+ this.advancedDetailComposite = improvedAdvancedDetailComposite;
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ @Override
+ public void dispose() {
+
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof EObject && !(element instanceof DiagramElement)) {
+ List<EObject> ret = getFilteredElements(element);
+ return !ret.isEmpty();
+ }
+ return false;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof EObject && !(inputElement instanceof DiagramElement)) {
+ return getFilteredElements(inputElement).toArray();
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof EObject && !(parentElement instanceof DiagramElement)) {
+ return getFilteredElements(parentElement).toArray();
+ }
+ return null;
+ }
+
+ private List<EObject> getFilteredElements(Object element) {
+ List<EObject> ret = new ArrayList<EObject>();
+
+ for (EObject eObject : ((EObject) element).eContents()) {
+ if (!(eObject instanceof DiagramElement) && !(eObject instanceof BPMNDiagram)) {
+ ret.add(eObject);
+ }
+ }
+ return ret;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationDetailComposite.java
index 506a574..920e9dc 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationDetailComposite.java
@@ -1,53 +1,53 @@
-package org.eclipse.bpmn2.modeler.ui.property.artifact;
-
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-/**
- *
- * @author hien quoc dang
- *
- */
-public class TextAnnotationDetailComposite extends DefaultDetailComposite {
-
- public TextAnnotationDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- public TextAnnotationDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "textFormat",
- "text",
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-
- @Override
- public void createBindings(EObject be) {
- ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(be, ExtendedPropertiesAdapter.class);
- adapter.getFeatureDescriptor(Bpmn2Package.eINSTANCE.getTextAnnotation_Text()).setMultiLine(true);
- super.createBindings(be);
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.artifact;
+
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+/**
+ *
+ * @author hien quoc dang
+ *
+ */
+public class TextAnnotationDetailComposite extends DefaultDetailComposite {
+
+ public TextAnnotationDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public TextAnnotationDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "textFormat",
+ "text",
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ ExtendedPropertiesAdapter adapter = (ExtendedPropertiesAdapter) AdapterUtil.adapt(be, ExtendedPropertiesAdapter.class);
+ adapter.getFeatureDescriptor(Bpmn2Package.eINSTANCE.getTextAnnotation_Text()).setMultiLine(true);
+ super.createBindings(be);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
index 946a664..8ae1ff1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/artifact/TextAnnotationPropertySection.java
@@ -1,39 +1,39 @@
-package org.eclipse.bpmn2.modeler.ui.property.artifact;
-
-import org.eclipse.bpmn2.TextAnnotation;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-/**
- *
- * @author hien quoc dang
- *
- */
-public class TextAnnotationPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants{
- static {
- PropertiesCompositeFactory.register(TextAnnotation.class, TextAnnotationDetailComposite.class);
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new TextAnnotationDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new TextAnnotationDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
- if (be instanceof TextAnnotation)
- return be;
- return null;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.artifact;
+
+import org.eclipse.bpmn2.TextAnnotation;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+/**
+ *
+ * @author hien quoc dang
+ *
+ */
+public class TextAnnotationPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants{
+ static {
+ PropertiesCompositeFactory.register(TextAnnotation.class, TextAnnotationDetailComposite.class);
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new TextAnnotationDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new TextAnnotationDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
+ if (be instanceof TextAnnotation)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssocationDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssocationDetailComposite.java
index 416cbac..b9a10e7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssocationDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssocationDetailComposite.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class AssocationDetailComposite extends DefaultDetailComposite {
-
- public AssocationDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public AssocationDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "associationDirection"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class AssocationDetailComposite extends DefaultDetailComposite {
+
+ public AssocationDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public AssocationDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "associationDirection"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssociationPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssociationPropertySection.java
index 3d4a807..d19fb06 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssociationPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/AssociationPropertySection.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.Association;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class AssociationPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(Association.class, AssocationDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new AssocationDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new AssocationDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Association)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.Association;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class AssociationPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(Association.class, AssocationDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new AssocationDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new AssocationDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Association)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationDetailComposite.java
index 7f7ec9f..b7bfe16 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationDetailComposite.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ConversationDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider propertiesProvider;
-
- public ConversationDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ConversationDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "correlationKeys"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ConversationDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider propertiesProvider;
+
+ public ConversationDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ConversationDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "correlationKeys"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkDetailComposite.java
index a75e0b3..8da2cbe 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkDetailComposite.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ConversationLinkDetailComposite extends DefaultDetailComposite {
-
- // NOTE: This has no additional attributes or other features
-
- public ConversationLinkDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ConversationLinkDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void createBindings(EObject be) {
- getToolkit().createLabel(this, "Nothing to see here...move along!");
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ConversationLinkDetailComposite extends DefaultDetailComposite {
+
+ // NOTE: This has no additional attributes or other features
+
+ public ConversationLinkDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ConversationLinkDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ getToolkit().createLabel(this, "Nothing to see here...move along!");
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkPropertySection.java
index f44444f..1ed12be 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationLinkPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.ConversationLink;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ConversationLinkPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ConversationLink.class, ConversationLinkDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ConversationLinkDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ConversationLinkDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ConversationLink)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.ConversationLink;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ConversationLinkPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ConversationLink.class, ConversationLinkDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ConversationLinkDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ConversationLinkDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ConversationLink)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationPropertySection.java
index 98f7060..ffc3e65 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/ConversationPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.Conversation;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ConversationPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(Conversation.class, ConversationDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ConversationDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ConversationDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Conversation)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.Conversation;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ConversationPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(Conversation.class, ConversationDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ConversationDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ConversationDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Conversation)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowDetailComposite.java
index fcc6909..bf415d1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowDetailComposite.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class MessageFlowDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider propertiesProvider;
-
- public MessageFlowDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public MessageFlowDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "messageRef",
- "sourceRef",
- "targetRef"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class MessageFlowDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider propertiesProvider;
+
+ public MessageFlowDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public MessageFlowDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "messageRef",
+ "sourceRef",
+ "targetRef"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowPropertySection.java
index b74f9dc..fcf783f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/MessageFlowPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.MessageFlow;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class MessageFlowPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(MessageFlow.class, MessageFlowDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new MessageFlowDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new MessageFlowDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof MessageFlow)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.MessageFlow;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class MessageFlowPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(MessageFlow.class, MessageFlowDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new MessageFlowDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new MessageFlowDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof MessageFlow)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/SequenceFlowPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/SequenceFlowPropertySection.java
index 80a97d5..ba4ce40 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/SequenceFlowPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/connectors/SequenceFlowPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.connectors;
-
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class SequenceFlowPropertySection extends AbstractBpmn2PropertySection {
-
- static {
- PropertiesCompositeFactory.register(SequenceFlow.class, SequenceFlowDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new SequenceFlowDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new SequenceFlowDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof SequenceFlow)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.connectors;
+
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class SequenceFlowPropertySection extends AbstractBpmn2PropertySection {
+
+ static {
+ PropertiesCompositeFactory.register(SequenceFlow.class, SequenceFlowDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new SequenceFlowDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new SequenceFlowDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof SequenceFlow)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ConditionalEventDefinitionDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ConditionalEventDefinitionDetailComposite.java
index 996554e..2d88d84 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ConditionalEventDefinitionDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ConditionalEventDefinitionDetailComposite.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.ConditionalEventDefinition;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ConditionalEventDefinitionDetailComposite extends ExpressionDetailComposite {
-
- public ConditionalEventDefinitionDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ConditionalEventDefinitionDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void setBusinessObject(EObject object) {
- if (object instanceof ConditionalEventDefinition) {
- ConditionalEventDefinition ced = (ConditionalEventDefinition)object;
- if (ced.getCondition()==null) {
- object = ModelUtil.createFeature(
- ced,
- PACKAGE.getConditionalEventDefinition_Condition(),
- PACKAGE.getFormalExpression());
- }
- else
- object = ced.getCondition();
- }
- super.setBusinessObject(object);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.ConditionalEventDefinition;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ConditionalEventDefinitionDetailComposite extends ExpressionDetailComposite {
+
+ public ConditionalEventDefinitionDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ConditionalEventDefinitionDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void setBusinessObject(EObject object) {
+ if (object instanceof ConditionalEventDefinition) {
+ ConditionalEventDefinition ced = (ConditionalEventDefinition)object;
+ if (ced.getCondition()==null) {
+ object = ModelUtil.createFeature(
+ ced,
+ PACKAGE.getConditionalEventDefinition_Condition(),
+ PACKAGE.getFormalExpression());
+ }
+ else
+ object = ced.getCondition();
+ }
+ super.setBusinessObject(object);
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataAssignmentDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataAssignmentDetailComposite.java
index 9f576cd..86120ad 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataAssignmentDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataAssignmentDetailComposite.java
@@ -1,101 +1,101 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.Assignment;
-import org.eclipse.bpmn2.Expression;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.util.PropertyUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-
-public class DataAssignmentDetailComposite extends DefaultDetailComposite {
-
- private AbstractDetailComposite fromDetails;
- private AbstractDetailComposite toDetails;
-
- public DataAssignmentDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public DataAssignmentDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- protected void cleanBindings() {
- super.cleanBindings();
- fromDetails = null;
- toDetails = null;
- }
-
- @SuppressWarnings("restriction")
- @Override
- public void createBindings(final EObject be) {
-
- if (be instanceof Assignment) {
-
- final Assignment assignment = (Assignment) be;
-
- // an Assignment is not really valid without both a From and To
- Expression toExp = assignment.getTo();
- if (toExp==null) {
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- Expression exp = FACTORY.createFormalExpression();
- assignment.setTo(exp);
- ModelUtil.setID(exp);
- }
- });
- toExp = assignment.getTo();
- }
-
- Expression fromExp = assignment.getFrom();
- if (fromExp==null) {
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- Expression exp = FACTORY.createFormalExpression();
- assignment.setFrom(exp);
- ModelUtil.setID(exp);
- }
- });
- fromExp = assignment.getFrom();
- }
-
- if (toDetails==null) {
- toDetails = PropertiesCompositeFactory.createDetailComposite(
- Expression.class, this, SWT.NONE);
- }
- toDetails.setBusinessObject(toExp);
- toDetails.setTitle("To Expression");
-
- if (fromDetails==null) {
- fromDetails = PropertiesCompositeFactory.createDetailComposite(
- Expression.class, this, SWT.NONE);
- }
- fromDetails.setBusinessObject(fromExp);
- fromDetails.setTitle("From Expression");
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.Assignment;
+import org.eclipse.bpmn2.Expression;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.util.PropertyUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+public class DataAssignmentDetailComposite extends DefaultDetailComposite {
+
+ private AbstractDetailComposite fromDetails;
+ private AbstractDetailComposite toDetails;
+
+ public DataAssignmentDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public DataAssignmentDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ protected void cleanBindings() {
+ super.cleanBindings();
+ fromDetails = null;
+ toDetails = null;
+ }
+
+ @SuppressWarnings("restriction")
+ @Override
+ public void createBindings(final EObject be) {
+
+ if (be instanceof Assignment) {
+
+ final Assignment assignment = (Assignment) be;
+
+ // an Assignment is not really valid without both a From and To
+ Expression toExp = assignment.getTo();
+ if (toExp==null) {
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ Expression exp = FACTORY.createFormalExpression();
+ assignment.setTo(exp);
+ ModelUtil.setID(exp);
+ }
+ });
+ toExp = assignment.getTo();
+ }
+
+ Expression fromExp = assignment.getFrom();
+ if (fromExp==null) {
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ Expression exp = FACTORY.createFormalExpression();
+ assignment.setFrom(exp);
+ ModelUtil.setID(exp);
+ }
+ });
+ fromExp = assignment.getFrom();
+ }
+
+ if (toDetails==null) {
+ toDetails = PropertiesCompositeFactory.createDetailComposite(
+ Expression.class, this, SWT.NONE);
+ }
+ toDetails.setBusinessObject(toExp);
+ toDetails.setTitle("To Expression");
+
+ if (fromDetails==null) {
+ fromDetails = PropertiesCompositeFactory.createDetailComposite(
+ Expression.class, this, SWT.NONE);
+ }
+ fromDetails.setBusinessObject(fromExp);
+ fromDetails.setTitle("From Expression");
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectPropertySection.java
index 3abe3b9..80b3d4f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectPropertySection.java
@@ -1,163 +1,163 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.Assignment;
-import org.eclipse.bpmn2.DataObject;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.DataState;
-import org.eclipse.bpmn2.Expression;
-import org.eclipse.bpmn2.FormalExpression;
-import org.eclipse.bpmn2.HumanPerformer;
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.Performer;
-import org.eclipse.bpmn2.PotentialOwner;
-import org.eclipse.bpmn2.ResourceAssignmentExpression;
-import org.eclipse.bpmn2.ResourceParameterBinding;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- * From section 10.3.1 of the BPMN 2.0 specification:
- * "The Data Object class is an item-aware parameter. Data Object elements MUST be contained within Process or Sub-
- * Process elements. Data Object elements are visually displayed on a Process diagram. Data Object References are
- * a way to reuse Data Objects in the same diagram. They can specify different states of the same Data Object at
- * different points in a Process. Data Object Reference cannot specify item definitions, and Data Objects cannot
- * specify states. The names of Data Object References are derived by concatenating the name of the referenced Data
- * Data Object the state of the Data Object Reference in square brackets as follows: <Data Object Name> [ <Data
- * Object Reference State> ]."
- */
-public class DataObjectPropertySection extends AbstractBpmn2PropertySection {
-
- static {
- PropertiesCompositeFactory.register(DataObject.class, DataObjectDetailComposite.class);
- PropertiesCompositeFactory.register(DataObjectReference.class, DataObjectDetailComposite.class);
- PropertiesCompositeFactory.register(Assignment.class, DataAssignmentDetailComposite.class);
- PropertiesCompositeFactory.register(Expression.class, ExpressionDetailComposite.class);
- PropertiesCompositeFactory.register(FormalExpression.class, ExpressionDetailComposite.class);
- PropertiesCompositeFactory.register(ResourceAssignmentExpression.class, ResourceAssignmentExpressionDetailComposite.class);
- PropertiesCompositeFactory.register(ResourceParameterBinding.class, ResourceParameterBindingDetailComposite.class);
- PropertiesCompositeFactory.register(PotentialOwner.class, ResourceRoleDetailComposite.class);
- PropertiesCompositeFactory.register(HumanPerformer.class, ResourceRoleDetailComposite.class);
- PropertiesCompositeFactory.register(Performer.class, ResourceRoleDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new DataObjectDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new DataObjectDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject bo = super.getBusinessObjectForPictogramElement(pe);
- if (bo instanceof DataObject) {
- return bo;
- }
- if (bo instanceof DataObjectReference) {
- return ((DataObjectReference)bo).getDataObjectRef();
- }
-
- return null;
- }
-
- public class DataObjectDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider dataObjectReferencePropertiesProvider;
- private AbstractPropertiesProvider dataStatePropertiesProvider;
-
- public DataObjectDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public DataObjectDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (object instanceof DataState) {
- if (dataStatePropertiesProvider == null) {
- dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return dataStatePropertiesProvider;
- }
- else if (object instanceof DataObject) {
- if (propertiesProvider == null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name", "isCollection", "itemSubjectRef" };
- String[] children = new String[] { "dataState" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
-
- @Override
- public String[] getChildren(String name) {
- return children;
- }
- };
- }
- return propertiesProvider;
- }
- else if (object instanceof DataObjectReference) {
- if (dataObjectReferencePropertiesProvider == null) {
- dataObjectReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
- String[] children = new String[] { "dataObjectRef" , "dataState" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
-
- @Override
- public String[] getChildren(String name) {
- return children;
- }
- };
-
- }
- return dataObjectReferencePropertiesProvider;
- }
- return null;
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.Assignment;
+import org.eclipse.bpmn2.DataObject;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.DataState;
+import org.eclipse.bpmn2.Expression;
+import org.eclipse.bpmn2.FormalExpression;
+import org.eclipse.bpmn2.HumanPerformer;
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.Performer;
+import org.eclipse.bpmn2.PotentialOwner;
+import org.eclipse.bpmn2.ResourceAssignmentExpression;
+import org.eclipse.bpmn2.ResourceParameterBinding;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ * From section 10.3.1 of the BPMN 2.0 specification:
+ * "The Data Object class is an item-aware parameter. Data Object elements MUST be contained within Process or Sub-
+ * Process elements. Data Object elements are visually displayed on a Process diagram. Data Object References are
+ * a way to reuse Data Objects in the same diagram. They can specify different states of the same Data Object at
+ * different points in a Process. Data Object Reference cannot specify item definitions, and Data Objects cannot
+ * specify states. The names of Data Object References are derived by concatenating the name of the referenced Data
+ * Data Object the state of the Data Object Reference in square brackets as follows: <Data Object Name> [ <Data
+ * Object Reference State> ]."
+ */
+public class DataObjectPropertySection extends AbstractBpmn2PropertySection {
+
+ static {
+ PropertiesCompositeFactory.register(DataObject.class, DataObjectDetailComposite.class);
+ PropertiesCompositeFactory.register(DataObjectReference.class, DataObjectDetailComposite.class);
+ PropertiesCompositeFactory.register(Assignment.class, DataAssignmentDetailComposite.class);
+ PropertiesCompositeFactory.register(Expression.class, ExpressionDetailComposite.class);
+ PropertiesCompositeFactory.register(FormalExpression.class, ExpressionDetailComposite.class);
+ PropertiesCompositeFactory.register(ResourceAssignmentExpression.class, ResourceAssignmentExpressionDetailComposite.class);
+ PropertiesCompositeFactory.register(ResourceParameterBinding.class, ResourceParameterBindingDetailComposite.class);
+ PropertiesCompositeFactory.register(PotentialOwner.class, ResourceRoleDetailComposite.class);
+ PropertiesCompositeFactory.register(HumanPerformer.class, ResourceRoleDetailComposite.class);
+ PropertiesCompositeFactory.register(Performer.class, ResourceRoleDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new DataObjectDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DataObjectDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject bo = super.getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof DataObject) {
+ return bo;
+ }
+ if (bo instanceof DataObjectReference) {
+ return ((DataObjectReference)bo).getDataObjectRef();
+ }
+
+ return null;
+ }
+
+ public class DataObjectDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider dataObjectReferencePropertiesProvider;
+ private AbstractPropertiesProvider dataStatePropertiesProvider;
+
+ public DataObjectDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public DataObjectDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (object instanceof DataState) {
+ if (dataStatePropertiesProvider == null) {
+ dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return dataStatePropertiesProvider;
+ }
+ else if (object instanceof DataObject) {
+ if (propertiesProvider == null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name", "isCollection", "itemSubjectRef" };
+ String[] children = new String[] { "dataState" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String[] getChildren(String name) {
+ return children;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+ else if (object instanceof DataObjectReference) {
+ if (dataObjectReferencePropertiesProvider == null) {
+ dataObjectReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+ String[] children = new String[] { "dataObjectRef" , "dataState" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String[] getChildren(String name) {
+ return children;
+ }
+ };
+
+ }
+ return dataObjectReferencePropertiesProvider;
+ }
+ return null;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectReferencePropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectReferencePropertySection.java
index 728e907..a8218c8 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectReferencePropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataObjectReferencePropertySection.java
@@ -1,113 +1,113 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.DataObject;
-import org.eclipse.bpmn2.DataObjectReference;
-import org.eclipse.bpmn2.DataState;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataObjectReferencePropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(DataObjectReference.class, DataObjectReferenceDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new DataObjectReferenceDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new DataObjectReferenceDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject bo = super.getBusinessObjectForPictogramElement(pe);
- if (bo instanceof DataObjectReference) {
- return bo;
- }
- return null;
- }
-
- public class DataObjectReferenceDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider dataObjectReferencePropertiesProvider;
- private AbstractPropertiesProvider dataStatePropertiesProvider;
-
- /**
- * @param section
- */
- public DataObjectReferenceDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public DataObjectReferenceDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (object instanceof DataState) {
- if (dataStatePropertiesProvider == null) {
- dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return dataStatePropertiesProvider;
- }
- else if (object instanceof DataObjectReference) {
- if (dataObjectReferencePropertiesProvider == null) {
- dataObjectReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
- String[] children = new String[] { "dataState" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
-
- @Override
- public String[] getChildren(String name) {
- return children;
- }
- };
-
- }
- return dataObjectReferencePropertiesProvider;
- }
- return null;
- }
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.DataObject;
+import org.eclipse.bpmn2.DataObjectReference;
+import org.eclipse.bpmn2.DataState;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataObjectReferencePropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(DataObjectReference.class, DataObjectReferenceDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new DataObjectReferenceDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DataObjectReferenceDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject bo = super.getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof DataObjectReference) {
+ return bo;
+ }
+ return null;
+ }
+
+ public class DataObjectReferenceDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider dataObjectReferencePropertiesProvider;
+ private AbstractPropertiesProvider dataStatePropertiesProvider;
+
+ /**
+ * @param section
+ */
+ public DataObjectReferenceDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public DataObjectReferenceDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (object instanceof DataState) {
+ if (dataStatePropertiesProvider == null) {
+ dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return dataStatePropertiesProvider;
+ }
+ else if (object instanceof DataObjectReference) {
+ if (dataObjectReferencePropertiesProvider == null) {
+ dataObjectReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+ String[] children = new String[] { "dataState" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String[] getChildren(String name) {
+ return children;
+ }
+ };
+
+ }
+ return dataObjectReferencePropertiesProvider;
+ }
+ return null;
+ }
+
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStorePropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStorePropertySection.java
index 457ad60..66a76f7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStorePropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStorePropertySection.java
@@ -1,139 +1,139 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.DataStore;
-import org.eclipse.bpmn2.DataStoreReference;
-import org.eclipse.bpmn2.DataState;
-import org.eclipse.bpmn2.DataStore;
-import org.eclipse.bpmn2.DataStoreReference;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataStorePropertySection extends AbstractBpmn2PropertySection {
-
- static {
- // register the DataStoreDetailComposite for rendering DataStore objects
- PropertiesCompositeFactory.register(DataStore.class, DataStoreDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new DataStoreDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new DataStoreDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject bo = super.getBusinessObjectForPictogramElement(pe);
- if (bo instanceof DataStoreReference) {
- return ((DataStoreReference) bo).getDataStoreRef();
- } else if (bo instanceof DataStore) {
- return bo;
- }
-
- return null;
- }
-
- public class DataStoreDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider dataStoreReferencePropertiesProvider;
- private AbstractPropertiesProvider dataStatePropertiesProvider;
-
- public DataStoreDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public DataStoreDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (object instanceof DataState) {
- if (dataStatePropertiesProvider == null) {
- dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return dataStatePropertiesProvider;
- }
- else if (object instanceof DataStore) {
- if (propertiesProvider == null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name", "capacity", "isUnlimited", "itemSubjectRef" };
- String[] children = new String[] { "dataState" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
-
- @Override
- public String[] getChildren(String name) {
- return children;
- }
- };
- }
- return propertiesProvider;
- }
- else if (object instanceof DataStoreReference) {
- if (dataStoreReferencePropertiesProvider == null) {
- dataStoreReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
- String[] children = new String[] { "dataStoreRef" , "dataState" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
-
- @Override
- public String[] getChildren(String name) {
- return children;
- }
- };
-
- }
- return dataStoreReferencePropertiesProvider;
- }
- return null;
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.DataStore;
+import org.eclipse.bpmn2.DataStoreReference;
+import org.eclipse.bpmn2.DataState;
+import org.eclipse.bpmn2.DataStore;
+import org.eclipse.bpmn2.DataStoreReference;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite.AbstractPropertiesProvider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataStorePropertySection extends AbstractBpmn2PropertySection {
+
+ static {
+ // register the DataStoreDetailComposite for rendering DataStore objects
+ PropertiesCompositeFactory.register(DataStore.class, DataStoreDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new DataStoreDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DataStoreDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject bo = super.getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof DataStoreReference) {
+ return ((DataStoreReference) bo).getDataStoreRef();
+ } else if (bo instanceof DataStore) {
+ return bo;
+ }
+
+ return null;
+ }
+
+ public class DataStoreDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider dataStoreReferencePropertiesProvider;
+ private AbstractPropertiesProvider dataStatePropertiesProvider;
+
+ public DataStoreDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public DataStoreDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (object instanceof DataState) {
+ if (dataStatePropertiesProvider == null) {
+ dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return dataStatePropertiesProvider;
+ }
+ else if (object instanceof DataStore) {
+ if (propertiesProvider == null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name", "capacity", "isUnlimited", "itemSubjectRef" };
+ String[] children = new String[] { "dataState" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String[] getChildren(String name) {
+ return children;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+ else if (object instanceof DataStoreReference) {
+ if (dataStoreReferencePropertiesProvider == null) {
+ dataStoreReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+ String[] children = new String[] { "dataStoreRef" , "dataState" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String[] getChildren(String name) {
+ return children;
+ }
+ };
+
+ }
+ return dataStoreReferencePropertiesProvider;
+ }
+ return null;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStoreReferencePropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStoreReferencePropertySection.java
index 32a80bb..74238ca 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStoreReferencePropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/DataStoreReferencePropertySection.java
@@ -1,113 +1,113 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.DataStoreReference;
-import org.eclipse.bpmn2.DataState;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Bob Brodt
- *
- */
-public class DataStoreReferencePropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(DataStoreReference.class, DataStoreReferenceDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new DataStoreReferenceDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new DataStoreReferenceDetailComposite(parent,style);
- }
-
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject bo = super.getBusinessObjectForPictogramElement(pe);
- if (bo instanceof DataStoreReference) {
- return bo;
- }
- return null;
- }
-
- public class DataStoreReferenceDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider dataStoreReferencePropertiesProvider;
- private AbstractPropertiesProvider dataStatePropertiesProvider;
-
- /**
- * @param section
- */
- public DataStoreReferenceDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public DataStoreReferenceDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (object instanceof DataState) {
- if (dataStatePropertiesProvider == null) {
- dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return dataStatePropertiesProvider;
- }
- else if (object instanceof DataStoreReference) {
- if (dataStoreReferencePropertiesProvider == null) {
- dataStoreReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] { "id", "name" };
- String[] children = new String[] { "dataState" };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
-
- @Override
- public String[] getChildren(String name) {
- return children;
- }
- };
-
- }
- return dataStoreReferencePropertiesProvider;
- }
- return null;
- }
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.DataStoreReference;
+import org.eclipse.bpmn2.DataState;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class DataStoreReferencePropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(DataStoreReference.class, DataStoreReferenceDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new DataStoreReferenceDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DataStoreReferenceDetailComposite(parent,style);
+ }
+
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject bo = super.getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof DataStoreReference) {
+ return bo;
+ }
+ return null;
+ }
+
+ public class DataStoreReferenceDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider dataStoreReferencePropertiesProvider;
+ private AbstractPropertiesProvider dataStatePropertiesProvider;
+
+ /**
+ * @param section
+ */
+ public DataStoreReferenceDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public DataStoreReferenceDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (object instanceof DataState) {
+ if (dataStatePropertiesProvider == null) {
+ dataStatePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return dataStatePropertiesProvider;
+ }
+ else if (object instanceof DataStoreReference) {
+ if (dataStoreReferencePropertiesProvider == null) {
+ dataStoreReferencePropertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] { "id", "name" };
+ String[] children = new String[] { "dataState" };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String[] getChildren(String name) {
+ return children;
+ }
+ };
+
+ }
+ return dataStoreReferencePropertiesProvider;
+ }
+ return null;
+ }
+
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ExpressionDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ExpressionDetailComposite.java
index 7557145..f0d2ff2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ExpressionDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ExpressionDetailComposite.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ExpressionDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider propertiesProvider;
-
- public ExpressionDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ExpressionDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "body",
- "language",
- "evaluatesToTypeRef"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ExpressionDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider propertiesProvider;
+
+ public ExpressionDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ExpressionDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "body",
+ "language",
+ "evaluatesToTypeRef"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ItemAwareElementDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ItemAwareElementDetailComposite.java
index 5cf7b8e..0a06914 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ItemAwareElementDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/ItemAwareElementDetailComposite.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ItemAwareElementDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider propertiesProvider;
-
- public ItemAwareElementDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ItemAwareElementDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "id",
- "name",
- "dataState",
- "itemSubjectRef"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ItemAwareElementDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider propertiesProvider;
+
+ public ItemAwareElementDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ItemAwareElementDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "id",
+ "name",
+ "dataState",
+ "itemSubjectRef"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/MessageDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/MessageDetailComposite.java
index 92761c6..6e3f972 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/MessageDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/MessageDetailComposite.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.data;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class MessageDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider propertiesProvider;
-
- public MessageDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public MessageDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "name",
- "itemRef"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class MessageDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider propertiesProvider;
+
+ public MessageDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public MessageDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "name",
+ "itemRef"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
index 2e84662..3b18a40 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
@@ -1,51 +1,51 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import java.io.IOException;
-import java.util.Collection;
-
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.Property;
-import org.eclipse.bpmn2.ResourceRole;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-
-public class DataItemsPropertySection extends DefaultPropertySection {
-
- static {
- PropertiesCompositeFactory.register(ItemDefinition.class, ItemDefinitionDetailComposite.class);
- PropertiesCompositeFactory.register(ItemDefinition.class, ItemDefinitionListComposite.class);
- PropertiesCompositeFactory.register(Property.class, PropertyListComposite.class);
- PropertiesCompositeFactory.register(ResourceRole.class, ResourceRoleListComposite.class);
- }
-
- public DataItemsPropertySection() {
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new DataItemsDetailComposite(this);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof BPMNDiagram) {
-// EList<EObject> contents = be.eResource().getContents();
-// if (!contents.isEmpty() && contents.get(0) instanceof DocumentRoot) {
-// return contents.get(0);
-// }
- try {
- return ModelHandlerLocator.getModelHandler(be.eResource()).getDefinitions();
- } catch (IOException e) {
- Activator.showErrorWithLogging(e);
- }
- }
- return null;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.Property;
+import org.eclipse.bpmn2.ResourceRole;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+public class DataItemsPropertySection extends DefaultPropertySection {
+
+ static {
+ PropertiesCompositeFactory.register(ItemDefinition.class, ItemDefinitionDetailComposite.class);
+ PropertiesCompositeFactory.register(ItemDefinition.class, ItemDefinitionListComposite.class);
+ PropertiesCompositeFactory.register(Property.class, PropertyListComposite.class);
+ PropertiesCompositeFactory.register(ResourceRole.class, ResourceRoleListComposite.class);
+ }
+
+ public DataItemsPropertySection() {
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new DataItemsDetailComposite(this);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof BPMNDiagram) {
+// EList<EObject> contents = be.eResource().getContents();
+// if (!contents.isEmpty() && contents.get(0) instanceof DocumentRoot) {
+// return contents.get(0);
+// }
+ try {
+ return ModelHandlerLocator.getModelHandler(be.eResource()).getDefinitions();
+ } catch (IOException e) {
+ Activator.showErrorWithLogging(e);
+ }
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertySection.java
index fe2ba42..c9c7e34 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertySection.java
@@ -1,49 +1,49 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.Import;
-import org.eclipse.bpmn2.TimerEventDefinition;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.property.diagrams.DefinitionsPropertyComposite.ImportDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefinitionsPropertySection extends AbstractBpmn2PropertySection {
-
- static {
- PropertiesCompositeFactory.register(Import.class, ImportDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new DefinitionsPropertyComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new DefinitionsPropertyComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof BPMNDiagram) {
- try {
- return ModelHandlerLocator.getModelHandler(be.eResource()).getDefinitions();
- } catch (IOException e) {
- Activator.showErrorWithLogging(e);
- }
- }
- return null;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.Import;
+import org.eclipse.bpmn2.TimerEventDefinition;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.property.diagrams.DefinitionsPropertyComposite.ImportDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class DefinitionsPropertySection extends AbstractBpmn2PropertySection {
+
+ static {
+ PropertiesCompositeFactory.register(Import.class, ImportDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new DefinitionsPropertyComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DefinitionsPropertyComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof BPMNDiagram) {
+ try {
+ return ModelHandlerLocator.getModelHandler(be.eResource()).getDefinitions();
+ } catch (IOException e) {
+ Activator.showErrorWithLogging(e);
+ }
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionListComposite.java
index 23c3af5..e59b3cf 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionListComposite.java
@@ -1,43 +1,43 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.swt.widgets.Composite;
-
-public class ItemDefinitionListComposite extends DefaultListComposite {
-
- public ItemDefinitionListComposite(AbstractBpmn2PropertySection section, int style) {
- super(section, style);
- }
-
- public ItemDefinitionListComposite(AbstractBpmn2PropertySection section) {
- super(section, DEFAULT_STYLE|EDIT_BUTTON);
- }
-
- public ItemDefinitionListComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- public ItemDefinitionListComposite(Composite parent) {
- super(parent, DEFAULT_STYLE|EDIT_BUTTON);
- }
-
- public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
- if (columnProvider==null) {
- columnProvider = new ListCompositeColumnProvider(this,true);
- EClass eclass = PACKAGE.getItemDefinition();
-
- columnProvider.add(object,PACKAGE.getItemDefinition_StructureRef()).setEditable(false);
- columnProvider.add(object,PACKAGE.getItemDefinition_ItemKind());
- columnProvider.add(object,PACKAGE.getItemDefinition_IsCollection());
- }
- return columnProvider;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.swt.widgets.Composite;
+
+public class ItemDefinitionListComposite extends DefaultListComposite {
+
+ public ItemDefinitionListComposite(AbstractBpmn2PropertySection section, int style) {
+ super(section, style);
+ }
+
+ public ItemDefinitionListComposite(AbstractBpmn2PropertySection section) {
+ super(section, DEFAULT_STYLE|EDIT_BUTTON);
+ }
+
+ public ItemDefinitionListComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public ItemDefinitionListComposite(Composite parent) {
+ super(parent, DEFAULT_STYLE|EDIT_BUTTON);
+ }
+
+ public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
+ if (columnProvider==null) {
+ columnProvider = new ListCompositeColumnProvider(this,true);
+ EClass eclass = PACKAGE.getItemDefinition();
+
+ columnProvider.add(object,PACKAGE.getItemDefinition_StructureRef()).setEditable(false);
+ columnProvider.add(object,PACKAGE.getItemDefinition_ItemKind());
+ columnProvider.add(object,PACKAGE.getItemDefinition_IsCollection());
+ }
+ return columnProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertyComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertyComposite.java
index ac10c82..ab085ed 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertyComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertyComposite.java
@@ -1,41 +1,41 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ProcessDiagramPropertyComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider propertiesProvider;
-
- public ProcessDiagramPropertyComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- public ProcessDiagramPropertyComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider == null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "id", "name",
- "anyAttribute",
- "processType", "isExecutable", "isClosed",
- "definitionalCollaborationRef",
- "ioSpecification",
- "ioBinding",
- "properties", "laneSets", "correlationSubscriptions"};
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ProcessDiagramPropertyComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider propertiesProvider;
+
+ public ProcessDiagramPropertyComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public ProcessDiagramPropertyComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider == null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "id", "name",
+ "anyAttribute",
+ "processType", "isExecutable", "isClosed",
+ "definitionalCollaborationRef",
+ "ioSpecification",
+ "ioBinding",
+ "properties", "laneSets", "correlationSubscriptions"};
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertySection.java
index f436623..9113538 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ProcessDiagramPropertySection.java
@@ -1,48 +1,48 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.di.BPMNDiagram;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class ProcessDiagramPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(Process.class, ProcessDiagramPropertyComposite.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#
- * createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ProcessDiagramPropertyComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ProcessDiagramPropertyComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject bo = super.getBusinessObjectForPictogramElement(pe);
- if (bo instanceof Participant) {
- return ((Participant) bo).getProcessRef();
- } else if (bo instanceof BPMNDiagram) {
- BaseElement be = ((BPMNDiagram)bo).getPlane().getBpmnElement();
- if (be instanceof Process)
- return be;
- }
-
- return null;
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class ProcessDiagramPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(Process.class, ProcessDiagramPropertyComposite.class);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#
+ * createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ProcessDiagramPropertyComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ProcessDiagramPropertyComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject bo = super.getBusinessObjectForPictogramElement(pe);
+ if (bo instanceof Participant) {
+ return ((Participant) bo).getProcessRef();
+ } else if (bo instanceof BPMNDiagram) {
+ BaseElement be = ((BPMNDiagram)bo).getPlane().getBpmnElement();
+ if (be instanceof Process)
+ return be;
+ }
+
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/PropertyListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/PropertyListComposite.java
index dcd4b73..1ac0613 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/PropertyListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/PropertyListComposite.java
@@ -1,66 +1,66 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import org.eclipse.bpmn2.Property;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-public class PropertyListComposite extends DefaultListComposite {
-
- public PropertyListComposite(AbstractBpmn2PropertySection section) {
- super(section, DEFAULT_STYLE|EDIT_BUTTON);
- }
-
- public PropertyListComposite(Composite parent) {
- this(parent, DEFAULT_STYLE|EDIT_BUTTON);
- }
-
- public PropertyListComposite(Composite parent, int style) {
- super(parent,style);
- }
-
- @Override
- public void bindList(EObject theobject, EStructuralFeature thefeature) {
- super.bindList(theobject, thefeature);
- ModelUtil.setLabel(theobject, thefeature, "Variables");
- }
-
- public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
- if (columnProvider==null) {
- columnProvider = new ListCompositeColumnProvider(this,true);
- columnProvider.add(new TableColumn(object, PACKAGE.getProperty_Name()));
- columnProvider.add(new TableColumn(object, PACKAGE.getItemAwareElement_ItemSubjectRef()));
- }
- return columnProvider;
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- EList<Property> properties = (EList)object.eGet(feature);
- // generate a unique parameter name
- String base = "localVar";
- int suffix = 1;
- String name = base + suffix;
- for (;;) {
- boolean found = false;
- for (Property p : properties) {
- if (name.equals(p.getName()) || name.equals(p.getId())) {
- found = true;
- break;
- }
- }
- if (!found)
- break;
- name = base + ++suffix;
- }
- Property prop = (Property)super.addListItem(object, feature);
- prop.setName(name);
- return prop;
- }
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import org.eclipse.bpmn2.Property;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+public class PropertyListComposite extends DefaultListComposite {
+
+ public PropertyListComposite(AbstractBpmn2PropertySection section) {
+ super(section, DEFAULT_STYLE|EDIT_BUTTON);
+ }
+
+ public PropertyListComposite(Composite parent) {
+ this(parent, DEFAULT_STYLE|EDIT_BUTTON);
+ }
+
+ public PropertyListComposite(Composite parent, int style) {
+ super(parent,style);
+ }
+
+ @Override
+ public void bindList(EObject theobject, EStructuralFeature thefeature) {
+ super.bindList(theobject, thefeature);
+ ModelUtil.setLabel(theobject, thefeature, "Variables");
+ }
+
+ public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
+ if (columnProvider==null) {
+ columnProvider = new ListCompositeColumnProvider(this,true);
+ columnProvider.add(new TableColumn(object, PACKAGE.getProperty_Name()));
+ columnProvider.add(new TableColumn(object, PACKAGE.getItemAwareElement_ItemSubjectRef()));
+ }
+ return columnProvider;
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ EList<Property> properties = (EList)object.eGet(feature);
+ // generate a unique parameter name
+ String base = "localVar";
+ int suffix = 1;
+ String name = base + suffix;
+ for (;;) {
+ boolean found = false;
+ for (Property p : properties) {
+ if (name.equals(p.getName()) || name.equals(p.getId())) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ break;
+ name = base + ++suffix;
+ }
+ Property prop = (Property)super.addListItem(object, feature);
+ prop.setName(name);
+ return prop;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ResourceRoleListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ResourceRoleListComposite.java
index 627a2a7..f657422 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ResourceRoleListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ResourceRoleListComposite.java
@@ -1,66 +1,66 @@
-package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-
-import org.eclipse.bpmn2.ResourceRole;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-public class ResourceRoleListComposite extends DefaultListComposite {
-
- public ResourceRoleListComposite(AbstractBpmn2PropertySection section) {
- super(section, DEFAULT_STYLE|EDIT_BUTTON);
- }
-
- public ResourceRoleListComposite(Composite parent) {
- this(parent, DEFAULT_STYLE|EDIT_BUTTON);
- }
-
- public ResourceRoleListComposite(Composite parent, int style) {
- super(parent,style);
- }
-
- @Override
- public void bindList(EObject theobject, EStructuralFeature thefeature) {
- super.bindList(theobject, thefeature);
- ModelUtil.setLabel(theobject, thefeature, "Roles");
- }
-
- public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
- if (columnProvider==null) {
- columnProvider = new ListCompositeColumnProvider(this,true);
- columnProvider.add(new TableColumn(object, PACKAGE.getResourceRole_Name()));
- columnProvider.add(new TableColumn(object, PACKAGE.getResourceRole_ResourceRef()));
- }
- return columnProvider;
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
-// EList<ResourceRole> roles = (EList)object.eGet(feature);
-// // generate a unique parameter name
-// String base = "Role";
-// int suffix = 1;
-// String name = base + suffix;
-// for (;;) {
-// boolean found = false;
-// for (ResourceRole p : roles) {
-// if (name.equals(p.getName()) || name.equals(p.getId())) {
-// found = true;
-// break;
-// }
-// }
-// if (!found)
-// break;
-// name = base + ++suffix;
-// }
- ResourceRole role = (ResourceRole)super.addListItem(object, feature);
-// role.setName(name);
- return role;
- }
+package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+
+import org.eclipse.bpmn2.ResourceRole;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+public class ResourceRoleListComposite extends DefaultListComposite {
+
+ public ResourceRoleListComposite(AbstractBpmn2PropertySection section) {
+ super(section, DEFAULT_STYLE|EDIT_BUTTON);
+ }
+
+ public ResourceRoleListComposite(Composite parent) {
+ this(parent, DEFAULT_STYLE|EDIT_BUTTON);
+ }
+
+ public ResourceRoleListComposite(Composite parent, int style) {
+ super(parent,style);
+ }
+
+ @Override
+ public void bindList(EObject theobject, EStructuralFeature thefeature) {
+ super.bindList(theobject, thefeature);
+ ModelUtil.setLabel(theobject, thefeature, "Roles");
+ }
+
+ public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
+ if (columnProvider==null) {
+ columnProvider = new ListCompositeColumnProvider(this,true);
+ columnProvider.add(new TableColumn(object, PACKAGE.getResourceRole_Name()));
+ columnProvider.add(new TableColumn(object, PACKAGE.getResourceRole_ResourceRef()));
+ }
+ return columnProvider;
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+// EList<ResourceRole> roles = (EList)object.eGet(feature);
+// // generate a unique parameter name
+// String base = "Role";
+// int suffix = 1;
+// String name = base + suffix;
+// for (;;) {
+// boolean found = false;
+// for (ResourceRole p : roles) {
+// if (name.equals(p.getName()) || name.equals(p.getId())) {
+// found = true;
+// break;
+// }
+// }
+// if (!found)
+// break;
+// name = base + ++suffix;
+// }
+ ResourceRole role = (ResourceRole)super.addListItem(object, feature);
+// role.setName(name);
+ return role;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/FileSelectionGroup.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/FileSelectionGroup.java
index 43c731c..a6bc909 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/FileSelectionGroup.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/FileSelectionGroup.java
@@ -1,221 +1,221 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.dialogs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.DrillDownComposite;
-
-public class FileSelectionGroup extends Composite {
-
- // The listener to notify of events
- private Listener listener;
-
- private String message;
-
- // Last selection made by user
- private IResource selectedResource;
-
- // handle on parts
- private TreeViewer treeViewer;
-
- // Filters
- private ViewerFileFilter viewerFileFilter;
- // private ViewerFileFilterMatcher viewerFileFilterMatcher
- private String filterPatterns;
- // sizing constants
- private static final int SIZING_SELECTION_PANE_HEIGHT = 175;
- private static final int SIZING_SELECTION_PANE_WIDTH = 200;
- /**
- * Creates a new instance of the widget.
- */
- public FileSelectionGroup(
- Composite parent,
- Listener listener,
- String message) {
- this(parent, listener, message, null);
- }
- public FileSelectionGroup(
- Composite parent,
- Listener listener,
- String message,
- String filterPatterns) {
- super(parent, SWT.NONE);
-
- this.filterPatterns = filterPatterns;
- this.listener = listener;
- this.message = message;
- this.setFont(parent.getFont());
-
- createViewerFileFilter();
- createContents();
- }
- public void setFileFilter(String filter) {
- filterPatterns = filter;
- createViewerFileFilter();
- treeViewer.setFilters(new ViewerFilter[] {viewerFileFilter});
- treeViewer.setInput(ResourcesPlugin.getWorkspace());
- }
- /**
- * Creates ViewerFileFilter using array of objects.
- */
- public void createViewerFileFilter() {
- if (filterPatterns != null) {
- viewerFileFilter = new ViewerFileFilter(filterPatterns);
- }
- }
- /**
- * Creates the contents of the composite.
- */
- public void createContents() {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- setLayout(layout);
- setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label label = new Label(this, SWT.WRAP);
- label.setText(message != null ? message : ""); //$NON-NLS-1$
- label.setFont(this.getFont());
-
- createTreeViewer();
- }
- /**
- * Returns a new drill down viewer for this dialog.
- */
- protected void createTreeViewer() {
-
- // Create drill down.
- DrillDownComposite drillDown = new DrillDownComposite(this, SWT.BORDER);
- GridData spec =
- new GridData(
- GridData.VERTICAL_ALIGN_FILL
- | GridData.HORIZONTAL_ALIGN_FILL
- | GridData.GRAB_HORIZONTAL
- | GridData.GRAB_VERTICAL);
- spec.widthHint = SIZING_SELECTION_PANE_WIDTH;
- spec.heightHint = SIZING_SELECTION_PANE_HEIGHT;
- drillDown.setLayoutData(spec);
-
- // Create tree viewer inside drill down.
- treeViewer = new TreeViewer(drillDown, SWT.NONE);
- drillDown.setChildTree(treeViewer);
- treeViewer.setContentProvider(new WorkbenchContentProvider());
- treeViewer.setLabelProvider(new WorkbenchLabelProvider());
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- resourceSelectionChanged((IResource) selection.getFirstElement());
- // allow null
- }
- });
- treeViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- Object item = ((IStructuredSelection) selection).getFirstElement();
- if (treeViewer.getExpandedState(item))
- treeViewer.collapseToLevel(item, 1);
- else
- treeViewer.expandToLevel(item, 1);
- }
- }
- });
-
- if (viewerFileFilter != null)
- treeViewer.addFilter(viewerFileFilter);
- // This has to be done after the viewer has been laid out
- treeViewer.setInput(ResourcesPlugin.getWorkspace());
- }
- /**
- * Returns the "full path" (i.e. first segment is project name) of the currently selected file.
- */
- public IPath getResourceFullPath() {
- if (selectedResource == null) return null;
- return selectedResource.getFullPath();
- }
-
-
- public IResource getSelectedResource () {
- return selectedResource;
- }
-
-
- /**
- * Returns the tree viewer.
- */
- public TreeViewer getTreeViewer() {
- return treeViewer;
- }
- /**
- * The file selection has changed in the
- * tree view. Update the file name field
- * value and notify all listeners.
- */
- public void resourceSelectionChanged(IResource resource) {
- selectedResource = resource;
-
- // fire an event so the parent can update its controls
- if (listener != null) {
- Event changeEvent = new Event();
- changeEvent.type = SWT.Selection;
- changeEvent.widget = this;
- listener.handleEvent(changeEvent);
- }
- }
- /**
- * Gives focus to one of the widgets in the group, as determined by the group.
- */
- public void setInitialFocus() {
- treeViewer.getTree().setFocus();
- }
- /**
- * Sets the selected existing file.
- */
- public void setSelectedResource(IResource resource) {
- // https://issues.jboss.org/browse/JBIDE-8738
- if (resource==null)
- return;
- selectedResource = resource;
-
- //expand to and select the specified file
- List itemsToExpand = new ArrayList();
- IContainer parent = resource.getParent();
- while (parent != null) {
- itemsToExpand.add(0, parent);
- parent = parent.getParent();
- }
- treeViewer.setExpandedElements(itemsToExpand.toArray());
- treeViewer.setSelection(new StructuredSelection(resource), true);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.dialogs;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.part.DrillDownComposite;
+
+public class FileSelectionGroup extends Composite {
+
+ // The listener to notify of events
+ private Listener listener;
+
+ private String message;
+
+ // Last selection made by user
+ private IResource selectedResource;
+
+ // handle on parts
+ private TreeViewer treeViewer;
+
+ // Filters
+ private ViewerFileFilter viewerFileFilter;
+ // private ViewerFileFilterMatcher viewerFileFilterMatcher
+ private String filterPatterns;
+ // sizing constants
+ private static final int SIZING_SELECTION_PANE_HEIGHT = 175;
+ private static final int SIZING_SELECTION_PANE_WIDTH = 200;
+ /**
+ * Creates a new instance of the widget.
+ */
+ public FileSelectionGroup(
+ Composite parent,
+ Listener listener,
+ String message) {
+ this(parent, listener, message, null);
+ }
+ public FileSelectionGroup(
+ Composite parent,
+ Listener listener,
+ String message,
+ String filterPatterns) {
+ super(parent, SWT.NONE);
+
+ this.filterPatterns = filterPatterns;
+ this.listener = listener;
+ this.message = message;
+ this.setFont(parent.getFont());
+
+ createViewerFileFilter();
+ createContents();
+ }
+ public void setFileFilter(String filter) {
+ filterPatterns = filter;
+ createViewerFileFilter();
+ treeViewer.setFilters(new ViewerFilter[] {viewerFileFilter});
+ treeViewer.setInput(ResourcesPlugin.getWorkspace());
+ }
+ /**
+ * Creates ViewerFileFilter using array of objects.
+ */
+ public void createViewerFileFilter() {
+ if (filterPatterns != null) {
+ viewerFileFilter = new ViewerFileFilter(filterPatterns);
+ }
+ }
+ /**
+ * Creates the contents of the composite.
+ */
+ public void createContents() {
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ setLayout(layout);
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Label label = new Label(this, SWT.WRAP);
+ label.setText(message != null ? message : ""); //$NON-NLS-1$
+ label.setFont(this.getFont());
+
+ createTreeViewer();
+ }
+ /**
+ * Returns a new drill down viewer for this dialog.
+ */
+ protected void createTreeViewer() {
+
+ // Create drill down.
+ DrillDownComposite drillDown = new DrillDownComposite(this, SWT.BORDER);
+ GridData spec =
+ new GridData(
+ GridData.VERTICAL_ALIGN_FILL
+ | GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.GRAB_HORIZONTAL
+ | GridData.GRAB_VERTICAL);
+ spec.widthHint = SIZING_SELECTION_PANE_WIDTH;
+ spec.heightHint = SIZING_SELECTION_PANE_HEIGHT;
+ drillDown.setLayoutData(spec);
+
+ // Create tree viewer inside drill down.
+ treeViewer = new TreeViewer(drillDown, SWT.NONE);
+ drillDown.setChildTree(treeViewer);
+ treeViewer.setContentProvider(new WorkbenchContentProvider());
+ treeViewer.setLabelProvider(new WorkbenchLabelProvider());
+ treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ resourceSelectionChanged((IResource) selection.getFirstElement());
+ // allow null
+ }
+ });
+ treeViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object item = ((IStructuredSelection) selection).getFirstElement();
+ if (treeViewer.getExpandedState(item))
+ treeViewer.collapseToLevel(item, 1);
+ else
+ treeViewer.expandToLevel(item, 1);
+ }
+ }
+ });
+
+ if (viewerFileFilter != null)
+ treeViewer.addFilter(viewerFileFilter);
+ // This has to be done after the viewer has been laid out
+ treeViewer.setInput(ResourcesPlugin.getWorkspace());
+ }
+ /**
+ * Returns the "full path" (i.e. first segment is project name) of the currently selected file.
+ */
+ public IPath getResourceFullPath() {
+ if (selectedResource == null) return null;
+ return selectedResource.getFullPath();
+ }
+
+
+ public IResource getSelectedResource () {
+ return selectedResource;
+ }
+
+
+ /**
+ * Returns the tree viewer.
+ */
+ public TreeViewer getTreeViewer() {
+ return treeViewer;
+ }
+ /**
+ * The file selection has changed in the
+ * tree view. Update the file name field
+ * value and notify all listeners.
+ */
+ public void resourceSelectionChanged(IResource resource) {
+ selectedResource = resource;
+
+ // fire an event so the parent can update its controls
+ if (listener != null) {
+ Event changeEvent = new Event();
+ changeEvent.type = SWT.Selection;
+ changeEvent.widget = this;
+ listener.handleEvent(changeEvent);
+ }
+ }
+ /**
+ * Gives focus to one of the widgets in the group, as determined by the group.
+ */
+ public void setInitialFocus() {
+ treeViewer.getTree().setFocus();
+ }
+ /**
+ * Sets the selected existing file.
+ */
+ public void setSelectedResource(IResource resource) {
+ // https://issues.jboss.org/browse/JBIDE-8738
+ if (resource==null)
+ return;
+ selectedResource = resource;
+
+ //expand to and select the specified file
+ List itemsToExpand = new ArrayList();
+ IContainer parent = resource.getParent();
+ while (parent != null) {
+ itemsToExpand.add(0, parent);
+ parent = parent.getParent();
+ }
+ treeViewer.setExpandedElements(itemsToExpand.toArray());
+ treeViewer.setSelection(new StructuredSelection(resource), true);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaImportDialog.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaImportDialog.java
index e600202..745e301 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaImportDialog.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaImportDialog.java
@@ -1,1291 +1,1291 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.dialogs;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpel.wsil.model.inspection.Description;
-import org.eclipse.bpel.wsil.model.inspection.Inspection;
-import org.eclipse.bpel.wsil.model.inspection.Link;
-import org.eclipse.bpel.wsil.model.inspection.Name;
-import org.eclipse.bpel.wsil.model.inspection.Service;
-import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
-import org.eclipse.bpmn2.DocumentRoot;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.utils.JavaProjectClassLoader;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.bpmn2.modeler.ui.property.providers.BPMN2DefinitionsTreeContentProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.JavaTreeContentProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.ModelLabelProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.ModelTreeLabelProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.ServiceTreeContentProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.TreeNode;
-import org.eclipse.bpmn2.modeler.ui.property.providers.VariableTypeTreeContentProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.WSILContentProvider;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.dialogs.SelectionStatusDialog;
-import org.eclipse.ui.part.DrillDownComposite;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * Browse for complex/simple types available in the process and choose that
- * simple type.
- *
- */
-
-public class SchemaImportDialog extends SelectionStatusDialog {
-
- // resource type flags for configuring this dialog:
- public final static int ALLOW_XSD = (1 << 0);
- public final static int ALLOW_WSDL = (1 << 1);
- public final static int ALLOW_BPMN2 = (1 << 2);
- public final static int ALLOW_JAVA = (1 << 3);
-
- // Button id for browsing the workspace
- protected final static int BID_BROWSE_WORKSPACE = IDialogConstants.CLIENT_ID + 1;
- // Button id for browsing URLs
- protected final static int BID_BROWSE_URL = IDialogConstants.CLIENT_ID + 2;
- // Button id for browse files
- protected final static int BID_BROWSE_FILE = IDialogConstants.CLIENT_ID + 3;
- // button id for browsing WSIL
- protected static final int BID_BROWSE_WSIL = IDialogConstants.CLIENT_ID + 5;
- // Browse button id
- protected static final int BID_BROWSE = IDialogConstants.CLIENT_ID + 4;
- // Button id for import XML file types
- protected static final int BID_IMPORT_XML = IDialogConstants.CLIENT_ID + 6;
- // Button id for import XSD file types
- protected static final int BID_IMPORT_XSD = IDialogConstants.CLIENT_ID + 7;
- // Button id for import WSDL file types
- protected static final int BID_IMPORT_WSDL = IDialogConstants.CLIENT_ID + 8;
- // Button id for import BPMN 2.0 file types
- protected static final int BID_IMPORT_BPMN2 = IDialogConstants.CLIENT_ID + 9;
-
- ///////////////////////////////////////////////////////////////////////////////
- // TODO: we may want to use JavaUI.createTypeDialog(...) instead of cluttering
- // up this dialog with java types here...
- ///////////////////////////////////////////////////////////////////////////////
- // Button id for import Java types
- protected static final int BID_IMPORT_JAVA = IDialogConstants.CLIENT_ID + 10;
-
- // the current import type
- private int fImportType = BID_IMPORT_XSD;
- // the current import source
- private int fImportSource = BID_BROWSE_WORKSPACE;
- // the import type setting, remembered in the dialog settings
- private static final String IMPORT_TYPE = "ImportType"; //$NON-NLS-1$
- // the import source setting, remembered in the dialog settings
- private static final String IMPORT_SOURCE = "ImportSource"; //$NON-NLS-1$
-
- private static final String EMPTY = ""; //$NON-NLS-1$
-
- private String[] FILTER_EXTENSIONS;
- private String[] FILTER_NAMES;
- private String resourceFilter;
- protected String fResourceKind;
-
- protected BPMN2Editor bpmn2Editor;
- protected EObject modelObject;
- protected int allowedResourceTypes;
-
- protected Tree fTree;
- protected TreeViewer fTreeViewer;
-
- Text fLocation;
- String fLocationText;
- Label fLocationLabel;
- Label fStructureLabel;
-
- private Composite fLocationComposite;
- FileSelectionGroup fResourceComposite;
-
- // Import from WSIL constructs
- private Composite fWSILComposite;
- protected TreeViewer fWSILTreeViewer;
- protected Tree fWSILTree;
- protected Text filterText;
- String fFilter = ""; //$NON-NLS-1$
-
- Button fBrowseButton;
-
- private Group fTypeGroup;
-
- private Group fKindGroup;
- private Composite fKindButtonComposite;
-
- private IDialogSettings fSettings;
-
- private String fStructureTitle;
-
- private ITreeContentProvider fTreeContentProvider;
-
- protected Object fInput;
-
- protected Bpmn2ModelerResourceSetImpl fHackedResourceSet;
-
- long fRunnableStart;
- URI fRunnableLoadURI;
- Job fLoaderJob;
-
- IPreferenceStore fPrefStore = Activator.getDefault().getPreferenceStore();
- String fBasePath = fPrefStore.getString(Bpmn2Preferences.PREF_WSIL_URL);
-
- // The WSIL radio box is turned off if the WSIL document is not set in the
- // modelEnablement.
- Button fBtnWSIL;
- Button fBtnResource;
-
- /**
- * Create a brand new shiny Schema Import Dialog.
- *
- * @param parent
- */
- public SchemaImportDialog(Shell parent, int allowedResourceTypes) {
-
- super(parent);
- setStatusLineAboveButtons(true);
- int shellStyle = getShellStyle();
- setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
-
- fSettings = Activator.getDefault().getDialogSettingsFor(this);
-
- try {
- fImportSource = fSettings.getInt(IMPORT_SOURCE);
- fImportType = fSettings.getInt(IMPORT_TYPE);
- } catch (java.lang.NumberFormatException nfe) {
- fImportSource = BID_BROWSE_WORKSPACE;
- fImportType = BID_IMPORT_XSD;
- }
-
- setDialogBoundsSettings(fSettings, getDialogBoundsStrategy());
-
- this.allowedResourceTypes = allowedResourceTypes;
- if ((allowedResourceTypes & ALLOW_XSD) == 0) {
- if (fImportType==BID_IMPORT_XML || fImportType==BID_IMPORT_XSD)
- fImportType = 0;
- }
- if ((allowedResourceTypes & ALLOW_WSDL) == 0) {
- if (fImportType==BID_IMPORT_WSDL)
- fImportType = 0;
- }
- if ((allowedResourceTypes & ALLOW_BPMN2) == 0) {
- if (fImportType==BID_IMPORT_BPMN2)
- fImportType = 0;
- }
- if ((allowedResourceTypes & ALLOW_JAVA) == 0) {
- if (fImportType==BID_IMPORT_JAVA)
- fImportType = 0;
- }
- if (fImportType==0) {
- if ((allowedResourceTypes & ALLOW_XSD) != 0)
- fImportType = BID_IMPORT_XSD;
- if ((allowedResourceTypes & ALLOW_WSDL) != 0)
- fImportType = BID_IMPORT_WSDL;
- if ((allowedResourceTypes & ALLOW_BPMN2) != 0)
- fImportType = BID_IMPORT_BPMN2;
- if ((allowedResourceTypes & ALLOW_JAVA) != 0)
- fImportType = BID_IMPORT_JAVA;
- }
-
- if (fImportType==BID_IMPORT_XML)
- configureAsXMLImport();
- else if (fImportType==BID_IMPORT_XSD)
- configureAsSchemaImport();
- else if (fImportType==BID_IMPORT_WSDL)
- configureAsWSDLImport();
- else if (fImportType==BID_IMPORT_BPMN2)
- configureAsBPMN2Import();
- else if (fImportType==BID_IMPORT_JAVA)
- configureAsJavaImport();
-
- bpmn2Editor = BPMN2Editor.getActiveEditor();
- ResourceSet rs = bpmn2Editor.getResourceSet();
- fHackedResourceSet = ModelUtil.slightlyHackedResourceSet(rs);
- }
-
- public SchemaImportDialog(Shell parent) {
- this(parent, -1);
- }
-
- /**
- *
- * @see Dialog#createDialogArea(Composite)
- *
- * @param parent
- * the parent composite to use
- * @return the composite it created to be used in the dialog area.
- */
-
- @Override
- public Control createDialogArea(Composite parent) {
-
- Composite contents = (Composite) super.createDialogArea(parent);
-
- createImportType(contents);
- createImportLocation(contents);
- createImportStructure(contents);
-
- buttonPressed(fImportSource, true);
- return contents;
- }
-
- @Override
- protected void buttonPressed(int buttonId) {
- switch (buttonId) {
- case BID_BROWSE:
- if (fImportSource == BID_BROWSE_URL) {
- String loc = fLocation.getText();
- if (loc.length() > 0) {
- attemptLoad(loc);
- }
- }
- else {
- FileDialog fileDialog = new FileDialog(getShell());
- fileDialog.setFilterExtensions(FILTER_EXTENSIONS);
- fileDialog.setFilterNames(FILTER_NAMES);
- String path = fileDialog.open();
- if (path == null) {
- return;
- }
- fLocation.setText(path);
- attemptLoad(path);
- }
- break;
-
- case IDialogConstants.CANCEL_ID:
- if (fLoaderJob != null) {
- if (fLoaderJob.getState() == Job.RUNNING) {
- fLoaderJob.cancel();
- }
- }
- break;
- }
-
- super.buttonPressed(buttonId);
- }
-
- protected void buttonPressed(int id, boolean checked) {
-
- if (id==BID_BROWSE_FILE
- || id==BID_BROWSE_WORKSPACE
- || id==BID_BROWSE_URL
- || id==BID_BROWSE_WSIL) {
- if (checked==false) {
- return;
- }
- if (id==BID_BROWSE_WSIL) {
- if (fBasePath==null || fBasePath.isEmpty()) {
- MessageDialog.openInformation(getShell(), "WSIL Browser",
- "In order to browse a WSIL registry, please configure a\n"+
- "WSIL Document URL in the BPMN2 Preferences.");
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fBtnWSIL.setSelection(false);
- fBtnResource.setSelection(true);
- buttonPressed(BID_BROWSE_WORKSPACE, true);
- }
- });
- return;
- }
- }
-
- fImportSource = id;
- fSettings.put(IMPORT_SOURCE, fImportSource);
- }
- else if (id==BID_IMPORT_XML
- || id==BID_IMPORT_XSD
- || id==BID_IMPORT_WSDL
- || id==BID_IMPORT_BPMN2
- || id==BID_IMPORT_JAVA) {
- if (checked==false) {
- return;
- }
- if (id==BID_IMPORT_XML) {
- configureAsXMLImport();
- setVisibleControl(fKindButtonComposite,true);
- }
- else if (id==BID_IMPORT_XSD) {
- configureAsSchemaImport();
- setVisibleControl(fKindButtonComposite,true);
- }
- else if (id==BID_IMPORT_WSDL) {
- configureAsWSDLImport();
- setVisibleControl(fKindButtonComposite,true);
- }
- else if (id==BID_IMPORT_BPMN2) {
- configureAsBPMN2Import();
- setVisibleControl(fKindButtonComposite,true);
- }
- else if (id==BID_IMPORT_JAVA) {
- configureAsJavaImport();
- setVisibleControl(fKindButtonComposite,false);
- }
-
- fImportType = id;
- fSettings.put(IMPORT_TYPE, fImportType);
- }
-
- setVisibleControl(fResourceComposite, fImportSource==BID_BROWSE_WORKSPACE && fImportType != BID_IMPORT_JAVA);
- setVisibleControl(fLocationComposite, fImportSource==BID_BROWSE_URL || fImportSource==BID_BROWSE_FILE || fImportType==BID_IMPORT_JAVA);
- setVisibleControl(fWSILComposite, fImportSource==BID_BROWSE_WSIL && fImportType != BID_IMPORT_JAVA);
- if (fImportType==BID_IMPORT_JAVA) {
- setVisibleControl(fKindButtonComposite, false);
- setVisibleControl(fBrowseButton,false);
- fLocationLabel.setText(Messages.SchemaImportDialog_27);
- }
- else {
- setVisibleControl(fKindButtonComposite, true);
- setVisibleControl(fBrowseButton,true);
- fLocationLabel.setText(Messages.SchemaImportDialog_8);
- fBrowseButton.setText(fImportSource==BID_BROWSE_FILE || fImportSource==BID_BROWSE_WSIL ?
- Messages.SchemaImportDialog_9 : Messages.SchemaImportDialog_26);
- }
- fLocation.setText(EMPTY);
- fTypeGroup.getParent().layout(true);
- fKindGroup.getParent().layout(true);
-
- markEmptySelection();
- }
-
- protected void setVisibleControl(Control c, boolean b) {
- Object layoutData = c.getLayoutData();
-
- if (layoutData instanceof GridData) {
- GridData data = (GridData) layoutData;
- data.exclude = !b;
- }
- c.setVisible(b);
- }
-
- /**
- * Create the dialog.
- *
- */
-
- @Override
- public void create() {
- super.create();
- buttonPressed(fImportSource, true);
- }
-
- protected Button createRadioButton(Composite parent, String label, int id,
- boolean checked) {
-
- Button button = new Button(parent, SWT.RADIO);
- button.setText(label);
- button.setFont(JFaceResources.getDialogFont());
- button.setData( Integer.valueOf( id ));
- button.setSelection(checked);
-
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- Button b = (Button) event.widget;
- int bid = ((Integer) b.getData()).intValue();
-
- buttonPressed(bid, b.getSelection());
- }
- });
-
- return button;
-
- }
-
- protected void createImportType(Composite parent) {
- fTypeGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
- fTypeGroup.setText(Messages.SchemaImportDialog_3);
- GridLayout layout = new GridLayout(1, true);
- GridData typeGroupGridData = new GridData();
- typeGroupGridData.grabExcessVerticalSpace = false;
- typeGroupGridData.grabExcessHorizontalSpace = true;
- typeGroupGridData.horizontalAlignment = GridData.FILL;
- typeGroupGridData.verticalAlignment = GridData.FILL;
-
- fTypeGroup.setLayout(layout);
- fTypeGroup.setLayoutData(typeGroupGridData);
-
- Composite container = new Composite(fTypeGroup, SWT.NONE);
-
- layout = new GridLayout();
- layout.makeColumnsEqualWidth = false;
- layout.numColumns = 4;
- container.setLayout(layout);
- GridData data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.CENTER;
- container.setLayoutData(data);
-
- Button button;
-
-// button = createRadioButton(control, Messages.SchemaImportDialog_20,
-// BID_IMPORT_XML, fImportType == BID_IMPORT_XML);
-// button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
- int buttonCount = 0;
- if ((allowedResourceTypes & ALLOW_XSD) != 0) {
- button = createRadioButton(container, Messages.SchemaImportDialog_21,
- BID_IMPORT_XSD, fImportType == BID_IMPORT_XSD);
- button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
- ++buttonCount;
- }
-
- if ((allowedResourceTypes & ALLOW_WSDL) != 0) {
- button = createRadioButton(container, Messages.SchemaImportDialog_22,
- BID_IMPORT_WSDL, fImportType == BID_IMPORT_WSDL);
- button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
- ++buttonCount;
- }
-
- if ((allowedResourceTypes & ALLOW_BPMN2) != 0) {
- button = createRadioButton(container, Messages.SchemaImportDialog_28,
- BID_IMPORT_BPMN2, fImportType == BID_IMPORT_BPMN2);
- button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
- ++buttonCount;
- }
-
- if ((allowedResourceTypes & ALLOW_JAVA) != 0) {
- button = createRadioButton(container, Messages.SchemaImportDialog_23,
- BID_IMPORT_JAVA, fImportType == BID_IMPORT_JAVA);
- button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
- ++buttonCount;
- }
- if (buttonCount==1) {
- fTypeGroup.setVisible(false);
- typeGroupGridData.exclude = true;
- }
- }
-
- protected void createImportLocation(Composite parent) {
-
- fKindGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
- fKindGroup.setText(Messages.SchemaImportDialog_4);
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
-
- fKindGroup.setLayout(layout);
- fKindGroup.setLayoutData(data);
-
- fKindButtonComposite = new Composite(fKindGroup, SWT.NONE);
-
- layout = new GridLayout();
- layout.makeColumnsEqualWidth = true;
- layout.numColumns = 4;
- fKindButtonComposite.setLayout(layout);
- data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.CENTER;
- fKindButtonComposite.setLayoutData(data);
-
- fBtnResource = createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_5,
- BID_BROWSE_WORKSPACE, fImportSource == BID_BROWSE_WORKSPACE);
- createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_6,
- BID_BROWSE_FILE, fImportSource == BID_BROWSE_FILE);
- createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_7,
- BID_BROWSE_URL, fImportSource == BID_BROWSE_URL);
-
- // Add WSIL option
- fBtnWSIL = createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_15,
- BID_BROWSE_WSIL, fImportSource == BID_BROWSE_WSIL);
-
- // Create location variant
- fLocationComposite = new Composite(fKindGroup, SWT.NONE);
-
- layout = new GridLayout();
- layout.numColumns = 3;
- fLocationComposite.setLayout(layout);
- data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- fLocationComposite.setLayoutData(data);
-
- fLocationLabel = new Label(fLocationComposite, SWT.NONE);
- fLocationLabel.setText(Messages.SchemaImportDialog_8);
-
- fLocation = new Text(fLocationComposite, SWT.BORDER);
- fLocation.setText(EMPTY);
- data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- fLocation.setLayoutData(data);
-// fLocation.addListener(SWT.FocusOut, new Listener() {
-//
-// public void handleEvent(Event event) {
-// String loc = fLocation.getText();
-// if (loc.length() > 0) {
-// attemptLoad(loc);
-// }
-// }
-// });
- fLocation.addKeyListener(new KeyListener() {
-
- public void keyPressed(KeyEvent event) {
- if (fImportType == BID_IMPORT_JAVA) {
- }
- else if (event.keyCode == SWT.CR) {
- attemptLoad(fLocation.getText());
- event.doit = false;
- }
- }
-
- public void keyReleased(KeyEvent e) {
- if (fImportType == BID_IMPORT_JAVA) {
- String s = fLocation.getText();
- if (s!=null && s.length()>1) {
- if (!s.equals(fLocationText)) {
- fLocationText = s;
- attemptLoad(s);
- }
- }
- }
- }
-
- });
-
- fBrowseButton = createButton(fLocationComposite, BID_BROWSE,
- Messages.SchemaImportDialog_9, false);
-
- // End of location variant
-
- // Start Resource Variant
- fResourceComposite = new FileSelectionGroup(fKindGroup, new Listener() {
- public void handleEvent(Event event) {
- IResource resource = fResourceComposite.getSelectedResource();
- if (resource != null && resource.getType() == IResource.FILE) {
- // only attempt to load a resource which is not a control
- attemptLoad((IFile) resource);
- return;
- }
- markEmptySelection();
- }
- }, Messages.SchemaImportDialog_10, resourceFilter); //$NON-NLS-1$
-
- TreeViewer viewer = fResourceComposite.getTreeViewer();
- viewer.setAutoExpandLevel(2);
-
- // End resource variant
-
- // create WSIL UI widgets
- createWSILStructure(fKindGroup);
-
- }
-
- protected Object createWSILStructure(Composite parent) {
-
- fWSILComposite = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- fWSILComposite.setLayout(layout);
-
- GridData data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.minimumHeight = 220;
- fWSILComposite.setLayoutData(data);
-
- Label location = new Label(fWSILComposite, SWT.NONE);
- location.setText( Messages.SchemaImportDialog_16 );
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = SWT.LEFT;
- location.setLayoutData(data);
-
- filterText = new Text(fWSILComposite, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- filterText.setLayoutData(data);
-
- filterText.addKeyListener(new KeyListener() {
-
- public void keyPressed(KeyEvent e) {
-
- }
-
- public void keyReleased(KeyEvent e) {
- // set the value of the filter.
- fFilter = filterText.getText().trim().toLowerCase();
-
- if (fFilter.length() > 0) {
- /* for the time being, only filter 3 levels deep
- * since link references within WSIL are rare at
- * this time. when adoption of WSIL directories
- * take off, this needs to be rehashed */
- fWSILTreeViewer.expandToLevel(3);
- }
- fWSILTreeViewer.refresh();
- e.doit = false;
- }
- });
-
- DrillDownComposite wsilTreeComposite = new DrillDownComposite(fWSILComposite, SWT.BORDER);
-
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 0;
- wsilTreeComposite.setLayout(layout);
-
- data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- wsilTreeComposite.setLayoutData(data);
-
- // Tree viewer for variable structure ...
- fWSILTree = new Tree(wsilTreeComposite, SWT.NONE );
- data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.minimumHeight = 200;
- fWSILTree.setLayoutData(data);
-
- fWSILTreeViewer = new TreeViewer( fWSILTree );
- fWSILTreeViewer.setContentProvider( new WSILContentProvider() );
- fWSILTreeViewer.setLabelProvider( new ModelLabelProvider() );
-
- Object wsilDoc = attemptLoad(URI.createURI(fBasePath),"wsil");
- fWSILTreeViewer.setInput ( wsilDoc ) ;
- if (wsilDoc == null || wsilDoc instanceof Throwable ) {
-// fBtnWSIL.setEnabled(false);
- // that's always available.
- // delete fImportSource = BID_BROWSE_WORKSPACE; by Grid.Qian
- // because if not, the dialog always display the resource Control
- // regardless last time if user choose the resource button
-
- /*// that's always available.
- fImportSource = BID_BROWSE_WORKSPACE;*/
- }
-
-
- // set default tree expansion to the 2nd level
- fWSILTreeViewer.expandToLevel(2);
- fWSILTreeViewer.addFilter(new TreeFilter());
- fWSILTreeViewer.setComparator(new WSILViewerComparator());
-
- wsilTreeComposite.setChildTree(fWSILTreeViewer);
-
- fWSILTreeViewer
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- // TODO Auto-generated method stub
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- if (sel.getFirstElement() instanceof Service) {
- Service serv = (Service) sel.getFirstElement();
- Description descr = serv.getDescription().get(0);
- attemptLoad(descr.getLocation());
- } else {
- markEmptySelection();
- }
- }
- });
- // end tree viewer for variable structure
-
- return fWSILComposite;
- }
-
- protected Object createImportStructure(Composite parent) {
-
- fStructureLabel = new Label(parent, SWT.NONE);
- fStructureLabel.setText(fStructureTitle);
-
- // Tree viewer for variable structure ...
- fTree = new Tree(parent, SWT.BORDER);
-
- fTreeViewer = new TreeViewer(fTree);
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fTreeViewer.setLabelProvider(new ModelTreeLabelProvider());
- fTreeViewer.setInput(null);
- fTreeViewer.setAutoExpandLevel(3);
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- if (!sel.isEmpty()) {
- computeResult();
- if (getResult()!=null)
- updateStatus(Status.OK_STATUS);
- else
- updateStatus(new Status(IStatus.ERROR, Activator.getDefault().getID(),0,
- Messages.SchemaImportDialog_31,null));
- } else {
- markEmptySelection();
- }
- }
- });
- // end tree viewer for variable structure
- GridData data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.minimumHeight = 200;
- fTree.setLayoutData(data);
-
- return fTree;
- }
-
- Object attemptLoad(URI uri, String kind) {
-
- Resource resource = null;
- if ("java".equals(kind)) {
- final String fileName = uri.lastSegment();
- final List<Class> results = new ArrayList<Class>();
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (IProject p : projects) {
- try {
- if (p.isOpen() && p.hasNature(JavaCore.NATURE_ID)) {
- final IJavaProject javaProject = JavaCore.create(p);
- JavaProjectClassLoader cl = new JavaProjectClassLoader(javaProject);
- results.addAll(cl.findClasses(fileName));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return results;
- }
- else {
- try {
- resource = fHackedResourceSet.getResource(uri, true, kind);
- } catch (Throwable t) {
- // BPELUIPlugin.log(t);
- return t;
- }
-
- if (resource!=null && resource.getErrors().isEmpty() && resource.isLoaded()) {
- return resource.getContents().get(0);
- }
- }
- return null;
- }
-
- Object attemptLoad ( URI uri ) {
- return attemptLoad (uri, fResourceKind );
- }
-
-
- void attemptLoad ( IFile file ) {
- attemptLoad ( file.getFullPath().toString() );
- }
-
-
- void attemptLoad ( String path ) {
-
- if (fLoaderJob != null) {
- if (fLoaderJob.getState() == Job.RUNNING) {
- fLoaderJob.cancel();
- }
- }
-
- updateStatus ( Status.OK_STATUS );
-
- // empty paths are ignored
- path = path.trim();
- if (path.length() == 0) {
- return ;
- }
-
-
- URI uri = convertToURI ( path );
- if (uri == null) {
- return ;
- }
-
-
- if (uri.isRelative()) {
- // construct absolute path
- String absolutepath = fBasePath.substring(0, fBasePath.lastIndexOf('/')+1) + path;
- uri = URI.createURI(absolutepath);
- }
-
-
- fRunnableLoadURI = uri;
- final String msg = MessageFormat.format(Messages.SchemaImportDialog_17,fRunnableLoadURI);
- fLoaderJob = new Job(msg) {
-
- @Override
- protected IStatus run (IProgressMonitor monitor) {
- monitor.beginTask(msg, 1);
- // Bug 290090 - move this to asyncExec() as below because the method will
- // modify UI parameter, if not, will have a invalid access error.
-
- /* fInput = attemptLoad(fRunnableLoadURI); */
-
- monitor.worked(1);
- if (fBrowseButton != null
- && fBrowseButton.isDisposed() == false) {
- fBrowseButton.getDisplay().asyncExec(new Runnable() {
- public void run() {
- fInput = attemptLoad(fRunnableLoadURI);
- loadDone();
- }
- });
- }
-
- return Status.OK_STATUS;
- }
- };
-
- fLoaderJob.schedule();
- fRunnableStart = System.currentTimeMillis();
-
- updateStatus ( new Status(IStatus.INFO, Activator.getDefault().getID(),0,msg,null));
- }
-
-
-
- @SuppressWarnings("boxing")
- void loadDone () {
-
- long elapsed = System.currentTimeMillis() - fRunnableStart;
-
- if (fInput == null || fInput instanceof Throwable) {
- markEmptySelection();
-
- updateStatus( new Status(IStatus.ERROR,Activator.getDefault().getID(),0,
- MessageFormat.format(Messages.SchemaImportDialog_19,fRunnableLoadURI,elapsed),(Throwable) fInput) );
- fInput = null;
-
- } else {
-
- updateStatus ( new Status(IStatus.INFO, Activator.getDefault().getID(),0,
- MessageFormat.format(Messages.SchemaImportDialog_18,fRunnableLoadURI,elapsed),null)) ;
-
-
- // display a warning if this import does not define a targetNamespace
- String type = null;
- String ns = null;
- String loc = null;
- if (fInput instanceof XSDSchema) {
- XSDSchema schema = (XSDSchema)fInput;
- ns = schema.getTargetNamespace();
- loc = schema.getSchemaLocation();
- type = "XSD Schema";
- }
- else if (fInput instanceof Definition) {
- Definition definition = (Definition)fInput;
- ns = definition.getTargetNamespace();
- loc = definition.getLocation();
- type = "WSDL";
- }
- else if (fInput instanceof org.eclipse.bpmn2.DocumentRoot) {
- DocumentRoot root = (DocumentRoot)fInput;
- org.eclipse.bpmn2.Definitions definitions = root.getDefinitions();
- ns = definitions.getTargetNamespace();
- loc = root.eResource().getURI().toString();
- type = "BPMN2";
- fInput = definitions;
- }
- else if (fInput instanceof List) {
- markEmptySelection();
- }
- if (type!=null) {
- if (ns==null || ns.isEmpty()) {
- updateStatus ( new Status(IStatus.WARNING, Activator.getDefault().getID(),0,
- "This "+type+" does not define a target namespace",null)) ;
- }
- if (loc==null || loc.isEmpty()) {
- updateStatus( new Status(IStatus.ERROR,Activator.getDefault().getID(),0,
- MessageFormat.format(Messages.SchemaImportDialog_19,fRunnableLoadURI,elapsed),null) );
- fInput = null;
- }
- }
-
- fTreeViewer.setInput(fInput);
- fTree.getVerticalBar().setSelection(0);
- }
- }
-
-
-
- void markEmptySelection () {
- updateStatus ( Status.OK_STATUS );
- updateOK(false);
- fTreeViewer.setInput(null);
- }
-
-
- private URI convertToURI (String path ) {
-
- try {
- switch (fImportSource) {
- case BID_BROWSE_FILE :
- return URI.createFileURI( path );
-
- case BID_BROWSE_WORKSPACE :
- return URI.createPlatformResourceURI(path,false);
-
- case BID_BROWSE_WSIL :
- //return URI.createFileURI( path );
- case BID_BROWSE_URL :
- return URI.createURI(path);
-
-
-
- default :
- return null;
- }
-
- } catch (Exception ex) {
- updateStatus ( new Status(IStatus.ERROR,Activator.getDefault().getID(),0,Messages.SchemaImportDialog_13,ex) );
- return null;
- }
- }
-
- /**
- * Update the state of the OK button to the state indicated.
- *
- * @param state
- * false to disable, true to enable.
- */
-
- public void updateOK(boolean state) {
- Button okButton = getOkButton();
- if (okButton != null && !okButton.isDisposed()) {
- okButton.setEnabled(state);
- }
- }
-
- /**
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
- */
-
- @Override
- protected void computeResult() {
- Object object = fTreeViewer.getInput();
- if (object == null) {
- return;
- }
- if (fImportType == BID_IMPORT_JAVA) {
- IStructuredSelection sel = (IStructuredSelection)fTreeViewer.getSelection();
- if (!sel.isEmpty()) {
- TreeNode treeNode = (TreeNode)sel.getFirstElement();
- if (treeNode.getModelObject() instanceof Class)
- setSelectionResult(new Object[] { treeNode.getModelObject() });
- else
- setSelectionResult(null);
- }
- }
- else {
- setSelectionResult(new Object[] { object });
- }
- }
-
- /**
- * TODO: not implemented - do we need this?
- */
- public void configureAsXMLImport() {
- setTitle(Messages.SchemaImportDialog_1);
- fStructureTitle = Messages.SchemaImportDialog_12;
- if (fStructureLabel!=null)
- fStructureLabel.setText(fStructureTitle);
- fTreeContentProvider = new VariableTypeTreeContentProvider(true, true);
- if (fTreeViewer!=null)
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fResourceKind = "xml";
-
- String[] wsdl_FILTER_EXTENSIONS = {
- "*.xml",
- "*.xsd",
- "*.wsdl",
- "*.*"
- };
- FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
-
- String[] wsdl_FILTER_NAMES = {
- "XML Files",
- "XML Schema Files",
- "WSDL Definition Files",
- "All"
- };
- FILTER_NAMES = wsdl_FILTER_NAMES;
-
- resourceFilter = ".xml";
- if (fResourceComposite!=null)
- fResourceComposite.setFileFilter(resourceFilter);
- }
-
- /**
- * Configure the dialog as a schema import dialog. Set the title and the
- * structure pane message.
- *
- */
-
- public void configureAsSchemaImport() {
- setTitle(Messages.SchemaImportDialog_2);
- fStructureTitle = Messages.SchemaImportDialog_11;
- if (fStructureLabel!=null)
- fStructureLabel.setText(fStructureTitle);
- fTreeContentProvider = new VariableTypeTreeContentProvider(true, true);
- if (fTreeViewer!=null)
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fResourceKind = "xsd";
-
- String[] wsdl_FILTER_EXTENSIONS = {
- "*.xml",
- "*.xsd",
- "*.wsdl",
- "*.*"
- };
- FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
-
- String[] wsdl_FILTER_NAMES = {
- "XML Files",
- "XML Schema Files",
- "WSDL Definition Files",
- "All"
- };
- FILTER_NAMES = wsdl_FILTER_NAMES;
-
- resourceFilter = ".xsd";
- if (fResourceComposite!=null)
- fResourceComposite.setFileFilter(resourceFilter);
- }
-
- /**
- * Configure the dialog as a WSDL import dialog. Set the title and the
- * structure pane message.
- *
- */
-
- public void configureAsWSDLImport() {
-
- setTitle(Messages.SchemaImportDialog_0);
- fStructureTitle = Messages.SchemaImportDialog_14;
- if (fStructureLabel!=null)
- fStructureLabel.setText(fStructureTitle);
- fTreeContentProvider = new ServiceTreeContentProvider(true);
- if (fTreeViewer!=null)
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fResourceKind = "wsdl";
-
- String[] wsdl_FILTER_EXTENSIONS = {
- "*.wsdl",
- "*.*"
- };
- FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
-
- String[] wsdl_FILTER_NAMES = {
- "WSDL Definition Files",
- "All"
- };
- FILTER_NAMES = wsdl_FILTER_NAMES;
-
- resourceFilter = ".wsdl";
- if (fResourceComposite!=null)
- fResourceComposite.setFileFilter(resourceFilter);
- }
-
- public void configureAsBPMN2Import() {
-
- setTitle(Messages.SchemaImportDialog_29);
- fStructureTitle = Messages.SchemaImportDialog_30;
- if (fStructureLabel!=null)
- fStructureLabel.setText(fStructureTitle);
- fTreeContentProvider = new BPMN2DefinitionsTreeContentProvider(true);
- if (fTreeViewer!=null)
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fResourceKind = "";
-
- String[] wsdl_FILTER_EXTENSIONS = {
- "*.bpmn",
- "*.bpmn2",
- "*.*"
- };
- FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
-
- String[] wsdl_FILTER_NAMES = {
- "BPMN 2.0 Diagram Files",
- "BPMN 2.0 Diagram Files",
- "All"
- };
- FILTER_NAMES = wsdl_FILTER_NAMES;
-
- resourceFilter = ".bpmn";
- if (fResourceComposite!=null)
- fResourceComposite.setFileFilter(resourceFilter);
- }
-
- public void configureAsJavaImport() {
-
- setTitle(Messages.SchemaImportDialog_24);
- fStructureTitle = Messages.SchemaImportDialog_25;
- if (fStructureLabel!=null)
- fStructureLabel.setText(fStructureTitle);
- fTreeContentProvider = new JavaTreeContentProvider(true);
- if (fTreeViewer!=null)
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fResourceKind = "java";
-
- String[] java_FILTER_EXTENSIONS = {
- "*.java",
- "*.class",
- "*.jar",
- "*.*"
- };
- FILTER_EXTENSIONS = java_FILTER_EXTENSIONS;
-
- String[] wsdl_FILTER_NAMES = {
- "Java Source Files",
- "Compiled Java Files",
- "Java Archives",
- "All"
- };
- FILTER_NAMES = wsdl_FILTER_NAMES;
-
- // Resource selection widget not used (yet)
- resourceFilter = ".java";
- if (fResourceComposite!=null)
- fResourceComposite.setFileFilter(resourceFilter);
- }
-
- @Override
- public void setTitle(String title) {
- super.setTitle(title);
- if (getShell()!=null)
- getShell().setText(title);
- }
-
- /**
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 4, 2007
- *
- */
- public class TreeFilter extends ViewerFilter {
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement,
- Object element) {
-
- if (fFilter == null || fFilter.length() == 0) {
- return true;
- }
-
- if (element instanceof Service) {
- String text = ""; //$NON-NLS-1$
- Service service = (Service) element;
- if (service.getName().size() > 0) {
- Name name = service.getName().get(0);
- text += name.getValue();
- }
- if (service.getAbstract().size() > 0) {
- TypeOfAbstract abst = service.getAbstract().get(0);
- text += abst.getValue();
- }
- return (text.toLowerCase().indexOf(fFilter) > -1);
- }
-
- return true;
- }
- }
-
- /**
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date May 10, 2007
- *
- */
- public class WSILViewerComparator extends ViewerComparator {
-
- /**
- * @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
- */
- @Override
- public int category(Object element) {
- if (element instanceof Inspection)
- return 1;
- if (element instanceof Link)
- return 2;
- if (element instanceof Service)
- return 3;
-
- return 0;
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.dialogs;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpel.wsil.model.inspection.Description;
+import org.eclipse.bpel.wsil.model.inspection.Inspection;
+import org.eclipse.bpel.wsil.model.inspection.Link;
+import org.eclipse.bpel.wsil.model.inspection.Name;
+import org.eclipse.bpel.wsil.model.inspection.Service;
+import org.eclipse.bpel.wsil.model.inspection.TypeOfAbstract;
+import org.eclipse.bpmn2.DocumentRoot;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.utils.JavaProjectClassLoader;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.bpmn2.modeler.ui.property.providers.BPMN2DefinitionsTreeContentProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.JavaTreeContentProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.ModelLabelProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.ModelTreeLabelProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.ServiceTreeContentProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.TreeNode;
+import org.eclipse.bpmn2.modeler.ui.property.providers.VariableTypeTreeContentProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.WSILContentProvider;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.eclipse.ui.part.DrillDownComposite;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.xsd.XSDSchema;
+
+/**
+ * Browse for complex/simple types available in the process and choose that
+ * simple type.
+ *
+ */
+
+public class SchemaImportDialog extends SelectionStatusDialog {
+
+ // resource type flags for configuring this dialog:
+ public final static int ALLOW_XSD = (1 << 0);
+ public final static int ALLOW_WSDL = (1 << 1);
+ public final static int ALLOW_BPMN2 = (1 << 2);
+ public final static int ALLOW_JAVA = (1 << 3);
+
+ // Button id for browsing the workspace
+ protected final static int BID_BROWSE_WORKSPACE = IDialogConstants.CLIENT_ID + 1;
+ // Button id for browsing URLs
+ protected final static int BID_BROWSE_URL = IDialogConstants.CLIENT_ID + 2;
+ // Button id for browse files
+ protected final static int BID_BROWSE_FILE = IDialogConstants.CLIENT_ID + 3;
+ // button id for browsing WSIL
+ protected static final int BID_BROWSE_WSIL = IDialogConstants.CLIENT_ID + 5;
+ // Browse button id
+ protected static final int BID_BROWSE = IDialogConstants.CLIENT_ID + 4;
+ // Button id for import XML file types
+ protected static final int BID_IMPORT_XML = IDialogConstants.CLIENT_ID + 6;
+ // Button id for import XSD file types
+ protected static final int BID_IMPORT_XSD = IDialogConstants.CLIENT_ID + 7;
+ // Button id for import WSDL file types
+ protected static final int BID_IMPORT_WSDL = IDialogConstants.CLIENT_ID + 8;
+ // Button id for import BPMN 2.0 file types
+ protected static final int BID_IMPORT_BPMN2 = IDialogConstants.CLIENT_ID + 9;
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // TODO: we may want to use JavaUI.createTypeDialog(...) instead of cluttering
+ // up this dialog with java types here...
+ ///////////////////////////////////////////////////////////////////////////////
+ // Button id for import Java types
+ protected static final int BID_IMPORT_JAVA = IDialogConstants.CLIENT_ID + 10;
+
+ // the current import type
+ private int fImportType = BID_IMPORT_XSD;
+ // the current import source
+ private int fImportSource = BID_BROWSE_WORKSPACE;
+ // the import type setting, remembered in the dialog settings
+ private static final String IMPORT_TYPE = "ImportType"; //$NON-NLS-1$
+ // the import source setting, remembered in the dialog settings
+ private static final String IMPORT_SOURCE = "ImportSource"; //$NON-NLS-1$
+
+ private static final String EMPTY = ""; //$NON-NLS-1$
+
+ private String[] FILTER_EXTENSIONS;
+ private String[] FILTER_NAMES;
+ private String resourceFilter;
+ protected String fResourceKind;
+
+ protected BPMN2Editor bpmn2Editor;
+ protected EObject modelObject;
+ protected int allowedResourceTypes;
+
+ protected Tree fTree;
+ protected TreeViewer fTreeViewer;
+
+ Text fLocation;
+ String fLocationText;
+ Label fLocationLabel;
+ Label fStructureLabel;
+
+ private Composite fLocationComposite;
+ FileSelectionGroup fResourceComposite;
+
+ // Import from WSIL constructs
+ private Composite fWSILComposite;
+ protected TreeViewer fWSILTreeViewer;
+ protected Tree fWSILTree;
+ protected Text filterText;
+ String fFilter = ""; //$NON-NLS-1$
+
+ Button fBrowseButton;
+
+ private Group fTypeGroup;
+
+ private Group fKindGroup;
+ private Composite fKindButtonComposite;
+
+ private IDialogSettings fSettings;
+
+ private String fStructureTitle;
+
+ private ITreeContentProvider fTreeContentProvider;
+
+ protected Object fInput;
+
+ protected Bpmn2ModelerResourceSetImpl fHackedResourceSet;
+
+ long fRunnableStart;
+ URI fRunnableLoadURI;
+ Job fLoaderJob;
+
+ IPreferenceStore fPrefStore = Activator.getDefault().getPreferenceStore();
+ String fBasePath = fPrefStore.getString(Bpmn2Preferences.PREF_WSIL_URL);
+
+ // The WSIL radio box is turned off if the WSIL document is not set in the
+ // modelEnablement.
+ Button fBtnWSIL;
+ Button fBtnResource;
+
+ /**
+ * Create a brand new shiny Schema Import Dialog.
+ *
+ * @param parent
+ */
+ public SchemaImportDialog(Shell parent, int allowedResourceTypes) {
+
+ super(parent);
+ setStatusLineAboveButtons(true);
+ int shellStyle = getShellStyle();
+ setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
+
+ fSettings = Activator.getDefault().getDialogSettingsFor(this);
+
+ try {
+ fImportSource = fSettings.getInt(IMPORT_SOURCE);
+ fImportType = fSettings.getInt(IMPORT_TYPE);
+ } catch (java.lang.NumberFormatException nfe) {
+ fImportSource = BID_BROWSE_WORKSPACE;
+ fImportType = BID_IMPORT_XSD;
+ }
+
+ setDialogBoundsSettings(fSettings, getDialogBoundsStrategy());
+
+ this.allowedResourceTypes = allowedResourceTypes;
+ if ((allowedResourceTypes & ALLOW_XSD) == 0) {
+ if (fImportType==BID_IMPORT_XML || fImportType==BID_IMPORT_XSD)
+ fImportType = 0;
+ }
+ if ((allowedResourceTypes & ALLOW_WSDL) == 0) {
+ if (fImportType==BID_IMPORT_WSDL)
+ fImportType = 0;
+ }
+ if ((allowedResourceTypes & ALLOW_BPMN2) == 0) {
+ if (fImportType==BID_IMPORT_BPMN2)
+ fImportType = 0;
+ }
+ if ((allowedResourceTypes & ALLOW_JAVA) == 0) {
+ if (fImportType==BID_IMPORT_JAVA)
+ fImportType = 0;
+ }
+ if (fImportType==0) {
+ if ((allowedResourceTypes & ALLOW_XSD) != 0)
+ fImportType = BID_IMPORT_XSD;
+ if ((allowedResourceTypes & ALLOW_WSDL) != 0)
+ fImportType = BID_IMPORT_WSDL;
+ if ((allowedResourceTypes & ALLOW_BPMN2) != 0)
+ fImportType = BID_IMPORT_BPMN2;
+ if ((allowedResourceTypes & ALLOW_JAVA) != 0)
+ fImportType = BID_IMPORT_JAVA;
+ }
+
+ if (fImportType==BID_IMPORT_XML)
+ configureAsXMLImport();
+ else if (fImportType==BID_IMPORT_XSD)
+ configureAsSchemaImport();
+ else if (fImportType==BID_IMPORT_WSDL)
+ configureAsWSDLImport();
+ else if (fImportType==BID_IMPORT_BPMN2)
+ configureAsBPMN2Import();
+ else if (fImportType==BID_IMPORT_JAVA)
+ configureAsJavaImport();
+
+ bpmn2Editor = BPMN2Editor.getActiveEditor();
+ ResourceSet rs = bpmn2Editor.getResourceSet();
+ fHackedResourceSet = ModelUtil.slightlyHackedResourceSet(rs);
+ }
+
+ public SchemaImportDialog(Shell parent) {
+ this(parent, -1);
+ }
+
+ /**
+ *
+ * @see Dialog#createDialogArea(Composite)
+ *
+ * @param parent
+ * the parent composite to use
+ * @return the composite it created to be used in the dialog area.
+ */
+
+ @Override
+ public Control createDialogArea(Composite parent) {
+
+ Composite contents = (Composite) super.createDialogArea(parent);
+
+ createImportType(contents);
+ createImportLocation(contents);
+ createImportStructure(contents);
+
+ buttonPressed(fImportSource, true);
+ return contents;
+ }
+
+ @Override
+ protected void buttonPressed(int buttonId) {
+ switch (buttonId) {
+ case BID_BROWSE:
+ if (fImportSource == BID_BROWSE_URL) {
+ String loc = fLocation.getText();
+ if (loc.length() > 0) {
+ attemptLoad(loc);
+ }
+ }
+ else {
+ FileDialog fileDialog = new FileDialog(getShell());
+ fileDialog.setFilterExtensions(FILTER_EXTENSIONS);
+ fileDialog.setFilterNames(FILTER_NAMES);
+ String path = fileDialog.open();
+ if (path == null) {
+ return;
+ }
+ fLocation.setText(path);
+ attemptLoad(path);
+ }
+ break;
+
+ case IDialogConstants.CANCEL_ID:
+ if (fLoaderJob != null) {
+ if (fLoaderJob.getState() == Job.RUNNING) {
+ fLoaderJob.cancel();
+ }
+ }
+ break;
+ }
+
+ super.buttonPressed(buttonId);
+ }
+
+ protected void buttonPressed(int id, boolean checked) {
+
+ if (id==BID_BROWSE_FILE
+ || id==BID_BROWSE_WORKSPACE
+ || id==BID_BROWSE_URL
+ || id==BID_BROWSE_WSIL) {
+ if (checked==false) {
+ return;
+ }
+ if (id==BID_BROWSE_WSIL) {
+ if (fBasePath==null || fBasePath.isEmpty()) {
+ MessageDialog.openInformation(getShell(), "WSIL Browser",
+ "In order to browse a WSIL registry, please configure a\n"+
+ "WSIL Document URL in the BPMN2 Preferences.");
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ fBtnWSIL.setSelection(false);
+ fBtnResource.setSelection(true);
+ buttonPressed(BID_BROWSE_WORKSPACE, true);
+ }
+ });
+ return;
+ }
+ }
+
+ fImportSource = id;
+ fSettings.put(IMPORT_SOURCE, fImportSource);
+ }
+ else if (id==BID_IMPORT_XML
+ || id==BID_IMPORT_XSD
+ || id==BID_IMPORT_WSDL
+ || id==BID_IMPORT_BPMN2
+ || id==BID_IMPORT_JAVA) {
+ if (checked==false) {
+ return;
+ }
+ if (id==BID_IMPORT_XML) {
+ configureAsXMLImport();
+ setVisibleControl(fKindButtonComposite,true);
+ }
+ else if (id==BID_IMPORT_XSD) {
+ configureAsSchemaImport();
+ setVisibleControl(fKindButtonComposite,true);
+ }
+ else if (id==BID_IMPORT_WSDL) {
+ configureAsWSDLImport();
+ setVisibleControl(fKindButtonComposite,true);
+ }
+ else if (id==BID_IMPORT_BPMN2) {
+ configureAsBPMN2Import();
+ setVisibleControl(fKindButtonComposite,true);
+ }
+ else if (id==BID_IMPORT_JAVA) {
+ configureAsJavaImport();
+ setVisibleControl(fKindButtonComposite,false);
+ }
+
+ fImportType = id;
+ fSettings.put(IMPORT_TYPE, fImportType);
+ }
+
+ setVisibleControl(fResourceComposite, fImportSource==BID_BROWSE_WORKSPACE && fImportType != BID_IMPORT_JAVA);
+ setVisibleControl(fLocationComposite, fImportSource==BID_BROWSE_URL || fImportSource==BID_BROWSE_FILE || fImportType==BID_IMPORT_JAVA);
+ setVisibleControl(fWSILComposite, fImportSource==BID_BROWSE_WSIL && fImportType != BID_IMPORT_JAVA);
+ if (fImportType==BID_IMPORT_JAVA) {
+ setVisibleControl(fKindButtonComposite, false);
+ setVisibleControl(fBrowseButton,false);
+ fLocationLabel.setText(Messages.SchemaImportDialog_27);
+ }
+ else {
+ setVisibleControl(fKindButtonComposite, true);
+ setVisibleControl(fBrowseButton,true);
+ fLocationLabel.setText(Messages.SchemaImportDialog_8);
+ fBrowseButton.setText(fImportSource==BID_BROWSE_FILE || fImportSource==BID_BROWSE_WSIL ?
+ Messages.SchemaImportDialog_9 : Messages.SchemaImportDialog_26);
+ }
+ fLocation.setText(EMPTY);
+ fTypeGroup.getParent().layout(true);
+ fKindGroup.getParent().layout(true);
+
+ markEmptySelection();
+ }
+
+ protected void setVisibleControl(Control c, boolean b) {
+ Object layoutData = c.getLayoutData();
+
+ if (layoutData instanceof GridData) {
+ GridData data = (GridData) layoutData;
+ data.exclude = !b;
+ }
+ c.setVisible(b);
+ }
+
+ /**
+ * Create the dialog.
+ *
+ */
+
+ @Override
+ public void create() {
+ super.create();
+ buttonPressed(fImportSource, true);
+ }
+
+ protected Button createRadioButton(Composite parent, String label, int id,
+ boolean checked) {
+
+ Button button = new Button(parent, SWT.RADIO);
+ button.setText(label);
+ button.setFont(JFaceResources.getDialogFont());
+ button.setData( Integer.valueOf( id ));
+ button.setSelection(checked);
+
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ Button b = (Button) event.widget;
+ int bid = ((Integer) b.getData()).intValue();
+
+ buttonPressed(bid, b.getSelection());
+ }
+ });
+
+ return button;
+
+ }
+
+ protected void createImportType(Composite parent) {
+ fTypeGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
+ fTypeGroup.setText(Messages.SchemaImportDialog_3);
+ GridLayout layout = new GridLayout(1, true);
+ GridData typeGroupGridData = new GridData();
+ typeGroupGridData.grabExcessVerticalSpace = false;
+ typeGroupGridData.grabExcessHorizontalSpace = true;
+ typeGroupGridData.horizontalAlignment = GridData.FILL;
+ typeGroupGridData.verticalAlignment = GridData.FILL;
+
+ fTypeGroup.setLayout(layout);
+ fTypeGroup.setLayoutData(typeGroupGridData);
+
+ Composite container = new Composite(fTypeGroup, SWT.NONE);
+
+ layout = new GridLayout();
+ layout.makeColumnsEqualWidth = false;
+ layout.numColumns = 4;
+ container.setLayout(layout);
+ GridData data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.CENTER;
+ container.setLayoutData(data);
+
+ Button button;
+
+// button = createRadioButton(control, Messages.SchemaImportDialog_20,
+// BID_IMPORT_XML, fImportType == BID_IMPORT_XML);
+// button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
+ int buttonCount = 0;
+ if ((allowedResourceTypes & ALLOW_XSD) != 0) {
+ button = createRadioButton(container, Messages.SchemaImportDialog_21,
+ BID_IMPORT_XSD, fImportType == BID_IMPORT_XSD);
+ button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
+ ++buttonCount;
+ }
+
+ if ((allowedResourceTypes & ALLOW_WSDL) != 0) {
+ button = createRadioButton(container, Messages.SchemaImportDialog_22,
+ BID_IMPORT_WSDL, fImportType == BID_IMPORT_WSDL);
+ button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
+ ++buttonCount;
+ }
+
+ if ((allowedResourceTypes & ALLOW_BPMN2) != 0) {
+ button = createRadioButton(container, Messages.SchemaImportDialog_28,
+ BID_IMPORT_BPMN2, fImportType == BID_IMPORT_BPMN2);
+ button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
+ ++buttonCount;
+ }
+
+ if ((allowedResourceTypes & ALLOW_JAVA) != 0) {
+ button = createRadioButton(container, Messages.SchemaImportDialog_23,
+ BID_IMPORT_JAVA, fImportType == BID_IMPORT_JAVA);
+ button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
+ ++buttonCount;
+ }
+ if (buttonCount==1) {
+ fTypeGroup.setVisible(false);
+ typeGroupGridData.exclude = true;
+ }
+ }
+
+ protected void createImportLocation(Composite parent) {
+
+ fKindGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
+ fKindGroup.setText(Messages.SchemaImportDialog_4);
+ GridLayout layout = new GridLayout(1, true);
+ GridData data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+
+ fKindGroup.setLayout(layout);
+ fKindGroup.setLayoutData(data);
+
+ fKindButtonComposite = new Composite(fKindGroup, SWT.NONE);
+
+ layout = new GridLayout();
+ layout.makeColumnsEqualWidth = true;
+ layout.numColumns = 4;
+ fKindButtonComposite.setLayout(layout);
+ data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.CENTER;
+ fKindButtonComposite.setLayoutData(data);
+
+ fBtnResource = createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_5,
+ BID_BROWSE_WORKSPACE, fImportSource == BID_BROWSE_WORKSPACE);
+ createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_6,
+ BID_BROWSE_FILE, fImportSource == BID_BROWSE_FILE);
+ createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_7,
+ BID_BROWSE_URL, fImportSource == BID_BROWSE_URL);
+
+ // Add WSIL option
+ fBtnWSIL = createRadioButton(fKindButtonComposite, Messages.SchemaImportDialog_15,
+ BID_BROWSE_WSIL, fImportSource == BID_BROWSE_WSIL);
+
+ // Create location variant
+ fLocationComposite = new Composite(fKindGroup, SWT.NONE);
+
+ layout = new GridLayout();
+ layout.numColumns = 3;
+ fLocationComposite.setLayout(layout);
+ data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ fLocationComposite.setLayoutData(data);
+
+ fLocationLabel = new Label(fLocationComposite, SWT.NONE);
+ fLocationLabel.setText(Messages.SchemaImportDialog_8);
+
+ fLocation = new Text(fLocationComposite, SWT.BORDER);
+ fLocation.setText(EMPTY);
+ data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ fLocation.setLayoutData(data);
+// fLocation.addListener(SWT.FocusOut, new Listener() {
+//
+// public void handleEvent(Event event) {
+// String loc = fLocation.getText();
+// if (loc.length() > 0) {
+// attemptLoad(loc);
+// }
+// }
+// });
+ fLocation.addKeyListener(new KeyListener() {
+
+ public void keyPressed(KeyEvent event) {
+ if (fImportType == BID_IMPORT_JAVA) {
+ }
+ else if (event.keyCode == SWT.CR) {
+ attemptLoad(fLocation.getText());
+ event.doit = false;
+ }
+ }
+
+ public void keyReleased(KeyEvent e) {
+ if (fImportType == BID_IMPORT_JAVA) {
+ String s = fLocation.getText();
+ if (s!=null && s.length()>1) {
+ if (!s.equals(fLocationText)) {
+ fLocationText = s;
+ attemptLoad(s);
+ }
+ }
+ }
+ }
+
+ });
+
+ fBrowseButton = createButton(fLocationComposite, BID_BROWSE,
+ Messages.SchemaImportDialog_9, false);
+
+ // End of location variant
+
+ // Start Resource Variant
+ fResourceComposite = new FileSelectionGroup(fKindGroup, new Listener() {
+ public void handleEvent(Event event) {
+ IResource resource = fResourceComposite.getSelectedResource();
+ if (resource != null && resource.getType() == IResource.FILE) {
+ // only attempt to load a resource which is not a control
+ attemptLoad((IFile) resource);
+ return;
+ }
+ markEmptySelection();
+ }
+ }, Messages.SchemaImportDialog_10, resourceFilter); //$NON-NLS-1$
+
+ TreeViewer viewer = fResourceComposite.getTreeViewer();
+ viewer.setAutoExpandLevel(2);
+
+ // End resource variant
+
+ // create WSIL UI widgets
+ createWSILStructure(fKindGroup);
+
+ }
+
+ protected Object createWSILStructure(Composite parent) {
+
+ fWSILComposite = new Composite(parent, SWT.NONE);
+
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ fWSILComposite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ data.minimumHeight = 220;
+ fWSILComposite.setLayoutData(data);
+
+ Label location = new Label(fWSILComposite, SWT.NONE);
+ location.setText( Messages.SchemaImportDialog_16 );
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.LEFT;
+ location.setLayoutData(data);
+
+ filterText = new Text(fWSILComposite, SWT.BORDER);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ filterText.setLayoutData(data);
+
+ filterText.addKeyListener(new KeyListener() {
+
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ public void keyReleased(KeyEvent e) {
+ // set the value of the filter.
+ fFilter = filterText.getText().trim().toLowerCase();
+
+ if (fFilter.length() > 0) {
+ /* for the time being, only filter 3 levels deep
+ * since link references within WSIL are rare at
+ * this time. when adoption of WSIL directories
+ * take off, this needs to be rehashed */
+ fWSILTreeViewer.expandToLevel(3);
+ }
+ fWSILTreeViewer.refresh();
+ e.doit = false;
+ }
+ });
+
+ DrillDownComposite wsilTreeComposite = new DrillDownComposite(fWSILComposite, SWT.BORDER);
+
+ layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.verticalSpacing = 0;
+ wsilTreeComposite.setLayout(layout);
+
+ data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ wsilTreeComposite.setLayoutData(data);
+
+ // Tree viewer for variable structure ...
+ fWSILTree = new Tree(wsilTreeComposite, SWT.NONE );
+ data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ data.minimumHeight = 200;
+ fWSILTree.setLayoutData(data);
+
+ fWSILTreeViewer = new TreeViewer( fWSILTree );
+ fWSILTreeViewer.setContentProvider( new WSILContentProvider() );
+ fWSILTreeViewer.setLabelProvider( new ModelLabelProvider() );
+
+ Object wsilDoc = attemptLoad(URI.createURI(fBasePath),"wsil");
+ fWSILTreeViewer.setInput ( wsilDoc ) ;
+ if (wsilDoc == null || wsilDoc instanceof Throwable ) {
+// fBtnWSIL.setEnabled(false);
+ // that's always available.
+ // delete fImportSource = BID_BROWSE_WORKSPACE; by Grid.Qian
+ // because if not, the dialog always display the resource Control
+ // regardless last time if user choose the resource button
+
+ /*// that's always available.
+ fImportSource = BID_BROWSE_WORKSPACE;*/
+ }
+
+
+ // set default tree expansion to the 2nd level
+ fWSILTreeViewer.expandToLevel(2);
+ fWSILTreeViewer.addFilter(new TreeFilter());
+ fWSILTreeViewer.setComparator(new WSILViewerComparator());
+
+ wsilTreeComposite.setChildTree(fWSILTreeViewer);
+
+ fWSILTreeViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ // TODO Auto-generated method stub
+ IStructuredSelection sel = (IStructuredSelection) event.getSelection();
+ if (sel.getFirstElement() instanceof Service) {
+ Service serv = (Service) sel.getFirstElement();
+ Description descr = serv.getDescription().get(0);
+ attemptLoad(descr.getLocation());
+ } else {
+ markEmptySelection();
+ }
+ }
+ });
+ // end tree viewer for variable structure
+
+ return fWSILComposite;
+ }
+
+ protected Object createImportStructure(Composite parent) {
+
+ fStructureLabel = new Label(parent, SWT.NONE);
+ fStructureLabel.setText(fStructureTitle);
+
+ // Tree viewer for variable structure ...
+ fTree = new Tree(parent, SWT.BORDER);
+
+ fTreeViewer = new TreeViewer(fTree);
+ fTreeViewer.setContentProvider(fTreeContentProvider);
+ fTreeViewer.setLabelProvider(new ModelTreeLabelProvider());
+ fTreeViewer.setInput(null);
+ fTreeViewer.setAutoExpandLevel(3);
+ fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection sel = (IStructuredSelection) event.getSelection();
+ if (!sel.isEmpty()) {
+ computeResult();
+ if (getResult()!=null)
+ updateStatus(Status.OK_STATUS);
+ else
+ updateStatus(new Status(IStatus.ERROR, Activator.getDefault().getID(),0,
+ Messages.SchemaImportDialog_31,null));
+ } else {
+ markEmptySelection();
+ }
+ }
+ });
+ // end tree viewer for variable structure
+ GridData data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ data.minimumHeight = 200;
+ fTree.setLayoutData(data);
+
+ return fTree;
+ }
+
+ Object attemptLoad(URI uri, String kind) {
+
+ Resource resource = null;
+ if ("java".equals(kind)) {
+ final String fileName = uri.lastSegment();
+ final List<Class> results = new ArrayList<Class>();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (IProject p : projects) {
+ try {
+ if (p.isOpen() && p.hasNature(JavaCore.NATURE_ID)) {
+ final IJavaProject javaProject = JavaCore.create(p);
+ JavaProjectClassLoader cl = new JavaProjectClassLoader(javaProject);
+ results.addAll(cl.findClasses(fileName));
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return results;
+ }
+ else {
+ try {
+ resource = fHackedResourceSet.getResource(uri, true, kind);
+ } catch (Throwable t) {
+ // BPELUIPlugin.log(t);
+ return t;
+ }
+
+ if (resource!=null && resource.getErrors().isEmpty() && resource.isLoaded()) {
+ return resource.getContents().get(0);
+ }
+ }
+ return null;
+ }
+
+ Object attemptLoad ( URI uri ) {
+ return attemptLoad (uri, fResourceKind );
+ }
+
+
+ void attemptLoad ( IFile file ) {
+ attemptLoad ( file.getFullPath().toString() );
+ }
+
+
+ void attemptLoad ( String path ) {
+
+ if (fLoaderJob != null) {
+ if (fLoaderJob.getState() == Job.RUNNING) {
+ fLoaderJob.cancel();
+ }
+ }
+
+ updateStatus ( Status.OK_STATUS );
+
+ // empty paths are ignored
+ path = path.trim();
+ if (path.length() == 0) {
+ return ;
+ }
+
+
+ URI uri = convertToURI ( path );
+ if (uri == null) {
+ return ;
+ }
+
+
+ if (uri.isRelative()) {
+ // construct absolute path
+ String absolutepath = fBasePath.substring(0, fBasePath.lastIndexOf('/')+1) + path;
+ uri = URI.createURI(absolutepath);
+ }
+
+
+ fRunnableLoadURI = uri;
+ final String msg = MessageFormat.format(Messages.SchemaImportDialog_17,fRunnableLoadURI);
+ fLoaderJob = new Job(msg) {
+
+ @Override
+ protected IStatus run (IProgressMonitor monitor) {
+ monitor.beginTask(msg, 1);
+ // Bug 290090 - move this to asyncExec() as below because the method will
+ // modify UI parameter, if not, will have a invalid access error.
+
+ /* fInput = attemptLoad(fRunnableLoadURI); */
+
+ monitor.worked(1);
+ if (fBrowseButton != null
+ && fBrowseButton.isDisposed() == false) {
+ fBrowseButton.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ fInput = attemptLoad(fRunnableLoadURI);
+ loadDone();
+ }
+ });
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+
+ fLoaderJob.schedule();
+ fRunnableStart = System.currentTimeMillis();
+
+ updateStatus ( new Status(IStatus.INFO, Activator.getDefault().getID(),0,msg,null));
+ }
+
+
+
+ @SuppressWarnings("boxing")
+ void loadDone () {
+
+ long elapsed = System.currentTimeMillis() - fRunnableStart;
+
+ if (fInput == null || fInput instanceof Throwable) {
+ markEmptySelection();
+
+ updateStatus( new Status(IStatus.ERROR,Activator.getDefault().getID(),0,
+ MessageFormat.format(Messages.SchemaImportDialog_19,fRunnableLoadURI,elapsed),(Throwable) fInput) );
+ fInput = null;
+
+ } else {
+
+ updateStatus ( new Status(IStatus.INFO, Activator.getDefault().getID(),0,
+ MessageFormat.format(Messages.SchemaImportDialog_18,fRunnableLoadURI,elapsed),null)) ;
+
+
+ // display a warning if this import does not define a targetNamespace
+ String type = null;
+ String ns = null;
+ String loc = null;
+ if (fInput instanceof XSDSchema) {
+ XSDSchema schema = (XSDSchema)fInput;
+ ns = schema.getTargetNamespace();
+ loc = schema.getSchemaLocation();
+ type = "XSD Schema";
+ }
+ else if (fInput instanceof Definition) {
+ Definition definition = (Definition)fInput;
+ ns = definition.getTargetNamespace();
+ loc = definition.getLocation();
+ type = "WSDL";
+ }
+ else if (fInput instanceof org.eclipse.bpmn2.DocumentRoot) {
+ DocumentRoot root = (DocumentRoot)fInput;
+ org.eclipse.bpmn2.Definitions definitions = root.getDefinitions();
+ ns = definitions.getTargetNamespace();
+ loc = root.eResource().getURI().toString();
+ type = "BPMN2";
+ fInput = definitions;
+ }
+ else if (fInput instanceof List) {
+ markEmptySelection();
+ }
+ if (type!=null) {
+ if (ns==null || ns.isEmpty()) {
+ updateStatus ( new Status(IStatus.WARNING, Activator.getDefault().getID(),0,
+ "This "+type+" does not define a target namespace",null)) ;
+ }
+ if (loc==null || loc.isEmpty()) {
+ updateStatus( new Status(IStatus.ERROR,Activator.getDefault().getID(),0,
+ MessageFormat.format(Messages.SchemaImportDialog_19,fRunnableLoadURI,elapsed),null) );
+ fInput = null;
+ }
+ }
+
+ fTreeViewer.setInput(fInput);
+ fTree.getVerticalBar().setSelection(0);
+ }
+ }
+
+
+
+ void markEmptySelection () {
+ updateStatus ( Status.OK_STATUS );
+ updateOK(false);
+ fTreeViewer.setInput(null);
+ }
+
+
+ private URI convertToURI (String path ) {
+
+ try {
+ switch (fImportSource) {
+ case BID_BROWSE_FILE :
+ return URI.createFileURI( path );
+
+ case BID_BROWSE_WORKSPACE :
+ return URI.createPlatformResourceURI(path,false);
+
+ case BID_BROWSE_WSIL :
+ //return URI.createFileURI( path );
+ case BID_BROWSE_URL :
+ return URI.createURI(path);
+
+
+
+ default :
+ return null;
+ }
+
+ } catch (Exception ex) {
+ updateStatus ( new Status(IStatus.ERROR,Activator.getDefault().getID(),0,Messages.SchemaImportDialog_13,ex) );
+ return null;
+ }
+ }
+
+ /**
+ * Update the state of the OK button to the state indicated.
+ *
+ * @param state
+ * false to disable, true to enable.
+ */
+
+ public void updateOK(boolean state) {
+ Button okButton = getOkButton();
+ if (okButton != null && !okButton.isDisposed()) {
+ okButton.setEnabled(state);
+ }
+ }
+
+ /**
+ * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
+ */
+
+ @Override
+ protected void computeResult() {
+ Object object = fTreeViewer.getInput();
+ if (object == null) {
+ return;
+ }
+ if (fImportType == BID_IMPORT_JAVA) {
+ IStructuredSelection sel = (IStructuredSelection)fTreeViewer.getSelection();
+ if (!sel.isEmpty()) {
+ TreeNode treeNode = (TreeNode)sel.getFirstElement();
+ if (treeNode.getModelObject() instanceof Class)
+ setSelectionResult(new Object[] { treeNode.getModelObject() });
+ else
+ setSelectionResult(null);
+ }
+ }
+ else {
+ setSelectionResult(new Object[] { object });
+ }
+ }
+
+ /**
+ * TODO: not implemented - do we need this?
+ */
+ public void configureAsXMLImport() {
+ setTitle(Messages.SchemaImportDialog_1);
+ fStructureTitle = Messages.SchemaImportDialog_12;
+ if (fStructureLabel!=null)
+ fStructureLabel.setText(fStructureTitle);
+ fTreeContentProvider = new VariableTypeTreeContentProvider(true, true);
+ if (fTreeViewer!=null)
+ fTreeViewer.setContentProvider(fTreeContentProvider);
+ fResourceKind = "xml";
+
+ String[] wsdl_FILTER_EXTENSIONS = {
+ "*.xml",
+ "*.xsd",
+ "*.wsdl",
+ "*.*"
+ };
+ FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
+
+ String[] wsdl_FILTER_NAMES = {
+ "XML Files",
+ "XML Schema Files",
+ "WSDL Definition Files",
+ "All"
+ };
+ FILTER_NAMES = wsdl_FILTER_NAMES;
+
+ resourceFilter = ".xml";
+ if (fResourceComposite!=null)
+ fResourceComposite.setFileFilter(resourceFilter);
+ }
+
+ /**
+ * Configure the dialog as a schema import dialog. Set the title and the
+ * structure pane message.
+ *
+ */
+
+ public void configureAsSchemaImport() {
+ setTitle(Messages.SchemaImportDialog_2);
+ fStructureTitle = Messages.SchemaImportDialog_11;
+ if (fStructureLabel!=null)
+ fStructureLabel.setText(fStructureTitle);
+ fTreeContentProvider = new VariableTypeTreeContentProvider(true, true);
+ if (fTreeViewer!=null)
+ fTreeViewer.setContentProvider(fTreeContentProvider);
+ fResourceKind = "xsd";
+
+ String[] wsdl_FILTER_EXTENSIONS = {
+ "*.xml",
+ "*.xsd",
+ "*.wsdl",
+ "*.*"
+ };
+ FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
+
+ String[] wsdl_FILTER_NAMES = {
+ "XML Files",
+ "XML Schema Files",
+ "WSDL Definition Files",
+ "All"
+ };
+ FILTER_NAMES = wsdl_FILTER_NAMES;
+
+ resourceFilter = ".xsd";
+ if (fResourceComposite!=null)
+ fResourceComposite.setFileFilter(resourceFilter);
+ }
+
+ /**
+ * Configure the dialog as a WSDL import dialog. Set the title and the
+ * structure pane message.
+ *
+ */
+
+ public void configureAsWSDLImport() {
+
+ setTitle(Messages.SchemaImportDialog_0);
+ fStructureTitle = Messages.SchemaImportDialog_14;
+ if (fStructureLabel!=null)
+ fStructureLabel.setText(fStructureTitle);
+ fTreeContentProvider = new ServiceTreeContentProvider(true);
+ if (fTreeViewer!=null)
+ fTreeViewer.setContentProvider(fTreeContentProvider);
+ fResourceKind = "wsdl";
+
+ String[] wsdl_FILTER_EXTENSIONS = {
+ "*.wsdl",
+ "*.*"
+ };
+ FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
+
+ String[] wsdl_FILTER_NAMES = {
+ "WSDL Definition Files",
+ "All"
+ };
+ FILTER_NAMES = wsdl_FILTER_NAMES;
+
+ resourceFilter = ".wsdl";
+ if (fResourceComposite!=null)
+ fResourceComposite.setFileFilter(resourceFilter);
+ }
+
+ public void configureAsBPMN2Import() {
+
+ setTitle(Messages.SchemaImportDialog_29);
+ fStructureTitle = Messages.SchemaImportDialog_30;
+ if (fStructureLabel!=null)
+ fStructureLabel.setText(fStructureTitle);
+ fTreeContentProvider = new BPMN2DefinitionsTreeContentProvider(true);
+ if (fTreeViewer!=null)
+ fTreeViewer.setContentProvider(fTreeContentProvider);
+ fResourceKind = "";
+
+ String[] wsdl_FILTER_EXTENSIONS = {
+ "*.bpmn",
+ "*.bpmn2",
+ "*.*"
+ };
+ FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
+
+ String[] wsdl_FILTER_NAMES = {
+ "BPMN 2.0 Diagram Files",
+ "BPMN 2.0 Diagram Files",
+ "All"
+ };
+ FILTER_NAMES = wsdl_FILTER_NAMES;
+
+ resourceFilter = ".bpmn";
+ if (fResourceComposite!=null)
+ fResourceComposite.setFileFilter(resourceFilter);
+ }
+
+ public void configureAsJavaImport() {
+
+ setTitle(Messages.SchemaImportDialog_24);
+ fStructureTitle = Messages.SchemaImportDialog_25;
+ if (fStructureLabel!=null)
+ fStructureLabel.setText(fStructureTitle);
+ fTreeContentProvider = new JavaTreeContentProvider(true);
+ if (fTreeViewer!=null)
+ fTreeViewer.setContentProvider(fTreeContentProvider);
+ fResourceKind = "java";
+
+ String[] java_FILTER_EXTENSIONS = {
+ "*.java",
+ "*.class",
+ "*.jar",
+ "*.*"
+ };
+ FILTER_EXTENSIONS = java_FILTER_EXTENSIONS;
+
+ String[] wsdl_FILTER_NAMES = {
+ "Java Source Files",
+ "Compiled Java Files",
+ "Java Archives",
+ "All"
+ };
+ FILTER_NAMES = wsdl_FILTER_NAMES;
+
+ // Resource selection widget not used (yet)
+ resourceFilter = ".java";
+ if (fResourceComposite!=null)
+ fResourceComposite.setFileFilter(resourceFilter);
+ }
+
+ @Override
+ public void setTitle(String title) {
+ super.setTitle(title);
+ if (getShell()!=null)
+ getShell().setText(title);
+ }
+
+ /**
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 4, 2007
+ *
+ */
+ public class TreeFilter extends ViewerFilter {
+
+ /**
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+
+ if (fFilter == null || fFilter.length() == 0) {
+ return true;
+ }
+
+ if (element instanceof Service) {
+ String text = ""; //$NON-NLS-1$
+ Service service = (Service) element;
+ if (service.getName().size() > 0) {
+ Name name = service.getName().get(0);
+ text += name.getValue();
+ }
+ if (service.getAbstract().size() > 0) {
+ TypeOfAbstract abst = service.getAbstract().get(0);
+ text += abst.getValue();
+ }
+ return (text.toLowerCase().indexOf(fFilter) > -1);
+ }
+
+ return true;
+ }
+ }
+
+ /**
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date May 10, 2007
+ *
+ */
+ public class WSILViewerComparator extends ViewerComparator {
+
+ /**
+ * @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
+ */
+ @Override
+ public int category(Object element) {
+ if (element instanceof Inspection)
+ return 1;
+ if (element instanceof Link)
+ return 2;
+ if (element instanceof Service)
+ return 3;
+
+ return 0;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaSelectionDialog.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaSelectionDialog.java
index 837f7ae..8834846 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaSelectionDialog.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/SchemaSelectionDialog.java
@@ -1,347 +1,347 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.dialogs;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Import;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
-import org.eclipse.bpmn2.modeler.core.utils.ImportUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.bpmn2.modeler.ui.property.providers.ModelTreeLabelProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.ServiceTreeContentProvider;
-import org.eclipse.bpmn2.modeler.ui.property.providers.TreeNode;
-import org.eclipse.bpmn2.modeler.ui.property.providers.VariableTypeTreeContentProvider;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.dialogs.SelectionStatusDialog;
-
-public class SchemaSelectionDialog extends SelectionStatusDialog {
-
- protected BPMN2Editor bpmn2Editor;
- protected EObject modelObject;
- protected Object input; // an XSDSchema or WSDL Definition
- protected List importList;
- protected Tree tree;
- protected TreeViewer treeViewer;
- protected ITreeContentProvider treeContentProvider;
- protected Bpmn2ModelerResourceSetImpl hackedResourceSet;
- protected String importType;
- protected String importLocation;
- protected Job loaderJob;
- private String selectionPath;
-
- /**
- * @param parent
- * @param structureRefObjectEditor TODO
- */
- public SchemaSelectionDialog(Shell parent, EObject object) {
- super(parent);
- setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
-
- modelObject = object;
- bpmn2Editor = BPMN2Editor.getActiveEditor();
- }
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText("Schema Selection");
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite contents = (Composite) super.createDialogArea(parent);
-
- GridLayout contentsGridLayout = (GridLayout) contents.getLayout();
- contentsGridLayout.numColumns = 2;
- contentsGridLayout.makeColumnsEqualWidth = false;
-
- createImportList(contents);
- createImportStructure(contents);
-
- return contents;
- }
-
- protected Object createImportList(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText("Imports");
- label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
-
- Button addImport = new Button(parent, SWT.PUSH);
- addImport.setText("Add new Import");
- addImport.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,true,true,1,1));
- addImport.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- SchemaImportDialog dialog = new SchemaImportDialog(getShell());
- if (dialog.open() == Window.OK) {
- Object result[] = dialog.getResult();
- if (result.length == 1) {
- Import imp = ImportUtil.addImport(bpmn2Editor.getModelHandler().getResource(), result[0]);
- if (imp!=null) {
- int index = importList.getItemCount();
- importList.add(imp.getLocation());
- importList.setData(""+index,imp);
- }
- }
- }
- }
- });
-
- importList = new List(parent, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(SWT.FILL,SWT.FILL,true,true,2,1);
- data.minimumHeight = 100;
- data.minimumWidth = 400;
- importList.setLayoutData(data);
-
- int index = 0;
- for (Import imp : getImports()) {
- importList.add(imp.getLocation());
- importList.setData(""+index++, imp);
- }
- importList.addSelectionListener( new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- int index = importList.getSelectionIndex();
- Import imp = (Import)importList.getData(""+index);
- importType = getImportType(imp);
- importLocation = imp.getLocation();
-
- attemptLoad();
- updateOK(false);
- }
- });
- return importList;
- }
-
- protected Object createImportStructure(Composite parent) {
-
- Label label = new Label(parent, SWT.NONE);
- label.setText("Structure");
-
- // Tree viewer for variable structure
- tree = new Tree(parent, SWT.BORDER | SWT.SINGLE);
-
- treeViewer = new TreeViewer(tree);
- treeViewer.setLabelProvider(new ModelTreeLabelProvider());
- treeViewer.setAutoExpandLevel(3);
-
- GridData data = new GridData(SWT.FILL,SWT.FILL,true,true,2,1);
- data.minimumHeight = 200;
- tree.setLayoutData(data);
- tree.getVerticalBar().setSelection(0);
-
- tree.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- TreeItem[] sel = tree.getSelection();
- if (sel.length==1) {
- Object data = sel[0].getData();
- if (data instanceof TreeNode) {
- TreeNode tn = (TreeNode)data;
- Object[] result = new Object[] {tn.getModelObject()};
- setSelectionResult(result);
- setSelectionPath(sel[0]);
- updateOK(true);
- }
- else
- updateOK(false);
- }
- }
- });
-
- return tree;
- }
-
- protected void setSelectionPath(TreeItem sel) {
- selectionPath = buildSelectionPath(sel);
- }
-
- public String getSelectionPath() {
- return selectionPath;
- }
-
- private String buildSelectionPath(TreeItem sel) {
- String path = "";
- TreeItem parent = sel.getParentItem();
- if (parent!=null) {
- path += buildSelectionPath(parent);
-
- Object data = sel.getData();
- if (data instanceof TreeNode) {
- TreeNode tn = (TreeNode)data;
- path += "/" + tn.getLabel();
- }
- }
- else
- path = ""; // this is the tree root
-
- return path;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- }
-
- void attemptLoad() {
- String path = null;
- if ("xsd".equals(importType)) {
- treeContentProvider = new VariableTypeTreeContentProvider(true, true);
- path = importLocation;
- } else if ("wsdl".equals(importType)) {
- treeContentProvider = new ServiceTreeContentProvider(true);
- path = importLocation;
- } else {
- treeContentProvider = null;
- input = null;
- }
-
- if (loaderJob != null) {
- if (loaderJob.getState() == Job.RUNNING) {
- loaderJob.cancel();
- }
- }
-
- // empty paths are ignored
- if (path.length() == 0) {
- return;
- }
-
- URI uri = URI.createURI(path);
- if (uri == null) {
- return ;
- }
- if (uri.isRelative())
- uri = URI.createFileURI( path );
- if (uri == null) {
- return ;
- }
- if (uri.isRelative()) {
- // construct absolute path
- String basePath = bpmn2Editor.getModelFile().getLocation().removeLastSegments(1).toString();
- uri = URI.createFileURI( basePath + "/" + path );
- }
-
- final URI loadUri = uri;
- loaderJob = new Job("") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- Thread.sleep(500);
- tree.getDisplay().asyncExec(new Runnable() {
- public void run() {
- input = attemptLoad(loadUri, importType);
- loadDone();
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- return Status.OK_STATUS;
- }
- };
-
- loaderJob.schedule();
- }
-
- Object attemptLoad(URI uri, String kind) {
-
- Resource resource = null;
- try {
- hackedResourceSet = ModelUtil.slightlyHackedResourceSet(bpmn2Editor.getResourceSet());
- resource = hackedResourceSet.getResource(uri, true, kind);
- } catch (Exception e) {
- return e;
- }
-
- if (resource != null && resource.getErrors().isEmpty() && resource.isLoaded()) {
- return resource.getContents().get(0);
- }
- return null;
- }
-
- @SuppressWarnings("boxing")
- void loadDone() {
-
- if (input == null || input instanceof Exception) {
- updateStatus(new Status(IStatus.ERROR, Activator.getDefault().PLUGIN_ID, 0,
- "Cannot load "+importLocation, (Throwable)input));
-// treeViewer.setInput(null);
- input = null;
-
- } else {
- treeViewer.setContentProvider(treeContentProvider);
- treeViewer.setInput(input);
- tree.getVerticalBar().setSelection(0);
- updateStatus(new Status(IStatus.OK, Activator.getDefault().PLUGIN_ID, 0,
- "Loaded "+importLocation, null));
- }
- }
-
- public void updateOK(boolean state) {
- Button okButton = getOkButton();
- if (okButton != null && !okButton.isDisposed()) {
- okButton.setEnabled(state);
- }
- }
-
- public Definitions getDefinitions() {
- return bpmn2Editor.getModelHandler().getDefinitions();
- }
-
- public java.util.List<Import> getImports() {
- return getDefinitions().getImports();
- }
-
- String getImportType(Import imp) {
- if (imp != null) {
- String type = imp.getImportType();
- if ("http://schemas.xmlsoap.org/wsdl/".equals(type))
- return "wsdl";
- if ("http://www.w3.org/2001/XMLSchema".equals(type))
- return "xsd";
- }
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.dialogs;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Import;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
+import org.eclipse.bpmn2.modeler.core.utils.ImportUtil;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.bpmn2.modeler.ui.property.providers.ModelTreeLabelProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.ServiceTreeContentProvider;
+import org.eclipse.bpmn2.modeler.ui.property.providers.TreeNode;
+import org.eclipse.bpmn2.modeler.ui.property.providers.VariableTypeTreeContentProvider;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+
+public class SchemaSelectionDialog extends SelectionStatusDialog {
+
+ protected BPMN2Editor bpmn2Editor;
+ protected EObject modelObject;
+ protected Object input; // an XSDSchema or WSDL Definition
+ protected List importList;
+ protected Tree tree;
+ protected TreeViewer treeViewer;
+ protected ITreeContentProvider treeContentProvider;
+ protected Bpmn2ModelerResourceSetImpl hackedResourceSet;
+ protected String importType;
+ protected String importLocation;
+ protected Job loaderJob;
+ private String selectionPath;
+
+ /**
+ * @param parent
+ * @param structureRefObjectEditor TODO
+ */
+ public SchemaSelectionDialog(Shell parent, EObject object) {
+ super(parent);
+ setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
+
+ modelObject = object;
+ bpmn2Editor = BPMN2Editor.getActiveEditor();
+ }
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText("Schema Selection");
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite contents = (Composite) super.createDialogArea(parent);
+
+ GridLayout contentsGridLayout = (GridLayout) contents.getLayout();
+ contentsGridLayout.numColumns = 2;
+ contentsGridLayout.makeColumnsEqualWidth = false;
+
+ createImportList(contents);
+ createImportStructure(contents);
+
+ return contents;
+ }
+
+ protected Object createImportList(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Imports");
+ label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
+
+ Button addImport = new Button(parent, SWT.PUSH);
+ addImport.setText("Add new Import");
+ addImport.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,true,true,1,1));
+ addImport.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ SchemaImportDialog dialog = new SchemaImportDialog(getShell());
+ if (dialog.open() == Window.OK) {
+ Object result[] = dialog.getResult();
+ if (result.length == 1) {
+ Import imp = ImportUtil.addImport(bpmn2Editor.getModelHandler().getResource(), result[0]);
+ if (imp!=null) {
+ int index = importList.getItemCount();
+ importList.add(imp.getLocation());
+ importList.setData(""+index,imp);
+ }
+ }
+ }
+ }
+ });
+
+ importList = new List(parent, SWT.SINGLE | SWT.BORDER);
+ GridData data = new GridData(SWT.FILL,SWT.FILL,true,true,2,1);
+ data.minimumHeight = 100;
+ data.minimumWidth = 400;
+ importList.setLayoutData(data);
+
+ int index = 0;
+ for (Import imp : getImports()) {
+ importList.add(imp.getLocation());
+ importList.setData(""+index++, imp);
+ }
+ importList.addSelectionListener( new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int index = importList.getSelectionIndex();
+ Import imp = (Import)importList.getData(""+index);
+ importType = getImportType(imp);
+ importLocation = imp.getLocation();
+
+ attemptLoad();
+ updateOK(false);
+ }
+ });
+ return importList;
+ }
+
+ protected Object createImportStructure(Composite parent) {
+
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Structure");
+
+ // Tree viewer for variable structure
+ tree = new Tree(parent, SWT.BORDER | SWT.SINGLE);
+
+ treeViewer = new TreeViewer(tree);
+ treeViewer.setLabelProvider(new ModelTreeLabelProvider());
+ treeViewer.setAutoExpandLevel(3);
+
+ GridData data = new GridData(SWT.FILL,SWT.FILL,true,true,2,1);
+ data.minimumHeight = 200;
+ tree.setLayoutData(data);
+ tree.getVerticalBar().setSelection(0);
+
+ tree.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ TreeItem[] sel = tree.getSelection();
+ if (sel.length==1) {
+ Object data = sel[0].getData();
+ if (data instanceof TreeNode) {
+ TreeNode tn = (TreeNode)data;
+ Object[] result = new Object[] {tn.getModelObject()};
+ setSelectionResult(result);
+ setSelectionPath(sel[0]);
+ updateOK(true);
+ }
+ else
+ updateOK(false);
+ }
+ }
+ });
+
+ return tree;
+ }
+
+ protected void setSelectionPath(TreeItem sel) {
+ selectionPath = buildSelectionPath(sel);
+ }
+
+ public String getSelectionPath() {
+ return selectionPath;
+ }
+
+ private String buildSelectionPath(TreeItem sel) {
+ String path = "";
+ TreeItem parent = sel.getParentItem();
+ if (parent!=null) {
+ path += buildSelectionPath(parent);
+
+ Object data = sel.getData();
+ if (data instanceof TreeNode) {
+ TreeNode tn = (TreeNode)data;
+ path += "/" + tn.getLabel();
+ }
+ }
+ else
+ path = ""; // this is the tree root
+
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
+ */
+ @Override
+ protected void computeResult() {
+ }
+
+ void attemptLoad() {
+ String path = null;
+ if ("xsd".equals(importType)) {
+ treeContentProvider = new VariableTypeTreeContentProvider(true, true);
+ path = importLocation;
+ } else if ("wsdl".equals(importType)) {
+ treeContentProvider = new ServiceTreeContentProvider(true);
+ path = importLocation;
+ } else {
+ treeContentProvider = null;
+ input = null;
+ }
+
+ if (loaderJob != null) {
+ if (loaderJob.getState() == Job.RUNNING) {
+ loaderJob.cancel();
+ }
+ }
+
+ // empty paths are ignored
+ if (path.length() == 0) {
+ return;
+ }
+
+ URI uri = URI.createURI(path);
+ if (uri == null) {
+ return ;
+ }
+ if (uri.isRelative())
+ uri = URI.createFileURI( path );
+ if (uri == null) {
+ return ;
+ }
+ if (uri.isRelative()) {
+ // construct absolute path
+ String basePath = bpmn2Editor.getModelFile().getLocation().removeLastSegments(1).toString();
+ uri = URI.createFileURI( basePath + "/" + path );
+ }
+
+ final URI loadUri = uri;
+ loaderJob = new Job("") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ Thread.sleep(500);
+ tree.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ input = attemptLoad(loadUri, importType);
+ loadDone();
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+
+ loaderJob.schedule();
+ }
+
+ Object attemptLoad(URI uri, String kind) {
+
+ Resource resource = null;
+ try {
+ hackedResourceSet = ModelUtil.slightlyHackedResourceSet(bpmn2Editor.getResourceSet());
+ resource = hackedResourceSet.getResource(uri, true, kind);
+ } catch (Exception e) {
+ return e;
+ }
+
+ if (resource != null && resource.getErrors().isEmpty() && resource.isLoaded()) {
+ return resource.getContents().get(0);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("boxing")
+ void loadDone() {
+
+ if (input == null || input instanceof Exception) {
+ updateStatus(new Status(IStatus.ERROR, Activator.getDefault().PLUGIN_ID, 0,
+ "Cannot load "+importLocation, (Throwable)input));
+// treeViewer.setInput(null);
+ input = null;
+
+ } else {
+ treeViewer.setContentProvider(treeContentProvider);
+ treeViewer.setInput(input);
+ tree.getVerticalBar().setSelection(0);
+ updateStatus(new Status(IStatus.OK, Activator.getDefault().PLUGIN_ID, 0,
+ "Loaded "+importLocation, null));
+ }
+ }
+
+ public void updateOK(boolean state) {
+ Button okButton = getOkButton();
+ if (okButton != null && !okButton.isDisposed()) {
+ okButton.setEnabled(state);
+ }
+ }
+
+ public Definitions getDefinitions() {
+ return bpmn2Editor.getModelHandler().getDefinitions();
+ }
+
+ public java.util.List<Import> getImports() {
+ return getDefinitions().getImports();
+ }
+
+ String getImportType(Import imp) {
+ if (imp != null) {
+ String type = imp.getImportType();
+ if ("http://schemas.xmlsoap.org/wsdl/".equals(type))
+ return "wsdl";
+ if ("http://www.w3.org/2001/XMLSchema".equals(type))
+ return "xsd";
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/ViewerFileFilter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/ViewerFileFilter.java
index 207a893..566f153 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/ViewerFileFilter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/ViewerFileFilter.java
@@ -1,84 +1,84 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.dialogs;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-public class ViewerFileFilter extends ViewerFilter {
-
- private String[] patterns;
-
- static String COMMA_SEPARATOR = ","; //$NON-NLS-1$
-
- public ViewerFileFilter() {
- this(null);
- }
- /**
- * Creates a new resource pattern filter.
- */
- public ViewerFileFilter(String patterns) {
- super();
-
- if (patterns != null) {
- //Get the strings separated by a comma and filter them from the currently
- //defined ones
- StringTokenizer entries = new StringTokenizer(patterns, COMMA_SEPARATOR);
- List localPatterns = new ArrayList();
-
- while (entries.hasMoreElements()) {
- String nextToken = entries.nextToken();
- if (patterns.indexOf(nextToken) > -1)
- localPatterns.add(nextToken);
- }
-
- //Convert to an array of Strings
- String[] patternArray = new String[localPatterns.size()];
- localPatterns.toArray(patternArray);
- setPatterns(patternArray);
- }
- }
- /**
- * Return the currently configured StringMatchers. If there aren't any look
- * them up.
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- IResource resource = null;
- if (element instanceof IFile) {
- resource = (IFile) element;
- }
- else
- return true;
- if (resource != null) {
- String name = resource.getName();
- for (int i = 0; i < patterns.length; i++) {
- if (name.endsWith(patterns[i]))
- return true;
- }
- return false;
- }
- return true;
- }
- /**
- * Sets the patterns to filter out for the receiver.
- */
- public void setPatterns(String[] newPatterns) {
-
- this.patterns = newPatterns;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.dialogs;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+public class ViewerFileFilter extends ViewerFilter {
+
+ private String[] patterns;
+
+ static String COMMA_SEPARATOR = ","; //$NON-NLS-1$
+
+ public ViewerFileFilter() {
+ this(null);
+ }
+ /**
+ * Creates a new resource pattern filter.
+ */
+ public ViewerFileFilter(String patterns) {
+ super();
+
+ if (patterns != null) {
+ //Get the strings separated by a comma and filter them from the currently
+ //defined ones
+ StringTokenizer entries = new StringTokenizer(patterns, COMMA_SEPARATOR);
+ List localPatterns = new ArrayList();
+
+ while (entries.hasMoreElements()) {
+ String nextToken = entries.nextToken();
+ if (patterns.indexOf(nextToken) > -1)
+ localPatterns.add(nextToken);
+ }
+
+ //Convert to an array of Strings
+ String[] patternArray = new String[localPatterns.size()];
+ localPatterns.toArray(patternArray);
+ setPatterns(patternArray);
+ }
+ }
+ /**
+ * Return the currently configured StringMatchers. If there aren't any look
+ * them up.
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ IResource resource = null;
+ if (element instanceof IFile) {
+ resource = (IFile) element;
+ }
+ else
+ return true;
+ if (resource != null) {
+ String name = resource.getName();
+ for (int i = 0; i < patterns.length; i++) {
+ if (name.endsWith(patterns[i]))
+ return true;
+ }
+ return false;
+ }
+ return true;
+ }
+ /**
+ * Sets the patterns to filter out for the receiver.
+ */
+ public void setPatterns(String[] newPatterns) {
+
+ this.patterns = newPatterns;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/editors/SchemaObjectEditor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/editors/SchemaObjectEditor.java
index 4f50d00..ceae341 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/editors/SchemaObjectEditor.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/editors/SchemaObjectEditor.java
@@ -1,193 +1,193 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.editors;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.bpmn2.Import;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextAndButtonObjectEditor;
-import org.eclipse.bpmn2.modeler.core.utils.NamespaceUtil;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.bpmn2.modeler.ui.property.dialogs.SchemaSelectionDialog;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SchemaObjectEditor extends TextAndButtonObjectEditor {
-
- protected Resource resource;
- protected Import imp;
- protected Button editButton;
-
- /**
- * @param parent
- * @param object
- * @param feature
- */
- public SchemaObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) {
- super(parent, object, feature);
- resource = BPMN2Editor.getActiveEditor().getModelHandler().getResource();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor#createControl
- * (org.eclipse.swt.widgets.Composite, java.lang.String, int)
- */
- @Override
- public Control createControl(Composite composite, String label, int style) {
- super.createControl(composite, label, style);
- // the Text field should be editable
- text.setEditable(true);
- // and change the "Edit" button to a "Browse" to make it clear that
- // an XML type can be selected from the imports
- button.setText("Browse...");
- return text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.editors.TextAndButtonObjectEditor#buttonClicked()
- */
- @Override
- protected void buttonClicked() {
- SchemaSelectionDialog dialog = new SchemaSelectionDialog(parent.getShell(), object);
-
- if (dialog.open() == Window.OK) {
- Object result = dialog.getResult()[0];
- String selectionPath = dialog.getSelectionPath();
- String value = "";
- String selectionType = "";
-
- // TODO: do we need these?
- if (result instanceof PortType) {
- PortType portType = (PortType)result;
- QName qname = portType.getQName();
- String prefix = NamespaceUtil.getPrefixForNamespace(resource, qname.getNamespaceURI());
- if (prefix==null)
- prefix = NamespaceUtil.addNamespace(resource, qname.getNamespaceURI());
- if (prefix!=null)
- value = prefix + ":";
- value += qname.getLocalPart();
- selectionType = "WSDL Port Type";
- }
- if (result instanceof Operation) {
- selectionType = "WSDL Operation";
- }
- if (result instanceof Input) {
- Input input = (Input)result;
- result = input.getMessage();
- selectionType = "WSDL Input";
- }
- if (result instanceof Output) {
- Output output = (Output)result;
- result = output.getMessage();
- selectionType = "WSDL Output";
- }
- if (result instanceof Fault) {
- Fault fault = (Fault)result;
- result = fault.getMessage();
- selectionType = "WSDL Fault";
- }
- if (result instanceof Part) {
- Part part = (Part)result;
- result = part.getElementDeclaration();
- selectionType = "WSDL Message Part";
- }
- if (result instanceof Message) {
- Message message = (Message)result;
- QName qname = message.getQName();
- String prefix = NamespaceUtil.getPrefixForNamespace(resource, qname.getNamespaceURI());
- if (prefix==null)
- prefix = NamespaceUtil.addNamespace(resource, qname.getNamespaceURI());
- if (prefix!=null)
- value = prefix + ":";
- value += qname.getLocalPart();
- selectionType = "WSDL Message";
- }
- if (result instanceof XSDAttributeDeclaration) {
- selectionType = "XML Attribute";
- }
-
- if (result instanceof XSDElementDeclaration) {
- XSDElementDeclaration decl = (XSDElementDeclaration)result;
- XSDSchema schema = getContainingSchema(decl);
- String ns = schema.getTargetNamespace();
- if (ns==null) {
- XSDTypeDefinition type = decl.getTypeDefinition();
- if (type!=null) {
- ns = type.getSchema().getTargetNamespace();
- }
- }
- String prefix = NamespaceUtil.getPrefixForNamespace(resource, ns);
- if (prefix!=null)
- value = prefix + ":";
- value += selectionPath;
- }
- if (result instanceof XSDTypeDefinition) {
- XSDTypeDefinition type = (XSDTypeDefinition)result;
- XSDSchema schema = getContainingSchema(type);
- String ns = schema.getTargetNamespace();
- String prefix = NamespaceUtil.getPrefixForNamespace(resource, ns);
- if (prefix!=null)
- value = prefix + ":";
- value += selectionPath;
- }
- if (result instanceof XSDSchema) {
- XSDSchema schema = (XSDSchema)result;
- String prefix = NamespaceUtil.getPrefixForNamespace(resource, schema.getTargetNamespace());
- if (prefix!=null)
- value = prefix + ":";
- value += "schema";
- }
- if (value.isEmpty()) {
- MessageDialog.openWarning(parent.getShell(), "Invalid Selection","The selection, "+
- selectionType+" is not a valid type definition.");
- }
- else
- updateObject(value);
- }
- }
-
- private XSDSchema getContainingSchema(EObject object) {
- EObject container = object.eContainer();
- if (container instanceof XSDSchema)
- return (XSDSchema) container;
- if (container!=null)
- return getContainingSchema(container);
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.editors;
+
+import javax.xml.namespace.QName;
+
+import org.eclipse.bpmn2.Import;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextAndButtonObjectEditor;
+import org.eclipse.bpmn2.modeler.core.utils.NamespaceUtil;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.bpmn2.modeler.ui.property.dialogs.SchemaSelectionDialog;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.wst.wsdl.Fault;
+import org.eclipse.wst.wsdl.Input;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Operation;
+import org.eclipse.wst.wsdl.Output;
+import org.eclipse.wst.wsdl.Part;
+import org.eclipse.wst.wsdl.PortType;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SchemaObjectEditor extends TextAndButtonObjectEditor {
+
+ protected Resource resource;
+ protected Import imp;
+ protected Button editButton;
+
+ /**
+ * @param parent
+ * @param object
+ * @param feature
+ */
+ public SchemaObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) {
+ super(parent, object, feature);
+ resource = BPMN2Editor.getActiveEditor().getModelHandler().getResource();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor#createControl
+ * (org.eclipse.swt.widgets.Composite, java.lang.String, int)
+ */
+ @Override
+ public Control createControl(Composite composite, String label, int style) {
+ super.createControl(composite, label, style);
+ // the Text field should be editable
+ text.setEditable(true);
+ // and change the "Edit" button to a "Browse" to make it clear that
+ // an XML type can be selected from the imports
+ button.setText("Browse...");
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.editors.TextAndButtonObjectEditor#buttonClicked()
+ */
+ @Override
+ protected void buttonClicked() {
+ SchemaSelectionDialog dialog = new SchemaSelectionDialog(parent.getShell(), object);
+
+ if (dialog.open() == Window.OK) {
+ Object result = dialog.getResult()[0];
+ String selectionPath = dialog.getSelectionPath();
+ String value = "";
+ String selectionType = "";
+
+ // TODO: do we need these?
+ if (result instanceof PortType) {
+ PortType portType = (PortType)result;
+ QName qname = portType.getQName();
+ String prefix = NamespaceUtil.getPrefixForNamespace(resource, qname.getNamespaceURI());
+ if (prefix==null)
+ prefix = NamespaceUtil.addNamespace(resource, qname.getNamespaceURI());
+ if (prefix!=null)
+ value = prefix + ":";
+ value += qname.getLocalPart();
+ selectionType = "WSDL Port Type";
+ }
+ if (result instanceof Operation) {
+ selectionType = "WSDL Operation";
+ }
+ if (result instanceof Input) {
+ Input input = (Input)result;
+ result = input.getMessage();
+ selectionType = "WSDL Input";
+ }
+ if (result instanceof Output) {
+ Output output = (Output)result;
+ result = output.getMessage();
+ selectionType = "WSDL Output";
+ }
+ if (result instanceof Fault) {
+ Fault fault = (Fault)result;
+ result = fault.getMessage();
+ selectionType = "WSDL Fault";
+ }
+ if (result instanceof Part) {
+ Part part = (Part)result;
+ result = part.getElementDeclaration();
+ selectionType = "WSDL Message Part";
+ }
+ if (result instanceof Message) {
+ Message message = (Message)result;
+ QName qname = message.getQName();
+ String prefix = NamespaceUtil.getPrefixForNamespace(resource, qname.getNamespaceURI());
+ if (prefix==null)
+ prefix = NamespaceUtil.addNamespace(resource, qname.getNamespaceURI());
+ if (prefix!=null)
+ value = prefix + ":";
+ value += qname.getLocalPart();
+ selectionType = "WSDL Message";
+ }
+ if (result instanceof XSDAttributeDeclaration) {
+ selectionType = "XML Attribute";
+ }
+
+ if (result instanceof XSDElementDeclaration) {
+ XSDElementDeclaration decl = (XSDElementDeclaration)result;
+ XSDSchema schema = getContainingSchema(decl);
+ String ns = schema.getTargetNamespace();
+ if (ns==null) {
+ XSDTypeDefinition type = decl.getTypeDefinition();
+ if (type!=null) {
+ ns = type.getSchema().getTargetNamespace();
+ }
+ }
+ String prefix = NamespaceUtil.getPrefixForNamespace(resource, ns);
+ if (prefix!=null)
+ value = prefix + ":";
+ value += selectionPath;
+ }
+ if (result instanceof XSDTypeDefinition) {
+ XSDTypeDefinition type = (XSDTypeDefinition)result;
+ XSDSchema schema = getContainingSchema(type);
+ String ns = schema.getTargetNamespace();
+ String prefix = NamespaceUtil.getPrefixForNamespace(resource, ns);
+ if (prefix!=null)
+ value = prefix + ":";
+ value += selectionPath;
+ }
+ if (result instanceof XSDSchema) {
+ XSDSchema schema = (XSDSchema)result;
+ String prefix = NamespaceUtil.getPrefixForNamespace(resource, schema.getTargetNamespace());
+ if (prefix!=null)
+ value = prefix + ":";
+ value += "schema";
+ }
+ if (value.isEmpty()) {
+ MessageDialog.openWarning(parent.getShell(), "Invalid Selection","The selection, "+
+ selectionType+" is not a valid type definition.");
+ }
+ else
+ updateObject(value);
+ }
+ }
+
+ private XSDSchema getContainingSchema(EObject object) {
+ EObject container = object.eContainer();
+ if (container instanceof XSDSchema)
+ return (XSDSchema) container;
+ if (container!=null)
+ return getContainingSchema(container);
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventDetailComposite.java
index 55297cc..43f5003 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventDetailComposite.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class BoundaryEventDetailComposite extends AbstractDetailComposite {
-
- public BoundaryEventDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public BoundaryEventDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"isCancelActivity");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class BoundaryEventDetailComposite extends AbstractDetailComposite {
+
+ public BoundaryEventDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public BoundaryEventDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"isCancelActivity");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventPropertySection.java
index 8544c73..d647ba6 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/BoundaryEventPropertySection.java
@@ -1,44 +1,44 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class BoundaryEventPropertySection extends AbstractBpmn2PropertySection {
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new BoundaryEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new BoundaryEventDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof BoundaryEvent)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class BoundaryEventPropertySection extends AbstractBpmn2PropertySection {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new BoundaryEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new BoundaryEventDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof BoundaryEvent)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventDetailComposite.java
index 3b61b45..1d997c9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventDetailComposite.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class CatchEventDetailComposite extends AbstractDetailComposite {
-
- public CatchEventDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param parent
- * @param style
- */
- public CatchEventDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"parallelMultiple");
- bindList(be,"eventDefinitions");
- bindList(be,"dataOutputs");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class CatchEventDetailComposite extends AbstractDetailComposite {
+
+ public CatchEventDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public CatchEventDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"parallelMultiple");
+ bindList(be,"eventDefinitions");
+ bindList(be,"dataOutputs");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventPropertySection.java
index 23f7350..aad9c82 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CatchEventPropertySection.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class CatchEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new CatchEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new CatchEventDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof CatchEvent)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class CatchEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new CatchEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new CatchEventDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof CatchEvent)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventPropertySection.java
index 866289e..881267b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventPropertySection.java
@@ -1,89 +1,89 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.CompensateEventDefinition;
-import org.eclipse.bpmn2.ConditionalEventDefinition;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.ErrorEventDefinition;
-import org.eclipse.bpmn2.EscalationEventDefinition;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.LinkEventDefinition;
-import org.eclipse.bpmn2.MessageEventDefinition;
-import org.eclipse.bpmn2.SignalEventDefinition;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.TimerEventDefinition;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDialogComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.ui.property.data.ConditionalEventDefinitionDetailComposite;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class CommonEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(Event.class, CommonEventDetailComposite.class);
- PropertiesCompositeFactory.register(StartEvent.class, StartEventDetailComposite.class);
- PropertiesCompositeFactory.register(EndEvent.class, EndEventDetailComposite.class);
- PropertiesCompositeFactory.register(CatchEvent.class, CatchEventDetailComposite.class);
- PropertiesCompositeFactory.register(ThrowEvent.class, ThrowEventDetailComposite.class);
- PropertiesCompositeFactory.register(BoundaryEvent.class, BoundaryEventDetailComposite.class);
- PropertiesCompositeFactory.register(TimerEventDefinition.class, TimerEventDefinitionDetailComposite.class);
- PropertiesCompositeFactory.register(ConditionalEventDefinition.class, ConditionalEventDefinitionDetailComposite.class);
-
- PropertiesCompositeFactory.register(CompensateEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(ConditionalEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(ErrorEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(EscalationEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(LinkEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(MessageEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(SignalEventDefinition.class, EventDefinitionDialogComposite.class);
- PropertiesCompositeFactory.register(TimerEventDefinition.class, EventDefinitionDialogComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new CommonEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new CommonEventDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Event)
- return be;
- return null;
- }
-
- public class EventDefinitionDialogComposite extends DefaultDialogComposite {
- public EventDefinitionDialogComposite(Composite parent, EClass eclass, int style) {
- super(parent, eclass, style);
- }
- protected int getDetailsCount() { return 0; }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.CompensateEventDefinition;
+import org.eclipse.bpmn2.ConditionalEventDefinition;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.ErrorEventDefinition;
+import org.eclipse.bpmn2.EscalationEventDefinition;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.LinkEventDefinition;
+import org.eclipse.bpmn2.MessageEventDefinition;
+import org.eclipse.bpmn2.SignalEventDefinition;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.TimerEventDefinition;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDialogComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.ui.property.data.ConditionalEventDefinitionDetailComposite;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class CommonEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(Event.class, CommonEventDetailComposite.class);
+ PropertiesCompositeFactory.register(StartEvent.class, StartEventDetailComposite.class);
+ PropertiesCompositeFactory.register(EndEvent.class, EndEventDetailComposite.class);
+ PropertiesCompositeFactory.register(CatchEvent.class, CatchEventDetailComposite.class);
+ PropertiesCompositeFactory.register(ThrowEvent.class, ThrowEventDetailComposite.class);
+ PropertiesCompositeFactory.register(BoundaryEvent.class, BoundaryEventDetailComposite.class);
+ PropertiesCompositeFactory.register(TimerEventDefinition.class, TimerEventDefinitionDetailComposite.class);
+ PropertiesCompositeFactory.register(ConditionalEventDefinition.class, ConditionalEventDefinitionDetailComposite.class);
+
+ PropertiesCompositeFactory.register(CompensateEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(ConditionalEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(ErrorEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(EscalationEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(LinkEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(MessageEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(SignalEventDefinition.class, EventDefinitionDialogComposite.class);
+ PropertiesCompositeFactory.register(TimerEventDefinition.class, EventDefinitionDialogComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new CommonEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new CommonEventDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Event)
+ return be;
+ return null;
+ }
+
+ public class EventDefinitionDialogComposite extends DefaultDialogComposite {
+ public EventDefinitionDialogComposite(Composite parent, EClass eclass, int style) {
+ super(parent, eclass, style);
+ }
+ protected int getDetailsCount() { return 0; }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataInputsListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataInputsListComposite.java
index be5937e..2efdb4b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataInputsListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataInputsListComposite.java
@@ -1,101 +1,101 @@
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataInputAssociation;
-import org.eclipse.bpmn2.InputSet;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterMappingColumn;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterNameColumn;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-public class DataInputsListComposite extends DefaultListComposite {
-
- ThrowEvent throwEvent;
-
- public DataInputsListComposite(Composite parent, ThrowEvent throwEvent) {
- super(parent, ADD_BUTTON|REMOVE_BUTTON|EDIT_BUTTON|SHOW_DETAILS);
- this.throwEvent = throwEvent;
-
- columnProvider = new ListCompositeColumnProvider(this,true);
-
- EStructuralFeature f;
- f = PACKAGE.getDataInput_Name();
- columnProvider.add(new IoParameterNameColumn(throwEvent,f));
-
- f = PACKAGE.getThrowEvent_DataInputAssociation();
- columnProvider.add(new IoParameterMappingColumn(throwEvent,f));
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- InputSet inputSet = throwEvent.getInputSet();
- if (inputSet==null) {
- inputSet = FACTORY.createInputSet();
- throwEvent.setInputSet(inputSet);
- ModelUtil.setID(inputSet);
- }
- // generate a unique parameter name
- String base = "inParam";
- int suffix = 1;
- String name = base + suffix;
- for (;;) {
- boolean found = false;
- for (DataInput p : inputSet.getDataInputRefs()) {
- if (name.equals(p.getName())) {
- found = true;
- break;
- }
- }
- if (!found)
- break;
- name = base + ++suffix;
- }
-
- DataInput param = (DataInput)super.addListItem(object, feature);
- // add the new parameter to the InputSet
- (param).setName(name);
- inputSet.getDataInputRefs().add(param);
-
- // create a DataInputAssociation
- DataInputAssociation inputAssociation = FACTORY.createDataInputAssociation();
- throwEvent.getDataInputAssociation().add(inputAssociation);
- inputAssociation.setTargetRef((DataInput) param);
- ModelUtil.setID(inputAssociation);
- return param;
- }
-
- @Override
- protected EObject editListItem(EObject object, EStructuralFeature feature) {
- return super.editListItem(object, feature);
- }
-
- @Override
- protected Object removeListItem(EObject object, EStructuralFeature feature, int index) {
- // remove parameter from inputSets
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- EObject item = list.get(index);
- InputSet inputSet = throwEvent.getInputSet();
- if (inputSet.getDataInputRefs().contains(item))
- inputSet.getDataInputRefs().remove(item);
-
- // remove Input or Output DataAssociations
- List<DataInputAssociation> dataInputAssociations = throwEvent.getDataInputAssociation();
- List<DataInputAssociation> removed = new ArrayList<DataInputAssociation>();
- for (DataInputAssociation dia : dataInputAssociations) {
- if (item==dia.getTargetRef())
- removed.add(dia);
- }
- dataInputAssociations.removeAll(removed);
-
- return super.removeListItem(object, feature, index);
- }
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataInputAssociation;
+import org.eclipse.bpmn2.InputSet;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterMappingColumn;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterNameColumn;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+public class DataInputsListComposite extends DefaultListComposite {
+
+ ThrowEvent throwEvent;
+
+ public DataInputsListComposite(Composite parent, ThrowEvent throwEvent) {
+ super(parent, ADD_BUTTON|REMOVE_BUTTON|EDIT_BUTTON|SHOW_DETAILS);
+ this.throwEvent = throwEvent;
+
+ columnProvider = new ListCompositeColumnProvider(this,true);
+
+ EStructuralFeature f;
+ f = PACKAGE.getDataInput_Name();
+ columnProvider.add(new IoParameterNameColumn(throwEvent,f));
+
+ f = PACKAGE.getThrowEvent_DataInputAssociation();
+ columnProvider.add(new IoParameterMappingColumn(throwEvent,f));
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ InputSet inputSet = throwEvent.getInputSet();
+ if (inputSet==null) {
+ inputSet = FACTORY.createInputSet();
+ throwEvent.setInputSet(inputSet);
+ ModelUtil.setID(inputSet);
+ }
+ // generate a unique parameter name
+ String base = "inParam";
+ int suffix = 1;
+ String name = base + suffix;
+ for (;;) {
+ boolean found = false;
+ for (DataInput p : inputSet.getDataInputRefs()) {
+ if (name.equals(p.getName())) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ break;
+ name = base + ++suffix;
+ }
+
+ DataInput param = (DataInput)super.addListItem(object, feature);
+ // add the new parameter to the InputSet
+ (param).setName(name);
+ inputSet.getDataInputRefs().add(param);
+
+ // create a DataInputAssociation
+ DataInputAssociation inputAssociation = FACTORY.createDataInputAssociation();
+ throwEvent.getDataInputAssociation().add(inputAssociation);
+ inputAssociation.setTargetRef((DataInput) param);
+ ModelUtil.setID(inputAssociation);
+ return param;
+ }
+
+ @Override
+ protected EObject editListItem(EObject object, EStructuralFeature feature) {
+ return super.editListItem(object, feature);
+ }
+
+ @Override
+ protected Object removeListItem(EObject object, EStructuralFeature feature, int index) {
+ // remove parameter from inputSets
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ EObject item = list.get(index);
+ InputSet inputSet = throwEvent.getInputSet();
+ if (inputSet.getDataInputRefs().contains(item))
+ inputSet.getDataInputRefs().remove(item);
+
+ // remove Input or Output DataAssociations
+ List<DataInputAssociation> dataInputAssociations = throwEvent.getDataInputAssociation();
+ List<DataInputAssociation> removed = new ArrayList<DataInputAssociation>();
+ for (DataInputAssociation dia : dataInputAssociations) {
+ if (item==dia.getTargetRef())
+ removed.add(dia);
+ }
+ dataInputAssociations.removeAll(removed);
+
+ return super.removeListItem(object, feature, index);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataOutputsListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataOutputsListComposite.java
index a0b9e1d..d8dc43a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataOutputsListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/DataOutputsListComposite.java
@@ -1,109 +1,109 @@
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.DataOutputAssociation;
-import org.eclipse.bpmn2.ItemAwareElement;
-import org.eclipse.bpmn2.OutputSet;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterMappingColumn;
-import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterNameColumn;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-public class DataOutputsListComposite extends DefaultListComposite {
-
- CatchEvent catchEvent;
-
- public DataOutputsListComposite(Composite parent, CatchEvent catchEvent) {
- super(parent, ADD_BUTTON|REMOVE_BUTTON|EDIT_BUTTON|SHOW_DETAILS);
- this.catchEvent = catchEvent;
-
- columnProvider = new ListCompositeColumnProvider(this,true);
-
- EStructuralFeature f;
- f = PACKAGE.getDataOutput_Name();
- columnProvider.add(new IoParameterNameColumn(catchEvent,f));
-
- f = PACKAGE.getCatchEvent_DataOutputAssociation();
- columnProvider.add(new IoParameterMappingColumn(catchEvent,f));
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- OutputSet outputSet = catchEvent.getOutputSet();
- if (outputSet==null) {
- outputSet = FACTORY.createOutputSet();
- catchEvent.setOutputSet(outputSet);
- ModelUtil.setID(outputSet);
- }
- // generate a unique parameter name
- String base = "outParam";
- int suffix = 1;
- String name = base + suffix;
- for (;;) {
- boolean found = false;
- for (DataOutput p : outputSet.getDataOutputRefs()) {
- if (name.equals(p.getName())) {
- found = true;
- break;
- }
- }
- if (!found)
- break;
- name = base + ++suffix;
- }
-
- DataOutput param = (DataOutput)super.addListItem(object, feature);
- // add the new parameter to the OutputSet
- param.setName(name);
- outputSet.getDataOutputRefs().add(param);
-
-
- // create a Data OutputAssociation
- DataOutputAssociation outputAssociation = FACTORY.createDataOutputAssociation();
- catchEvent.getDataOutputAssociation().add(outputAssociation);
- outputAssociation.getSourceRef().clear();
- outputAssociation.getSourceRef().add( param);
- ModelUtil.setID(outputAssociation);
-
- return param;
- }
-
- @Override
- protected EObject editListItem(EObject object, EStructuralFeature feature) {
- return super.editListItem(object, feature);
- }
-
- @Override
- protected Object removeListItem(EObject object, EStructuralFeature feature, int index) {
- // remove parameter from outputSets
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- EObject item = list.get(index);
- OutputSet outputSet = catchEvent.getOutputSet();
- if (outputSet.getDataOutputRefs().contains(item))
- outputSet.getDataOutputRefs().remove(item);
-
- // remove Input or Output DataAssociations
- List<DataOutputAssociation> dataOutputAssociations = catchEvent.getDataOutputAssociation();
- List<DataOutputAssociation> removed = new ArrayList<DataOutputAssociation>();
- for (DataOutputAssociation doa : dataOutputAssociations) {
- for (ItemAwareElement e : doa.getSourceRef()) {
- if (e == item)
- removed.add(doa);
- }
- }
- dataOutputAssociations.removeAll(removed);
-
- return super.removeListItem(object, feature, index);
- }
-
-
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.DataOutputAssociation;
+import org.eclipse.bpmn2.ItemAwareElement;
+import org.eclipse.bpmn2.OutputSet;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterMappingColumn;
+import org.eclipse.bpmn2.modeler.ui.property.tasks.IoParameterNameColumn;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+public class DataOutputsListComposite extends DefaultListComposite {
+
+ CatchEvent catchEvent;
+
+ public DataOutputsListComposite(Composite parent, CatchEvent catchEvent) {
+ super(parent, ADD_BUTTON|REMOVE_BUTTON|EDIT_BUTTON|SHOW_DETAILS);
+ this.catchEvent = catchEvent;
+
+ columnProvider = new ListCompositeColumnProvider(this,true);
+
+ EStructuralFeature f;
+ f = PACKAGE.getDataOutput_Name();
+ columnProvider.add(new IoParameterNameColumn(catchEvent,f));
+
+ f = PACKAGE.getCatchEvent_DataOutputAssociation();
+ columnProvider.add(new IoParameterMappingColumn(catchEvent,f));
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ OutputSet outputSet = catchEvent.getOutputSet();
+ if (outputSet==null) {
+ outputSet = FACTORY.createOutputSet();
+ catchEvent.setOutputSet(outputSet);
+ ModelUtil.setID(outputSet);
+ }
+ // generate a unique parameter name
+ String base = "outParam";
+ int suffix = 1;
+ String name = base + suffix;
+ for (;;) {
+ boolean found = false;
+ for (DataOutput p : outputSet.getDataOutputRefs()) {
+ if (name.equals(p.getName())) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ break;
+ name = base + ++suffix;
+ }
+
+ DataOutput param = (DataOutput)super.addListItem(object, feature);
+ // add the new parameter to the OutputSet
+ param.setName(name);
+ outputSet.getDataOutputRefs().add(param);
+
+
+ // create a Data OutputAssociation
+ DataOutputAssociation outputAssociation = FACTORY.createDataOutputAssociation();
+ catchEvent.getDataOutputAssociation().add(outputAssociation);
+ outputAssociation.getSourceRef().clear();
+ outputAssociation.getSourceRef().add( param);
+ ModelUtil.setID(outputAssociation);
+
+ return param;
+ }
+
+ @Override
+ protected EObject editListItem(EObject object, EStructuralFeature feature) {
+ return super.editListItem(object, feature);
+ }
+
+ @Override
+ protected Object removeListItem(EObject object, EStructuralFeature feature, int index) {
+ // remove parameter from outputSets
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ EObject item = list.get(index);
+ OutputSet outputSet = catchEvent.getOutputSet();
+ if (outputSet.getDataOutputRefs().contains(item))
+ outputSet.getDataOutputRefs().remove(item);
+
+ // remove Input or Output DataAssociations
+ List<DataOutputAssociation> dataOutputAssociations = catchEvent.getDataOutputAssociation();
+ List<DataOutputAssociation> removed = new ArrayList<DataOutputAssociation>();
+ for (DataOutputAssociation doa : dataOutputAssociations) {
+ for (ItemAwareElement e : doa.getSourceRef()) {
+ if (e == item)
+ removed.add(doa);
+ }
+ }
+ dataOutputAssociations.removeAll(removed);
+
+ return super.removeListItem(object, feature, index);
+ }
+
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventDetailComposite.java
index e50e486..2848e75 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventDetailComposite.java
@@ -1,43 +1,43 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class EndEventDetailComposite extends AbstractDetailComposite {
-
- public EndEventDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param parent
- * @param style
- */
- public EndEventDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite#createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- }
-
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class EndEventDetailComposite extends AbstractDetailComposite {
+
+ public EndEventDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public EndEventDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite#createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ }
+
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventPropertySection.java
index 60c5bdc..b933392 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EndEventPropertySection.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class EndEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(EndEvent.class, EndEventDetailComposite.class);
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new EndEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new EndEventDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof EndEvent)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class EndEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(EndEvent.class, EndEventDetailComposite.class);
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new EndEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new EndEventDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof EndEvent)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
index 6d16886..ee43428 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
@@ -1,129 +1,129 @@
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.BoundaryEvent;
-import org.eclipse.bpmn2.EndEvent;
-import org.eclipse.bpmn2.Event;
-import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.ImplicitThrowEvent;
-import org.eclipse.bpmn2.IntermediateCatchEvent;
-import org.eclipse.bpmn2.IntermediateThrowEvent;
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.Transaction;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ModelSubclassSelectionDialog;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Composite;
-
-public class EventDefinitionsListComposite extends DefaultListComposite {
-
- protected Event event;
-
- public EventDefinitionsListComposite(Composite parent, Event event) {
- super(parent, ADD_BUTTON|REMOVE_BUTTON|SHOW_DETAILS);
- this.event = event;
- }
-
- @Override
- public EClass getListItemClassToAdd(EClass listItemClass) {
- EClass eclass = null;
- ModelSubclassSelectionDialog dialog = new ModelSubclassSelectionDialog(getDiagramEditor(), businessObject, feature) {
- @Override
- protected void filterList(List<EClass> items) {
- BaseElement eventOwner = null;
- if (event instanceof BoundaryEvent) {
- eventOwner = ((BoundaryEvent)event).getAttachedToRef();
- }
- else {
- EObject parent = event.eContainer();
- while (parent!=null) {
- if (parent instanceof FlowElementsContainer ) {
- eventOwner = (BaseElement)parent;
- break;
- }
- parent = parent.eContainer();
- }
- }
- List<EClass> filteredItems = new ArrayList<EClass>();
- List<EClass> allowedItems = new ArrayList<EClass>();
- if (event instanceof BoundaryEvent) {
- if (eventOwner instanceof Transaction) {
- if (((BoundaryEvent)event).isCancelActivity())
- allowedItems.add(PACKAGE.getCancelEventDefinition());
- }
- if (((BoundaryEvent)event).isCancelActivity())
- allowedItems.add(PACKAGE.getCompensateEventDefinition());
- allowedItems.add(PACKAGE.getConditionalEventDefinition());
- if (((BoundaryEvent)event).isCancelActivity())
- allowedItems.add(PACKAGE.getErrorEventDefinition());
- allowedItems.add(PACKAGE.getEscalationEventDefinition());
- allowedItems.add(PACKAGE.getMessageEventDefinition());
- allowedItems.add(PACKAGE.getSignalEventDefinition());
- allowedItems.add(PACKAGE.getTimerEventDefinition());
- }
- else if (event instanceof IntermediateCatchEvent) {
- allowedItems.add(PACKAGE.getConditionalEventDefinition());
- allowedItems.add(PACKAGE.getLinkEventDefinition());
- allowedItems.add(PACKAGE.getMessageEventDefinition());
- allowedItems.add(PACKAGE.getSignalEventDefinition());
- allowedItems.add(PACKAGE.getTimerEventDefinition());
- }
- else if (event instanceof StartEvent) {
- if (eventOwner instanceof SubProcess) {
- if (((StartEvent)event).isIsInterrupting()) {
- allowedItems.add(PACKAGE.getCompensateEventDefinition());
- allowedItems.add(PACKAGE.getErrorEventDefinition());
- }
- allowedItems.add(PACKAGE.getEscalationEventDefinition());
- }
- allowedItems.add(PACKAGE.getConditionalEventDefinition());
- allowedItems.add(PACKAGE.getMessageEventDefinition());
- allowedItems.add(PACKAGE.getSignalEventDefinition());
- allowedItems.add(PACKAGE.getTimerEventDefinition());
- }
- else if (event instanceof EndEvent) {
- if (eventOwner instanceof Transaction)
- allowedItems.add(PACKAGE.getCancelEventDefinition());
- allowedItems.add(PACKAGE.getCompensateEventDefinition());
- allowedItems.add(PACKAGE.getErrorEventDefinition());
- allowedItems.add(PACKAGE.getEscalationEventDefinition());
- allowedItems.add(PACKAGE.getMessageEventDefinition());
- allowedItems.add(PACKAGE.getSignalEventDefinition());
- allowedItems.add(PACKAGE.getTerminateEventDefinition());
- }
- else if (event instanceof ImplicitThrowEvent) {
- allowedItems.add(PACKAGE.getCompensateEventDefinition());
- allowedItems.add(PACKAGE.getEscalationEventDefinition());
- allowedItems.add(PACKAGE.getLinkEventDefinition());
- allowedItems.add(PACKAGE.getMessageEventDefinition());
- allowedItems.add(PACKAGE.getSignalEventDefinition());
- }
- else if (event instanceof IntermediateThrowEvent) {
- allowedItems.add(PACKAGE.getCompensateEventDefinition());
- allowedItems.add(PACKAGE.getEscalationEventDefinition());
- allowedItems.add(PACKAGE.getLinkEventDefinition());
- allowedItems.add(PACKAGE.getMessageEventDefinition());
- allowedItems.add(PACKAGE.getSignalEventDefinition());
- }
- for (EClass eclass : items) {
- if (allowedItems.contains(eclass))
- filteredItems.add(eclass);
- }
- items.clear();
- items.addAll(filteredItems);
- }
- };
-
- if (dialog.open()==Window.OK){
- eclass = (EClass)dialog.getResult()[0];
- }
- return eclass;
- }
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.BoundaryEvent;
+import org.eclipse.bpmn2.EndEvent;
+import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.FlowElementsContainer;
+import org.eclipse.bpmn2.ImplicitThrowEvent;
+import org.eclipse.bpmn2.IntermediateCatchEvent;
+import org.eclipse.bpmn2.IntermediateThrowEvent;
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.Transaction;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ModelSubclassSelectionDialog;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Composite;
+
+public class EventDefinitionsListComposite extends DefaultListComposite {
+
+ protected Event event;
+
+ public EventDefinitionsListComposite(Composite parent, Event event) {
+ super(parent, ADD_BUTTON|REMOVE_BUTTON|SHOW_DETAILS);
+ this.event = event;
+ }
+
+ @Override
+ public EClass getListItemClassToAdd(EClass listItemClass) {
+ EClass eclass = null;
+ ModelSubclassSelectionDialog dialog = new ModelSubclassSelectionDialog(getDiagramEditor(), businessObject, feature) {
+ @Override
+ protected void filterList(List<EClass> items) {
+ BaseElement eventOwner = null;
+ if (event instanceof BoundaryEvent) {
+ eventOwner = ((BoundaryEvent)event).getAttachedToRef();
+ }
+ else {
+ EObject parent = event.eContainer();
+ while (parent!=null) {
+ if (parent instanceof FlowElementsContainer ) {
+ eventOwner = (BaseElement)parent;
+ break;
+ }
+ parent = parent.eContainer();
+ }
+ }
+ List<EClass> filteredItems = new ArrayList<EClass>();
+ List<EClass> allowedItems = new ArrayList<EClass>();
+ if (event instanceof BoundaryEvent) {
+ if (eventOwner instanceof Transaction) {
+ if (((BoundaryEvent)event).isCancelActivity())
+ allowedItems.add(PACKAGE.getCancelEventDefinition());
+ }
+ if (((BoundaryEvent)event).isCancelActivity())
+ allowedItems.add(PACKAGE.getCompensateEventDefinition());
+ allowedItems.add(PACKAGE.getConditionalEventDefinition());
+ if (((BoundaryEvent)event).isCancelActivity())
+ allowedItems.add(PACKAGE.getErrorEventDefinition());
+ allowedItems.add(PACKAGE.getEscalationEventDefinition());
+ allowedItems.add(PACKAGE.getMessageEventDefinition());
+ allowedItems.add(PACKAGE.getSignalEventDefinition());
+ allowedItems.add(PACKAGE.getTimerEventDefinition());
+ }
+ else if (event instanceof IntermediateCatchEvent) {
+ allowedItems.add(PACKAGE.getConditionalEventDefinition());
+ allowedItems.add(PACKAGE.getLinkEventDefinition());
+ allowedItems.add(PACKAGE.getMessageEventDefinition());
+ allowedItems.add(PACKAGE.getSignalEventDefinition());
+ allowedItems.add(PACKAGE.getTimerEventDefinition());
+ }
+ else if (event instanceof StartEvent) {
+ if (eventOwner instanceof SubProcess) {
+ if (((StartEvent)event).isIsInterrupting()) {
+ allowedItems.add(PACKAGE.getCompensateEventDefinition());
+ allowedItems.add(PACKAGE.getErrorEventDefinition());
+ }
+ allowedItems.add(PACKAGE.getEscalationEventDefinition());
+ }
+ allowedItems.add(PACKAGE.getConditionalEventDefinition());
+ allowedItems.add(PACKAGE.getMessageEventDefinition());
+ allowedItems.add(PACKAGE.getSignalEventDefinition());
+ allowedItems.add(PACKAGE.getTimerEventDefinition());
+ }
+ else if (event instanceof EndEvent) {
+ if (eventOwner instanceof Transaction)
+ allowedItems.add(PACKAGE.getCancelEventDefinition());
+ allowedItems.add(PACKAGE.getCompensateEventDefinition());
+ allowedItems.add(PACKAGE.getErrorEventDefinition());
+ allowedItems.add(PACKAGE.getEscalationEventDefinition());
+ allowedItems.add(PACKAGE.getMessageEventDefinition());
+ allowedItems.add(PACKAGE.getSignalEventDefinition());
+ allowedItems.add(PACKAGE.getTerminateEventDefinition());
+ }
+ else if (event instanceof ImplicitThrowEvent) {
+ allowedItems.add(PACKAGE.getCompensateEventDefinition());
+ allowedItems.add(PACKAGE.getEscalationEventDefinition());
+ allowedItems.add(PACKAGE.getLinkEventDefinition());
+ allowedItems.add(PACKAGE.getMessageEventDefinition());
+ allowedItems.add(PACKAGE.getSignalEventDefinition());
+ }
+ else if (event instanceof IntermediateThrowEvent) {
+ allowedItems.add(PACKAGE.getCompensateEventDefinition());
+ allowedItems.add(PACKAGE.getEscalationEventDefinition());
+ allowedItems.add(PACKAGE.getLinkEventDefinition());
+ allowedItems.add(PACKAGE.getMessageEventDefinition());
+ allowedItems.add(PACKAGE.getSignalEventDefinition());
+ }
+ for (EClass eclass : items) {
+ if (allowedItems.contains(eclass))
+ filteredItems.add(eclass);
+ }
+ items.clear();
+ items.addAll(filteredItems);
+ }
+ };
+
+ if (dialog.open()==Window.OK){
+ eclass = (EClass)dialog.getResult()[0];
+ }
+ return eclass;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventDetailComposite.java
index 4e8fb82..c333324 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventDetailComposite.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class StartEventDetailComposite extends DefaultDetailComposite {
-
- public StartEventDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param parent
- * @param style
- */
- public StartEventDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider == null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "isInterrupting",
- "eventDefinitions",
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class StartEventDetailComposite extends DefaultDetailComposite {
+
+ public StartEventDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public StartEventDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider == null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "isInterrupting",
+ "eventDefinitions",
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventPropertySection.java
index 5f77343..6f8511c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/StartEventPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.StartEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class StartEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(StartEvent.class, StartEventDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new StartEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new StartEventDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof StartEvent)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.StartEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class StartEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(StartEvent.class, StartEventDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new StartEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new StartEventDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof StartEvent)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventDetailComposite.java
index 73cdfc1..84b3575 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventDetailComposite.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ThrowEventDetailComposite extends AbstractDetailComposite {
-
- public ThrowEventDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param parent
- * @param style
- */
- public ThrowEventDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindList(be,"eventDefinitions");
- bindList(be,"dataInputs");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ThrowEventDetailComposite extends AbstractDetailComposite {
+
+ public ThrowEventDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public ThrowEventDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindList(be,"eventDefinitions");
+ bindList(be,"dataInputs");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventPropertySection.java
index e11b389..a7ff08e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/ThrowEventPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.events;
-
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ThrowEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ThrowEvent.class, ThrowEventDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ThrowEventDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ThrowEventDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ThrowEvent)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.events;
+
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ThrowEventPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ThrowEvent.class, ThrowEventDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ThrowEventDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ThrowEventDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ThrowEvent)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/gateways/GatewayPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/gateways/GatewayPropertySection.java
index 35d1a07..a89cb29 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/gateways/GatewayPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/gateways/GatewayPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.gateways;
-
-import org.eclipse.bpmn2.Gateway;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class GatewayPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(Gateway.class, GatewayDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new GatewayDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new GatewayDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Gateway)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.gateways;
+
+import org.eclipse.bpmn2.Gateway;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class GatewayPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(Gateway.class, GatewayDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new GatewayDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new GatewayDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Gateway)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/AbstractContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/AbstractContentProvider.java
index f3f0615..eff9d75 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/AbstractContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/AbstractContentProvider.java
@@ -1,107 +1,107 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Common base class for our content providers.
- */
-public abstract class AbstractContentProvider implements IStructuredContentProvider {
-
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
-
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
-
- /**
- * Provide the elements to be shown from this content provider.
- * The generic implementation creates a list, then calls collectElements, and
- * subsequently returns the array created from the list or the empty array if no
- * elements are collected.
- *
- * Under no circumstances null is returned.
- * @param input
- * @return
- *
- */
-
- public Object[] getElements(Object input) {
- if (input == null) {
- return EMPTY_ARRAY;
- }
-
- List<Object> list = new ArrayList<Object>();
- collectElements ( input, list );
-
- return list.isEmpty()? EMPTY_ARRAY : list.toArray();
- }
-
-
- /**
- * Collect the elements to be returned by this provider.
- * Subclasses will override this method.
- *
- * @param input the object to provide elements from (input)
- * @param list the list in which the elements are to be inserted.
- */
-
- public void collectElements (Object input, List<Object> list) {
- // need to override this method.
- }
-
-
-
- /**
- * Collect elements from the input object if the object is a list or an array.
- * The method returns true if it discovers that the passed object is "complex",
- * meaning it is either an array or a list of objects.
- *
- * @param input the complex object to look at.
- * @param list the list to collect elements into
- * @return
- */
-
- public boolean collectComplex ( Object input, List<Object> list) {
-
- Object[] arr = null;
-
- if (input.getClass().isArray()) {
- arr = (Object[]) input;
- } else if (input instanceof List) {
- arr = ((List)input).toArray();
- }
-
- if (arr == null) {
- return false;
- }
- for(Object n : arr) {
- collectElements(n, list);
- }
- return arr.length > 0;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Common base class for our content providers.
+ */
+public abstract class AbstractContentProvider implements IStructuredContentProvider {
+
+ protected static final Object[] EMPTY_ARRAY = new Object[0];
+
+ /**
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+
+ /**
+ * Provide the elements to be shown from this content provider.
+ * The generic implementation creates a list, then calls collectElements, and
+ * subsequently returns the array created from the list or the empty array if no
+ * elements are collected.
+ *
+ * Under no circumstances null is returned.
+ * @param input
+ * @return
+ *
+ */
+
+ public Object[] getElements(Object input) {
+ if (input == null) {
+ return EMPTY_ARRAY;
+ }
+
+ List<Object> list = new ArrayList<Object>();
+ collectElements ( input, list );
+
+ return list.isEmpty()? EMPTY_ARRAY : list.toArray();
+ }
+
+
+ /**
+ * Collect the elements to be returned by this provider.
+ * Subclasses will override this method.
+ *
+ * @param input the object to provide elements from (input)
+ * @param list the list in which the elements are to be inserted.
+ */
+
+ public void collectElements (Object input, List<Object> list) {
+ // need to override this method.
+ }
+
+
+
+ /**
+ * Collect elements from the input object if the object is a list or an array.
+ * The method returns true if it discovers that the passed object is "complex",
+ * meaning it is either an array or a list of objects.
+ *
+ * @param input the complex object to look at.
+ * @param list the list to collect elements into
+ * @return
+ */
+
+ public boolean collectComplex ( Object input, List<Object> list) {
+
+ Object[] arr = null;
+
+ if (input.getClass().isArray()) {
+ arr = (Object[]) input;
+ } else if (input instanceof List) {
+ arr = ((List)input).toArray();
+ }
+
+ if (arr == null) {
+ return false;
+ }
+ for(Object n : arr) {
+ collectElements(n, list);
+ }
+ return arr.length > 0;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2DefinitionsTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2DefinitionsTreeContentProvider.java
index fd3708c..e44cf20 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2DefinitionsTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2DefinitionsTreeContentProvider.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.ui.util.ListMap;
-
-
-/**
- * Provides a tree of model objects representing some expansion of the underlying graph
- * of model objects whose roots are the Variables of a Process.
- */
-public class BPMN2DefinitionsTreeContentProvider extends ModelTreeContentProvider {
-
- boolean isPropertyTree;
- private CompositeContentProvider fContentProvider;
-
-
- public BPMN2DefinitionsTreeContentProvider( boolean isCondensed ) {
- super(isCondensed);
-
- fContentProvider = new CompositeContentProvider ();
- fContentProvider.add ( new BPMN2InterfaceContentProvider() );
- fContentProvider.add ( new BPMN2ProcessContentProvider() );
-
- }
-
- public boolean isPropertyTree() { return isPropertyTree; }
-
-
-
- @Override
- public Object[] primGetElements (Object inputElement) {
-
- ITreeNode result = getTreeNode ( inputElement );
- if (result != null) {
- return new Object[] { result } ;
- }
-
-
- if (inputElement instanceof Definitions) {
-
- return (Object[]) ListMap.Map (
- fContentProvider.getElements( inputElement ) ,
- new ListMap.Visitor () {
- public Object visit (Object obj) {
- Object r = getTreeNode ( obj );
- return (r == null ? ListMap.IGNORE : r );
- }
- },
- EMPTY_ARRAY );
- }
-
- return EMPTY_ARRAY;
- }
-
-
- ITreeNode getTreeNode ( Object inputElement ) {
-
- if (inputElement instanceof Interface) {
- return new BPMN2InterfaceTreeNode ((Interface) inputElement,isCondensed);
- }
-
- if (inputElement instanceof Process) {
- return new BPMN2ProcessTreeNode ((Process) inputElement,isCondensed);
- }
-
- return null;
-
- }
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.ui.util.ListMap;
+
+
+/**
+ * Provides a tree of model objects representing some expansion of the underlying graph
+ * of model objects whose roots are the Variables of a Process.
+ */
+public class BPMN2DefinitionsTreeContentProvider extends ModelTreeContentProvider {
+
+ boolean isPropertyTree;
+ private CompositeContentProvider fContentProvider;
+
+
+ public BPMN2DefinitionsTreeContentProvider( boolean isCondensed ) {
+ super(isCondensed);
+
+ fContentProvider = new CompositeContentProvider ();
+ fContentProvider.add ( new BPMN2InterfaceContentProvider() );
+ fContentProvider.add ( new BPMN2ProcessContentProvider() );
+
+ }
+
+ public boolean isPropertyTree() { return isPropertyTree; }
+
+
+
+ @Override
+ public Object[] primGetElements (Object inputElement) {
+
+ ITreeNode result = getTreeNode ( inputElement );
+ if (result != null) {
+ return new Object[] { result } ;
+ }
+
+
+ if (inputElement instanceof Definitions) {
+
+ return (Object[]) ListMap.Map (
+ fContentProvider.getElements( inputElement ) ,
+ new ListMap.Visitor () {
+ public Object visit (Object obj) {
+ Object r = getTreeNode ( obj );
+ return (r == null ? ListMap.IGNORE : r );
+ }
+ },
+ EMPTY_ARRAY );
+ }
+
+ return EMPTY_ARRAY;
+ }
+
+
+ ITreeNode getTreeNode ( Object inputElement ) {
+
+ if (inputElement instanceof Interface) {
+ return new BPMN2InterfaceTreeNode ((Interface) inputElement,isCondensed);
+ }
+
+ if (inputElement instanceof Process) {
+ return new BPMN2ProcessTreeNode ((Process) inputElement,isCondensed);
+ }
+
+ return null;
+
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ErrorTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ErrorTreeNode.java
index 9435858..5a0fda7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ErrorTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ErrorTreeNode.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.Error;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Tree node to represent a Part within the messageType of a Variable.
- */
-public class BPMN2ErrorTreeNode extends TreeNode {
-
- public BPMN2ErrorTreeNode(Error msg, boolean isCondensed) {
- super(msg, isCondensed);
- }
-
- /* ITreeNode */
-
- @Override
- public String getLabelSuffix() {
- Error error = (Error)modelObject;
- ItemDefinition itemDef = error.getStructureRef();
- if (itemDef==null || itemDef.getStructureRef()==null)
- return null;
- return ModelUtil.getStringWrapperValue(itemDef.getStructureRef());
- }
-
- @Override
- public Object[] getChildren() {
- return EMPTY_ARRAY;
- }
-
- @Override
- public boolean hasChildren() {
- return false;
- }
-
- @Override
- public Image getImage() {
- return Activator.getDefault().getImage(IConstants.ICON_BPMN2_ERROR_16);
- }
-
- @Override
- public String getLabel() {
- Error error = (Error)modelObject;
- String label = error.getName();
- if (label==null || label.isEmpty())
- label = "Unnamed Error";
- return label;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.Error;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * Tree node to represent a Part within the messageType of a Variable.
+ */
+public class BPMN2ErrorTreeNode extends TreeNode {
+
+ public BPMN2ErrorTreeNode(Error msg, boolean isCondensed) {
+ super(msg, isCondensed);
+ }
+
+ /* ITreeNode */
+
+ @Override
+ public String getLabelSuffix() {
+ Error error = (Error)modelObject;
+ ItemDefinition itemDef = error.getStructureRef();
+ if (itemDef==null || itemDef.getStructureRef()==null)
+ return null;
+ return ModelUtil.getStringWrapperValue(itemDef.getStructureRef());
+ }
+
+ @Override
+ public Object[] getChildren() {
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean hasChildren() {
+ return false;
+ }
+
+ @Override
+ public Image getImage() {
+ return Activator.getDefault().getImage(IConstants.ICON_BPMN2_ERROR_16);
+ }
+
+ @Override
+ public String getLabel() {
+ Error error = (Error)modelObject;
+ String label = error.getName();
+ if (label==null || label.isEmpty())
+ label = "Unnamed Error";
+ return label;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceContentProvider.java
index b2f497a..10d92d9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceContentProvider.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.RootElement;
-
-/**
- * Content provider for Services.
- *
- * Expects a Definition as input.
- */
-public class BPMN2InterfaceContentProvider extends AbstractContentProvider {
-
- @Override
- public void collectElements(Object input, List list) {
- if (input instanceof Definitions) {
- Definitions definitions = (Definitions) input;
- for (RootElement re : definitions.getRootElements()) {
- if (re instanceof Interface)
- list.add(re);
- }
- return;
- }
- // This will break any CompositeContentProvider
- throw new IllegalArgumentException();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.RootElement;
+
+/**
+ * Content provider for Services.
+ *
+ * Expects a Definition as input.
+ */
+public class BPMN2InterfaceContentProvider extends AbstractContentProvider {
+
+ @Override
+ public void collectElements(Object input, List list) {
+ if (input instanceof Definitions) {
+ Definitions definitions = (Definitions) input;
+ for (RootElement re : definitions.getRootElements()) {
+ if (re instanceof Interface)
+ list.add(re);
+ }
+ return;
+ }
+ // This will break any CompositeContentProvider
+ throw new IllegalArgumentException();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceTreeNode.java
index 73352a8..d432333 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2InterfaceTreeNode.java
@@ -1,62 +1,62 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.Operation;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Tree node to represent an Interface model object.
- */
-public class BPMN2InterfaceTreeNode extends TreeNode {
-
- public BPMN2InterfaceTreeNode(Interface it, boolean isCondensed) {
- super(it, isCondensed);
- }
-
- /* ITreeNode */
-
- @Override
- public Object[] getChildren() {
- Interface intf = (Interface)modelObject;
- List<BPMN2OperationTreeNode> list = new ArrayList<BPMN2OperationTreeNode>();
- for (Operation op : intf.getOperations()) {
- list.add(new BPMN2OperationTreeNode(op,isCondensed));
- }
- return list.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- Interface intf = (Interface) modelObject;
- return !intf.getOperations().isEmpty();
- }
-
- @Override
- public Image getImage() {
- return Activator.getDefault().getImage(IConstants.ICON_BPMN2_INTERFACE_16);
- }
-
- @Override
- public String getLabel() {
- Interface intf = (Interface)modelObject;
- String label = intf.getName();
- if (label==null || label.isEmpty())
- label = "Unnamed Interface";
- return label;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.Operation;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Tree node to represent an Interface model object.
+ */
+public class BPMN2InterfaceTreeNode extends TreeNode {
+
+ public BPMN2InterfaceTreeNode(Interface it, boolean isCondensed) {
+ super(it, isCondensed);
+ }
+
+ /* ITreeNode */
+
+ @Override
+ public Object[] getChildren() {
+ Interface intf = (Interface)modelObject;
+ List<BPMN2OperationTreeNode> list = new ArrayList<BPMN2OperationTreeNode>();
+ for (Operation op : intf.getOperations()) {
+ list.add(new BPMN2OperationTreeNode(op,isCondensed));
+ }
+ return list.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ Interface intf = (Interface) modelObject;
+ return !intf.getOperations().isEmpty();
+ }
+
+ @Override
+ public Image getImage() {
+ return Activator.getDefault().getImage(IConstants.ICON_BPMN2_INTERFACE_16);
+ }
+
+ @Override
+ public String getLabel() {
+ Interface intf = (Interface)modelObject;
+ String label = intf.getName();
+ if (label==null || label.isEmpty())
+ label = "Unnamed Interface";
+ return label;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2MessageTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2MessageTreeNode.java
index 58646d7..394d49c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2MessageTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2MessageTreeNode.java
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.bpmn2.ItemDefinition;
-import org.eclipse.bpmn2.Message;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Tree node to represent a Part within the messageType of a Variable.
- */
-public class BPMN2MessageTreeNode extends TreeNode {
-
- boolean isInput;
-
- public BPMN2MessageTreeNode(Message msg, boolean isCondensed, boolean isInput) {
- super(msg, isCondensed);
- this.isInput = isInput;
- }
-
- /* ITreeNode */
-
- @Override
- public String getLabelSuffix() {
- Message msg = (Message)modelObject;
- ItemDefinition itemDef = msg.getItemRef();
- if (itemDef==null || itemDef.getStructureRef()==null)
- return null;
- return ModelUtil.getStringWrapperValue(itemDef.getStructureRef());
- }
-
- @Override
- public Object[] getChildren() {
- return EMPTY_ARRAY;
- }
-
- @Override
- public boolean hasChildren() {
- return false;
- }
-
- @Override
- public Image getImage() {
- if (isInput)
- return Activator.getDefault().getImage(IConstants.ICON_BPMN2_INPUT_16);
- return Activator.getDefault().getImage(IConstants.ICON_BPMN2_OUTPUT_16);
- }
-
- @Override
- public String getLabel() {
- Message msg = (Message)modelObject;
- String label = msg.getName();
- if (label==null || label.isEmpty())
- label = "Unnamed Message";
- return label;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.bpmn2.ItemDefinition;
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * Tree node to represent a Part within the messageType of a Variable.
+ */
+public class BPMN2MessageTreeNode extends TreeNode {
+
+ boolean isInput;
+
+ public BPMN2MessageTreeNode(Message msg, boolean isCondensed, boolean isInput) {
+ super(msg, isCondensed);
+ this.isInput = isInput;
+ }
+
+ /* ITreeNode */
+
+ @Override
+ public String getLabelSuffix() {
+ Message msg = (Message)modelObject;
+ ItemDefinition itemDef = msg.getItemRef();
+ if (itemDef==null || itemDef.getStructureRef()==null)
+ return null;
+ return ModelUtil.getStringWrapperValue(itemDef.getStructureRef());
+ }
+
+ @Override
+ public Object[] getChildren() {
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean hasChildren() {
+ return false;
+ }
+
+ @Override
+ public Image getImage() {
+ if (isInput)
+ return Activator.getDefault().getImage(IConstants.ICON_BPMN2_INPUT_16);
+ return Activator.getDefault().getImage(IConstants.ICON_BPMN2_OUTPUT_16);
+ }
+
+ @Override
+ public String getLabel() {
+ Message msg = (Message)modelObject;
+ String label = msg.getName();
+ if (label==null || label.isEmpty())
+ label = "Unnamed Message";
+ return label;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2OperationTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2OperationTreeNode.java
index e755cc8..2bcad1f 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2OperationTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2OperationTreeNode.java
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.Message;
-import org.eclipse.bpmn2.Operation;
-import org.eclipse.bpmn2.Error;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Tree node to represent a message-type model object.
- */
-public class BPMN2OperationTreeNode extends TreeNode {
-
- public BPMN2OperationTreeNode(Operation operation, boolean isCondensed) {
- super(operation, isCondensed);
- }
-
- @Override
- public Object[] getChildren() {
- Operation operation = (Operation)modelObject;
-
- List<TreeNode> list = new ArrayList<TreeNode>();
- if (operation.getInMessageRef()!=null)
- list.add(new BPMN2MessageTreeNode(operation.getInMessageRef(), isCondensed, true));
- if (operation.getOutMessageRef()!=null)
- list.add(new BPMN2MessageTreeNode(operation.getOutMessageRef(), isCondensed, false));
- if (!operation.getErrorRefs().isEmpty()) {
- for (Error e : operation.getErrorRefs()) {
- list.add(new BPMN2ErrorTreeNode(e, isCondensed));
- }
- }
- return list.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- Operation operation = (Operation)modelObject;
- return operation.getInMessageRef()!=null
- || operation.getOutMessageRef()!=null
- || !operation.getErrorRefs().isEmpty();
- }
-
- @Override
- public Image getImage() {
- return Activator.getDefault().getImage(IConstants.ICON_BPMN2_OPERATION_16);
- }
-
- @Override
- public String getLabel() {
- Operation op = (Operation)modelObject;
- String label = op.getName();
- if (label==null || label.isEmpty())
- label = "Unnamed Operation";
- return label;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Message;
+import org.eclipse.bpmn2.Operation;
+import org.eclipse.bpmn2.Error;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Tree node to represent a message-type model object.
+ */
+public class BPMN2OperationTreeNode extends TreeNode {
+
+ public BPMN2OperationTreeNode(Operation operation, boolean isCondensed) {
+ super(operation, isCondensed);
+ }
+
+ @Override
+ public Object[] getChildren() {
+ Operation operation = (Operation)modelObject;
+
+ List<TreeNode> list = new ArrayList<TreeNode>();
+ if (operation.getInMessageRef()!=null)
+ list.add(new BPMN2MessageTreeNode(operation.getInMessageRef(), isCondensed, true));
+ if (operation.getOutMessageRef()!=null)
+ list.add(new BPMN2MessageTreeNode(operation.getOutMessageRef(), isCondensed, false));
+ if (!operation.getErrorRefs().isEmpty()) {
+ for (Error e : operation.getErrorRefs()) {
+ list.add(new BPMN2ErrorTreeNode(e, isCondensed));
+ }
+ }
+ return list.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ Operation operation = (Operation)modelObject;
+ return operation.getInMessageRef()!=null
+ || operation.getOutMessageRef()!=null
+ || !operation.getErrorRefs().isEmpty();
+ }
+
+ @Override
+ public Image getImage() {
+ return Activator.getDefault().getImage(IConstants.ICON_BPMN2_OPERATION_16);
+ }
+
+ @Override
+ public String getLabel() {
+ Operation op = (Operation)modelObject;
+ String label = op.getName();
+ if (label==null || label.isEmpty())
+ label = "Unnamed Operation";
+ return label;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessContentProvider.java
index 77f75c8..e1440dc 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessContentProvider.java
@@ -1,42 +1,42 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.RootElement;
-
-/**
- * Content provider for Process elements.
- *
- * Expects a Role or a Definition or a context as input.
- */
-public class BPMN2ProcessContentProvider extends AbstractContentProvider {
-
- @Override
- public void collectElements(Object input, List list) {
-
- if (input instanceof Definitions) {
- Definitions definitions = (Definitions) input;
- for (RootElement re : definitions.getRootElements()) {
- if (re instanceof Process)
- list.add(re);
- }
- } else if (input instanceof Process) {
- Process process = (Process) input;
- list.add(process);
-
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.RootElement;
+
+/**
+ * Content provider for Process elements.
+ *
+ * Expects a Role or a Definition or a context as input.
+ */
+public class BPMN2ProcessContentProvider extends AbstractContentProvider {
+
+ @Override
+ public void collectElements(Object input, List list) {
+
+ if (input instanceof Definitions) {
+ Definitions definitions = (Definitions) input;
+ for (RootElement re : definitions.getRootElements()) {
+ if (re instanceof Process)
+ list.add(re);
+ }
+ } else if (input instanceof Process) {
+ Process process = (Process) input;
+ list.add(process);
+
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessTreeNode.java
index 6931514..88d1421 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/BPMN2ProcessTreeNode.java
@@ -1,62 +1,62 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Tree node to represent a Process model object.
- */
-public class BPMN2ProcessTreeNode extends TreeNode {
-
- public BPMN2ProcessTreeNode(Process process, boolean isCondensed) {
- super(process, isCondensed);
- }
-
- @Override
- public Object[] getChildren() {
- Process process = (Process)modelObject;
- if (process.getSupportedInterfaceRefs().isEmpty())
- return EMPTY_ARRAY;
- List<BPMN2InterfaceTreeNode> v = new ArrayList<BPMN2InterfaceTreeNode>();
- for (Interface it : process.getSupportedInterfaceRefs()) {
- v.add(new BPMN2InterfaceTreeNode(it, isCondensed));
- }
- return v.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- Process process = (Process)modelObject;
- return !process.getSupportedInterfaceRefs().isEmpty();
- }
-
- @Override
- public Image getImage() {
- return Activator.getDefault().getImage(IConstants.ICON_BPMN2_PROCESS_16);
- }
-
- @Override
- public String getLabel() {
- Process process = (Process)modelObject;
- String label = process.getName();
- if (label==null || label.isEmpty())
- label = "Unnamed Process";
- return label;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Tree node to represent a Process model object.
+ */
+public class BPMN2ProcessTreeNode extends TreeNode {
+
+ public BPMN2ProcessTreeNode(Process process, boolean isCondensed) {
+ super(process, isCondensed);
+ }
+
+ @Override
+ public Object[] getChildren() {
+ Process process = (Process)modelObject;
+ if (process.getSupportedInterfaceRefs().isEmpty())
+ return EMPTY_ARRAY;
+ List<BPMN2InterfaceTreeNode> v = new ArrayList<BPMN2InterfaceTreeNode>();
+ for (Interface it : process.getSupportedInterfaceRefs()) {
+ v.add(new BPMN2InterfaceTreeNode(it, isCondensed));
+ }
+ return v.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ Process process = (Process)modelObject;
+ return !process.getSupportedInterfaceRefs().isEmpty();
+ }
+
+ @Override
+ public Image getImage() {
+ return Activator.getDefault().getImage(IConstants.ICON_BPMN2_PROCESS_16);
+ }
+
+ @Override
+ public String getLabel() {
+ Process process = (Process)modelObject;
+ String label = process.getName();
+ if (label==null || label.isEmpty())
+ label = "Unnamed Process";
+ return label;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CachedTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CachedTreeContentProvider.java
index bc53dc1..9c16018 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CachedTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CachedTreeContentProvider.java
@@ -1,141 +1,141 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.HashMap;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * An abstract content provider that caches the tree nodes as they are discovered.
- *
- * This is useful for two reasons: it guarantees that the same object will be returned
- * until the cache is cleared (which is convenient for trees that wrap a different set
- * of model objects), and it handles the parent relationship automatically.
- *
- * Note that the parent of a node will only be known if the node appeared in an array
- * previously returned by primGetChildren()! The value UNKNOWN_PARENT is returned
- * as the parent of a node whose parent has never had primGetChildren() called on it.
- * null is returned as the parent of the root nodes, that is, those returned by
- * primGetElements().
- */
-public abstract class CachedTreeContentProvider implements ITreeContentProvider {
-
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- public static final Object UNKNOWN_PARENT = new Object();
-
- // A null value in the treeNodeToParent parentMap means the node is a root parameter.
- protected HashMap treeNodeToParent;
-
- // A null value in the treeNodeToChildren parentMap means the node has children, button
- // we don't yet know what they are. (If it has no children, an empty array would
- // be present instead).
- protected HashMap treeNodeToChildren;
-
- Object[] rootChildren;
-
- public CachedTreeContentProvider() {
- super();
- treeNodeToParent = new HashMap();
- treeNodeToChildren = new HashMap();
- }
-
- protected abstract boolean primHasChildren(Object node);
- protected abstract Object[] primGetChildren(Object node);
- protected abstract Object[] primGetElements(Object node);
-
- /**
- * Returns an array describing the path from a node up to the root. The node will
- * be the first parameter of the array, its parent will be the 2nd, and so on, with
- * a top-level node (i.e. a root) as the last parameter of the array. Note that the
- * input object of the content provider is *NOT* included in this path, because the
- * top-level nodes returned by getElements() have a parent value of null.
- */
- public Object[] getPathToRoot(Object node) {
- Vector v = new Vector();
- while (node != null && node != UNKNOWN_PARENT) {
- v.add(node);
- node = getParent(node);
- }
- return v.toArray();
- }
-
- /* IStructuredContentProvider */
-
- public final Object[] getElements(Object node) {
- if (rootChildren == null) {
- rootChildren = primGetElements(node);
- if (rootChildren == null) rootChildren = EMPTY_ARRAY;
- for (int i = 0; i<rootChildren.length; i++) {
- treeNodeToParent.put(rootChildren[i], null);
- }
- }
- return rootChildren;
- }
-
- /* ITreeContentProvider */
-
- public final boolean hasChildren(Object node) {
- Object[] result = (Object[])treeNodeToChildren.get(node);
- if (result != null) return (result.length > 0);
- if (treeNodeToChildren.containsKey(node)) {
- // it has children, we just haven't seen them yet.
- return true;
- }
- if (primHasChildren(node)) {
- treeNodeToChildren.put(node, null);
- return true;
- }
-
- treeNodeToChildren.put(node, EMPTY_ARRAY);
- return false;
- }
-
- public final Object[] getChildren(Object node) {
- Object[] result = (Object[])treeNodeToChildren.get(node);
- if (result == null) {
- result = primGetChildren(node);
- if (result == null) result = EMPTY_ARRAY;
- treeNodeToChildren.put(node, result);
- for (int i = 0; i<result.length; i++) {
- treeNodeToParent.put(result[i], node);
- }
- }
- return result;
- }
-
- public final Object getParent(Object node) {
- // Prevent stack overflow in cases where a caller is walking up the
- // parent chain of a stale object and doesn't recognize UNKNOWN_PARENT.
- // (e.g. in a StructuredViewer, internalExpand() will keep asking for
- // the parent of UNKNOWN_PARENT until stack overflow).
- if (node==UNKNOWN_PARENT) return null;
-
- Object result = treeNodeToParent.get(node);
- if (result != null || treeNodeToParent.containsKey(node)) return result;
- return UNKNOWN_PARENT;
- }
-
- /* IContentProvider */
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- rootChildren = null;
- treeNodeToParent.clear();
- treeNodeToChildren.clear();
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.HashMap;
+import java.util.Vector;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * An abstract content provider that caches the tree nodes as they are discovered.
+ *
+ * This is useful for two reasons: it guarantees that the same object will be returned
+ * until the cache is cleared (which is convenient for trees that wrap a different set
+ * of model objects), and it handles the parent relationship automatically.
+ *
+ * Note that the parent of a node will only be known if the node appeared in an array
+ * previously returned by primGetChildren()! The value UNKNOWN_PARENT is returned
+ * as the parent of a node whose parent has never had primGetChildren() called on it.
+ * null is returned as the parent of the root nodes, that is, those returned by
+ * primGetElements().
+ */
+public abstract class CachedTreeContentProvider implements ITreeContentProvider {
+
+ protected static final Object[] EMPTY_ARRAY = new Object[0];
+
+ public static final Object UNKNOWN_PARENT = new Object();
+
+ // A null value in the treeNodeToParent parentMap means the node is a root parameter.
+ protected HashMap treeNodeToParent;
+
+ // A null value in the treeNodeToChildren parentMap means the node has children, button
+ // we don't yet know what they are. (If it has no children, an empty array would
+ // be present instead).
+ protected HashMap treeNodeToChildren;
+
+ Object[] rootChildren;
+
+ public CachedTreeContentProvider() {
+ super();
+ treeNodeToParent = new HashMap();
+ treeNodeToChildren = new HashMap();
+ }
+
+ protected abstract boolean primHasChildren(Object node);
+ protected abstract Object[] primGetChildren(Object node);
+ protected abstract Object[] primGetElements(Object node);
+
+ /**
+ * Returns an array describing the path from a node up to the root. The node will
+ * be the first parameter of the array, its parent will be the 2nd, and so on, with
+ * a top-level node (i.e. a root) as the last parameter of the array. Note that the
+ * input object of the content provider is *NOT* included in this path, because the
+ * top-level nodes returned by getElements() have a parent value of null.
+ */
+ public Object[] getPathToRoot(Object node) {
+ Vector v = new Vector();
+ while (node != null && node != UNKNOWN_PARENT) {
+ v.add(node);
+ node = getParent(node);
+ }
+ return v.toArray();
+ }
+
+ /* IStructuredContentProvider */
+
+ public final Object[] getElements(Object node) {
+ if (rootChildren == null) {
+ rootChildren = primGetElements(node);
+ if (rootChildren == null) rootChildren = EMPTY_ARRAY;
+ for (int i = 0; i<rootChildren.length; i++) {
+ treeNodeToParent.put(rootChildren[i], null);
+ }
+ }
+ return rootChildren;
+ }
+
+ /* ITreeContentProvider */
+
+ public final boolean hasChildren(Object node) {
+ Object[] result = (Object[])treeNodeToChildren.get(node);
+ if (result != null) return (result.length > 0);
+ if (treeNodeToChildren.containsKey(node)) {
+ // it has children, we just haven't seen them yet.
+ return true;
+ }
+ if (primHasChildren(node)) {
+ treeNodeToChildren.put(node, null);
+ return true;
+ }
+
+ treeNodeToChildren.put(node, EMPTY_ARRAY);
+ return false;
+ }
+
+ public final Object[] getChildren(Object node) {
+ Object[] result = (Object[])treeNodeToChildren.get(node);
+ if (result == null) {
+ result = primGetChildren(node);
+ if (result == null) result = EMPTY_ARRAY;
+ treeNodeToChildren.put(node, result);
+ for (int i = 0; i<result.length; i++) {
+ treeNodeToParent.put(result[i], node);
+ }
+ }
+ return result;
+ }
+
+ public final Object getParent(Object node) {
+ // Prevent stack overflow in cases where a caller is walking up the
+ // parent chain of a stale object and doesn't recognize UNKNOWN_PARENT.
+ // (e.g. in a StructuredViewer, internalExpand() will keep asking for
+ // the parent of UNKNOWN_PARENT until stack overflow).
+ if (node==UNKNOWN_PARENT) return null;
+
+ Object result = treeNodeToParent.get(node);
+ if (result != null || treeNodeToParent.containsKey(node)) return result;
+ return UNKNOWN_PARENT;
+ }
+
+ /* IContentProvider */
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ rootChildren = null;
+ treeNodeToParent.clear();
+ treeNodeToChildren.clear();
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CompositeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CompositeContentProvider.java
index da8aefc..fddad09 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CompositeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/CompositeContentProvider.java
@@ -1,89 +1,89 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-
-/**
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Jul 18, 2006
- *
- */
-public class CompositeContentProvider extends AbstractContentProvider {
-
-
- List fList = new LinkedList();
-
-
- /**
- *
- */
- public CompositeContentProvider() {
- super();
- }
-
- /**
- * @param providers
- */
-
- public CompositeContentProvider (IStructuredContentProvider[] providers) {
- super();
- if (providers != null) {
- for(int i=0; i<providers.length; i++) {
- fList.add(providers[i]);
- }
- }
- }
-
- public void add ( IStructuredContentProvider provider ) {
- fList.add ( provider );
- }
-
-
- @Override
- public void collectElements (Object input, List list) {
-
- // Check if the input parameter is a complex one
- if (collectComplex(input, list)) {
- return ;
- }
-
-
- Iterator it = fList.iterator();
-
- while (it.hasNext()) {
-
- Object next = it.next();
-
- if (next instanceof AbstractContentProvider) {
- AbstractContentProvider provider = (AbstractContentProvider) next;
- provider.collectElements(input, list);
-
- } else if (next instanceof IStructuredContentProvider) {
-
- IStructuredContentProvider provider = (IStructuredContentProvider) next;
- Object objs [] = provider.getElements(input);
- if (objs.length > 0) {
- for(int j=0; j<objs.length;j++) {
- list.add(objs[j]);
- }
- }
- }
- // silently ignore non-conformists ?
-
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+
+/**
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Jul 18, 2006
+ *
+ */
+public class CompositeContentProvider extends AbstractContentProvider {
+
+
+ List fList = new LinkedList();
+
+
+ /**
+ *
+ */
+ public CompositeContentProvider() {
+ super();
+ }
+
+ /**
+ * @param providers
+ */
+
+ public CompositeContentProvider (IStructuredContentProvider[] providers) {
+ super();
+ if (providers != null) {
+ for(int i=0; i<providers.length; i++) {
+ fList.add(providers[i]);
+ }
+ }
+ }
+
+ public void add ( IStructuredContentProvider provider ) {
+ fList.add ( provider );
+ }
+
+
+ @Override
+ public void collectElements (Object input, List list) {
+
+ // Check if the input parameter is a complex one
+ if (collectComplex(input, list)) {
+ return ;
+ }
+
+
+ Iterator it = fList.iterator();
+
+ while (it.hasNext()) {
+
+ Object next = it.next();
+
+ if (next instanceof AbstractContentProvider) {
+ AbstractContentProvider provider = (AbstractContentProvider) next;
+ provider.collectElements(input, list);
+
+ } else if (next instanceof IStructuredContentProvider) {
+
+ IStructuredContentProvider provider = (IStructuredContentProvider) next;
+ Object objs [] = provider.getElements(input);
+ if (objs.length > 0) {
+ for(int j=0; j<objs.length;j++) {
+ list.add(objs[j]);
+ }
+ }
+ }
+ // silently ignore non-conformists ?
+
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ITreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ITreeNode.java
index 9ae2be3..1f5ceec 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ITreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ITreeNode.java
@@ -1,55 +1,55 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Interface to tree nodes which represent a model object. The model objects can't
- * represent themselves in the tree because they have to have unique parents, and
- * in general, our model objects don't. In addition, the model object might want to
- * present different children in different contexts (e.g. variable/property versus
- * variable/part/query).
- */
-public interface ITreeNode {
-
- /**
- * Returns the regular label for the node (not including a suffix).
- */
- public String getLabel();
-
- /**
- * Returns the suffix which should be appended to the label. This is useful to
- * show the label of a condensed node in condensed trees.
- */
- public String getLabelSuffix();
-
- /**
- * Returns an image descriptor from which the label provider can create an image
- * for this node.
- */
- public Image getImage();
-
- /**
- * Returns the underlying model object represented by this node.
- */
- public Object getModelObject();
-
- /**
- * Similar in purpose to the getChildren() method of ITreeContentProvider.
- */
- public Object[] getChildren();
-
- /**
- * Similar in purpose to the hasChildren() method of ITreeContentProvider.
- */
- public boolean hasChildren();
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Interface to tree nodes which represent a model object. The model objects can't
+ * represent themselves in the tree because they have to have unique parents, and
+ * in general, our model objects don't. In addition, the model object might want to
+ * present different children in different contexts (e.g. variable/property versus
+ * variable/part/query).
+ */
+public interface ITreeNode {
+
+ /**
+ * Returns the regular label for the node (not including a suffix).
+ */
+ public String getLabel();
+
+ /**
+ * Returns the suffix which should be appended to the label. This is useful to
+ * show the label of a condensed node in condensed trees.
+ */
+ public String getLabelSuffix();
+
+ /**
+ * Returns an image descriptor from which the label provider can create an image
+ * for this node.
+ */
+ public Image getImage();
+
+ /**
+ * Returns the underlying model object represented by this node.
+ */
+ public Object getModelObject();
+
+ /**
+ * Similar in purpose to the getChildren() method of ITreeContentProvider.
+ */
+ public Object[] getChildren();
+
+ /**
+ * Similar in purpose to the hasChildren() method of ITreeContentProvider.
+ */
+ public boolean hasChildren();
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/JavaTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/JavaTreeContentProvider.java
index 9d15b1d..0476a2c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/JavaTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/JavaTreeContentProvider.java
@@ -1,87 +1,87 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.bpmn2.modeler.ui.util.ListMap;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-
-
-/**
- * Provides a tree of model objects representing some expansion of the underlying graph
- * of model objects whose roots are the Variables of a Process.
- */
-public class JavaTreeContentProvider extends ModelTreeContentProvider {
-
- boolean isPropertyTree;
- private CompositeContentProvider fContentProvider;
-
-
- public JavaTreeContentProvider( boolean isCondensed ) {
- super(isCondensed);
-
- fContentProvider = new CompositeContentProvider ();
- fContentProvider.add ( new JavaTypeContentProvider() );
- fContentProvider.add ( new JavaMemberContentProvider() );
-
- }
-
- public boolean isPropertyTree() { return isPropertyTree; }
-
-
-
- @Override
- public Object[] primGetElements (Object inputElement) {
-
- ITreeNode result = getTreeNode ( inputElement );
- if (result != null) {
- return new Object[] { result } ;
- }
-
- if (inputElement instanceof List) {
- List list = (List)inputElement;
- return (Object[]) ListMap.Map (
- fContentProvider.getElements( inputElement ), //list.toArray(),
- new ListMap.Visitor () {
- public Object visit (Object obj) {
- Object r = getTreeNode ( obj );
- return (r == null ? ListMap.IGNORE : r );
- }
- },
- EMPTY_ARRAY );
- }
-
- return EMPTY_ARRAY;
- }
-
-
- ITreeNode getTreeNode ( Object inputElement ) {
-
- if (inputElement instanceof Class) {
- return new JavaTypeTreeNode(inputElement,isCondensed);
- }
- else if (inputElement instanceof Member) {
- return new JavaMemberTreeNode(inputElement,isCondensed);
- }
-
- return null;
- }
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.bpmn2.modeler.ui.util.ListMap;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.PortType;
+
+
+/**
+ * Provides a tree of model objects representing some expansion of the underlying graph
+ * of model objects whose roots are the Variables of a Process.
+ */
+public class JavaTreeContentProvider extends ModelTreeContentProvider {
+
+ boolean isPropertyTree;
+ private CompositeContentProvider fContentProvider;
+
+
+ public JavaTreeContentProvider( boolean isCondensed ) {
+ super(isCondensed);
+
+ fContentProvider = new CompositeContentProvider ();
+ fContentProvider.add ( new JavaTypeContentProvider() );
+ fContentProvider.add ( new JavaMemberContentProvider() );
+
+ }
+
+ public boolean isPropertyTree() { return isPropertyTree; }
+
+
+
+ @Override
+ public Object[] primGetElements (Object inputElement) {
+
+ ITreeNode result = getTreeNode ( inputElement );
+ if (result != null) {
+ return new Object[] { result } ;
+ }
+
+ if (inputElement instanceof List) {
+ List list = (List)inputElement;
+ return (Object[]) ListMap.Map (
+ fContentProvider.getElements( inputElement ), //list.toArray(),
+ new ListMap.Visitor () {
+ public Object visit (Object obj) {
+ Object r = getTreeNode ( obj );
+ return (r == null ? ListMap.IGNORE : r );
+ }
+ },
+ EMPTY_ARRAY );
+ }
+
+ return EMPTY_ARRAY;
+ }
+
+
+ ITreeNode getTreeNode ( Object inputElement ) {
+
+ if (inputElement instanceof Class) {
+ return new JavaTypeTreeNode(inputElement,isCondensed);
+ }
+ else if (inputElement instanceof Member) {
+ return new JavaMemberTreeNode(inputElement,isCondensed);
+ }
+
+ return null;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/MessageTypeTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/MessageTypeTreeNode.java
index 535f048..16e1717 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/MessageTypeTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/MessageTypeTreeNode.java
@@ -1,106 +1,106 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-
-/**
- * Tree node to represent a message-type model object.
- */
-public class MessageTypeTreeNode extends TreeNode {
-
- boolean displayParticles;
-
- public MessageTypeTreeNode(Input msg, boolean isCondensed) {
- this(msg, isCondensed, true);
- }
-
-
- public MessageTypeTreeNode(Output msg, boolean isCondensed) {
- this(msg, isCondensed, true);
- }
-
- public MessageTypeTreeNode(Message messageType, boolean isCondensed) {
- this(messageType, isCondensed, true);
- }
-
-
- public MessageTypeTreeNode (Message messageType, boolean isCondensed,
- boolean displayParticles) {
- this((EObject) messageType,isCondensed,displayParticles);
- }
-
-
- private MessageTypeTreeNode(EObject obj, boolean isCondensed,
- boolean displayParticles )
- {
- super(obj, isCondensed);
- this.displayParticles = displayParticles;
- }
-
- /* ITreeNode */
-
- @Override
- public Object[] getChildren() {
-
- Message msg = getMessage();
-
- if (msg == null) {
- return EMPTY_ARRAY;
- }
-
- if (msg.getParts() == null) {
- return EMPTY_ARRAY;
- }
-
- List<PartTreeNode> list = new ArrayList<PartTreeNode>();
- for (Iterator<Part> it = msg.getParts().values().iterator(); it.hasNext(); ) {
- list.add(new PartTreeNode(it.next(), isCondensed, displayParticles));
- }
- return list.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- Message msg = getMessage();
- if (msg == null) {
- return false;
- }
-
- return (msg.getParts() != null && !msg.getParts().isEmpty());
- }
-
- /* other methods */
-
-
- Message getMessage () {
- if (modelObject instanceof Message) {
- return (Message) modelObject;
- }
- if (modelObject instanceof Input) {
- return ((Input)modelObject).getEMessage();
- }
- if (modelObject instanceof Output) {
- return ((Output)modelObject).getEMessage();
- }
- return null;
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.wst.wsdl.Input;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Output;
+import org.eclipse.wst.wsdl.Part;
+
+/**
+ * Tree node to represent a message-type model object.
+ */
+public class MessageTypeTreeNode extends TreeNode {
+
+ boolean displayParticles;
+
+ public MessageTypeTreeNode(Input msg, boolean isCondensed) {
+ this(msg, isCondensed, true);
+ }
+
+
+ public MessageTypeTreeNode(Output msg, boolean isCondensed) {
+ this(msg, isCondensed, true);
+ }
+
+ public MessageTypeTreeNode(Message messageType, boolean isCondensed) {
+ this(messageType, isCondensed, true);
+ }
+
+
+ public MessageTypeTreeNode (Message messageType, boolean isCondensed,
+ boolean displayParticles) {
+ this((EObject) messageType,isCondensed,displayParticles);
+ }
+
+
+ private MessageTypeTreeNode(EObject obj, boolean isCondensed,
+ boolean displayParticles )
+ {
+ super(obj, isCondensed);
+ this.displayParticles = displayParticles;
+ }
+
+ /* ITreeNode */
+
+ @Override
+ public Object[] getChildren() {
+
+ Message msg = getMessage();
+
+ if (msg == null) {
+ return EMPTY_ARRAY;
+ }
+
+ if (msg.getParts() == null) {
+ return EMPTY_ARRAY;
+ }
+
+ List<PartTreeNode> list = new ArrayList<PartTreeNode>();
+ for (Iterator<Part> it = msg.getParts().values().iterator(); it.hasNext(); ) {
+ list.add(new PartTreeNode(it.next(), isCondensed, displayParticles));
+ }
+ return list.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ Message msg = getMessage();
+ if (msg == null) {
+ return false;
+ }
+
+ return (msg.getParts() != null && !msg.getParts().isEmpty());
+ }
+
+ /* other methods */
+
+
+ Message getMessage () {
+ if (modelObject instanceof Message) {
+ return (Message) modelObject;
+ }
+ if (modelObject instanceof Input) {
+ return ((Input)modelObject).getEMessage();
+ }
+ if (modelObject instanceof Output) {
+ return ((Output)modelObject).getEMessage();
+ }
+ return null;
+ }
+
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeContentProvider.java
index 0bd266c..86a3779 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeContentProvider.java
@@ -1,99 +1,99 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.jface.viewers.Viewer;
-
-
-/**
- * A content provider for a tree of ITreeNode objects representing some expansion of
- * the underlying graph of model objects. CachedTreeContentProvider keeps track of the
- * parent relationships so the ITreeNode objects don't have to; however, the ITreeNode
- * objects *must have unique parents*, so our model objects can't represent themselves
- * directly. After all, our model is a graph, not a tree. Another reason to wrap our
- * model objects in ITreeNode objects is that there may be different tree expansions
- * of a particular model object in different contexts (e.g. variable/property versus
- * variable/part/query).
- *
- * To programatically expose a particular branch of the tree, you must first walk down
- * the content provider from the root to the ITreeNode you want to expose (causing the
- * necessary ITreeNode objects to be created). Then, you call viewer.expandToLevel()
- * on this ITreeNode. Using this content provider, the TreeViewer will walk up from
- * the given node to the deepest already-expanded item, then back down again expanding
- * the remaining items.
- */
-public class ModelTreeContentProvider extends CachedTreeContentProvider {
-
- protected boolean isCondensed;
-
- public ModelTreeContentProvider(boolean isCondensed) {
- super();
- this.isCondensed = isCondensed;
- }
-
- public boolean isCondensed() { return isCondensed; }
-
- @Override
- protected Object[] primGetChildren(Object node) {
- if (!(node instanceof ITreeNode)) return EMPTY_ARRAY;
- return ((ITreeNode)node).getChildren();
- }
-
- @Override
- protected Object[] primGetElements(Object node) {
- return primGetChildren(node);
- }
-
- @Override
- protected boolean primHasChildren(Object node) {
- if (!(node instanceof ITreeNode)) return false;
- return ((ITreeNode)node).hasChildren();
- }
-
- /**
- * Searches each of the nodes in the given array to find the node representing a
- * particular modelObject.
- *
- * If subtreeDepth > 0, the children of each node in the given array are recursively
- * searched to a depth of subtreeDepth-1.
- *
- * Values larger than 1 or 2 should be avoided whenever possible, because all of the
- * nodes in the subtree up to subtreeDepth have to be created and cached. The most
- * efficient subtreeDepth is 0.
- */
- public ITreeNode findModelNode(Object[] nodes, Object modelObject, int subtreeDepth) {
- for (int i = 0; i<nodes.length; i++) {
- if (!(nodes[i] instanceof ITreeNode)) continue;
- ITreeNode treeNode = (ITreeNode)nodes[i];
- if (treeNode.getModelObject().equals(modelObject)) return treeNode;
- }
- ITreeNode result = null;
- if (subtreeDepth > 0) {
- for (int i = 0; result==null && i<nodes.length; i++) {
- result = findModelNode(getChildren(nodes[i]), modelObject, subtreeDepth-1);
- }
- }
- return result;
- }
-
- /* IContentProvider */
-
- @Override
- public void dispose() {
- super.dispose();
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- super.inputChanged(viewer, oldInput, newInput);
- // TODO: hook model listener?
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.jface.viewers.Viewer;
+
+
+/**
+ * A content provider for a tree of ITreeNode objects representing some expansion of
+ * the underlying graph of model objects. CachedTreeContentProvider keeps track of the
+ * parent relationships so the ITreeNode objects don't have to; however, the ITreeNode
+ * objects *must have unique parents*, so our model objects can't represent themselves
+ * directly. After all, our model is a graph, not a tree. Another reason to wrap our
+ * model objects in ITreeNode objects is that there may be different tree expansions
+ * of a particular model object in different contexts (e.g. variable/property versus
+ * variable/part/query).
+ *
+ * To programatically expose a particular branch of the tree, you must first walk down
+ * the content provider from the root to the ITreeNode you want to expose (causing the
+ * necessary ITreeNode objects to be created). Then, you call viewer.expandToLevel()
+ * on this ITreeNode. Using this content provider, the TreeViewer will walk up from
+ * the given node to the deepest already-expanded item, then back down again expanding
+ * the remaining items.
+ */
+public class ModelTreeContentProvider extends CachedTreeContentProvider {
+
+ protected boolean isCondensed;
+
+ public ModelTreeContentProvider(boolean isCondensed) {
+ super();
+ this.isCondensed = isCondensed;
+ }
+
+ public boolean isCondensed() { return isCondensed; }
+
+ @Override
+ protected Object[] primGetChildren(Object node) {
+ if (!(node instanceof ITreeNode)) return EMPTY_ARRAY;
+ return ((ITreeNode)node).getChildren();
+ }
+
+ @Override
+ protected Object[] primGetElements(Object node) {
+ return primGetChildren(node);
+ }
+
+ @Override
+ protected boolean primHasChildren(Object node) {
+ if (!(node instanceof ITreeNode)) return false;
+ return ((ITreeNode)node).hasChildren();
+ }
+
+ /**
+ * Searches each of the nodes in the given array to find the node representing a
+ * particular modelObject.
+ *
+ * If subtreeDepth > 0, the children of each node in the given array are recursively
+ * searched to a depth of subtreeDepth-1.
+ *
+ * Values larger than 1 or 2 should be avoided whenever possible, because all of the
+ * nodes in the subtree up to subtreeDepth have to be created and cached. The most
+ * efficient subtreeDepth is 0.
+ */
+ public ITreeNode findModelNode(Object[] nodes, Object modelObject, int subtreeDepth) {
+ for (int i = 0; i<nodes.length; i++) {
+ if (!(nodes[i] instanceof ITreeNode)) continue;
+ ITreeNode treeNode = (ITreeNode)nodes[i];
+ if (treeNode.getModelObject().equals(modelObject)) return treeNode;
+ }
+ ITreeNode result = null;
+ if (subtreeDepth > 0) {
+ for (int i = 0; result==null && i<nodes.length; i++) {
+ result = findModelNode(getChildren(nodes[i]), modelObject, subtreeDepth-1);
+ }
+ }
+ return result;
+ }
+
+ /* IContentProvider */
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ super.inputChanged(viewer, oldInput, newInput);
+ // TODO: hook model listener?
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeLabelProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeLabelProvider.java
index 7ea9596..ea6dc21 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeLabelProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ModelTreeLabelProvider.java
@@ -1,80 +1,80 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * An ILabelProvider for implementors of ITreeNode. This class is complementary
- * to ModelTreeContentProvider and its subclasses.
- */
-public class ModelTreeLabelProvider implements ILabelProvider {
-
- protected Map stringToImage;
-
- public static final Object[] EMPTY_ARRAY = new Object[0];
-
- public ModelTreeLabelProvider() {
- stringToImage = new HashMap();
- }
-
- /* ILabelProvider */
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO: hook model listener?
- }
-
- public Image getImage(Object node) {
- if (!(node instanceof ITreeNode)) return null;
- ITreeNode treeElement = (ITreeNode)node;
- Image image = treeElement.getImage();
- if (image != null) stringToImage.put(image.toString(), image);
- return image;
- }
-
- public String getText(Object node) {
- if (!(node instanceof ITreeNode)) return null;
- ITreeNode treeElement = (ITreeNode)node;
- String s1 = treeElement.getLabel();
- String s2 = treeElement.getLabelSuffix();
- if (s2 != null){
- return NLS.bind(Messages.ModelTreeLabelProvider_s1_s2, (new String[] {s1, s2}));
- }
- return s1;
- }
-
- /* IBaseLabelProvider */
-
- public void dispose() {
- stringToImage = null;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
-
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * An ILabelProvider for implementors of ITreeNode. This class is complementary
+ * to ModelTreeContentProvider and its subclasses.
+ */
+public class ModelTreeLabelProvider implements ILabelProvider {
+
+ protected Map stringToImage;
+
+ public static final Object[] EMPTY_ARRAY = new Object[0];
+
+ public ModelTreeLabelProvider() {
+ stringToImage = new HashMap();
+ }
+
+ /* ILabelProvider */
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO: hook model listener?
+ }
+
+ public Image getImage(Object node) {
+ if (!(node instanceof ITreeNode)) return null;
+ ITreeNode treeElement = (ITreeNode)node;
+ Image image = treeElement.getImage();
+ if (image != null) stringToImage.put(image.toString(), image);
+ return image;
+ }
+
+ public String getText(Object node) {
+ if (!(node instanceof ITreeNode)) return null;
+ ITreeNode treeElement = (ITreeNode)node;
+ String s1 = treeElement.getLabel();
+ String s2 = treeElement.getLabelSuffix();
+ if (s2 != null){
+ return NLS.bind(Messages.ModelTreeLabelProvider_s1_s2, (new String[] {s1, s2}));
+ }
+ return s1;
+ }
+
+ /* IBaseLabelProvider */
+
+ public void dispose() {
+ stringToImage = null;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return true;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ // do nothing
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ // do nothing
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/OperationTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/OperationTreeNode.java
index 61030a5..4505f14 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/OperationTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/OperationTreeNode.java
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-
-/**
- * Tree node to represent an Operation model object.
- */
-public class OperationTreeNode extends TreeNode {
-
- public OperationTreeNode(Operation operation, boolean isCondensed) {
- super(operation, isCondensed);
- }
-
- /* ITreeNode */
-
- @Override
- public Object[] getChildren() {
- Operation op = (Operation)modelObject;
- List<MessageTypeTreeNode> list = new ArrayList<MessageTypeTreeNode>();
- if (op.getInput() != null ) {
-
- list.add(new MessageTypeTreeNode((Input)op.getInput(),isCondensed));
- }
- if (op.getOutput() != null ) {
- list.add(new MessageTypeTreeNode((Output)op.getOutput(),isCondensed));
- }
-
- return list.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- Operation op = (Operation) modelObject;
- if (op.getInput() != null) {
- return true;
- }
-
- if (op.getOutput() != null) {
- return true;
- }
-
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.wsdl.Input;
+import org.eclipse.wst.wsdl.Operation;
+import org.eclipse.wst.wsdl.Output;
+
+/**
+ * Tree node to represent an Operation model object.
+ */
+public class OperationTreeNode extends TreeNode {
+
+ public OperationTreeNode(Operation operation, boolean isCondensed) {
+ super(operation, isCondensed);
+ }
+
+ /* ITreeNode */
+
+ @Override
+ public Object[] getChildren() {
+ Operation op = (Operation)modelObject;
+ List<MessageTypeTreeNode> list = new ArrayList<MessageTypeTreeNode>();
+ if (op.getInput() != null ) {
+
+ list.add(new MessageTypeTreeNode((Input)op.getInput(),isCondensed));
+ }
+ if (op.getOutput() != null ) {
+ list.add(new MessageTypeTreeNode((Output)op.getOutput(),isCondensed));
+ }
+
+ return list.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ Operation op = (Operation) modelObject;
+ if (op.getInput() != null) {
+ return true;
+ }
+
+ if (op.getOutput() != null) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PartTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PartTreeNode.java
index d731d6e..5ebc628 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PartTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PartTreeNode.java
@@ -1,76 +1,76 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.wst.wsdl.Part;
-
-/**
- * Tree node to represent a Part within the messageType of a Variable.
- */
-public class PartTreeNode extends TreeNode {
-
- XSDTypeDefinitionTreeNode xsdType;
- XSDElementDeclarationTreeNode xsdElement;
-
- boolean displayParticles;
-
- public PartTreeNode(Part part, boolean isCondensed) {
- this(part, isCondensed, true);
- }
- public PartTreeNode(Part part, boolean isCondensed, boolean displayParticles) {
- super(part, isCondensed);
- if (part.getTypeDefinition() != null) {
-// XSDElementDeclaration e = part.getEXSDElement();
- xsdType = new XSDTypeDefinitionTreeNode(part.getTypeDefinition(), false);
- } else if (part.getElementDeclaration() != null) {
- xsdElement = new XSDElementDeclarationTreeNode(part.getElementDeclaration(), false);
- }
- this.displayParticles = displayParticles;
- }
-
- /* ITreeNode */
-
- @Override
- public String getLabelSuffix() {
- if (xsdType != null) {
- String label = xsdType.getLabel();
- return label;
- } else if (xsdElement != null) {
- String label = xsdElement.getLabel();
- return label;
- }
- return null;
- }
-
- @Override
- public Object[] getChildren() {
- if (xsdType != null && displayParticles)
- return xsdType.getChildren();
- if (xsdElement != null && displayParticles)
- return xsdElement.getChildren();
- return EMPTY_ARRAY;
- }
-
- @Override
- public boolean hasChildren() {
- if (xsdType != null && displayParticles)
- return xsdType.hasChildren();
- if (xsdElement != null && displayParticles)
- return xsdElement.hasChildren();
- return false;
- }
-
- @Override
- public String getLabel() {
- String label = super.getLabel();
- return label;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.wst.wsdl.Part;
+
+/**
+ * Tree node to represent a Part within the messageType of a Variable.
+ */
+public class PartTreeNode extends TreeNode {
+
+ XSDTypeDefinitionTreeNode xsdType;
+ XSDElementDeclarationTreeNode xsdElement;
+
+ boolean displayParticles;
+
+ public PartTreeNode(Part part, boolean isCondensed) {
+ this(part, isCondensed, true);
+ }
+ public PartTreeNode(Part part, boolean isCondensed, boolean displayParticles) {
+ super(part, isCondensed);
+ if (part.getTypeDefinition() != null) {
+// XSDElementDeclaration e = part.getEXSDElement();
+ xsdType = new XSDTypeDefinitionTreeNode(part.getTypeDefinition(), false);
+ } else if (part.getElementDeclaration() != null) {
+ xsdElement = new XSDElementDeclarationTreeNode(part.getElementDeclaration(), false);
+ }
+ this.displayParticles = displayParticles;
+ }
+
+ /* ITreeNode */
+
+ @Override
+ public String getLabelSuffix() {
+ if (xsdType != null) {
+ String label = xsdType.getLabel();
+ return label;
+ } else if (xsdElement != null) {
+ String label = xsdElement.getLabel();
+ return label;
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren() {
+ if (xsdType != null && displayParticles)
+ return xsdType.getChildren();
+ if (xsdElement != null && displayParticles)
+ return xsdElement.getChildren();
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean hasChildren() {
+ if (xsdType != null && displayParticles)
+ return xsdType.hasChildren();
+ if (xsdElement != null && displayParticles)
+ return xsdElement.hasChildren();
+ return false;
+ }
+
+ @Override
+ public String getLabel() {
+ String label = super.getLabel();
+ return label;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortContentProvider.java
index 4098b87..5094050 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortContentProvider.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Service;
-
-/**
- * Content provider for Ports.
- *
- * Expects a Service as input.
- */
-public class PortContentProvider extends AbstractContentProvider {
-
- @Override
- public void collectElements(Object input, List list) {
- if (input instanceof Service) {
- Service service = (Service) input;
- list.addAll ( service.getEPorts() );
- }
- throw new IllegalArgumentException();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.List;
+
+import org.eclipse.wst.wsdl.Service;
+
+/**
+ * Content provider for Ports.
+ *
+ * Expects a Service as input.
+ */
+public class PortContentProvider extends AbstractContentProvider {
+
+ @Override
+ public void collectElements(Object input, List list) {
+ if (input instanceof Service) {
+ Service service = (Service) input;
+ list.addAll ( service.getEPorts() );
+ }
+ throw new IllegalArgumentException();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeContentProvider.java
index d8139e2..1b0378c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeContentProvider.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-
-/**
- * Content provider for PortTypes.
- *
- * Expects a Role or a Definition or a context as input.
- */
-public class PortTypeContentProvider extends AbstractContentProvider {
-
- @Override
- public void collectElements(Object input, List list) {
-
- if (input instanceof Definition) {
- Definition defn = (Definition) input;
- list.addAll ( defn.getEPortTypes() );
-
- } else if (input instanceof PortType) {
-
- PortType pt = (PortType) input;
- collectElements ( pt.eContainer(), list );
-
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.List;
+
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.PortType;
+
+/**
+ * Content provider for PortTypes.
+ *
+ * Expects a Role or a Definition or a context as input.
+ */
+public class PortTypeContentProvider extends AbstractContentProvider {
+
+ @Override
+ public void collectElements(Object input, List list) {
+
+ if (input instanceof Definition) {
+ Definition defn = (Definition) input;
+ list.addAll ( defn.getEPortTypes() );
+
+ } else if (input instanceof PortType) {
+
+ PortType pt = (PortType) input;
+ collectElements ( pt.eContainer(), list );
+
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeTreeNode.java
index c21be69..c181b73 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/PortTypeTreeNode.java
@@ -1,68 +1,68 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-
-/**
- * Tree node to represent a PortType model object.
- */
-public class PortTypeTreeNode extends TreeNode {
-
- // we need these to allow filters to work correctly.
-
- boolean fDerivedFromMyRole = false;
- boolean fDerivedFromPartnerRole = false;
-
- public PortTypeTreeNode(PortType portType, boolean isCondensed) {
- super(portType, isCondensed);
- }
-
- /* ITreeNode */
-
- public boolean isDerivedFromMyRole() {
- return fDerivedFromMyRole;
- }
-
- public void setDerivedFromMyRole(boolean derivedFromMyRole) {
- fDerivedFromMyRole = derivedFromMyRole;
- }
-
- public boolean isDerivedFromPartnerRole() {
- return fDerivedFromPartnerRole;
- }
-
- public void setDerivedFromPartnerRole(boolean derivedFromPartnerRole) {
- fDerivedFromPartnerRole = derivedFromPartnerRole;
- }
-
- @Override
- public Object[] getChildren() {
- PortType pt = (PortType)modelObject;
- if (pt.getOperations() == null) return EMPTY_ARRAY;
- Vector<OperationTreeNode> v = new Vector<OperationTreeNode>();
- for (Iterator<Operation> it = pt.getOperations().iterator(); it.hasNext(); ) {
- v.add(new OperationTreeNode(it.next(), isCondensed));
- }
- return v.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- PortType pt = (PortType)modelObject;
- if (pt.getOperations() == null) return false;
- return pt.getOperations().size() > 0;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.eclipse.wst.wsdl.Operation;
+import org.eclipse.wst.wsdl.PortType;
+
+/**
+ * Tree node to represent a PortType model object.
+ */
+public class PortTypeTreeNode extends TreeNode {
+
+ // we need these to allow filters to work correctly.
+
+ boolean fDerivedFromMyRole = false;
+ boolean fDerivedFromPartnerRole = false;
+
+ public PortTypeTreeNode(PortType portType, boolean isCondensed) {
+ super(portType, isCondensed);
+ }
+
+ /* ITreeNode */
+
+ public boolean isDerivedFromMyRole() {
+ return fDerivedFromMyRole;
+ }
+
+ public void setDerivedFromMyRole(boolean derivedFromMyRole) {
+ fDerivedFromMyRole = derivedFromMyRole;
+ }
+
+ public boolean isDerivedFromPartnerRole() {
+ return fDerivedFromPartnerRole;
+ }
+
+ public void setDerivedFromPartnerRole(boolean derivedFromPartnerRole) {
+ fDerivedFromPartnerRole = derivedFromPartnerRole;
+ }
+
+ @Override
+ public Object[] getChildren() {
+ PortType pt = (PortType)modelObject;
+ if (pt.getOperations() == null) return EMPTY_ARRAY;
+ Vector<OperationTreeNode> v = new Vector<OperationTreeNode>();
+ for (Iterator<Operation> it = pt.getOperations().iterator(); it.hasNext(); ) {
+ v.add(new OperationTreeNode(it.next(), isCondensed));
+ }
+ return v.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ PortType pt = (PortType)modelObject;
+ if (pt.getOperations() == null) return false;
+ return pt.getOperations().size() > 0;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceContentProvider.java
index 6907b9f..349e94d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceContentProvider.java
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-
-/**
- * Content provider for Services.
- *
- * Expects a Definition as input.
- */
-public class ServiceContentProvider extends AbstractContentProvider {
-
- @Override
- public void collectElements(Object input, List list) {
- if (input instanceof Definition) {
- Definition defn = (Definition) input;
- list.addAll( defn.getEServices());
- return;
- }
- // This will break any CompositeContentProvider
- throw new IllegalArgumentException();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.List;
+
+import org.eclipse.wst.wsdl.Definition;
+
+/**
+ * Content provider for Services.
+ *
+ * Expects a Definition as input.
+ */
+public class ServiceContentProvider extends AbstractContentProvider {
+
+ @Override
+ public void collectElements(Object input, List list) {
+ if (input instanceof Definition) {
+ Definition defn = (Definition) input;
+ list.addAll( defn.getEServices());
+ return;
+ }
+ // This will break any CompositeContentProvider
+ throw new IllegalArgumentException();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceTreeContentProvider.java
index e8ba357..bdc3819 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/ServiceTreeContentProvider.java
@@ -1,76 +1,76 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.bpmn2.modeler.ui.util.ListMap;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-
-
-/**
- * Provides a tree of model objects representing some expansion of the underlying graph
- * of model objects whose roots are the Variables of a Process.
- */
-public class ServiceTreeContentProvider extends ModelTreeContentProvider {
-
- boolean isPropertyTree;
- private CompositeContentProvider fContentProvider;
-
-
- public ServiceTreeContentProvider( boolean isCondensed ) {
- super(isCondensed);
-
- fContentProvider = new CompositeContentProvider ();
- fContentProvider.add ( new ServiceContentProvider() );
- fContentProvider.add ( new PortTypeContentProvider() );
-
- }
-
- public boolean isPropertyTree() { return isPropertyTree; }
-
-
-
- @Override
- public Object[] primGetElements (Object inputElement) {
-
- ITreeNode result = getTreeNode ( inputElement );
- if (result != null) {
- return new Object[] { result } ;
- }
-
-
- if (inputElement instanceof Definition) {
-
- return (Object[]) ListMap.Map (
- fContentProvider.getElements( inputElement ) ,
- new ListMap.Visitor () {
- public Object visit (Object obj) {
- Object r = getTreeNode ( obj );
- return (r == null ? ListMap.IGNORE : r );
- }
- },
- EMPTY_ARRAY );
- }
-
- return EMPTY_ARRAY;
- }
-
-
- ITreeNode getTreeNode ( Object inputElement ) {
-
- if (inputElement instanceof PortType) {
- return new PortTypeTreeNode ((PortType) inputElement,isCondensed);
- }
-
- return null;
-
- }
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.bpmn2.modeler.ui.util.ListMap;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.PortType;
+
+
+/**
+ * Provides a tree of model objects representing some expansion of the underlying graph
+ * of model objects whose roots are the Variables of a Process.
+ */
+public class ServiceTreeContentProvider extends ModelTreeContentProvider {
+
+ boolean isPropertyTree;
+ private CompositeContentProvider fContentProvider;
+
+
+ public ServiceTreeContentProvider( boolean isCondensed ) {
+ super(isCondensed);
+
+ fContentProvider = new CompositeContentProvider ();
+ fContentProvider.add ( new ServiceContentProvider() );
+ fContentProvider.add ( new PortTypeContentProvider() );
+
+ }
+
+ public boolean isPropertyTree() { return isPropertyTree; }
+
+
+
+ @Override
+ public Object[] primGetElements (Object inputElement) {
+
+ ITreeNode result = getTreeNode ( inputElement );
+ if (result != null) {
+ return new Object[] { result } ;
+ }
+
+
+ if (inputElement instanceof Definition) {
+
+ return (Object[]) ListMap.Map (
+ fContentProvider.getElements( inputElement ) ,
+ new ListMap.Visitor () {
+ public Object visit (Object obj) {
+ Object r = getTreeNode ( obj );
+ return (r == null ? ListMap.IGNORE : r );
+ }
+ },
+ EMPTY_ARRAY );
+ }
+
+ return EMPTY_ARRAY;
+ }
+
+
+ ITreeNode getTreeNode ( Object inputElement ) {
+
+ if (inputElement instanceof PortType) {
+ return new PortTypeTreeNode ((PortType) inputElement,isCondensed);
+ }
+
+ return null;
+
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/TreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/TreeNode.java
index 3c6ad25..712f40e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/TreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/TreeNode.java
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
-import org.eclipse.bpmn2.modeler.ui.adapters.ILabeledElement;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Abstract implementation of ITreeNode which implements default getLabel() and
- * getImage() behaviour by adapting the model object to ILabeledElement.
- *
- * TODO: condensed trees should be implemented using a ListFlattener rather than
- * the ad-hoc way they are implemented now. @see ModelTreeContentProvider.
- */
-public abstract class TreeNode implements ITreeNode {
-
- public static final Object[] EMPTY_ARRAY = new Object[0];
-
- protected Object modelObject;
- protected boolean isCondensed;
-
- public TreeNode(Object modelObject, boolean isCondensed) {
- this.modelObject = modelObject;
- this.isCondensed = isCondensed;
- }
-
- /* ITreeNode */
-
- // May need to override this default getLabel() for some objects!
- public String getLabel() {
- ILabeledElement label = AdapterUtil.adapt(modelObject, ILabeledElement.class);
- if (label == null) return null;
- return label.getLabel(modelObject);
- }
-
- public String getLabelSuffix() { return null; }
-
- public boolean isNodeFlattenable() { return false; }
- public Object getModelObject() { return modelObject; }
-
- public Image getImage() {
- ILabeledElement label = AdapterUtil.adapt(modelObject, ILabeledElement.class);
- if (label == null) return null;
- return label.getSmallImage(modelObject);
- }
-
- public abstract Object[] getChildren();
- public abstract boolean hasChildren();
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
+import org.eclipse.bpmn2.modeler.ui.adapters.ILabeledElement;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * Abstract implementation of ITreeNode which implements default getLabel() and
+ * getImage() behaviour by adapting the model object to ILabeledElement.
+ *
+ * TODO: condensed trees should be implemented using a ListFlattener rather than
+ * the ad-hoc way they are implemented now. @see ModelTreeContentProvider.
+ */
+public abstract class TreeNode implements ITreeNode {
+
+ public static final Object[] EMPTY_ARRAY = new Object[0];
+
+ protected Object modelObject;
+ protected boolean isCondensed;
+
+ public TreeNode(Object modelObject, boolean isCondensed) {
+ this.modelObject = modelObject;
+ this.isCondensed = isCondensed;
+ }
+
+ /* ITreeNode */
+
+ // May need to override this default getLabel() for some objects!
+ public String getLabel() {
+ ILabeledElement label = AdapterUtil.adapt(modelObject, ILabeledElement.class);
+ if (label == null) return null;
+ return label.getLabel(modelObject);
+ }
+
+ public String getLabelSuffix() { return null; }
+
+ public boolean isNodeFlattenable() { return false; }
+ public Object getModelObject() { return modelObject; }
+
+ public Image getImage() {
+ ILabeledElement label = AdapterUtil.adapt(modelObject, ILabeledElement.class);
+ if (label == null) return null;
+ return label.getSmallImage(modelObject);
+ }
+
+ public abstract Object[] getChildren();
+ public abstract boolean hasChildren();
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/VariableTypeTreeContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/VariableTypeTreeContentProvider.java
index 2ccce3a..d496eec 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/VariableTypeTreeContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/VariableTypeTreeContentProvider.java
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-
-import org.eclipse.bpmn2.modeler.ui.util.ListMap;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-/**
- * Provides a tree of model objects representing some expansion of the underlying graph
- * of model objects whose roots are the Variables of a Process.
- */
-public class VariableTypeTreeContentProvider extends ModelTreeContentProvider {
-
- boolean isPropertyTree;
- boolean displayParticles;
-
- public VariableTypeTreeContentProvider(boolean isCondensed, boolean displayParticles) {
- super(isCondensed);
- this.displayParticles = displayParticles;
- }
-
- public boolean isPropertyTree() { return isPropertyTree; }
-
- @Override
- public Object[] primGetElements (Object inputElement) {
-
- Object [] list = new Object[1];
-
- if (inputElement instanceof XSDTypeDefinition) {
- XSDTypeDefinition typeDef = (XSDTypeDefinition) inputElement;
- list[0] = new XSDTypeDefinitionTreeNode(typeDef, isCondensed);
- } else if (inputElement instanceof XSDElementDeclaration) {
- XSDElementDeclaration decl = (XSDElementDeclaration) inputElement;
- list[0] = new XSDElementDeclarationTreeNode(decl, isCondensed);
- } else if (inputElement instanceof Message) {
- Message msg = (Message) inputElement;
- list[0] = new MessageTypeTreeNode(msg,isCondensed, false);
- } else if (inputElement instanceof XSDSchema) {
- XSDSchema schema = (XSDSchema) inputElement;
- list[0] = new XSDSchemaTreeNode(schema,isCondensed);
- } else if (inputElement instanceof Definition) {
-
- Definition defn = (Definition) inputElement;
- Types types = defn.getETypes();
-
- if (types != null) {
-
- return (Object[]) ListMap.Map (
- types.getSchemas(),
- new ListMap.Visitor () {
- public Object visit (Object obj) {
- return new XSDSchemaTreeNode ( (XSDSchema) obj,isCondensed);
- }
- },
- list );
-
- }
- return EMPTY_ARRAY;
- }
-
- return list;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+
+import org.eclipse.bpmn2.modeler.ui.util.ListMap;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Types;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+/**
+ * Provides a tree of model objects representing some expansion of the underlying graph
+ * of model objects whose roots are the Variables of a Process.
+ */
+public class VariableTypeTreeContentProvider extends ModelTreeContentProvider {
+
+ boolean isPropertyTree;
+ boolean displayParticles;
+
+ public VariableTypeTreeContentProvider(boolean isCondensed, boolean displayParticles) {
+ super(isCondensed);
+ this.displayParticles = displayParticles;
+ }
+
+ public boolean isPropertyTree() { return isPropertyTree; }
+
+ @Override
+ public Object[] primGetElements (Object inputElement) {
+
+ Object [] list = new Object[1];
+
+ if (inputElement instanceof XSDTypeDefinition) {
+ XSDTypeDefinition typeDef = (XSDTypeDefinition) inputElement;
+ list[0] = new XSDTypeDefinitionTreeNode(typeDef, isCondensed);
+ } else if (inputElement instanceof XSDElementDeclaration) {
+ XSDElementDeclaration decl = (XSDElementDeclaration) inputElement;
+ list[0] = new XSDElementDeclarationTreeNode(decl, isCondensed);
+ } else if (inputElement instanceof Message) {
+ Message msg = (Message) inputElement;
+ list[0] = new MessageTypeTreeNode(msg,isCondensed, false);
+ } else if (inputElement instanceof XSDSchema) {
+ XSDSchema schema = (XSDSchema) inputElement;
+ list[0] = new XSDSchemaTreeNode(schema,isCondensed);
+ } else if (inputElement instanceof Definition) {
+
+ Definition defn = (Definition) inputElement;
+ Types types = defn.getETypes();
+
+ if (types != null) {
+
+ return (Object[]) ListMap.Map (
+ types.getSchemas(),
+ new ListMap.Visitor () {
+ public Object visit (Object obj) {
+ return new XSDSchemaTreeNode ( (XSDSchema) obj,isCondensed);
+ }
+ },
+ list );
+
+ }
+ return EMPTY_ARRAY;
+ }
+
+ return list;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/WSILContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/WSILContentProvider.java
index eb1abfc..1fce246 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/WSILContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/WSILContentProvider.java
@@ -1,167 +1,167 @@
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-
-import org.eclipse.bpel.wsil.model.inspection.Inspection;
-import org.eclipse.bpel.wsil.model.inspection.Link;
-import org.eclipse.bpel.wsil.model.inspection.WSILDocument;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-
-/**
- * WSIIL Content Provider
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @author Edward Gee
- * @date Apr 5, 2007
- *
- */
-
-@SuppressWarnings({"unchecked","nls"})
-
-public class WSILContentProvider implements ITreeContentProvider {
-
- /**
- * Flatten the inspection document ( do not return root document )
- */
- static public final int FLATTEN = 0x1;
-
- int fMode = 0;
-
- /**
- * Set the mode of operation of this content provider.
- * @param mode
- */
- public void setMode ( int mode ) {
- fMode = mode;
- }
-
-
- /** (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
-
-
-
- public Object[] getChildren (Object arg0) {
-
- ArrayList<Object> items = new ArrayList<Object>();
-
- if (arg0 instanceof WSILDocument) {
- if ((fMode & FLATTEN) == FLATTEN) {
- arg0 = ((WSILDocument)arg0).getInspection() ;
- } else {
- items.add(((WSILDocument)arg0).getInspection());
- }
- }
-
-
- if (arg0 instanceof Inspection) {
- Inspection insp = (Inspection) arg0;
- items.addAll( insp.getServices() );
- items.addAll( insp.getLinks() );
- }
-
- if (arg0 instanceof Link) {
-
- Link link = (Link) arg0;
-
- Bpmn2ModelerResourceSetImpl resourceSet = ModelUtil.slightlyHackedResourceSet ( link );
-
- URI linkURI = null;
-
- try {
- linkURI = URI.createURI( link.getLocation() );
- if (linkURI.isRelative()) {
- // path is relative to me ...
- URI parentURI = link.eResource().getURI();
- linkURI = linkURI.resolve(parentURI);
- }
- } catch (Throwable t) {
- items.add(t);
- return items.toArray();
- }
-
-
- Resource resource = null;
-
- try {
- resource = resourceSet.getResource(linkURI, true, "wsil");
- } catch (Throwable t) {
- items.add(t);
- return items.toArray();
-
- }
-
-
- if (resource != null) {
-
- Object root = resource.getContents().get(0);
- if (root instanceof WSILDocument) {
- WSILDocument doc = (WSILDocument) root;
-
- items.addAll( doc.getInspection().getLinks() );
- items.addAll( doc.getInspection().getServices() );
- } else {
- items.add( new Exception("Not a WSIL document") );
- }
- }
- }
-
- return items.toArray();
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
-
- public Object getParent(Object arg0) {
-
- if (arg0 instanceof EObject) {
- EObject eObj = (EObject) arg0;
- return eObj.eContainer();
- }
- return null;
- }
-
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
-
- public boolean hasChildren(Object arg0) {
-
- return (arg0 instanceof WSILDocument ||
- arg0 instanceof Inspection ||
- arg0 instanceof Link) ;
-
- }
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements (Object arg0) {
- return getChildren(arg0);
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
-
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
-}
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+
+import org.eclipse.bpel.wsil.model.inspection.Inspection;
+import org.eclipse.bpel.wsil.model.inspection.Link;
+import org.eclipse.bpel.wsil.model.inspection.WSILDocument;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+
+/**
+ * WSIIL Content Provider
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @author Edward Gee
+ * @date Apr 5, 2007
+ *
+ */
+
+@SuppressWarnings({"unchecked","nls"})
+
+public class WSILContentProvider implements ITreeContentProvider {
+
+ /**
+ * Flatten the inspection document ( do not return root document )
+ */
+ static public final int FLATTEN = 0x1;
+
+ int fMode = 0;
+
+ /**
+ * Set the mode of operation of this content provider.
+ * @param mode
+ */
+ public void setMode ( int mode ) {
+ fMode = mode;
+ }
+
+
+ /** (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+
+
+
+ public Object[] getChildren (Object arg0) {
+
+ ArrayList<Object> items = new ArrayList<Object>();
+
+ if (arg0 instanceof WSILDocument) {
+ if ((fMode & FLATTEN) == FLATTEN) {
+ arg0 = ((WSILDocument)arg0).getInspection() ;
+ } else {
+ items.add(((WSILDocument)arg0).getInspection());
+ }
+ }
+
+
+ if (arg0 instanceof Inspection) {
+ Inspection insp = (Inspection) arg0;
+ items.addAll( insp.getServices() );
+ items.addAll( insp.getLinks() );
+ }
+
+ if (arg0 instanceof Link) {
+
+ Link link = (Link) arg0;
+
+ Bpmn2ModelerResourceSetImpl resourceSet = ModelUtil.slightlyHackedResourceSet ( link );
+
+ URI linkURI = null;
+
+ try {
+ linkURI = URI.createURI( link.getLocation() );
+ if (linkURI.isRelative()) {
+ // path is relative to me ...
+ URI parentURI = link.eResource().getURI();
+ linkURI = linkURI.resolve(parentURI);
+ }
+ } catch (Throwable t) {
+ items.add(t);
+ return items.toArray();
+ }
+
+
+ Resource resource = null;
+
+ try {
+ resource = resourceSet.getResource(linkURI, true, "wsil");
+ } catch (Throwable t) {
+ items.add(t);
+ return items.toArray();
+
+ }
+
+
+ if (resource != null) {
+
+ Object root = resource.getContents().get(0);
+ if (root instanceof WSILDocument) {
+ WSILDocument doc = (WSILDocument) root;
+
+ items.addAll( doc.getInspection().getLinks() );
+ items.addAll( doc.getInspection().getServices() );
+ } else {
+ items.add( new Exception("Not a WSIL document") );
+ }
+ }
+ }
+
+ return items.toArray();
+ }
+
+ /** (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+
+ public Object getParent(Object arg0) {
+
+ if (arg0 instanceof EObject) {
+ EObject eObj = (EObject) arg0;
+ return eObj.eContainer();
+ }
+ return null;
+ }
+
+
+ /**
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+
+ public boolean hasChildren(Object arg0) {
+
+ return (arg0 instanceof WSILDocument ||
+ arg0 instanceof Inspection ||
+ arg0 instanceof Link) ;
+
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements (Object arg0) {
+ return getChildren(arg0);
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDAttributeDeclarationTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDAttributeDeclarationTreeNode.java
index 5a21dcc..5c3e137 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDAttributeDeclarationTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDAttributeDeclarationTreeNode.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XSDAttributeDeclarationTreeNode extends TreeNode {
-
- public XSDAttributeDeclarationTreeNode(XSDAttributeDeclaration modelObject, boolean isCondensed) {
- super(modelObject, isCondensed);
- }
-
- public XSDAttributeDeclaration getResolvedModelObject() {
- return (XSDAttributeDeclaration)ModelUtil.resolveXSDObject(modelObject);
- }
-
- @Override
- public Object[] getChildren() {
- return EMPTY_ARRAY;
- }
-
- @Override
- public boolean hasChildren() {
- return false;
- }
-
- @Override
- public String getLabel() {
- XSDAttributeDeclaration attribute = getResolvedModelObject();
- String name = attribute.getName();
- return (name != null) ? name : ""; //$NON-NLS-1$
- }
-
- @Override
- public String getLabelSuffix() {
- XSDAttributeDeclaration attribute = getResolvedModelObject();
- XSDTypeDefinition type = attribute.getType();
- return (type != null) ? type.getName() : ""; //$NON-NLS-1$
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class XSDAttributeDeclarationTreeNode extends TreeNode {
+
+ public XSDAttributeDeclarationTreeNode(XSDAttributeDeclaration modelObject, boolean isCondensed) {
+ super(modelObject, isCondensed);
+ }
+
+ public XSDAttributeDeclaration getResolvedModelObject() {
+ return (XSDAttributeDeclaration)ModelUtil.resolveXSDObject(modelObject);
+ }
+
+ @Override
+ public Object[] getChildren() {
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean hasChildren() {
+ return false;
+ }
+
+ @Override
+ public String getLabel() {
+ XSDAttributeDeclaration attribute = getResolvedModelObject();
+ String name = attribute.getName();
+ return (name != null) ? name : ""; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getLabelSuffix() {
+ XSDAttributeDeclaration attribute = getResolvedModelObject();
+ XSDTypeDefinition type = attribute.getType();
+ return (type != null) ? type.getName() : ""; //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDElementDeclarationTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDElementDeclarationTreeNode.java
index bb2e7ab..650687d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDElementDeclarationTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDElementDeclarationTreeNode.java
@@ -1,71 +1,71 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.Vector;
-
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XSDElementDeclarationTreeNode extends XSDTreeNode {
-
- public XSDElementDeclarationTreeNode(XSDElementDeclaration element, boolean isCondensed) {
- super(element, isCondensed);
- }
-
- public XSDElementDeclaration getResolvedModelObject() {
- return (XSDElementDeclaration)ModelUtil.resolveXSDObject(modelObject);
- }
-
- @Override
- public Object[] getChildren() {
- XSDTypeDefinition xsdType = getResolvedModelObject().getType();
- if (xsdType instanceof XSDComplexTypeDefinition) {
- Vector<TreeNode> v = new Vector<TreeNode>();
- XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
- addComplexTypeContent(comp, v);
- return v.toArray();
- }
- return EMPTY_ARRAY;
- }
-
- @Override
- public boolean hasChildren() {
- XSDElementDeclaration element = getResolvedModelObject();
- XSDTypeDefinition xsdType = element.getType();
- if (xsdType == null) {
- xsdType = element.getTypeDefinition();
- }
-
- if (xsdType instanceof XSDComplexTypeDefinition) {
- XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
- return complexTypeHasChildren(comp);
- }
- return false;
- }
-
- @Override
- public String getLabel() {
- XSDElementDeclaration element = getResolvedModelObject();
- String name = element.getName();
- return (name != null) ? name : ""; //$NON-NLS-1$
- }
-
- @Override
- public String getLabelSuffix() {
- XSDElementDeclaration element = getResolvedModelObject();
- XSDTypeDefinition type = element.getType();
- return (type != null) ? type.getName() : null; // note: null, not ""
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.Vector;
+
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class XSDElementDeclarationTreeNode extends XSDTreeNode {
+
+ public XSDElementDeclarationTreeNode(XSDElementDeclaration element, boolean isCondensed) {
+ super(element, isCondensed);
+ }
+
+ public XSDElementDeclaration getResolvedModelObject() {
+ return (XSDElementDeclaration)ModelUtil.resolveXSDObject(modelObject);
+ }
+
+ @Override
+ public Object[] getChildren() {
+ XSDTypeDefinition xsdType = getResolvedModelObject().getType();
+ if (xsdType instanceof XSDComplexTypeDefinition) {
+ Vector<TreeNode> v = new Vector<TreeNode>();
+ XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
+ addComplexTypeContent(comp, v);
+ return v.toArray();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean hasChildren() {
+ XSDElementDeclaration element = getResolvedModelObject();
+ XSDTypeDefinition xsdType = element.getType();
+ if (xsdType == null) {
+ xsdType = element.getTypeDefinition();
+ }
+
+ if (xsdType instanceof XSDComplexTypeDefinition) {
+ XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
+ return complexTypeHasChildren(comp);
+ }
+ return false;
+ }
+
+ @Override
+ public String getLabel() {
+ XSDElementDeclaration element = getResolvedModelObject();
+ String name = element.getName();
+ return (name != null) ? name : ""; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getLabelSuffix() {
+ XSDElementDeclaration element = getResolvedModelObject();
+ XSDTypeDefinition type = element.getType();
+ return (type != null) ? type.getName() : null; // note: null, not ""
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDSchemaTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDSchemaTreeNode.java
index 0a91bb2..66b136d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDSchemaTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDSchemaTreeNode.java
@@ -1,68 +1,68 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-
-import org.eclipse.bpmn2.modeler.ui.Messages;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * Tree node to represent an XSD type model object.
- */
-public class XSDSchemaTreeNode extends XSDTreeNode {
-
- public XSDSchemaTreeNode(XSDSchema schema, boolean isCondensed) {
- super(schema, isCondensed);
- }
-
- @Override
- public boolean isNodeFlattenable() {
- return true;
- }
-
- @Override
- public Object[] getChildren() {
- XSDSchema schema = (XSDSchema)modelObject;
- ArrayList<TreeNode> list = new ArrayList<TreeNode>();
- // addNodes(list, schema.getAttributeDeclarations());
- addNodes(list, schema.getElementDeclarations());
- addNodes(list, schema.getTypeDefinitions());
- return list.toArray();
- }
-
- @Override
- public boolean hasChildren() {
- XSDSchema schema = (XSDSchema)modelObject;
- return schema.getElementDeclarations().size() > 0 ||
- schema.getTypeDefinitions().size() > 0;
- }
-
- @Override
- public String getLabel() {
- XSDSchema schema = (XSDSchema)modelObject;
- schema.getTargetNamespace();
-
- String tns = schema.getTargetNamespace();
- if (tns == null) {
- return Messages.XSDSchemaTreeNode_0;
- }
- return MessageFormat.format(Messages.XSDSchemaTreeNode_1,
- new Object[]{ tns });
- }
-
- @Override
- public String getLabelSuffix() {
- return super.getLabelSuffix();
- }
-}
-
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+
+import org.eclipse.bpmn2.modeler.ui.Messages;
+import org.eclipse.xsd.XSDSchema;
+
+/**
+ * Tree node to represent an XSD type model object.
+ */
+public class XSDSchemaTreeNode extends XSDTreeNode {
+
+ public XSDSchemaTreeNode(XSDSchema schema, boolean isCondensed) {
+ super(schema, isCondensed);
+ }
+
+ @Override
+ public boolean isNodeFlattenable() {
+ return true;
+ }
+
+ @Override
+ public Object[] getChildren() {
+ XSDSchema schema = (XSDSchema)modelObject;
+ ArrayList<TreeNode> list = new ArrayList<TreeNode>();
+ // addNodes(list, schema.getAttributeDeclarations());
+ addNodes(list, schema.getElementDeclarations());
+ addNodes(list, schema.getTypeDefinitions());
+ return list.toArray();
+ }
+
+ @Override
+ public boolean hasChildren() {
+ XSDSchema schema = (XSDSchema)modelObject;
+ return schema.getElementDeclarations().size() > 0 ||
+ schema.getTypeDefinitions().size() > 0;
+ }
+
+ @Override
+ public String getLabel() {
+ XSDSchema schema = (XSDSchema)modelObject;
+ schema.getTargetNamespace();
+
+ String tns = schema.getTargetNamespace();
+ if (tns == null) {
+ return Messages.XSDSchemaTreeNode_0;
+ }
+ return MessageFormat.format(Messages.XSDSchemaTreeNode_1,
+ new Object[]{ tns });
+ }
+
+ @Override
+ public String getLabelSuffix() {
+ return super.getLabelSuffix();
+ }
+}
+
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTreeNode.java
index a180068..9d9877d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTreeNode.java
@@ -1,80 +1,80 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.bpmn2.modeler.ui.util.XSDUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-/**
- * Common base class for XSD-related tree nodes (for helpers etc.)
- */
-public abstract class XSDTreeNode extends TreeNode {
-
- public XSDTreeNode(Object modelObject, boolean isCondensed) {
- super(modelObject, isCondensed);
- }
-
- public static List getInheritedXSDElementsAndAttributes(XSDComplexTypeDefinition complexType) {
- List result = new ArrayList();
- XSDTypeDefinition parent = complexType.getBaseTypeDefinition();
- if (parent instanceof XSDComplexTypeDefinition && complexType.isSetDerivationMethod()) {
- // order switched, from the XSDUtils version
- result.addAll(getInheritedXSDElementsAndAttributes((XSDComplexTypeDefinition)parent));
- result.addAll(XSDUtils.getXSDElementsAndAttributes((XSDComplexTypeDefinition)parent));
- }
- return result;
- }
-
- protected void addComplexTypeContent(XSDComplexTypeDefinition complexType, Vector<TreeNode> v) {
- List attrs = getInheritedXSDElementsAndAttributes(complexType);
- attrs.addAll(XSDUtils.getXSDElementsAndAttributes(complexType));
- for (Iterator it = attrs.iterator(); it.hasNext(); ) {
- Object attr = it.next();
- if (attr instanceof XSDAttributeDeclaration) {
- v.add(new XSDAttributeDeclarationTreeNode((XSDAttributeDeclaration)attr, isCondensed));
- } else if (attr instanceof XSDElementDeclaration) {
- v.add(new XSDElementDeclarationTreeNode((XSDElementDeclaration)attr, isCondensed));
- } else if (attr instanceof XSDComplexTypeDefinition) {
- v.add(new XSDTypeDefinitionTreeNode((XSDComplexTypeDefinition)attr, isCondensed));
- }
- }
- }
-
- protected boolean complexTypeHasChildren(XSDComplexTypeDefinition complexType) {
- if (!XSDUtils.getXSDElementsAndAttributes(complexType).isEmpty()) return true;
- if (!getInheritedXSDElementsAndAttributes(complexType).isEmpty()) return true;
- return false;
- }
-
- protected void addNodes ( List<TreeNode> dstList, List srcList ) {
- Iterator i = srcList.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof XSDAttributeDeclaration) {
- dstList.add(new XSDAttributeDeclarationTreeNode((XSDAttributeDeclaration)obj, isCondensed));
- } else if (obj instanceof XSDElementDeclaration) {
- dstList.add(new XSDElementDeclarationTreeNode((XSDElementDeclaration)obj, isCondensed));
- } else if (obj instanceof XSDTypeDefinition) {
- dstList.add(new XSDTypeDefinitionTreeNode((XSDTypeDefinition)obj, isCondensed));
- }
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.bpmn2.modeler.ui.util.XSDUtils;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+/**
+ * Common base class for XSD-related tree nodes (for helpers etc.)
+ */
+public abstract class XSDTreeNode extends TreeNode {
+
+ public XSDTreeNode(Object modelObject, boolean isCondensed) {
+ super(modelObject, isCondensed);
+ }
+
+ public static List getInheritedXSDElementsAndAttributes(XSDComplexTypeDefinition complexType) {
+ List result = new ArrayList();
+ XSDTypeDefinition parent = complexType.getBaseTypeDefinition();
+ if (parent instanceof XSDComplexTypeDefinition && complexType.isSetDerivationMethod()) {
+ // order switched, from the XSDUtils version
+ result.addAll(getInheritedXSDElementsAndAttributes((XSDComplexTypeDefinition)parent));
+ result.addAll(XSDUtils.getXSDElementsAndAttributes((XSDComplexTypeDefinition)parent));
+ }
+ return result;
+ }
+
+ protected void addComplexTypeContent(XSDComplexTypeDefinition complexType, Vector<TreeNode> v) {
+ List attrs = getInheritedXSDElementsAndAttributes(complexType);
+ attrs.addAll(XSDUtils.getXSDElementsAndAttributes(complexType));
+ for (Iterator it = attrs.iterator(); it.hasNext(); ) {
+ Object attr = it.next();
+ if (attr instanceof XSDAttributeDeclaration) {
+ v.add(new XSDAttributeDeclarationTreeNode((XSDAttributeDeclaration)attr, isCondensed));
+ } else if (attr instanceof XSDElementDeclaration) {
+ v.add(new XSDElementDeclarationTreeNode((XSDElementDeclaration)attr, isCondensed));
+ } else if (attr instanceof XSDComplexTypeDefinition) {
+ v.add(new XSDTypeDefinitionTreeNode((XSDComplexTypeDefinition)attr, isCondensed));
+ }
+ }
+ }
+
+ protected boolean complexTypeHasChildren(XSDComplexTypeDefinition complexType) {
+ if (!XSDUtils.getXSDElementsAndAttributes(complexType).isEmpty()) return true;
+ if (!getInheritedXSDElementsAndAttributes(complexType).isEmpty()) return true;
+ return false;
+ }
+
+ protected void addNodes ( List<TreeNode> dstList, List srcList ) {
+ Iterator i = srcList.iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof XSDAttributeDeclaration) {
+ dstList.add(new XSDAttributeDeclarationTreeNode((XSDAttributeDeclaration)obj, isCondensed));
+ } else if (obj instanceof XSDElementDeclaration) {
+ dstList.add(new XSDElementDeclarationTreeNode((XSDElementDeclaration)obj, isCondensed));
+ } else if (obj instanceof XSDTypeDefinition) {
+ dstList.add(new XSDTypeDefinitionTreeNode((XSDTypeDefinition)obj, isCondensed));
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTypeDefinitionTreeNode.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTypeDefinitionTreeNode.java
index 9f12c0c..3ec6dc4 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTypeDefinitionTreeNode.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/providers/XSDTypeDefinitionTreeNode.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.providers;
-
-import java.util.Vector;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Tree node to represent an XSD type model object.
- */
-public class XSDTypeDefinitionTreeNode extends XSDTreeNode {
-
- public XSDTypeDefinitionTreeNode(XSDTypeDefinition xsdType, boolean isCondensed) {
- super(xsdType, isCondensed);
- }
-
- @Override
- public boolean isNodeFlattenable() { return true; }
-
- @Override
- public Object[] getChildren() {
- XSDTypeDefinition xsdType = (XSDTypeDefinition)modelObject;
- if (xsdType instanceof XSDComplexTypeDefinition) {
- Vector<TreeNode> v = new Vector<TreeNode>();
- XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
- addComplexTypeContent(comp, v);
- return v.toArray();
- }
- return EMPTY_ARRAY;
- }
-
- @Override
- public boolean hasChildren() {
- XSDTypeDefinition xsdType = (XSDTypeDefinition)modelObject;
- if (xsdType instanceof XSDComplexTypeDefinition) {
- XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
- return complexTypeHasChildren(comp);
- }
- return false;
- }
-
- @Override
- public String getLabel() {
- XSDTypeDefinition xsdType = (XSDTypeDefinition)modelObject;
- String name = xsdType.getName();
- return (name != null) ? name : ""; //$NON-NLS-1$
- }
-
- @Override
- public String getLabelSuffix() {
- return super.getLabelSuffix();
- }
-}
-
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.providers;
+
+import java.util.Vector;
+
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+/**
+ * Tree node to represent an XSD type model object.
+ */
+public class XSDTypeDefinitionTreeNode extends XSDTreeNode {
+
+ public XSDTypeDefinitionTreeNode(XSDTypeDefinition xsdType, boolean isCondensed) {
+ super(xsdType, isCondensed);
+ }
+
+ @Override
+ public boolean isNodeFlattenable() { return true; }
+
+ @Override
+ public Object[] getChildren() {
+ XSDTypeDefinition xsdType = (XSDTypeDefinition)modelObject;
+ if (xsdType instanceof XSDComplexTypeDefinition) {
+ Vector<TreeNode> v = new Vector<TreeNode>();
+ XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
+ addComplexTypeContent(comp, v);
+ return v.toArray();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean hasChildren() {
+ XSDTypeDefinition xsdType = (XSDTypeDefinition)modelObject;
+ if (xsdType instanceof XSDComplexTypeDefinition) {
+ XSDComplexTypeDefinition comp = (XSDComplexTypeDefinition) xsdType;
+ return complexTypeHasChildren(comp);
+ }
+ return false;
+ }
+
+ @Override
+ public String getLabel() {
+ XSDTypeDefinition xsdType = (XSDTypeDefinition)modelObject;
+ String name = xsdType.getName();
+ return (name != null) ? name : ""; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getLabelSuffix() {
+ return super.getLabelSuffix();
+ }
+}
+
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputDetailComposite.java
index e949cdb..95633ae 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputDetailComposite.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.InputOutputSpecification;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-public class ActivityInputDetailComposite extends AbstractDetailComposite {
-
- public ActivityInputDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ActivityInputDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- if (be instanceof Activity) {
- Activity abe = (Activity)be;
- InputOutputSpecification ioSpecification = abe.getIoSpecification();
- if (ioSpecification != null) {
- EStructuralFeature feature = getFeature(ioSpecification, "dataInputs");
- bindList(ioSpecification, feature);
- }
- bindList(abe, "dataInputAssociations");
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.InputOutputSpecification;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+public class ActivityInputDetailComposite extends AbstractDetailComposite {
+
+ public ActivityInputDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ActivityInputDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ if (be instanceof Activity) {
+ Activity abe = (Activity)be;
+ InputOutputSpecification ioSpecification = abe.getIoSpecification();
+ if (ioSpecification != null) {
+ EStructuralFeature feature = getFeature(ioSpecification, "dataInputs");
+ bindList(ioSpecification, feature);
+ }
+ bindList(abe, "dataInputAssociations");
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputPropertySection.java
index c47af94..a9e8393 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityInputPropertySection.java
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.InputOutputSpecification;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class ActivityInputPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(Activity.class, ActivityInputDetailComposite.class);
- PropertiesCompositeFactory.register(InputOutputSpecification.class, ActivityInputDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ActivityInputDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ActivityInputDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Activity)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.InputOutputSpecification;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class ActivityInputPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(Activity.class, ActivityInputDetailComposite.class);
+ PropertiesCompositeFactory.register(InputOutputSpecification.class, ActivityInputDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ActivityInputDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ActivityInputDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Activity)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputDetailComposite.java
index 6bef957..7b08e8a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputDetailComposite.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.InputOutputSpecification;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.swt.widgets.Composite;
-
-public class ActivityOutputDetailComposite extends AbstractDetailComposite {
-
- public ActivityOutputDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ActivityOutputDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- if (be instanceof Activity) {
- Activity abe = (Activity)be;
- InputOutputSpecification ioSpecification = abe.getIoSpecification();
- if (ioSpecification != null) {
- EStructuralFeature feature = getFeature(ioSpecification, "dataOutputs");
- bindList(ioSpecification, feature);
- }
- bindList(abe, "dataOutputAssociations");
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.InputOutputSpecification;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.swt.widgets.Composite;
+
+public class ActivityOutputDetailComposite extends AbstractDetailComposite {
+
+ public ActivityOutputDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ActivityOutputDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ if (be instanceof Activity) {
+ Activity abe = (Activity)be;
+ InputOutputSpecification ioSpecification = abe.getIoSpecification();
+ if (ioSpecification != null) {
+ EStructuralFeature feature = getFeature(ioSpecification, "dataOutputs");
+ bindList(ioSpecification, feature);
+ }
+ bindList(abe, "dataOutputAssociations");
+ }
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputPropertySection.java
index 46b0848..d7ee873 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityOutputPropertySection.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class ActivityOutputPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(Activity.class, ActivityOutputDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ActivityOutputDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ActivityOutputDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Activity)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class ActivityOutputPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(Activity.class, ActivityOutputDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ActivityOutputDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ActivityOutputDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Activity)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskDetailComposite.java
index e903be4..41b0918 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskDetailComposite.java
@@ -1,47 +1,47 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class BusinessRuleTaskDetailComposite extends DefaultDetailComposite {
-
- /**
- * @param section
- */
- public BusinessRuleTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public BusinessRuleTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"anyAttribute");
- bindAttribute(be,"implementation");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class BusinessRuleTaskDetailComposite extends DefaultDetailComposite {
+
+ /**
+ * @param section
+ */
+ public BusinessRuleTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public BusinessRuleTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"anyAttribute");
+ bindAttribute(be,"implementation");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskPropertySection.java
index 42e2539..e7bbb6b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/BusinessRuleTaskPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.BusinessRuleTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class BusinessRuleTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(BusinessRuleTask.class, BusinessRuleTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new BusinessRuleTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new BusinessRuleTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof BusinessRuleTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.BusinessRuleTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class BusinessRuleTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(BusinessRuleTask.class, BusinessRuleTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new BusinessRuleTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new BusinessRuleTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof BusinessRuleTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityDetailComposite.java
index 92943c2..b23083c 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityDetailComposite.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.swt.widgets.Composite;
-
-public class CallActivityDetailComposite extends ActivityDetailComposite {
-
- public CallActivityDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public CallActivityDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.swt.widgets.Composite;
+
+public class CallActivityDetailComposite extends ActivityDetailComposite {
+
+ public CallActivityDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public CallActivityDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityPropertySection.java
index 12a1a07..d264f9a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/CallActivityPropertySection.java
@@ -1,103 +1,103 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.CallActivity;
-import org.eclipse.bpmn2.GlobalBusinessRuleTask;
-import org.eclipse.bpmn2.GlobalManualTask;
-import org.eclipse.bpmn2.GlobalScriptTask;
-import org.eclipse.bpmn2.GlobalTask;
-import org.eclipse.bpmn2.GlobalUserTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-/**
- * @author Bob Brodt
- *
- */
-public class CallActivityPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(CallActivity.class, CallActivityDetailComposite.class);
- PropertiesCompositeFactory.register(GlobalTask.class, GlobalTaskDetailComposite.class);
- PropertiesCompositeFactory.register(GlobalBusinessRuleTask.class, GlobalTaskDetailComposite.class);
- PropertiesCompositeFactory.register(GlobalManualTask.class, GlobalTaskDetailComposite.class);
- PropertiesCompositeFactory.register(GlobalScriptTask.class, GlobalTaskDetailComposite.class);
- PropertiesCompositeFactory.register(GlobalUserTask.class, GlobalTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new CallActivityDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new CallActivityDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof CallActivity)
- return be;
- return null;
- }
-
- public class GlobalTaskDetailComposite extends DefaultDetailComposite {
-
- public GlobalTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- public GlobalTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (propertiesProvider==null) {
- propertiesProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "id", // BaseElement
- "name", // CallableElement
- "ioBinding", // CallableElement
- "ioSpecification",// CallableElement
- "supportedInterfaceRefs",// CallableElement
- "resources", // GlobalTask
- "implementation", // GlobalBusinessRuleTask & GlobalUserTask
- "script", // GlobalScriptTask
- "scriptLanguage", // GlobalScriptTask
- "renderings", // GlobalUserTask
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return propertiesProvider;
- }
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.CallActivity;
+import org.eclipse.bpmn2.GlobalBusinessRuleTask;
+import org.eclipse.bpmn2.GlobalManualTask;
+import org.eclipse.bpmn2.GlobalScriptTask;
+import org.eclipse.bpmn2.GlobalTask;
+import org.eclipse.bpmn2.GlobalUserTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class CallActivityPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(CallActivity.class, CallActivityDetailComposite.class);
+ PropertiesCompositeFactory.register(GlobalTask.class, GlobalTaskDetailComposite.class);
+ PropertiesCompositeFactory.register(GlobalBusinessRuleTask.class, GlobalTaskDetailComposite.class);
+ PropertiesCompositeFactory.register(GlobalManualTask.class, GlobalTaskDetailComposite.class);
+ PropertiesCompositeFactory.register(GlobalScriptTask.class, GlobalTaskDetailComposite.class);
+ PropertiesCompositeFactory.register(GlobalUserTask.class, GlobalTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new CallActivityDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new CallActivityDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof CallActivity)
+ return be;
+ return null;
+ }
+
+ public class GlobalTaskDetailComposite extends DefaultDetailComposite {
+
+ public GlobalTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public GlobalTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (propertiesProvider==null) {
+ propertiesProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "id", // BaseElement
+ "name", // CallableElement
+ "ioBinding", // CallableElement
+ "ioSpecification",// CallableElement
+ "supportedInterfaceRefs",// CallableElement
+ "resources", // GlobalTask
+ "implementation", // GlobalBusinessRuleTask & GlobalUserTask
+ "script", // GlobalScriptTask
+ "scriptLanguage", // GlobalScriptTask
+ "renderings", // GlobalUserTask
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return propertiesProvider;
+ }
+
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskDetailComposite.java
index 9499210..e18ca4d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskDetailComposite.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ChoreographyTaskDetailComposite extends DefaultDetailComposite {
-
- private AbstractPropertiesProvider itemProvider;
-
- /**
- * @param section
- */
- public ChoreographyTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public ChoreographyTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- @Override
- public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
- if (itemProvider == null) {
- itemProvider = new AbstractPropertiesProvider(object) {
- String[] properties = new String[] {
- "loopType",
- "initiatingParticipantRef",
- "participantRefs",
- "correlationKeys",
- "messageFlowRef"
- };
-
- @Override
- public String[] getProperties() {
- return properties;
- }
- };
- }
- return itemProvider;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ChoreographyTaskDetailComposite extends DefaultDetailComposite {
+
+ private AbstractPropertiesProvider itemProvider;
+
+ /**
+ * @param section
+ */
+ public ChoreographyTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public ChoreographyTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public AbstractPropertiesProvider getPropertiesProvider(EObject object) {
+ if (itemProvider == null) {
+ itemProvider = new AbstractPropertiesProvider(object) {
+ String[] properties = new String[] {
+ "loopType",
+ "initiatingParticipantRef",
+ "participantRefs",
+ "correlationKeys",
+ "messageFlowRef"
+ };
+
+ @Override
+ public String[] getProperties() {
+ return properties;
+ }
+ };
+ }
+ return itemProvider;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskPropertySection.java
index dde4928..401e8ae 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ChoreographyTaskPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.ChoreographyTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ChoreographyTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ChoreographyTask.class, ChoreographyTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ChoreographyTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ChoreographyTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ChoreographyTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.ChoreographyTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ChoreographyTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ChoreographyTask.class, ChoreographyTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ChoreographyTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ChoreographyTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ChoreographyTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterMappingColumn.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterMappingColumn.java
index 4a24833..c045b24 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterMappingColumn.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterMappingColumn.java
@@ -1,188 +1,188 @@
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import java.util.List;
-
-import org.eclipse.bpmn2.Activity;
-import org.eclipse.bpmn2.Assignment;
-import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CatchEvent;
-import org.eclipse.bpmn2.DataAssociation;
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataInputAssociation;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.DataOutputAssociation;
-import org.eclipse.bpmn2.FormalExpression;
-import org.eclipse.bpmn2.ItemAwareElement;
-import org.eclipse.bpmn2.ThrowEvent;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.viewers.CellEditor;
-
-public class IoParameterMappingColumn extends TableColumn {
-
- protected DataAssociation association = null;
-
- public IoParameterMappingColumn(EObject o, EStructuralFeature f) {
- super(o, f);
- }
-
- @Override
- public String getHeaderText() {
- return ModelUtil.getLabel(
- Bpmn2Package.eINSTANCE.getDataAssociation(),
- feature.getName().startsWith("dataInput") ?
- Bpmn2Package.eINSTANCE.getDataAssociation_SourceRef() :
- Bpmn2Package.eINSTANCE.getDataAssociation_TargetRef()
- );
- }
-
- @Override
- public String getText(Object element) {
- String text = null;
- ItemAwareElement source = (ItemAwareElement)element;
- DataAssociation da = getDataAssociation(source);
- if (da!=null) {
- ItemAwareElement target = getTargetElement(da);
- if (target!=null)
- text = ModelUtil.getDisplayName(target);
- else {
- if (da.getTransformation()!=null) {
- text = "Transform: " + ModelUtil.getDisplayName(da.getTransformation());
- }
- if (!da.getAssignment().isEmpty()) {
- String text2 = null;
- for ( Assignment assign : da.getAssignment()) {
- FormalExpression expr = getTargetExpression(da, assign);
- String body = ModelUtil.getDisplayName(expr);
- if (text2==null)
- text2 = "Expression: " + body;
- else
- text2 += ",\n" + body;
- }
- if (text==null)
- text = text2;
- else
- text += " + " + text2;
- }
- }
- }
- return text==null ? "" : text;
- }
-
- private FormalExpression getTargetExpression(DataAssociation da, Assignment assign) {
- return (FormalExpression) ((da instanceof DataInputAssociation) ? assign.getFrom() : assign.getTo());
- }
-
- @Override
- public Object getValue(Object element, String property) {
- Integer value = new Integer(-1);
- ItemAwareElement source = (ItemAwareElement)element;
- DataAssociation da = getDataAssociation(source);
- if (da!=null) {
- ItemAwareElement target = getTargetElement(da);
- association = da;
- EStructuralFeature f = getTargetFeature(source);
- ((CustomComboBoxCellEditor)cellEditor).setValue(da,f,target);
- value = (Integer)cellEditor.getValue();
- }
- return value;
- }
-
- @Override
- protected CellEditor createCellEditor(Object element, String property) {
- CellEditor ce = new CustomComboBoxCellEditor(getParent(), object, feature);
- setCellEditor(ce);
- return ce;
- }
-
- @Override
- public boolean canModify(Object element, String property) {
- if (super.canModify(element, property)) {
- // only allow the combobox cell editor to work if the DataAssociation is
- // with a Property (no Assignments or Transformations please!)
- // Other types of associations must be done in the Detail section
- DataAssociation da = getDataAssociation((ItemAwareElement)element);
- if (da!= null) {
- if (getTargetElement(da) == null) {
- if (!da.getAssignment().isEmpty() || da.getTransformation()!=null)
- return false;
- }
- return true;
- }
- }
- return false;
- }
-
- public void modify(Object element, String property, Object value) {
- // the real object to be modified is the DataAssociation
- EStructuralFeature f = getTargetFeature((ItemAwareElement)element);
- super.modify(association, f, value);
- }
-
- protected List<DataAssociation> getDataAssociations(ItemAwareElement element) {
- if (element instanceof DataInput)
- return getDataInputAssociations();
- if (element instanceof DataOutput)
- return getDataOutputAssociations();
- return null;
- }
-
- public List getDataInputAssociations() {
- if (object instanceof Activity) {
- return ((Activity)object).getDataInputAssociations();
- }
- else if (object instanceof ThrowEvent) {
- return ((ThrowEvent)object).getDataInputAssociation();
- }
- return null;
- }
-
- public List getDataOutputAssociations() {
- if (object instanceof Activity) {
- return ((Activity)object).getDataOutputAssociations();
- }
- else if (object instanceof CatchEvent) {
- return ((CatchEvent)object).getDataOutputAssociation();
- }
- return null;
- }
-
- protected DataAssociation getDataAssociation(ItemAwareElement element) {
- for (DataAssociation da : getDataAssociations(element)) {
- if (element==getSourceElement(da)) {
- return da;
- }
- }
- return null;
- }
-
- protected ItemAwareElement getSourceElement(DataAssociation da) {
- if (da instanceof DataOutputAssociation) {
- if (da.getSourceRef().size()==1)
- return da.getSourceRef().get(0);
- }
- else if (da instanceof DataInputAssociation) {
- return da.getTargetRef();
- }
- return null;
- }
-
- protected ItemAwareElement getTargetElement(DataAssociation da) {
- if (da instanceof DataInputAssociation) {
- if (da.getSourceRef().size()==1)
- return da.getSourceRef().get(0);
- }
- else if (da instanceof DataOutputAssociation) {
- return da.getTargetRef();
- }
- return null;
- }
-
- protected EStructuralFeature getTargetFeature(ItemAwareElement element) {
- return element instanceof DataInput ?
- Bpmn2Package.eINSTANCE.getDataAssociation_SourceRef() :
- Bpmn2Package.eINSTANCE.getDataAssociation_TargetRef();
- }
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import java.util.List;
+
+import org.eclipse.bpmn2.Activity;
+import org.eclipse.bpmn2.Assignment;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CatchEvent;
+import org.eclipse.bpmn2.DataAssociation;
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataInputAssociation;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.DataOutputAssociation;
+import org.eclipse.bpmn2.FormalExpression;
+import org.eclipse.bpmn2.ItemAwareElement;
+import org.eclipse.bpmn2.ThrowEvent;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.viewers.CellEditor;
+
+public class IoParameterMappingColumn extends TableColumn {
+
+ protected DataAssociation association = null;
+
+ public IoParameterMappingColumn(EObject o, EStructuralFeature f) {
+ super(o, f);
+ }
+
+ @Override
+ public String getHeaderText() {
+ return ModelUtil.getLabel(
+ Bpmn2Package.eINSTANCE.getDataAssociation(),
+ feature.getName().startsWith("dataInput") ?
+ Bpmn2Package.eINSTANCE.getDataAssociation_SourceRef() :
+ Bpmn2Package.eINSTANCE.getDataAssociation_TargetRef()
+ );
+ }
+
+ @Override
+ public String getText(Object element) {
+ String text = null;
+ ItemAwareElement source = (ItemAwareElement)element;
+ DataAssociation da = getDataAssociation(source);
+ if (da!=null) {
+ ItemAwareElement target = getTargetElement(da);
+ if (target!=null)
+ text = ModelUtil.getDisplayName(target);
+ else {
+ if (da.getTransformation()!=null) {
+ text = "Transform: " + ModelUtil.getDisplayName(da.getTransformation());
+ }
+ if (!da.getAssignment().isEmpty()) {
+ String text2 = null;
+ for ( Assignment assign : da.getAssignment()) {
+ FormalExpression expr = getTargetExpression(da, assign);
+ String body = ModelUtil.getDisplayName(expr);
+ if (text2==null)
+ text2 = "Expression: " + body;
+ else
+ text2 += ",\n" + body;
+ }
+ if (text==null)
+ text = text2;
+ else
+ text += " + " + text2;
+ }
+ }
+ }
+ return text==null ? "" : text;
+ }
+
+ private FormalExpression getTargetExpression(DataAssociation da, Assignment assign) {
+ return (FormalExpression) ((da instanceof DataInputAssociation) ? assign.getFrom() : assign.getTo());
+ }
+
+ @Override
+ public Object getValue(Object element, String property) {
+ Integer value = new Integer(-1);
+ ItemAwareElement source = (ItemAwareElement)element;
+ DataAssociation da = getDataAssociation(source);
+ if (da!=null) {
+ ItemAwareElement target = getTargetElement(da);
+ association = da;
+ EStructuralFeature f = getTargetFeature(source);
+ ((CustomComboBoxCellEditor)cellEditor).setValue(da,f,target);
+ value = (Integer)cellEditor.getValue();
+ }
+ return value;
+ }
+
+ @Override
+ protected CellEditor createCellEditor(Object element, String property) {
+ CellEditor ce = new CustomComboBoxCellEditor(getParent(), object, feature);
+ setCellEditor(ce);
+ return ce;
+ }
+
+ @Override
+ public boolean canModify(Object element, String property) {
+ if (super.canModify(element, property)) {
+ // only allow the combobox cell editor to work if the DataAssociation is
+ // with a Property (no Assignments or Transformations please!)
+ // Other types of associations must be done in the Detail section
+ DataAssociation da = getDataAssociation((ItemAwareElement)element);
+ if (da!= null) {
+ if (getTargetElement(da) == null) {
+ if (!da.getAssignment().isEmpty() || da.getTransformation()!=null)
+ return false;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ // the real object to be modified is the DataAssociation
+ EStructuralFeature f = getTargetFeature((ItemAwareElement)element);
+ super.modify(association, f, value);
+ }
+
+ protected List<DataAssociation> getDataAssociations(ItemAwareElement element) {
+ if (element instanceof DataInput)
+ return getDataInputAssociations();
+ if (element instanceof DataOutput)
+ return getDataOutputAssociations();
+ return null;
+ }
+
+ public List getDataInputAssociations() {
+ if (object instanceof Activity) {
+ return ((Activity)object).getDataInputAssociations();
+ }
+ else if (object instanceof ThrowEvent) {
+ return ((ThrowEvent)object).getDataInputAssociation();
+ }
+ return null;
+ }
+
+ public List getDataOutputAssociations() {
+ if (object instanceof Activity) {
+ return ((Activity)object).getDataOutputAssociations();
+ }
+ else if (object instanceof CatchEvent) {
+ return ((CatchEvent)object).getDataOutputAssociation();
+ }
+ return null;
+ }
+
+ protected DataAssociation getDataAssociation(ItemAwareElement element) {
+ for (DataAssociation da : getDataAssociations(element)) {
+ if (element==getSourceElement(da)) {
+ return da;
+ }
+ }
+ return null;
+ }
+
+ protected ItemAwareElement getSourceElement(DataAssociation da) {
+ if (da instanceof DataOutputAssociation) {
+ if (da.getSourceRef().size()==1)
+ return da.getSourceRef().get(0);
+ }
+ else if (da instanceof DataInputAssociation) {
+ return da.getTargetRef();
+ }
+ return null;
+ }
+
+ protected ItemAwareElement getTargetElement(DataAssociation da) {
+ if (da instanceof DataInputAssociation) {
+ if (da.getSourceRef().size()==1)
+ return da.getSourceRef().get(0);
+ }
+ else if (da instanceof DataOutputAssociation) {
+ return da.getTargetRef();
+ }
+ return null;
+ }
+
+ protected EStructuralFeature getTargetFeature(ItemAwareElement element) {
+ return element instanceof DataInput ?
+ Bpmn2Package.eINSTANCE.getDataAssociation_SourceRef() :
+ Bpmn2Package.eINSTANCE.getDataAssociation_TargetRef();
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterNameColumn.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterNameColumn.java
index 0425176..603e594 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterNameColumn.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParameterNameColumn.java
@@ -1,12 +1,12 @@
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-public class IoParameterNameColumn extends TableColumn {
-
- public IoParameterNameColumn(EObject o, EStructuralFeature f) {
- super(o, f);
- }
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+public class IoParameterNameColumn extends TableColumn {
+
+ public IoParameterNameColumn(EObject o, EStructuralFeature f) {
+ super(o, f);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParametersPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParametersPropertySection.java
index 441abe0..39b0f3a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParametersPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoParametersPropertySection.java
@@ -1,75 +1,75 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.InputOutputSpecification;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class IoParametersPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(InputOutputSpecification.class, IoParametersDetailComposite.class);
- PropertiesCompositeFactory.register(DataInput.class, DataAssociationDetailComposite.class);
- PropertiesCompositeFactory.register(DataOutput.class, DataAssociationDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new IoParametersDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new IoParametersDetailComposite(parent,style);
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- if (super.appliesTo(part, selection)) {
- ModelEnablementDescriptor modelEnablement = getModelEnablement(selection);
- EObject selectionBO = BusinessObjectUtil.getBusinessObjectForSelection(selection);
- EStructuralFeature feature = selectionBO.eClass().getEStructuralFeature("ioSpecification");
- if (feature != null) {
- if (!modelEnablement.isEnabled(selectionBO.eClass(), feature))
- return false;
- }
- return true;
- }
- return false;
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be!=null) {
- EStructuralFeature feature = be.eClass().getEStructuralFeature("ioSpecification");
- if (feature != null)
- return be;
- }
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.DataInput;
+import org.eclipse.bpmn2.DataOutput;
+import org.eclipse.bpmn2.InputOutputSpecification;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class IoParametersPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(InputOutputSpecification.class, IoParametersDetailComposite.class);
+ PropertiesCompositeFactory.register(DataInput.class, DataAssociationDetailComposite.class);
+ PropertiesCompositeFactory.register(DataOutput.class, DataAssociationDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new IoParametersDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new IoParametersDetailComposite(parent,style);
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ if (super.appliesTo(part, selection)) {
+ ModelEnablementDescriptor modelEnablement = getModelEnablement(selection);
+ EObject selectionBO = BusinessObjectUtil.getBusinessObjectForSelection(selection);
+ EStructuralFeature feature = selectionBO.eClass().getEStructuralFeature("ioSpecification");
+ if (feature != null) {
+ if (!modelEnablement.isEnabled(selectionBO.eClass(), feature))
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be!=null) {
+ EStructuralFeature feature = be.eClass().getEStructuralFeature("ioSpecification");
+ if (feature != null)
+ return be;
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ManualTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ManualTaskPropertySection.java
index 2ac76e3..6101e46 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ManualTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ManualTaskPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.ManualTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ManualTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ManualTask.class, ManualTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ManualTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ManualTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ManualTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.ManualTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ManualTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ManualTask.class, ManualTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ManualTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ManualTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ManualTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java
index 3e984d1..2fa4126 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java
@@ -1,26 +1,26 @@
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class MultiInstanceLoopCharacteristicsDetailComposite extends
- DefaultDetailComposite {
-
- public MultiInstanceLoopCharacteristicsDetailComposite(Composite parent,
- int style) {
- super(parent, style);
- }
-
- public MultiInstanceLoopCharacteristicsDetailComposite(
- AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- public void createBindings(EObject be) {
- bindAttribute(be,"testBefore");
- bindReference(be,"loopCondition");
- bindReference(be,"loopMaximum");
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class MultiInstanceLoopCharacteristicsDetailComposite extends
+ DefaultDetailComposite {
+
+ public MultiInstanceLoopCharacteristicsDetailComposite(Composite parent,
+ int style) {
+ super(parent, style);
+ }
+
+ public MultiInstanceLoopCharacteristicsDetailComposite(
+ AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ public void createBindings(EObject be) {
+ bindAttribute(be,"testBefore");
+ bindReference(be,"loopCondition");
+ bindReference(be,"loopMaximum");
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskDetailComposite.java
index c88c97c..75ecb28 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskDetailComposite.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ReceiveTaskDetailComposite extends DefaultDetailComposite {
-
- public ReceiveTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ReceiveTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"implementation");
- bindAttribute(be,"instantiate");
- bindReference(be,"messageRef");
- bindReference(be,"operationRef");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ReceiveTaskDetailComposite extends DefaultDetailComposite {
+
+ public ReceiveTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ReceiveTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"implementation");
+ bindAttribute(be,"instantiate");
+ bindReference(be,"messageRef");
+ bindReference(be,"operationRef");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskPropertySection.java
index 6e5d613..81aa7b5 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ReceiveTaskPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.ReceiveTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ReceiveTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ReceiveTask.class, ReceiveTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ReceiveTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ReceiveTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ReceiveTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.ReceiveTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ReceiveTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ReceiveTask.class, ReceiveTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ReceiveTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ReceiveTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ReceiveTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskDetailComposite.java
index 1d3545e..1f269e2 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskDetailComposite.java
@@ -1,60 +1,60 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
-import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-
-public class ScriptTaskDetailComposite extends DefaultDetailComposite {
-
- private TextObjectEditor scriptEditor;
-
- public ScriptTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ScriptTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- scriptEditor = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"scriptFormat");
-// bindAttribute(be,"script");
- scriptEditor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("script"));
- scriptEditor.createControl(getAttributesParent(),"Script",SWT.MULTI);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+public class ScriptTaskDetailComposite extends DefaultDetailComposite {
+
+ private TextObjectEditor scriptEditor;
+
+ public ScriptTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ScriptTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ scriptEditor = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"scriptFormat");
+// bindAttribute(be,"script");
+ scriptEditor = new TextObjectEditor(this,be,be.eClass().getEStructuralFeature("script"));
+ scriptEditor.createControl(getAttributesParent(),"Script",SWT.MULTI);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskPropertySection.java
index 880995e..ce1f2fb 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ScriptTaskPropertySection.java
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.ScriptTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ScriptTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ScriptTask.class, ScriptTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ScriptTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ScriptTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
- if (be instanceof ScriptTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.ScriptTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ScriptTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ScriptTask.class, ScriptTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ScriptTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ScriptTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
+ if (be instanceof ScriptTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskDetailComposite.java
index 647f2b1..f0f09c5 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskDetailComposite.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class SendTaskDetailComposite extends DefaultDetailComposite {
-
- public SendTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public SendTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"implementation");
- bindReference(be,"messageRef");
- bindReference(be,"operationRef");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class SendTaskDetailComposite extends DefaultDetailComposite {
+
+ public SendTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public SendTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"implementation");
+ bindReference(be,"messageRef");
+ bindReference(be,"operationRef");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskPropertySection.java
index 85bac3d..e79ce34 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SendTaskPropertySection.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.SendTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class SendTaskPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(SendTask.class, SendTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new SendTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new SendTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof SendTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.SendTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class SendTaskPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(SendTask.class, SendTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new SendTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new SendTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof SendTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskDetailComposite.java
index d860979..8322e06 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskDetailComposite.java
@@ -1,47 +1,47 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class ServiceTaskDetailComposite extends DefaultDetailComposite {
-
- public ServiceTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public ServiceTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"implementation");
- bindReference(be,"operationRef");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class ServiceTaskDetailComposite extends DefaultDetailComposite {
+
+ public ServiceTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public ServiceTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"implementation");
+ bindReference(be,"operationRef");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskPropertySection.java
index 95620ad..abc720d 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ServiceTaskPropertySection.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.ServiceTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-public class ServiceTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(ServiceTask.class, ServiceTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new ServiceTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new ServiceTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof ServiceTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.ServiceTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+public class ServiceTaskPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(ServiceTask.class, ServiceTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new ServiceTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ServiceTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof ServiceTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/StandardLoopCharacteristicsDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/StandardLoopCharacteristicsDetailComposite.java
index 55a8794..0c10e42 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/StandardLoopCharacteristicsDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/StandardLoopCharacteristicsDetailComposite.java
@@ -1,116 +1,116 @@
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.Expression;
-import org.eclipse.bpmn2.StandardLoopCharacteristics;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class StandardLoopCharacteristicsDetailComposite extends
- DefaultDetailComposite {
-
- private Button addRemoveLoopConditionExpressionButton;
- private Button addRemoveLoopMaximumExpressionButton;
-
- public StandardLoopCharacteristicsDetailComposite(Composite parent,
- int style) {
- super(parent, style);
- }
-
- public StandardLoopCharacteristicsDetailComposite(
- AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- addRemoveLoopConditionExpressionButton = null;
- addRemoveLoopMaximumExpressionButton = null;
- }
-
- public void createBindings(EObject be) {
- bindAttribute(be,"testBefore");
-
- if (be instanceof StandardLoopCharacteristics) {
-
- final StandardLoopCharacteristics standardLoop = (StandardLoopCharacteristics) be;
-
- addRemoveLoopConditionExpressionButton = new Button(this, SWT.PUSH);
- addRemoveLoopConditionExpressionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
- addRemoveLoopConditionExpressionButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- @SuppressWarnings("restriction")
- TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- if (standardLoop.getLoopCondition() !=null)
- standardLoop.setLoopCondition(null);
- else {
- Expression exp = FACTORY.createFormalExpression();
- standardLoop.setLoopCondition(exp);
- ModelUtil.setID(exp);
- }
- setBusinessObject(standardLoop);
- }
- });
- }
- });
-
- addRemoveLoopMaximumExpressionButton = new Button(this, SWT.PUSH);
- addRemoveLoopMaximumExpressionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
- addRemoveLoopMaximumExpressionButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- @SuppressWarnings("restriction")
- TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- if (standardLoop.getLoopMaximum() !=null)
- standardLoop.setLoopMaximum(null);
- else {
- Expression exp = FACTORY.createFormalExpression();
- standardLoop.setLoopMaximum(exp);
- ModelUtil.setID(exp);
- }
- setBusinessObject(standardLoop);
- }
- });
- }
- });
-
- Expression loopexp = (Expression) standardLoop.getLoopCondition();
- Expression maxexp = (Expression) standardLoop.getLoopMaximum();
-
- if (loopexp != null) {
- addRemoveLoopConditionExpressionButton.setText("Remove Loop Condition");
- this.businessObject = loopexp;
- super.createBindings(loopexp);
- }
- else {
- addRemoveLoopConditionExpressionButton.setText("Add Loop Condition");
- }
-
- if (maxexp != null) {
- addRemoveLoopMaximumExpressionButton.setText("Remove Loop Maximum");
- this.businessObject = maxexp;
- super.createBindings(maxexp);
- }
- else {
- addRemoveLoopMaximumExpressionButton.setText("Add Loop Maximum");
- }
- }
- }
-}
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.Expression;
+import org.eclipse.bpmn2.StandardLoopCharacteristics;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+public class StandardLoopCharacteristicsDetailComposite extends
+ DefaultDetailComposite {
+
+ private Button addRemoveLoopConditionExpressionButton;
+ private Button addRemoveLoopMaximumExpressionButton;
+
+ public StandardLoopCharacteristicsDetailComposite(Composite parent,
+ int style) {
+ super(parent, style);
+ }
+
+ public StandardLoopCharacteristicsDetailComposite(
+ AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ addRemoveLoopConditionExpressionButton = null;
+ addRemoveLoopMaximumExpressionButton = null;
+ }
+
+ public void createBindings(EObject be) {
+ bindAttribute(be,"testBefore");
+
+ if (be instanceof StandardLoopCharacteristics) {
+
+ final StandardLoopCharacteristics standardLoop = (StandardLoopCharacteristics) be;
+
+ addRemoveLoopConditionExpressionButton = new Button(this, SWT.PUSH);
+ addRemoveLoopConditionExpressionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
+ addRemoveLoopConditionExpressionButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ @SuppressWarnings("restriction")
+ TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ if (standardLoop.getLoopCondition() !=null)
+ standardLoop.setLoopCondition(null);
+ else {
+ Expression exp = FACTORY.createFormalExpression();
+ standardLoop.setLoopCondition(exp);
+ ModelUtil.setID(exp);
+ }
+ setBusinessObject(standardLoop);
+ }
+ });
+ }
+ });
+
+ addRemoveLoopMaximumExpressionButton = new Button(this, SWT.PUSH);
+ addRemoveLoopMaximumExpressionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
+ addRemoveLoopMaximumExpressionButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ @SuppressWarnings("restriction")
+ TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ if (standardLoop.getLoopMaximum() !=null)
+ standardLoop.setLoopMaximum(null);
+ else {
+ Expression exp = FACTORY.createFormalExpression();
+ standardLoop.setLoopMaximum(exp);
+ ModelUtil.setID(exp);
+ }
+ setBusinessObject(standardLoop);
+ }
+ });
+ }
+ });
+
+ Expression loopexp = (Expression) standardLoop.getLoopCondition();
+ Expression maxexp = (Expression) standardLoop.getLoopMaximum();
+
+ if (loopexp != null) {
+ addRemoveLoopConditionExpressionButton.setText("Remove Loop Condition");
+ this.businessObject = loopexp;
+ super.createBindings(loopexp);
+ }
+ else {
+ addRemoveLoopConditionExpressionButton.setText("Add Loop Condition");
+ }
+
+ if (maxexp != null) {
+ addRemoveLoopMaximumExpressionButton.setText("Remove Loop Maximum");
+ this.businessObject = maxexp;
+ super.createBindings(maxexp);
+ }
+ else {
+ addRemoveLoopMaximumExpressionButton.setText("Add Loop Maximum");
+ }
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SubProcessPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SubProcessPropertySection.java
index 70bd66c..510c66b 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SubProcessPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/SubProcessPropertySection.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.SubProcess;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-
-/**
- * @author Bob Brodt
- *
- */
-public class SubProcessPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
- static {
- PropertiesCompositeFactory.register(SubProcess.class, SubProcessDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new SubProcessDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new SubProcessDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof SubProcess)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.SubProcess;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class SubProcessPropertySection extends AbstractBpmn2PropertySection implements ITabbedPropertyConstants {
+ static {
+ PropertiesCompositeFactory.register(SubProcess.class, SubProcessDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new SubProcessDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new SubProcessDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof SubProcess)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskDetailComposite.java
index 21b5610..d61b1f1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskDetailComposite.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class TaskDetailComposite extends ActivityDetailComposite {
-
- public TaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public TaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- super.createBindings(be);
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class TaskDetailComposite extends ActivityDetailComposite {
+
+ public TaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public TaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ super.createBindings(be);
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskPropertySection.java
index f78ec79..8e02bfd 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/TaskPropertySection.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDialogComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class TaskPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(Task.class, TaskDetailComposite.class);
- }
-
- public TaskPropertySection() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new TaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new TaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof Task)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.Task;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDialogComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class TaskPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(Task.class, TaskDetailComposite.class);
+ }
+
+ public TaskPropertySection() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new TaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new TaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof Task)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskDetailComposite.java
index 1487838..330ee67 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskDetailComposite.java
@@ -1,47 +1,47 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-
-public class UserTaskDetailComposite extends DefaultDetailComposite {
-
- public UserTaskDetailComposite(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public UserTaskDetailComposite(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
- * #createBindings(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void createBindings(EObject be) {
- bindAttribute(be,"implementation");
- bindList(be, "renderings");
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+
+public class UserTaskDetailComposite extends DefaultDetailComposite {
+
+ public UserTaskDetailComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public UserTaskDetailComposite(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2DetailComposite
+ * #createBindings(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void createBindings(EObject be) {
+ bindAttribute(be,"implementation");
+ bindList(be, "renderings");
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskPropertySection.java
index 96287e8..54fb773 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/UserTaskPropertySection.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.property.tasks;
-
-import org.eclipse.bpmn2.UserTask;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.swt.widgets.Composite;
-
-public class UserTaskPropertySection extends AbstractBpmn2PropertySection {
- static {
- PropertiesCompositeFactory.register(UserTask.class, UserTaskDetailComposite.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
- */
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new UserTaskDetailComposite(this);
- }
-
- @Override
- public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
- return new UserTaskDetailComposite(parent,style);
- }
-
- @Override
- protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
- EObject be = super.getBusinessObjectForPictogramElement(pe);
- if (be instanceof UserTask)
- return be;
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.tasks;
+
+import org.eclipse.bpmn2.UserTask;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.PropertiesCompositeFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.swt.widgets.Composite;
+
+public class UserTaskPropertySection extends AbstractBpmn2PropertySection {
+ static {
+ PropertiesCompositeFactory.register(UserTask.class, UserTaskDetailComposite.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
+ */
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new UserTaskDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new UserTaskDetailComposite(parent,style);
+ }
+
+ @Override
+ protected EObject getBusinessObjectForPictogramElement(PictogramElement pe) {
+ EObject be = super.getBusinessObjectForPictogramElement(pe);
+ if (be instanceof UserTask)
+ return be;
+ return null;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/ListMap.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/ListMap.java
index 78f3767..86e40b6 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/ListMap.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/ListMap.java
@@ -1,155 +1,155 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.util;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * A little bit of LISP.
- *
- * @author Michal Chmielewski (michal.chmielewski@oracle.com)
- * @date Jul 19, 2006
- *
- */
-public class ListMap {
-
- /**
- *
- */
- static final public Object IGNORE = new Object();
-
- /**
- * Interface visitor. The object returned from visit need not be the same
- * object as passed to visit. If IGNORE is returned (above), then
- * the resulting value will not be added to the resulting list.
- */
-
- static public interface Visitor {
- /**
- * @param obj the object to visit.
- * @return some other object, the object itself, or IGNORE
- */
- public Object visit ( Object obj );
- }
-
-
- /**
- * Map the visitor "visitor" on the list "list" and return the result as a list.
- *
- * @param list the list of objects
- * @param visitor the visitor
- * @return the resulting (new) list
- */
-
- static public Object Map (List<?> list, Visitor visitor) {
- return Map(list,visitor,null);
- }
-
-
-
- /**
- * Map the visitor "visitor" on the list "list" and return the result as a list. If the list argument
- * is passed (ret) the result is returned as an array of the results, otherwise it is a list.
- *
- * @param list the list of objects
- * @param visitor the visitor
- * @param ret the array class to convert the results into.
- * @return the resulting (new) list
- */
- static public Object Map ( List<?> list, Visitor visitor , Object[] ret ) {
- List<Object> output = new ArrayList<Object>(list.size());
- for(Object n : list) {
- Object result = visitor.visit(n);
- if (result != IGNORE) {
- output.add( result );
- }
- }
- if (ret == null) {
- return output;
- }
-
- return output.toArray(ret);
- }
-
-
- /**
- * Map the visitor "visitor" on the list "list" and return the result as a list.
- *
- * @param list the list of objects
- * @param visitor the visitor
- * @return the resulting (new) list
- *
- */
- static public Object Map ( Object[] list, Visitor visitor ) {
- return Map(list,visitor,null);
- }
-
-
- /**
- * Map the visitor "visitor" on the list "list" and return the result as a list. If the list argument
- * is passed (ret) the result is returned as an array of the results, otherwise it is a list.
- *
- * @param list the list of objects
- * @param visitor the visitor
- * @param ret the array class to convert the results into.
- * @return the resulting (new) list
- */
-
- static public Object Map (Object[] list, Visitor visitor, Object[] ret) {
- List<Object> l2 = new ArrayList<Object>(list.length);
- for( Object n : list) {
- l2.add(n);
- }
- return Map ( l2, visitor , ret);
- }
-
-
- /**
- * @param list the list of objects.
- * @param visitor the visitor
- * @return the object found or null
- */
- static public final Object Find (List<?> list, Visitor visitor) {
- for(Object n : list) {
- Object result = visitor.visit ( n );
- if (result != IGNORE) {
- return result;
- }
- }
- return null;
- }
-
-
-
-
-
- /**
- * Find the parameter using the comparator in the list.
- *
- * @param list
- * @param key
- * @param comparator
- * @return the parameter found or null
- */
-
- public static Object findElement (List<?> list, Object key, Comparator<Object> comparator) {
- for (Object n : list) {
- if (comparator.compare(n, key) == 0) {
- return n;
- }
- }
- return null;
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.util;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * A little bit of LISP.
+ *
+ * @author Michal Chmielewski (michal.chmielewski@oracle.com)
+ * @date Jul 19, 2006
+ *
+ */
+public class ListMap {
+
+ /**
+ *
+ */
+ static final public Object IGNORE = new Object();
+
+ /**
+ * Interface visitor. The object returned from visit need not be the same
+ * object as passed to visit. If IGNORE is returned (above), then
+ * the resulting value will not be added to the resulting list.
+ */
+
+ static public interface Visitor {
+ /**
+ * @param obj the object to visit.
+ * @return some other object, the object itself, or IGNORE
+ */
+ public Object visit ( Object obj );
+ }
+
+
+ /**
+ * Map the visitor "visitor" on the list "list" and return the result as a list.
+ *
+ * @param list the list of objects
+ * @param visitor the visitor
+ * @return the resulting (new) list
+ */
+
+ static public Object Map (List<?> list, Visitor visitor) {
+ return Map(list,visitor,null);
+ }
+
+
+
+ /**
+ * Map the visitor "visitor" on the list "list" and return the result as a list. If the list argument
+ * is passed (ret) the result is returned as an array of the results, otherwise it is a list.
+ *
+ * @param list the list of objects
+ * @param visitor the visitor
+ * @param ret the array class to convert the results into.
+ * @return the resulting (new) list
+ */
+ static public Object Map ( List<?> list, Visitor visitor , Object[] ret ) {
+ List<Object> output = new ArrayList<Object>(list.size());
+ for(Object n : list) {
+ Object result = visitor.visit(n);
+ if (result != IGNORE) {
+ output.add( result );
+ }
+ }
+ if (ret == null) {
+ return output;
+ }
+
+ return output.toArray(ret);
+ }
+
+
+ /**
+ * Map the visitor "visitor" on the list "list" and return the result as a list.
+ *
+ * @param list the list of objects
+ * @param visitor the visitor
+ * @return the resulting (new) list
+ *
+ */
+ static public Object Map ( Object[] list, Visitor visitor ) {
+ return Map(list,visitor,null);
+ }
+
+
+ /**
+ * Map the visitor "visitor" on the list "list" and return the result as a list. If the list argument
+ * is passed (ret) the result is returned as an array of the results, otherwise it is a list.
+ *
+ * @param list the list of objects
+ * @param visitor the visitor
+ * @param ret the array class to convert the results into.
+ * @return the resulting (new) list
+ */
+
+ static public Object Map (Object[] list, Visitor visitor, Object[] ret) {
+ List<Object> l2 = new ArrayList<Object>(list.length);
+ for( Object n : list) {
+ l2.add(n);
+ }
+ return Map ( l2, visitor , ret);
+ }
+
+
+ /**
+ * @param list the list of objects.
+ * @param visitor the visitor
+ * @return the object found or null
+ */
+ static public final Object Find (List<?> list, Visitor visitor) {
+ for(Object n : list) {
+ Object result = visitor.visit ( n );
+ if (result != IGNORE) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+
+
+
+
+ /**
+ * Find the parameter using the comparator in the list.
+ *
+ * @param list
+ * @param key
+ * @param comparator
+ * @return the parameter found or null
+ */
+
+ public static Object findElement (List<?> list, Object key, Comparator<Object> comparator) {
+ for (Object n : list) {
+ if (comparator.compare(n, key) == 0) {
+ return n;
+ }
+ }
+ return null;
+ }
+
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/PropertyUtil.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/PropertyUtil.java
index 6b90c92..115220a 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/PropertyUtil.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/PropertyUtil.java
@@ -39,13 +39,13 @@
System.err.println(name+" disposed!");
return;
}
- if (control instanceof Composite) {
- ((Composite)control).layout(true);
- }
- control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point sz = control.getSize();
- if (sz.x==0 || sz.y==0)
- System.err.println(name+" zero size!");
+// if (control instanceof Composite) {
+// ((Composite)control).layout(true);
+// }
+// control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+// Point sz = control.getSize();
+// if (sz.x==0 || sz.y==0)
+// System.err.println(name+" zero size!");
}
public static void dump(Composite parent, String comment) {
@@ -68,7 +68,9 @@
for (Control k : kids) {
for (int i=0; i<indent; ++i)
System.out.print("|");
- System.out.print(" "+k);
+ System.out.print(" "+k+" layoutData="+k.getLayoutData());
+ if (k instanceof Composite)
+ System.out.print(" layout="+((Composite)k).getLayout());
check(k);
if (k instanceof Label) {
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/XSDUtils.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/XSDUtils.java
index dddd9d6..f710515 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/XSDUtils.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/util/XSDUtils.java
@@ -1,1242 +1,1242 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDAttributeUseCategory;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDConstraint;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaCompositor;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.XSDXPathDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * Collection of utility methods for dealing with navigation of the XSD model
- */
-public class XSDUtils {
-
- // singleton lists of XSD simple type definitions for supported primitives (see getPrimitives()) and
- // all xsd primitives (see getAdvancedPrimitives()) respectively
- private static List<XSDSimpleTypeDefinition> primitives;
- private static List<XSDTypeDefinition> advancedPrimitives;
-
- // XSD short list -- these are the types presented to the user by default, rather than inundating them with
- // all the available types
- private static List<String> xsdShortList = new ArrayList<String>();
- static
- {
- xsdShortList.add("string"); //$NON-NLS-1$
- xsdShortList.add("int"); //$NON-NLS-1$
- xsdShortList.add("double"); //$NON-NLS-1$
- xsdShortList.add("date"); //$NON-NLS-1$
- xsdShortList.add("time"); //$NON-NLS-1$
- xsdShortList.add("dateTime"); //$NON-NLS-1$
- xsdShortList.add("boolean"); //$NON-NLS-1$
- xsdShortList.add("hexBinary"); //$NON-NLS-1$
- xsdShortList.add("float"); //$NON-NLS-1$
- }
-
-
- // A list of all supported XSD types. Usually the user will not be presented with the full list, but
- // rather with the xsd short list
- private static List<String> supportedPrimitives = new ArrayList<String>();
- static {
- supportedPrimitives.add("anyType"); //$NON-NLS-1$
- supportedPrimitives.add("anyURI"); //$NON-NLS-1$
- supportedPrimitives.add("base64Binary"); //$NON-NLS-1$
- supportedPrimitives.add("boolean"); //$NON-NLS-1$
- supportedPrimitives.add("byte"); //$NON-NLS-1$
- supportedPrimitives.add("date"); //$NON-NLS-1$
- supportedPrimitives.add("dateTime"); //$NON-NLS-1$
- supportedPrimitives.add("decimal"); //$NON-NLS-1$
- supportedPrimitives.add("double"); //$NON-NLS-1$
- supportedPrimitives.add("duration"); //$NON-NLS-1$
- supportedPrimitives.add("ENTITIES"); //$NON-NLS-1$
- supportedPrimitives.add("ENTITY"); //$NON-NLS-1$
- supportedPrimitives.add("float"); //$NON-NLS-1$
- supportedPrimitives.add("gDay"); //$NON-NLS-1$
- supportedPrimitives.add("gMonth"); //$NON-NLS-1$
- supportedPrimitives.add("gMonthDay"); //$NON-NLS-1$
- supportedPrimitives.add("gYear"); //$NON-NLS-1$
- supportedPrimitives.add("gYearMonth"); //$NON-NLS-1$
- supportedPrimitives.add("hexBinary"); //$NON-NLS-1$
- supportedPrimitives.add("ID"); //$NON-NLS-1$
- supportedPrimitives.add("IDREF"); //$NON-NLS-1$
- supportedPrimitives.add("IDREFS"); //$NON-NLS-1$
- supportedPrimitives.add("int"); //$NON-NLS-1$
- supportedPrimitives.add("integer"); //$NON-NLS-1$
- supportedPrimitives.add("language"); //$NON-NLS-1$
- supportedPrimitives.add("long"); //$NON-NLS-1$
- supportedPrimitives.add("Name"); //$NON-NLS-1$
- supportedPrimitives.add("NCName"); //$NON-NLS-1$
- supportedPrimitives.add("negativeInteger"); //$NON-NLS-1$
- supportedPrimitives.add("NMTOKEN"); //$NON-NLS-1$
- supportedPrimitives.add("NMTOKENS"); //$NON-NLS-1$, "NMTOKENS");
- supportedPrimitives.add("nonNegativeInteger"); //$NON-NLS-1$
- supportedPrimitives.add("nonPositiveInteger"); //$NON-NLS-1$
- supportedPrimitives.add("normalizedString"); //$NON-NLS-1$
- supportedPrimitives.add("NOTATION"); //$NON-NLS-1$
- supportedPrimitives.add("positiveInteger"); //$NON-NLS-1$
- supportedPrimitives.add("QName"); //$NON-NLS-1$
- supportedPrimitives.add("short"); //$NON-NLS-1$
- supportedPrimitives.add("string"); //$NON-NLS-1$
- supportedPrimitives.add("time"); //$NON-NLS-1$
- supportedPrimitives.add("token"); //$NON-NLS-1$
- supportedPrimitives.add("unsignedByte"); //$NON-NLS-1$
- supportedPrimitives.add("unsignedInt"); //$NON-NLS-1$
- supportedPrimitives.add("unsignedLong"); //$NON-NLS-1$
- supportedPrimitives.add("unsignedShort"); //$NON-NLS-1$
- }
-
- /**
- * Add a local annotation with userInfo to the given item.
- *
- * <p>
- * Note: We take an XSDConcreteComponent, however we must then cast it to
- * one of the types that has a setAnnotation call defined, since it doesn't
- * have a clear 'parent' interface for annotations.
- * </p>
- *
- * <p>
- * Also note that UserInformation and ApplicationInformation objects can
- * only be added <b>after </b> the parent of the annotation has been added
- * to an XSDSchema object. This is because these objects are modeled in the
- * concrete DOM layer only, and otherwise will throw a DOMException.
- * <p>
- *
- * @param component
- * to add annotation to; may be any kind of XSDConcreteComponent
- * object including an XSDSchema
- * @param text
- * text to add as the userInformation (xsd:documentation) node to
- * the annotation
- * @return the XSDAnnotation object created, after having been added to the
- * component; null if any error occoured
- */
- public static XSDAnnotation addDocumentation(XSDConcreteComponent component, String text) {
- if (null == component) {
- throw new IllegalArgumentException("addDocumentation called with null component"); //$NON-NLS-1$
- }
- try {
-
- // First get the factory from the component: this is
- // roundabout, but saves the user from having to
- // pass it in
- XSDFactory xsdFactory = XSDFactory.eINSTANCE;
-
- // Create an XSDAnnotation object to hold everything
- XSDAnnotation xsdAnnotation = xsdFactory.createXSDAnnotation();
-
- // Depending on the XSDConcreteComponent type, cast to
- // the appropriate type and add the annotation or, if component
- // already has an annotation, use that one instead.
- if (component instanceof XSDAttributeDeclaration) {
- if(((XSDAttributeDeclaration) component).getAnnotation() == null)
- ((XSDAttributeDeclaration) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDAttributeDeclaration) component).getAnnotation();
- } else if (component instanceof XSDAttributeGroupDefinition) {
- if(((XSDAttributeGroupDefinition) component).getAnnotation() == null)
- ((XSDAttributeGroupDefinition) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDAttributeGroupDefinition) component).getAnnotation();
- } else if (component instanceof XSDElementDeclaration) {
- if(((XSDElementDeclaration) component).getAnnotation() == null)
- ((XSDElementDeclaration) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDElementDeclaration) component).getAnnotation();
- } else if (component instanceof XSDFacet) {
- if(((XSDFacet) component).getAnnotation() == null)
- ((XSDFacet) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDFacet) component).getAnnotation();
- } else if (component instanceof XSDIdentityConstraintDefinition) {
- if(((XSDIdentityConstraintDefinition) component).getAnnotation() == null)
- ((XSDIdentityConstraintDefinition) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDIdentityConstraintDefinition) component).getAnnotation();
- } else if (component instanceof XSDImport) {
- if(((XSDImport) component).getAnnotation() == null)
- ((XSDImport) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDImport) component).getAnnotation();
- } else if (component instanceof XSDInclude) {
- if(((XSDInclude) component).getAnnotation() == null)
- ((XSDInclude) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDInclude) component).getAnnotation();
- } else if (component instanceof XSDModelGroup) {
- if(((XSDModelGroup) component).getAnnotation() == null)
- ((XSDModelGroup) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDModelGroup) component).getAnnotation();
- } else if (component instanceof XSDModelGroupDefinition) {
- if(((XSDModelGroupDefinition) component).getAnnotation() == null)
- ((XSDModelGroupDefinition) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDModelGroupDefinition) component).getAnnotation();
- } else if (component instanceof XSDNotationDeclaration) {
- if(((XSDNotationDeclaration) component).getAnnotation() == null)
- ((XSDNotationDeclaration) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDNotationDeclaration) component).getAnnotation();
- } else if (component instanceof XSDTypeDefinition) {
- if(((XSDTypeDefinition) component).getAnnotation() == null)
- ((XSDTypeDefinition) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDTypeDefinition) component).getAnnotation();
- } else if (component instanceof XSDWildcard) {
- if(((XSDWildcard) component).getAnnotation() == null)
- ((XSDWildcard) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDWildcard) component).getAnnotation();
- } else if (component instanceof XSDXPathDefinition) {
- if(((XSDXPathDefinition) component).getAnnotation() == null)
- ((XSDXPathDefinition) component).setAnnotation(xsdAnnotation);
- else
- xsdAnnotation = ((XSDXPathDefinition) component).getAnnotation();
- } else if (component instanceof XSDSchema) {
- // Note that this adds a global annotation to the
- // schema itself, not to any subcomponent
- ((XSDSchema) component).getContents().add(xsdAnnotation);
- } else {
- // Whoops, asked us to annotate an unannotateable item
- throw new IllegalArgumentException("Unable to addDocumentation onto type: " + component); //$NON-NLS-1$
- }
-
- // Remove any old documentation elements
- for(int i = 0; i < xsdAnnotation.getElement().getChildNodes().getLength(); i++) {
- Node node = xsdAnnotation.getElement().getChildNodes().item(i);
- if(node.getNodeName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
- xsdAnnotation.getElement().removeChild(node);
- }
- xsdAnnotation.getUserInformation().clear();
-
- if (text!=null)
- {
- // Now that the xsdAnnotation is added to a parent
- // XSDConcreteComponent, go ahead and create the
- // UserInformation node (xsd:documentation) and
- // add a DOM textNode to it containing the information
- Element userInfo = xsdAnnotation.createUserInformation(null);
- userInfo.appendChild(userInfo.getOwnerDocument().createTextNode(text));
-
- // Add the finished userInfo object to the concrete
- // parameter of the xsdAnnotation
- xsdAnnotation.getElement().appendChild(userInfo);
-
- // Add the finished userInfo object to the user information
- // list
- xsdAnnotation.getUserInformation().add(userInfo);
- }
-
- return xsdAnnotation;
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Adds the text to the component as a Documentation parameter (just like addDocumentation) and then adds the
- * Documentation properties to the Documentation parameter if they exist.
- * If text is null then no documentation is set.
- * If properties is null then no properties are added to the documentation parameter.
- * @param component
- * @param text
- * @param properties
- * @return
- */
- public static XSDAnnotation addDocumentationAndAttributes(XSDConcreteComponent component, String text, Map attributes)
- {
- if (null == component)
- {
- throw new IllegalArgumentException("addDocumentationAndAttributes called with null component"); //$NON-NLS-1$
- }
-
- // nothing to add
- if (text==null && attributes==null)
- return null;
-
- // add documentation
- XSDAnnotation annotation = addDocumentation(component, text);
-
- if (annotation==null)
- return null;
-
- // no properties so return
- if (attributes==null || attributes.isEmpty())
- return annotation;
-
- // get annotation dom parameter, create if necessary
- Element userInfo = null;
- if (annotation.getUserInformation().isEmpty())
- {
- userInfo = annotation.createUserInformation(null);
- annotation.getElement().appendChild(userInfo);
- }
- else
- {
- for (Iterator<Element> i = annotation.getUserInformation().iterator(); i.hasNext();)
- {
- userInfo = i.next();
- if (userInfo.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
- {
- break;
- }
- }
- }
-
- if (userInfo==null)
- return null;
-
- // add properties
- String key = null;
- for (Iterator<String> iter = attributes.keySet().iterator(); iter.hasNext();)
- {
- key = iter.next();
- userInfo.setAttribute(key, (String)attributes.get(key));
- }
-
- return annotation;
- }
-
-
- /**
- * Returns a string which is not used by any parameter in 'elements'. The name
- * is generated by appending numerical suffixes on to 'prefix' until a
- * unique one is found. PRECONDITION: 'elements' is a list of
- * XSDNamedComponent instances
- *
- * @param prefix
- * @param elements
- * @return
- */
- public static String createUniqueElementName(String prefix, List elements) {
- ArrayList<String> usedNames = new ArrayList<String>();
- for(Iterator i = elements.iterator(); i.hasNext(); ) {
- usedNames.add( getDisplayName((XSDNamedComponent) i.next()));
- }
-
- int i = 1;
- String testName = prefix + i++;
- while(usedNames.contains(testName)) {
- testName = prefix + i++;
- }
- return testName;
- }
-
- /**
- * Like getPrimitives(), this returns a list of XSDTypeDefinitions. However where getPrimitives()
- * returns the basic set supported by the editor, getAdvancedPrimitives returns every known XSD
- * primitive type.
- * @return
- */
- public static List<XSDTypeDefinition> getAdvancedPrimitives() {
- advancedPrimitives = null;
- if(advancedPrimitives == null) {
- advancedPrimitives = new ArrayList<XSDTypeDefinition>();
-
- // Get the schema for schemas instance to use when resolving primitives
- XSDSchema schemaForSchemas = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-
- // Start adding the simple types using the supportedPrimitives list
- for (String typeName : supportedPrimitives) {
- XSDTypeDefinition type = schemaForSchemas.resolveSimpleTypeDefinition(typeName);
- advancedPrimitives.add(type);
- }
-
- // Return primitives in alpha order
- Collections.sort(advancedPrimitives, new Comparator() {
-
- public int compare(Object o1, Object o2) {
- if(o1 == null || o2 == null || ((XSDTypeDefinition) o1).getName() == null)
- return 0;
- return ((XSDTypeDefinition) o1).getName().compareToIgnoreCase(((XSDTypeDefinition) o2).getName());
- }
- });
- }
- return advancedPrimitives;
- }
-
- /**
- * Retrieves all the root Data types defined in the schema including complex types, user-defined simple types and anonymous
- * complex types. If there's an anonymous complex type definition (from a root parameter declaration) then we return
- * the parameter declaration's anonymous type.
- * @param schema
- * @return
- */
- public static List<XSDTypeDefinition> getAllDataTypes(XSDSchema schema)
- {
- if (schema==null)
- return Collections.emptyList();
-
- List<XSDTypeDefinition> bos = new ArrayList<XSDTypeDefinition>();
-
- EList<XSDSchemaContent> contents = schema.getContents();
- // First try the easy approach -- if this XSD contains a type definition, that's our BO,
- // return it. This is the recommended path, and the way our tooling does things.
- for (XSDSchemaContent item : contents) {
- if (item instanceof XSDTypeDefinition)
- bos.add((XSDTypeDefinition)item);
- }
-
- // If we failed, we try a second pass, this time looking for an parameter
- // with an anonymous complex
- // type defined in line
- for (XSDSchemaContent item : contents) {
- if (item instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) item;
- if (element.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
- {
- bos.add(element.getAnonymousTypeDefinition());
- }
- }
- }
- return bos;
- }
-
- /**
- * Given a BO (XSD Complex Type), return a list of the properties
- * within the complexType.
- * @param bo
- * @return List of XSDAttributeDeclaration
- */
- public static List<XSDAttributeDeclaration> getChildAttributes(XSDComplexTypeDefinition bo)
- {
- EList attrContents = bo.getAttributeContents();
- List<XSDAttributeDeclaration> attrs = new ArrayList<XSDAttributeDeclaration>();
- for (int i=0; i< attrContents.size(); i++)
- {
- Object next = attrContents.get(i);
-
- // Attribute contents may include actual attribute delcarations (wrapped in XSDAttributeUses) or
- // attribute group definitions, containing bundles of properties
- if(next instanceof XSDAttributeUse) {
- attrs.add( ((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration() );
-
- } else if (next instanceof XSDAttributeGroupDefinition) {
-
- // Add these properties to the end of attrContents to be processed in turn
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
- if(attrGroup.getResolvedAttributeGroupDefinition() != null)
- attrContents.addAll(attrGroup.getResolvedAttributeGroupDefinition().getAttributeUses());
-
- }
- }
- return attrs;
- }
-
- /**
- * Given a BO (XSD Complex Type), return a list of the XSDFeatures
- * within the complexType's modelgroup (sequence, choice, etc.)
- * @param bo
- * @return
- */
- public static List<XSDFeature> getChildElements(XSDComplexTypeDefinition bo)
- {
- return XSDUtils.getChildElements( getModelGroup(bo) );
- }
-
- /**
- * Given an XSDFeature, return a list of the XSDFeatures
- * within the complexType's modelgroup (sequence, choice, etc.)
- * @param bo
- * @return
- */
- public static List<XSDFeature> getChildElements(XSDFeature elem)
- {
- XSDComplexTypeDefinition cType = getResolvedComplexType(elem);
- return (cType != null) ? XSDUtils.getChildElements(cType) : Collections.EMPTY_LIST;
- }
-
-
- /**
- * Given a Model group, return a list of the XSDFeatures
- * declared within.
- * @param group
- * @return
- */
- public static List<XSDFeature> getChildElements(XSDModelGroup group)
- {
- if(group == null)
- return new ArrayList<XSDFeature>();
-
- List<XSDFeature> children = new ArrayList<XSDFeature>();
- for(Iterator<XSDParticle> i = group.getContents().iterator(); i.hasNext();)
- {
- XSDParticle next = i.next();
- if(next.getContent() instanceof XSDFeature)
- children.add((XSDFeature) next.getContent());
- else if (next.getTerm() instanceof XSDModelGroup)
- children.addAll(getChildElements((XSDModelGroup) next.getTerm()));
- }
- return children;
- }
-
- /**
- * Return the contents of the documentation parameter in type's annotation, if it has one.
- * Otherwise return null
- * @param type
- * @return
- */
- public static String getDocumentation(XSDFeature element) {
- XSDAnnotation annotation = null;
-
- if (element instanceof XSDAttributeDeclaration)
- annotation = ((XSDAttributeDeclaration)element).getAnnotation();
- else if (element instanceof XSDElementDeclaration)
- annotation = ((XSDElementDeclaration)element).getAnnotation();
-
- if(annotation != null) {
- for(Iterator i = annotation.getUserInformation().iterator(); i.hasNext(); ) {
- Element domElement = (Element) i.next();
- if(domElement.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG) &&
- domElement.getFirstChild() instanceof Text) {
- return ((Text) domElement.getFirstChild()).getData();
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the properties on the documentation parameter if they exist. I.e. returns source and xml:lang
- * Returns an empty parentMap if none.
- * @param type
- * @return
- */
- public static Map<String, String> getDocumentationAttributes(XSDTypeDefinition type)
- {
- Map<String, String> attributes = new HashMap<String, String>();
-
- if (type.getAnnotation() != null)
- {
- XSDAnnotation annotation = type.getAnnotation();
- for (Iterator i = annotation.getUserInformation().iterator(); i
- .hasNext();)
- {
- Element element = (Element) i.next();
- if (element.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
- {
- String source = element.getAttribute("source"); //$NON-NLS-1$
- String lang = element.getAttribute("xml:lang"); //$NON-NLS-1$
- if (lang==null || lang.length()<1)
- lang = element.getAttribute("lang"); //$NON-NLS-1$
-
- if (source!=null && source.length()>0)
- attributes.put("source", source); //$NON-NLS-1$
-
- if (lang!=null && lang.length()>0)
- attributes.put("xml:lang", lang); //$NON-NLS-1$
-
- return attributes;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the properties on the documentation parameter if they exist. I.e. returns source and xml:lang
- * Returns an empty parentMap if none.
- * @param parameter
- * @return
- */
- public static Map<String, String> getDocumentationAttributes(XSDFeature element)
- {
- XSDAnnotation annotation = null;
- Map<String, String> attributes = new HashMap<String, String>();
-
- if (element instanceof XSDAttributeDeclaration)
- annotation = ((XSDAttributeDeclaration)element).getAnnotation();
- else if (element instanceof XSDElementDeclaration)
- annotation = ((XSDElementDeclaration)element).getAnnotation();
-
- if (annotation != null)
- {
- for (Iterator i = annotation.getUserInformation().iterator(); i
- .hasNext();)
- {
- Element domElement = (Element) i.next();
- if (domElement.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
- {
- String source = domElement.getAttribute("source"); //$NON-NLS-1$
- String lang = domElement.getAttribute("xml:lang"); //$NON-NLS-1$
- if (lang==null || lang.length()<1)
- lang = domElement.getAttribute("lang"); //$NON-NLS-1$
-
- if (source!=null && source.length()>0)
- attributes.put("source", source); //$NON-NLS-1$
-
- if (lang!=null && lang.length()>0)
- attributes.put("xml:lang", lang); //$NON-NLS-1$
-
- return attributes;
- }
- }
- }
- return null;
- }
-
- /**
- * Return the contents of the documentation parameter in type's annotation, if it has one.
- * Otherwise return null
- * @param type
- * @return
- */
- public static String getDocumentation(XSDTypeDefinition type) {
- if(type.getAnnotation() != null) {
- XSDAnnotation annotation = type.getAnnotation();
- for(Iterator i = annotation.getUserInformation().iterator(); i.hasNext(); ) {
- Element element = (Element) i.next();
- if(element.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG) &&
- element.getFirstChild() instanceof Text) {
- return ((Text) element.getFirstChild()).getData();
- }
- }
- }
- return null;
- }
-
- /**
- * Given an XSD Complex Type Definition, return the model group containing
- * its child elements.
- * @param parameter
- * @return
- */
- public static XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
- {
- XSDParticle particle = cType.getComplexType();
-
- // In cases where cType doesn't have a model group AND cType has a parent with a modelgroup, the
- // call above will rather unexpectedly give us cType's PARENT's model group, rather than the null we
- // might expect. We don't want that here, if the model group returned is null or belongs to someone
- // other than us, return null
- if (particle==null || particle.eContainer() != cType) {
- return null;
- }
-
- // get the model group
- Object particleContent = particle.getContent();
- XSDModelGroup group = null;
-
- if (particleContent instanceof XSDModelGroupDefinition) {
- group = ((XSDModelGroupDefinition)particleContent).getResolvedModelGroupDefinition().getModelGroup();
- } else if (particleContent instanceof XSDModelGroup) {
- group = (XSDModelGroup)particleContent;
- }
-
- if (group == null) {
- return null;
- }
-
- // if the content of the complex type is empty then the content
- // must be in the complexContent, ie. we're extending another BO.
- // if the group and the type are not in the same resource then
- // we are extending another BO and we don't want to show inherited
- // properties.
- if ( group.getContents().isEmpty() || group.eResource() != cType.eResource())
- {
- // if we are extending another BO then get the elements
- // we are adding
- if (cType.getBaseType()!=null)
- {
- XSDComplexTypeContent content = cType.getContent();
-
- if (content instanceof XSDParticle) {
- particleContent = ((XSDParticle)content).getContent();
- if (particleContent instanceof XSDModelGroupDefinition) {
- group = ((XSDModelGroupDefinition)particleContent).getResolvedModelGroupDefinition().getModelGroup();
- } else if (particleContent instanceof XSDModelGroup) {
- group = (XSDModelGroup)particleContent;
- }
- }
-
- }
- }
-
- return group;
- }
-
- /**
- * General utility method for finding a name for an xsd component. This method will handle
- * mapping of xsd primitive names to their human readable counterparts, as well as resolving
- * parameter references for properties and walking up object hierarchies for anonymous types.
- * Basically this method should be used whenever a name is needed to minimize the risk of
- * having a name of 'null' -- though this method WILL return null if no name can be found.
- * @param component
- * @return
- */
- public static String getDisplayName(XSDNamedComponent component) {
-
- if(component == null)
- return null;
-
- if(component instanceof XSDTypeDefinition)
- return getDisplayNameFromXSDType((XSDTypeDefinition) component);
-
- if (component instanceof XSDFeature) {
- XSDFeature feature = (XSDFeature) component;
- if(feature.getName() != null)
- return feature.getName();
- else if (feature.getResolvedFeature() != null && feature.getResolvedFeature().getName() != null)
- return feature.getResolvedFeature().getName();
- }
-
- return component.getName();
-
- }
-
- /**
- * Try a variety of methods to get a human readable name for type. In order, this method will
- * - check whether type is null, and if so return null
- * - check whether type is a restriction of a primitive type, if so return its parent's name
- * - check whether type is a complex anonymous (un-named) inner type of a named parameter, and if so, return the parameter's name
- * - check whether type is a primitive type, and if so return a human-readable version of that type
- * - check whether type is a named, non-primitive type, and if so, return its name
- * @param xsdType
- * @return
- */
- public static String getDisplayNameFromXSDType(XSDTypeDefinition type) {
- return getDisplayNameFromXSDType(type, true);
- }
-
- /**
- * Try a variety of methods to get a human readable name for type. In order, this method will
- * - check whether type is null, and if so return null
- * - check whether type is a complex anonymous (un-named) inner type of a named parameter, and if so, return the parameter's name
- * - check whether type is a primitive type, and if so return a human-readable version of that type
- * - check whether type is a named, non-primitive type, and if so, return its name
- * - if returnPrimitiveParents is true, check whether type is a restriction of a primitive type,
- * if so return its parent's name
- * @param xsdType
- * @param returnPrimitiveParents if true, and if type is an anonymous restriction of an xsd primitive
- * type, this method will return the name of the parent primitive type. If false, restrictions of
- * primitive types will not be treated differently from other types, and their control hierarchy will
- * be walked, instead of their inheritance hierarchy.
- * @return
- */
- public static String getDisplayNameFromXSDType(XSDTypeDefinition type, boolean returnPrimitiveParents) {
- if(type == null)
- return null;
-
-
-
- // Does type have a name? If not, walk up the control tree to try and find one
- if(type.getName() == null || type.getName().length() == 0) {
-
- // In the special case where type is a restriction on a primitive type, just return the parent's
- // name (which will either be a primitive itself, or a named simple type)
- if(returnPrimitiveParents && isRestrictedPrimitiveType(type)) {
- return getDisplayNameFromXSDType(type.getBaseType());
- }
-
- EObject container = type.eContainer();
-
- while(container != null) {
- if(container instanceof XSDNamedComponent && ((XSDNamedComponent) container).getName() != null) {
- return ((XSDNamedComponent) container).getName();
- }
- container = container.eContainer();
- }
- // Type doesn't have a name, or a control with a name, nothing useful
- return null;
- } else
- return type.getName();
- }
-
- /**
- * Return the type definition for the primitive with name xsdName (note, this is not the human-readable
- * name, but the actual XSD type name.) Return null if a type with this name is not in the list of
- * all primitives
- * @param xsdName
- * @return
- */
- public static XSDSimpleTypeDefinition getPrimitive(String xsdName) {
- for(Iterator<XSDTypeDefinition> i = getAdvancedPrimitives().iterator(); i.hasNext();) {
- XSDSimpleTypeDefinition next = (XSDSimpleTypeDefinition) i.next();
- if(next.getName().equals(xsdName)) {
- return next;
- }
- }
- return null;
- }
-
- /**
- *
- * @return Returns a list of XSDSimpleTypeDefinitions representing each of the supported primitives.
- * These will have their XSD spec names (e.g. xsd:dateTime) so they will likely need to be fed to
- * getDisplayName() if they are going to be presented to humans
- */
- public static List<XSDSimpleTypeDefinition> getPrimitives() {
- if(primitives == null) {
- primitives = new ArrayList<XSDSimpleTypeDefinition>();
-
- // Get the schema for schemas instance to use when resolving primitives
- XSDSchema schemaForSchemas = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-
- // Start adding the simple types from the XSD short list
- for(Iterator<String> i = xsdShortList.iterator(); i.hasNext(); ) {
- String typeName = i.next();
-
- XSDSimpleTypeDefinition type = schemaForSchemas.resolveSimpleTypeDefinition(typeName);
- primitives.add(type);
- }
-
- // Return primitives in alpha order
- Collections.sort(primitives, new Comparator() {
-
- public int compare(Object o1, Object o2) {
- if(o1 == null || o2 == null || getDisplayNameFromXSDType((XSDTypeDefinition) o1) == null)
- return 0;
- return getDisplayNameFromXSDType((XSDTypeDefinition) o1).compareTo(getDisplayNameFromXSDType((XSDTypeDefinition) o2));
- }
- });
- }
- return primitives;
- }
-
- /**
- * Return a collection of all types referenced by the properties (XSDFeatures) of source. This
- * method is non-recursive (i.e. the list only contains direct references, not references-of-references)
- * Will not return null, but may return an empty set. This will not return a BO reference if the file
- * has been deleted (or just doesn't exist).
- * @param source The complex type to examine for references
- * @return a Collection of XSDComplexTypeDefinition instances -- no duplicates
- */
- public static Collection<XSDComplexTypeDefinition> getReferencedTypes(XSDComplexTypeDefinition source) {
- if(source == null)
- return Collections.emptySet();
-
- List<XSDComplexTypeDefinition> results = new ArrayList<XSDComplexTypeDefinition>();
- for(Iterator<XSDFeature> i = getChildElements(source).iterator(); i.hasNext(); ) {
- XSDFeature element = i.next();
- XSDComplexTypeDefinition elementType = getResolvedComplexType(element);
- if(elementType != null && !results.contains(elementType) && !XSDConstants.isSchemaForSchemaNamespace(elementType.getTargetNamespace()))
- results.add(elementType);
- }
- return results;
- }
-
- /**
- * Return a collection of all types referenced by the properties (XSDFeatures) of source. This
- * method is non-recursive (i.e. the list only contains direct references, not references-of-references)
- * Will not return null, but may return an empty set. This will return a BO reference if the file
- * has been deleted (or just doesn't exist).
- * @param source The complex type to examine for references
- * @return a Collection of XSDTypeDefinition (could be complex or simple type) instances -- no duplicates
- */
- public static Collection<XSDTypeDefinition> getAllReferencedTypes(XSDComplexTypeDefinition source)
- {
- return getAllReferencedTypes(source, false);
- }
-
- /**
- * Return a collection of all types referenced by the properties (XSDFeatures) of source. This
- * method is non-recursive (i.e. the list only contains direct references, not references-of-references)
- * Will not return null, but may return an empty set. This will return a BO reference if the file
- * has been deleted (or just doesn't exist).
- * @param source The complex type to examine for references
- * @param includeAnonymous if true, the returned list will include anonymous inlined types as well. These
- * are not technically "referenced", however it allows this method to be used as a way to get all non-primitive
- * types used in any way by source
- * @return a Collection of XSDTypeDefinition (could be complex or simple type) instances -- no duplicates
- */
- public static Collection<XSDTypeDefinition> getAllReferencedTypes(XSDComplexTypeDefinition source, boolean includeAnonymous)
- {
- if (source == null)
- return Collections.emptySet();
-
- List<XSDTypeDefinition> results = new ArrayList<XSDTypeDefinition>();
- XSDTypeDefinition elementType = null;
- for (Iterator<XSDFeature> i = getChildElements(source).iterator(); i.hasNext();)
- {
- XSDFeature next = i.next();
- elementType = getResolvedType(next);
-
- // Only add non-null, non-duplicate, non-primitive types. If includeAnonymous is false,
- // anonymous types should be filtered out as well
- if( elementType != null &&
- !results.contains(elementType) &&
- !XSDConstants.isSchemaForSchemaNamespace(elementType.getTargetNamespace()) &&
- (includeAnonymous || elementType.eContainer() != next) )
- results.add(elementType);
- }
- return results;
- }
-
- /**
- * Given an parameter, return its complex type, or null if it does not have a complex type. This is
- * slightly more complicated than just calling getType() since an parameter may not have a type at all, it
- * may reference another parameter.
- * @param parameter
- * @return
- */
- public static XSDComplexTypeDefinition getResolvedComplexType(XSDFeature feature) {
- // The contents of this method have been adapted to the more general getResolvedType,
- // but this method is maintained for compatibility and convenience
- XSDTypeDefinition resolvedType = getResolvedType(feature);
- if(resolvedType instanceof XSDComplexTypeDefinition)
- return (XSDComplexTypeDefinition) resolvedType;
- return null;
- }
-
- /**
- * Given an parameter, return its type, or null if it does not have a type. This is
- * slightly more complicated than just calling getType() since an parameter may not have
- * a type at all, it may reference another parameter.
- * @param parameter
- * @return
- */
- public static XSDTypeDefinition getResolvedType(XSDFeature feature) {
-
- // Special case of elements referencing stale XSD complex types
- if (feature instanceof XSDElementDeclaration && ((XSDElementDeclaration) feature).getTypeDefinition() instanceof XSDComplexTypeDefinition) {
-
- XSDElementDeclaration element = (XSDElementDeclaration) feature;
-
- // We have a type, but types can be proxies, and proxies can become
- // stale if the referenced
- // type changes, so before we return it, re-resolve the proxy and
- // then return it
- XSDComplexTypeDefinition oldType = (XSDComplexTypeDefinition) element.getTypeDefinition();
- EObject newType = EcoreUtil.resolve(element.getTypeDefinition(), element);
- if (oldType != newType) {
- // We only return the resolved type if the name and the namespace has not changed. Changing the name
- // and namespace is essentially an unresolved BO.
- String oldName = oldType.getName();
- String newName = ((XSDTypeDefinition)newType).getName();
- String oldTNS = oldType.getTargetNamespace();
- String newTNS = ((XSDTypeDefinition)newType).getTargetNamespace();
-
- if ( ((oldName==newName) || (oldName!=null && oldName.equals(newName))) &&
- ((oldTNS==newTNS) || (oldTNS!=null && oldTNS.equals(newTNS))) )
- element.setTypeDefinition((XSDTypeDefinition) newType);
- }
- return element.getTypeDefinition();
-
- } else if (feature.getType() != null) {
- return feature.getType();
- } else if (feature.getResolvedFeature() != null && feature.getResolvedFeature().getType() != null) {
- // We reference another parameter
- return feature.getResolvedFeature().getType();
- } else {
- return null;
- }
- }
-
- /**
- * Return the base type from which this type inherits - that is, all xsd types are
- * either xsd:anyType or xsd:anySimpleType at the topmost level of inheritance, so return the second
- * topmost level of type's inheritance. The first specific type from which type inherits.
- * @param type
- * @return
- */
- public static XSDTypeDefinition getRootType(XSDTypeDefinition type) {
- if(type == null)
- return null;
-
- XSDTypeDefinition baseType = type.getBaseType();
- while(baseType != null && !XSDConstants.isAnySimpleType(baseType) && !XSDConstants.isAnyType(baseType)) {
- // walk one more step up the hierarchy
- type = baseType;
- baseType = type.getBaseType();
- }
-
- // Since baseType, type's immediate parent, broke the while condition, we know that type is now
- // as high up the tree as we want to be
- return type;
-
-
-
- }
-
- /**
- * Given a schema, return the list of XSDSimpleTypeDefinitions found within it. Will not return null,
- * but may return an empty list
- * @param schema
- * @return
- */
- public static List<XSDSimpleTypeDefinition> getUserDefinedSimpleTypes(XSDSchema schema) {
- if(schema == null)
- return Collections.emptyList();
-
- List<XSDSimpleTypeDefinition> result = new ArrayList<XSDSimpleTypeDefinition>();
- for (XSDSchemaContent next : schema.getContents()) {
- if(next instanceof XSDSimpleTypeDefinition)
- result.add((XSDSimpleTypeDefinition)next);
- }
- return result;
- }
-
- /**
- * Given a display name for a BO attribute type, return the XSD type name.
- * If the given input is not a display name, the input is returned.
- * @param displayName
- * @return
- */
- public static String getXSDTypeFromDisplayName(String displayName)
- {
- // Now a no-op since we no longer translate XSD type names to "human readable" ones
- return displayName;
- }
-
- /**
- * Return true iff type is a descendant of a primitive xsd type. Will not return true for primitives
- * themselves.
- * @param type
- * @return
- */
- public static boolean isRestrictedPrimitiveType(XSDTypeDefinition type) {
- if(type instanceof XSDComplexTypeDefinition)
- return false;
-
- XSDTypeDefinition baseType = getRootType(type);
- return getAdvancedPrimitives().contains(baseType);
- }
-
- /**
- * Gets the "minOccurs" attribute value for the given XSDFeature, if
- * there is none then it returns the default 1.
- * @param xsdElem
- * @return
- */
- public static int getMinOccurs(XSDFeature xsdElem)
- {
- if (xsdElem.eContainer() instanceof XSDAttributeUse)
- {
- return (((XSDAttributeUse)xsdElem.eContainer()).getUse()==XSDAttributeUseCategory.REQUIRED_LITERAL?1:0);
- }
-
- XSDParticle particle = (XSDParticle)xsdElem.eContainer();
- int min = 1;
- if (particle.isSetMinOccurs())
- min = particle.getMinOccurs();
-
- return min;
- }
-
- /**
- * Gets the "maxOccurs" attribute value for the given XSDFeature, if
- * there is none then it returns the default 1.
- * @param xsdElem
- * @return
- */
- public static int getMaxOccurs(XSDFeature xsdElem)
- {
- int max = 1;
-
- // not a particle means an attribute use. properties are maxed at 1.
- if ( !(xsdElem.eContainer() instanceof XSDParticle) )
- return max;
-
- XSDParticle particle = (XSDParticle)xsdElem.eContainer();
- if (particle.isSetMaxOccurs())
- max = particle.getMaxOccurs();
-
- return max;
- }
-
- /**
- * Return the Data Type from the given schema with the given name.
- * @param schema - The schema containing the type.
- * @param boName - The local name of the type to retrieve -- if null method returns first type found.
- * @return The XSDTypeDefinition if one exists, null otherwise
- */
- public static XSDTypeDefinition getDataType(XSDSchema schema, String typeName) {
- if(schema == null)
- return null;
-
- boolean pickFirstFound = (typeName==null || typeName.length()<1);
-
- EList<XSDSchemaContent> contents = schema.getContents();
-
- // First try the easy approach -- if this XSD contains a type definition with the right name, that's
- // our type, return it. This is the recommended path, and the way our tooling does things.
- for(Iterator<XSDSchemaContent> i = contents.iterator(); i.hasNext(); ) {
- Object item = i.next();
- if(item instanceof XSDTypeDefinition)
- if (pickFirstFound)
- return (XSDTypeDefinition) item;
- else if ( typeName.equals(getDisplayName((XSDTypeDefinition)item)))
- return (XSDTypeDefinition) item;
- }
-
- // If we failed, we try a second pass, this time looking for an parameter with an anonymous
- // type defined in line
- for(Iterator<XSDSchemaContent> i = contents.iterator(); i.hasNext(); ) {
- Object item = i.next();
- if(item instanceof XSDFeature) {
- XSDFeature element = (XSDFeature) item;
- XSDTypeDefinition resolvedType = getResolvedType(element);
- if(resolvedType != null && resolvedType.getSchema() == schema) {
- if (pickFirstFound)
- return resolvedType;
- else if (typeName.equals(getDisplayName(element)))
- return resolvedType;
- }
- }
- }
- return null;
-
- }
-
- /**
- * Gets the "default" attribute value for the given XSDFeature, if there
- * is none then it returns an empty string.
- * @param xsdElem
- * @return
- */
- public static String getDefaultValue(XSDFeature xsdElem)
- {
- XSDConstraint constraint = null;
- if (xsdElem instanceof XSDAttributeDeclaration)
- {
- // attribute declarations store their default values in
- // their containers (attribute uses)
- XSDAttributeUse use = (XSDAttributeUse)xsdElem.getContainer();
- if (use.isSetConstraint())
- constraint = use.getConstraint();
-
- if (constraint!=null && constraint.equals(XSDConstraint.DEFAULT_LITERAL))
- if (use.getLexicalValue()!=null)
- return use.getLexicalValue();
- else
- return ""; //$NON-NLS-1$
- }
- else if (xsdElem instanceof XSDElementDeclaration)
- {
- if (xsdElem.isSetConstraint())
- constraint = xsdElem.getConstraint();
-
- if (constraint!=null && constraint.equals(XSDConstraint.DEFAULT_LITERAL))
- if (xsdElem.getLexicalValue()!=null)
- return xsdElem.getLexicalValue();
- else
- return ""; //$NON-NLS-1$
-
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Return the enclosing Complex Type definition.
- * @param component
- * @return
- */
- public static XSDComplexTypeDefinition getEnclosingTypeDefinition(EObject component)
- {
- if (component == null)
- return null;
-
- if (component instanceof XSDComplexTypeDefinition)
- return (XSDComplexTypeDefinition)component;
-
- return getEnclosingTypeDefinition(component.eContainer());
- }
-
- /**
- * Given an XSD schema with a new target namespace set, this method will cycle through the XSD schema directives
- * (i.e. imports/includes/redefines) and remove as appropriate.
- *
- * I.e. this method will remove all includes/redefines if the new TNS is different than the old TNS and it will remove
- * all imports that have the same namespace as the new TNS (since these should now be includes).
- *
- * @param schema - has the new target namespace set
- * @param oldTNS
- */
- public static void removeImportsAndIncludes(XSDSchema schema, String oldTNS)
- {
- if (schema==null)
- return;
-
- String newTNS = schema.getTargetNamespace();
-
- // namespace hasn't changed
- if (newTNS==null && oldTNS==null)
- return;
-
- // namespace hasn't changed
- if (newTNS!=null && newTNS.equals(oldTNS))
- return;
-
- // namespace has changed so remove all includes and remove any imports to the new namespace
- ArrayList schemaContents = new ArrayList(schema.getContents());
- for (Iterator i = schemaContents.iterator(); i.hasNext();)
- {
- Object next = i.next();
- if (next instanceof XSDImport)
- {
- XSDImport nextImport = (XSDImport) next;
- if (nextImport.getNamespace()==null && newTNS==null)
- schema.getContents().remove(nextImport);
- else if (nextImport.getNamespace()!=null && nextImport.getNamespace().equals(newTNS))
- schema.getContents().remove(nextImport);
- }
- else if (next instanceof XSDSchemaCompositor)
- {
- schema.getContents().remove(next);
- }
- }
-
- }
-
- /**
- * Given an XSD complex type, return a list of the XSDFeatures (parameter
- * and attribute declarations) within the complex type.
- */
- public static List<XSDFeature> getXSDElementsAndAttributes(XSDComplexTypeDefinition complexType)
- {
- List<XSDFeature> result = getChildElements(complexType);
- result.addAll( getChildAttributes(complexType));
-
- return result;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDAttributeUseCategory;
+import org.eclipse.xsd.XSDComplexTypeContent;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDConstraint;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFacet;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDFeature;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaCompositor;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.XSDXPathDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.eclipse.xsd.util.XSDUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+/**
+ * Collection of utility methods for dealing with navigation of the XSD model
+ */
+public class XSDUtils {
+
+ // singleton lists of XSD simple type definitions for supported primitives (see getPrimitives()) and
+ // all xsd primitives (see getAdvancedPrimitives()) respectively
+ private static List<XSDSimpleTypeDefinition> primitives;
+ private static List<XSDTypeDefinition> advancedPrimitives;
+
+ // XSD short list -- these are the types presented to the user by default, rather than inundating them with
+ // all the available types
+ private static List<String> xsdShortList = new ArrayList<String>();
+ static
+ {
+ xsdShortList.add("string"); //$NON-NLS-1$
+ xsdShortList.add("int"); //$NON-NLS-1$
+ xsdShortList.add("double"); //$NON-NLS-1$
+ xsdShortList.add("date"); //$NON-NLS-1$
+ xsdShortList.add("time"); //$NON-NLS-1$
+ xsdShortList.add("dateTime"); //$NON-NLS-1$
+ xsdShortList.add("boolean"); //$NON-NLS-1$
+ xsdShortList.add("hexBinary"); //$NON-NLS-1$
+ xsdShortList.add("float"); //$NON-NLS-1$
+ }
+
+
+ // A list of all supported XSD types. Usually the user will not be presented with the full list, but
+ // rather with the xsd short list
+ private static List<String> supportedPrimitives = new ArrayList<String>();
+ static {
+ supportedPrimitives.add("anyType"); //$NON-NLS-1$
+ supportedPrimitives.add("anyURI"); //$NON-NLS-1$
+ supportedPrimitives.add("base64Binary"); //$NON-NLS-1$
+ supportedPrimitives.add("boolean"); //$NON-NLS-1$
+ supportedPrimitives.add("byte"); //$NON-NLS-1$
+ supportedPrimitives.add("date"); //$NON-NLS-1$
+ supportedPrimitives.add("dateTime"); //$NON-NLS-1$
+ supportedPrimitives.add("decimal"); //$NON-NLS-1$
+ supportedPrimitives.add("double"); //$NON-NLS-1$
+ supportedPrimitives.add("duration"); //$NON-NLS-1$
+ supportedPrimitives.add("ENTITIES"); //$NON-NLS-1$
+ supportedPrimitives.add("ENTITY"); //$NON-NLS-1$
+ supportedPrimitives.add("float"); //$NON-NLS-1$
+ supportedPrimitives.add("gDay"); //$NON-NLS-1$
+ supportedPrimitives.add("gMonth"); //$NON-NLS-1$
+ supportedPrimitives.add("gMonthDay"); //$NON-NLS-1$
+ supportedPrimitives.add("gYear"); //$NON-NLS-1$
+ supportedPrimitives.add("gYearMonth"); //$NON-NLS-1$
+ supportedPrimitives.add("hexBinary"); //$NON-NLS-1$
+ supportedPrimitives.add("ID"); //$NON-NLS-1$
+ supportedPrimitives.add("IDREF"); //$NON-NLS-1$
+ supportedPrimitives.add("IDREFS"); //$NON-NLS-1$
+ supportedPrimitives.add("int"); //$NON-NLS-1$
+ supportedPrimitives.add("integer"); //$NON-NLS-1$
+ supportedPrimitives.add("language"); //$NON-NLS-1$
+ supportedPrimitives.add("long"); //$NON-NLS-1$
+ supportedPrimitives.add("Name"); //$NON-NLS-1$
+ supportedPrimitives.add("NCName"); //$NON-NLS-1$
+ supportedPrimitives.add("negativeInteger"); //$NON-NLS-1$
+ supportedPrimitives.add("NMTOKEN"); //$NON-NLS-1$
+ supportedPrimitives.add("NMTOKENS"); //$NON-NLS-1$, "NMTOKENS");
+ supportedPrimitives.add("nonNegativeInteger"); //$NON-NLS-1$
+ supportedPrimitives.add("nonPositiveInteger"); //$NON-NLS-1$
+ supportedPrimitives.add("normalizedString"); //$NON-NLS-1$
+ supportedPrimitives.add("NOTATION"); //$NON-NLS-1$
+ supportedPrimitives.add("positiveInteger"); //$NON-NLS-1$
+ supportedPrimitives.add("QName"); //$NON-NLS-1$
+ supportedPrimitives.add("short"); //$NON-NLS-1$
+ supportedPrimitives.add("string"); //$NON-NLS-1$
+ supportedPrimitives.add("time"); //$NON-NLS-1$
+ supportedPrimitives.add("token"); //$NON-NLS-1$
+ supportedPrimitives.add("unsignedByte"); //$NON-NLS-1$
+ supportedPrimitives.add("unsignedInt"); //$NON-NLS-1$
+ supportedPrimitives.add("unsignedLong"); //$NON-NLS-1$
+ supportedPrimitives.add("unsignedShort"); //$NON-NLS-1$
+ }
+
+ /**
+ * Add a local annotation with userInfo to the given item.
+ *
+ * <p>
+ * Note: We take an XSDConcreteComponent, however we must then cast it to
+ * one of the types that has a setAnnotation call defined, since it doesn't
+ * have a clear 'parent' interface for annotations.
+ * </p>
+ *
+ * <p>
+ * Also note that UserInformation and ApplicationInformation objects can
+ * only be added <b>after </b> the parent of the annotation has been added
+ * to an XSDSchema object. This is because these objects are modeled in the
+ * concrete DOM layer only, and otherwise will throw a DOMException.
+ * <p>
+ *
+ * @param component
+ * to add annotation to; may be any kind of XSDConcreteComponent
+ * object including an XSDSchema
+ * @param text
+ * text to add as the userInformation (xsd:documentation) node to
+ * the annotation
+ * @return the XSDAnnotation object created, after having been added to the
+ * component; null if any error occoured
+ */
+ public static XSDAnnotation addDocumentation(XSDConcreteComponent component, String text) {
+ if (null == component) {
+ throw new IllegalArgumentException("addDocumentation called with null component"); //$NON-NLS-1$
+ }
+ try {
+
+ // First get the factory from the component: this is
+ // roundabout, but saves the user from having to
+ // pass it in
+ XSDFactory xsdFactory = XSDFactory.eINSTANCE;
+
+ // Create an XSDAnnotation object to hold everything
+ XSDAnnotation xsdAnnotation = xsdFactory.createXSDAnnotation();
+
+ // Depending on the XSDConcreteComponent type, cast to
+ // the appropriate type and add the annotation or, if component
+ // already has an annotation, use that one instead.
+ if (component instanceof XSDAttributeDeclaration) {
+ if(((XSDAttributeDeclaration) component).getAnnotation() == null)
+ ((XSDAttributeDeclaration) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDAttributeDeclaration) component).getAnnotation();
+ } else if (component instanceof XSDAttributeGroupDefinition) {
+ if(((XSDAttributeGroupDefinition) component).getAnnotation() == null)
+ ((XSDAttributeGroupDefinition) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDAttributeGroupDefinition) component).getAnnotation();
+ } else if (component instanceof XSDElementDeclaration) {
+ if(((XSDElementDeclaration) component).getAnnotation() == null)
+ ((XSDElementDeclaration) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDElementDeclaration) component).getAnnotation();
+ } else if (component instanceof XSDFacet) {
+ if(((XSDFacet) component).getAnnotation() == null)
+ ((XSDFacet) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDFacet) component).getAnnotation();
+ } else if (component instanceof XSDIdentityConstraintDefinition) {
+ if(((XSDIdentityConstraintDefinition) component).getAnnotation() == null)
+ ((XSDIdentityConstraintDefinition) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDIdentityConstraintDefinition) component).getAnnotation();
+ } else if (component instanceof XSDImport) {
+ if(((XSDImport) component).getAnnotation() == null)
+ ((XSDImport) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDImport) component).getAnnotation();
+ } else if (component instanceof XSDInclude) {
+ if(((XSDInclude) component).getAnnotation() == null)
+ ((XSDInclude) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDInclude) component).getAnnotation();
+ } else if (component instanceof XSDModelGroup) {
+ if(((XSDModelGroup) component).getAnnotation() == null)
+ ((XSDModelGroup) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDModelGroup) component).getAnnotation();
+ } else if (component instanceof XSDModelGroupDefinition) {
+ if(((XSDModelGroupDefinition) component).getAnnotation() == null)
+ ((XSDModelGroupDefinition) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDModelGroupDefinition) component).getAnnotation();
+ } else if (component instanceof XSDNotationDeclaration) {
+ if(((XSDNotationDeclaration) component).getAnnotation() == null)
+ ((XSDNotationDeclaration) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDNotationDeclaration) component).getAnnotation();
+ } else if (component instanceof XSDTypeDefinition) {
+ if(((XSDTypeDefinition) component).getAnnotation() == null)
+ ((XSDTypeDefinition) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDTypeDefinition) component).getAnnotation();
+ } else if (component instanceof XSDWildcard) {
+ if(((XSDWildcard) component).getAnnotation() == null)
+ ((XSDWildcard) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDWildcard) component).getAnnotation();
+ } else if (component instanceof XSDXPathDefinition) {
+ if(((XSDXPathDefinition) component).getAnnotation() == null)
+ ((XSDXPathDefinition) component).setAnnotation(xsdAnnotation);
+ else
+ xsdAnnotation = ((XSDXPathDefinition) component).getAnnotation();
+ } else if (component instanceof XSDSchema) {
+ // Note that this adds a global annotation to the
+ // schema itself, not to any subcomponent
+ ((XSDSchema) component).getContents().add(xsdAnnotation);
+ } else {
+ // Whoops, asked us to annotate an unannotateable item
+ throw new IllegalArgumentException("Unable to addDocumentation onto type: " + component); //$NON-NLS-1$
+ }
+
+ // Remove any old documentation elements
+ for(int i = 0; i < xsdAnnotation.getElement().getChildNodes().getLength(); i++) {
+ Node node = xsdAnnotation.getElement().getChildNodes().item(i);
+ if(node.getNodeName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
+ xsdAnnotation.getElement().removeChild(node);
+ }
+ xsdAnnotation.getUserInformation().clear();
+
+ if (text!=null)
+ {
+ // Now that the xsdAnnotation is added to a parent
+ // XSDConcreteComponent, go ahead and create the
+ // UserInformation node (xsd:documentation) and
+ // add a DOM textNode to it containing the information
+ Element userInfo = xsdAnnotation.createUserInformation(null);
+ userInfo.appendChild(userInfo.getOwnerDocument().createTextNode(text));
+
+ // Add the finished userInfo object to the concrete
+ // parameter of the xsdAnnotation
+ xsdAnnotation.getElement().appendChild(userInfo);
+
+ // Add the finished userInfo object to the user information
+ // list
+ xsdAnnotation.getUserInformation().add(userInfo);
+ }
+
+ return xsdAnnotation;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ /**
+ * Adds the text to the component as a Documentation parameter (just like addDocumentation) and then adds the
+ * Documentation properties to the Documentation parameter if they exist.
+ * If text is null then no documentation is set.
+ * If properties is null then no properties are added to the documentation parameter.
+ * @param component
+ * @param text
+ * @param properties
+ * @return
+ */
+ public static XSDAnnotation addDocumentationAndAttributes(XSDConcreteComponent component, String text, Map attributes)
+ {
+ if (null == component)
+ {
+ throw new IllegalArgumentException("addDocumentationAndAttributes called with null component"); //$NON-NLS-1$
+ }
+
+ // nothing to add
+ if (text==null && attributes==null)
+ return null;
+
+ // add documentation
+ XSDAnnotation annotation = addDocumentation(component, text);
+
+ if (annotation==null)
+ return null;
+
+ // no properties so return
+ if (attributes==null || attributes.isEmpty())
+ return annotation;
+
+ // get annotation dom parameter, create if necessary
+ Element userInfo = null;
+ if (annotation.getUserInformation().isEmpty())
+ {
+ userInfo = annotation.createUserInformation(null);
+ annotation.getElement().appendChild(userInfo);
+ }
+ else
+ {
+ for (Iterator<Element> i = annotation.getUserInformation().iterator(); i.hasNext();)
+ {
+ userInfo = i.next();
+ if (userInfo.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
+ {
+ break;
+ }
+ }
+ }
+
+ if (userInfo==null)
+ return null;
+
+ // add properties
+ String key = null;
+ for (Iterator<String> iter = attributes.keySet().iterator(); iter.hasNext();)
+ {
+ key = iter.next();
+ userInfo.setAttribute(key, (String)attributes.get(key));
+ }
+
+ return annotation;
+ }
+
+
+ /**
+ * Returns a string which is not used by any parameter in 'elements'. The name
+ * is generated by appending numerical suffixes on to 'prefix' until a
+ * unique one is found. PRECONDITION: 'elements' is a list of
+ * XSDNamedComponent instances
+ *
+ * @param prefix
+ * @param elements
+ * @return
+ */
+ public static String createUniqueElementName(String prefix, List elements) {
+ ArrayList<String> usedNames = new ArrayList<String>();
+ for(Iterator i = elements.iterator(); i.hasNext(); ) {
+ usedNames.add( getDisplayName((XSDNamedComponent) i.next()));
+ }
+
+ int i = 1;
+ String testName = prefix + i++;
+ while(usedNames.contains(testName)) {
+ testName = prefix + i++;
+ }
+ return testName;
+ }
+
+ /**
+ * Like getPrimitives(), this returns a list of XSDTypeDefinitions. However where getPrimitives()
+ * returns the basic set supported by the editor, getAdvancedPrimitives returns every known XSD
+ * primitive type.
+ * @return
+ */
+ public static List<XSDTypeDefinition> getAdvancedPrimitives() {
+ advancedPrimitives = null;
+ if(advancedPrimitives == null) {
+ advancedPrimitives = new ArrayList<XSDTypeDefinition>();
+
+ // Get the schema for schemas instance to use when resolving primitives
+ XSDSchema schemaForSchemas = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
+
+ // Start adding the simple types using the supportedPrimitives list
+ for (String typeName : supportedPrimitives) {
+ XSDTypeDefinition type = schemaForSchemas.resolveSimpleTypeDefinition(typeName);
+ advancedPrimitives.add(type);
+ }
+
+ // Return primitives in alpha order
+ Collections.sort(advancedPrimitives, new Comparator() {
+
+ public int compare(Object o1, Object o2) {
+ if(o1 == null || o2 == null || ((XSDTypeDefinition) o1).getName() == null)
+ return 0;
+ return ((XSDTypeDefinition) o1).getName().compareToIgnoreCase(((XSDTypeDefinition) o2).getName());
+ }
+ });
+ }
+ return advancedPrimitives;
+ }
+
+ /**
+ * Retrieves all the root Data types defined in the schema including complex types, user-defined simple types and anonymous
+ * complex types. If there's an anonymous complex type definition (from a root parameter declaration) then we return
+ * the parameter declaration's anonymous type.
+ * @param schema
+ * @return
+ */
+ public static List<XSDTypeDefinition> getAllDataTypes(XSDSchema schema)
+ {
+ if (schema==null)
+ return Collections.emptyList();
+
+ List<XSDTypeDefinition> bos = new ArrayList<XSDTypeDefinition>();
+
+ EList<XSDSchemaContent> contents = schema.getContents();
+ // First try the easy approach -- if this XSD contains a type definition, that's our BO,
+ // return it. This is the recommended path, and the way our tooling does things.
+ for (XSDSchemaContent item : contents) {
+ if (item instanceof XSDTypeDefinition)
+ bos.add((XSDTypeDefinition)item);
+ }
+
+ // If we failed, we try a second pass, this time looking for an parameter
+ // with an anonymous complex
+ // type defined in line
+ for (XSDSchemaContent item : contents) {
+ if (item instanceof XSDElementDeclaration)
+ {
+ XSDElementDeclaration element = (XSDElementDeclaration) item;
+ if (element.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
+ {
+ bos.add(element.getAnonymousTypeDefinition());
+ }
+ }
+ }
+ return bos;
+ }
+
+ /**
+ * Given a BO (XSD Complex Type), return a list of the properties
+ * within the complexType.
+ * @param bo
+ * @return List of XSDAttributeDeclaration
+ */
+ public static List<XSDAttributeDeclaration> getChildAttributes(XSDComplexTypeDefinition bo)
+ {
+ EList attrContents = bo.getAttributeContents();
+ List<XSDAttributeDeclaration> attrs = new ArrayList<XSDAttributeDeclaration>();
+ for (int i=0; i< attrContents.size(); i++)
+ {
+ Object next = attrContents.get(i);
+
+ // Attribute contents may include actual attribute delcarations (wrapped in XSDAttributeUses) or
+ // attribute group definitions, containing bundles of properties
+ if(next instanceof XSDAttributeUse) {
+ attrs.add( ((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration() );
+
+ } else if (next instanceof XSDAttributeGroupDefinition) {
+
+ // Add these properties to the end of attrContents to be processed in turn
+ XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
+ if(attrGroup.getResolvedAttributeGroupDefinition() != null)
+ attrContents.addAll(attrGroup.getResolvedAttributeGroupDefinition().getAttributeUses());
+
+ }
+ }
+ return attrs;
+ }
+
+ /**
+ * Given a BO (XSD Complex Type), return a list of the XSDFeatures
+ * within the complexType's modelgroup (sequence, choice, etc.)
+ * @param bo
+ * @return
+ */
+ public static List<XSDFeature> getChildElements(XSDComplexTypeDefinition bo)
+ {
+ return XSDUtils.getChildElements( getModelGroup(bo) );
+ }
+
+ /**
+ * Given an XSDFeature, return a list of the XSDFeatures
+ * within the complexType's modelgroup (sequence, choice, etc.)
+ * @param bo
+ * @return
+ */
+ public static List<XSDFeature> getChildElements(XSDFeature elem)
+ {
+ XSDComplexTypeDefinition cType = getResolvedComplexType(elem);
+ return (cType != null) ? XSDUtils.getChildElements(cType) : Collections.EMPTY_LIST;
+ }
+
+
+ /**
+ * Given a Model group, return a list of the XSDFeatures
+ * declared within.
+ * @param group
+ * @return
+ */
+ public static List<XSDFeature> getChildElements(XSDModelGroup group)
+ {
+ if(group == null)
+ return new ArrayList<XSDFeature>();
+
+ List<XSDFeature> children = new ArrayList<XSDFeature>();
+ for(Iterator<XSDParticle> i = group.getContents().iterator(); i.hasNext();)
+ {
+ XSDParticle next = i.next();
+ if(next.getContent() instanceof XSDFeature)
+ children.add((XSDFeature) next.getContent());
+ else if (next.getTerm() instanceof XSDModelGroup)
+ children.addAll(getChildElements((XSDModelGroup) next.getTerm()));
+ }
+ return children;
+ }
+
+ /**
+ * Return the contents of the documentation parameter in type's annotation, if it has one.
+ * Otherwise return null
+ * @param type
+ * @return
+ */
+ public static String getDocumentation(XSDFeature element) {
+ XSDAnnotation annotation = null;
+
+ if (element instanceof XSDAttributeDeclaration)
+ annotation = ((XSDAttributeDeclaration)element).getAnnotation();
+ else if (element instanceof XSDElementDeclaration)
+ annotation = ((XSDElementDeclaration)element).getAnnotation();
+
+ if(annotation != null) {
+ for(Iterator i = annotation.getUserInformation().iterator(); i.hasNext(); ) {
+ Element domElement = (Element) i.next();
+ if(domElement.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG) &&
+ domElement.getFirstChild() instanceof Text) {
+ return ((Text) domElement.getFirstChild()).getData();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the properties on the documentation parameter if they exist. I.e. returns source and xml:lang
+ * Returns an empty parentMap if none.
+ * @param type
+ * @return
+ */
+ public static Map<String, String> getDocumentationAttributes(XSDTypeDefinition type)
+ {
+ Map<String, String> attributes = new HashMap<String, String>();
+
+ if (type.getAnnotation() != null)
+ {
+ XSDAnnotation annotation = type.getAnnotation();
+ for (Iterator i = annotation.getUserInformation().iterator(); i
+ .hasNext();)
+ {
+ Element element = (Element) i.next();
+ if (element.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
+ {
+ String source = element.getAttribute("source"); //$NON-NLS-1$
+ String lang = element.getAttribute("xml:lang"); //$NON-NLS-1$
+ if (lang==null || lang.length()<1)
+ lang = element.getAttribute("lang"); //$NON-NLS-1$
+
+ if (source!=null && source.length()>0)
+ attributes.put("source", source); //$NON-NLS-1$
+
+ if (lang!=null && lang.length()>0)
+ attributes.put("xml:lang", lang); //$NON-NLS-1$
+
+ return attributes;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the properties on the documentation parameter if they exist. I.e. returns source and xml:lang
+ * Returns an empty parentMap if none.
+ * @param parameter
+ * @return
+ */
+ public static Map<String, String> getDocumentationAttributes(XSDFeature element)
+ {
+ XSDAnnotation annotation = null;
+ Map<String, String> attributes = new HashMap<String, String>();
+
+ if (element instanceof XSDAttributeDeclaration)
+ annotation = ((XSDAttributeDeclaration)element).getAnnotation();
+ else if (element instanceof XSDElementDeclaration)
+ annotation = ((XSDElementDeclaration)element).getAnnotation();
+
+ if (annotation != null)
+ {
+ for (Iterator i = annotation.getUserInformation().iterator(); i
+ .hasNext();)
+ {
+ Element domElement = (Element) i.next();
+ if (domElement.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG))
+ {
+ String source = domElement.getAttribute("source"); //$NON-NLS-1$
+ String lang = domElement.getAttribute("xml:lang"); //$NON-NLS-1$
+ if (lang==null || lang.length()<1)
+ lang = domElement.getAttribute("lang"); //$NON-NLS-1$
+
+ if (source!=null && source.length()>0)
+ attributes.put("source", source); //$NON-NLS-1$
+
+ if (lang!=null && lang.length()>0)
+ attributes.put("xml:lang", lang); //$NON-NLS-1$
+
+ return attributes;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return the contents of the documentation parameter in type's annotation, if it has one.
+ * Otherwise return null
+ * @param type
+ * @return
+ */
+ public static String getDocumentation(XSDTypeDefinition type) {
+ if(type.getAnnotation() != null) {
+ XSDAnnotation annotation = type.getAnnotation();
+ for(Iterator i = annotation.getUserInformation().iterator(); i.hasNext(); ) {
+ Element element = (Element) i.next();
+ if(element.getTagName().endsWith(XSDConstants.DOCUMENTATION_ELEMENT_TAG) &&
+ element.getFirstChild() instanceof Text) {
+ return ((Text) element.getFirstChild()).getData();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Given an XSD Complex Type Definition, return the model group containing
+ * its child elements.
+ * @param parameter
+ * @return
+ */
+ public static XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
+ {
+ XSDParticle particle = cType.getComplexType();
+
+ // In cases where cType doesn't have a model group AND cType has a parent with a modelgroup, the
+ // call above will rather unexpectedly give us cType's PARENT's model group, rather than the null we
+ // might expect. We don't want that here, if the model group returned is null or belongs to someone
+ // other than us, return null
+ if (particle==null || particle.eContainer() != cType) {
+ return null;
+ }
+
+ // get the model group
+ Object particleContent = particle.getContent();
+ XSDModelGroup group = null;
+
+ if (particleContent instanceof XSDModelGroupDefinition) {
+ group = ((XSDModelGroupDefinition)particleContent).getResolvedModelGroupDefinition().getModelGroup();
+ } else if (particleContent instanceof XSDModelGroup) {
+ group = (XSDModelGroup)particleContent;
+ }
+
+ if (group == null) {
+ return null;
+ }
+
+ // if the content of the complex type is empty then the content
+ // must be in the complexContent, ie. we're extending another BO.
+ // if the group and the type are not in the same resource then
+ // we are extending another BO and we don't want to show inherited
+ // properties.
+ if ( group.getContents().isEmpty() || group.eResource() != cType.eResource())
+ {
+ // if we are extending another BO then get the elements
+ // we are adding
+ if (cType.getBaseType()!=null)
+ {
+ XSDComplexTypeContent content = cType.getContent();
+
+ if (content instanceof XSDParticle) {
+ particleContent = ((XSDParticle)content).getContent();
+ if (particleContent instanceof XSDModelGroupDefinition) {
+ group = ((XSDModelGroupDefinition)particleContent).getResolvedModelGroupDefinition().getModelGroup();
+ } else if (particleContent instanceof XSDModelGroup) {
+ group = (XSDModelGroup)particleContent;
+ }
+ }
+
+ }
+ }
+
+ return group;
+ }
+
+ /**
+ * General utility method for finding a name for an xsd component. This method will handle
+ * mapping of xsd primitive names to their human readable counterparts, as well as resolving
+ * parameter references for properties and walking up object hierarchies for anonymous types.
+ * Basically this method should be used whenever a name is needed to minimize the risk of
+ * having a name of 'null' -- though this method WILL return null if no name can be found.
+ * @param component
+ * @return
+ */
+ public static String getDisplayName(XSDNamedComponent component) {
+
+ if(component == null)
+ return null;
+
+ if(component instanceof XSDTypeDefinition)
+ return getDisplayNameFromXSDType((XSDTypeDefinition) component);
+
+ if (component instanceof XSDFeature) {
+ XSDFeature feature = (XSDFeature) component;
+ if(feature.getName() != null)
+ return feature.getName();
+ else if (feature.getResolvedFeature() != null && feature.getResolvedFeature().getName() != null)
+ return feature.getResolvedFeature().getName();
+ }
+
+ return component.getName();
+
+ }
+
+ /**
+ * Try a variety of methods to get a human readable name for type. In order, this method will
+ * - check whether type is null, and if so return null
+ * - check whether type is a restriction of a primitive type, if so return its parent's name
+ * - check whether type is a complex anonymous (un-named) inner type of a named parameter, and if so, return the parameter's name
+ * - check whether type is a primitive type, and if so return a human-readable version of that type
+ * - check whether type is a named, non-primitive type, and if so, return its name
+ * @param xsdType
+ * @return
+ */
+ public static String getDisplayNameFromXSDType(XSDTypeDefinition type) {
+ return getDisplayNameFromXSDType(type, true);
+ }
+
+ /**
+ * Try a variety of methods to get a human readable name for type. In order, this method will
+ * - check whether type is null, and if so return null
+ * - check whether type is a complex anonymous (un-named) inner type of a named parameter, and if so, return the parameter's name
+ * - check whether type is a primitive type, and if so return a human-readable version of that type
+ * - check whether type is a named, non-primitive type, and if so, return its name
+ * - if returnPrimitiveParents is true, check whether type is a restriction of a primitive type,
+ * if so return its parent's name
+ * @param xsdType
+ * @param returnPrimitiveParents if true, and if type is an anonymous restriction of an xsd primitive
+ * type, this method will return the name of the parent primitive type. If false, restrictions of
+ * primitive types will not be treated differently from other types, and their control hierarchy will
+ * be walked, instead of their inheritance hierarchy.
+ * @return
+ */
+ public static String getDisplayNameFromXSDType(XSDTypeDefinition type, boolean returnPrimitiveParents) {
+ if(type == null)
+ return null;
+
+
+
+ // Does type have a name? If not, walk up the control tree to try and find one
+ if(type.getName() == null || type.getName().length() == 0) {
+
+ // In the special case where type is a restriction on a primitive type, just return the parent's
+ // name (which will either be a primitive itself, or a named simple type)
+ if(returnPrimitiveParents && isRestrictedPrimitiveType(type)) {
+ return getDisplayNameFromXSDType(type.getBaseType());
+ }
+
+ EObject container = type.eContainer();
+
+ while(container != null) {
+ if(container instanceof XSDNamedComponent && ((XSDNamedComponent) container).getName() != null) {
+ return ((XSDNamedComponent) container).getName();
+ }
+ container = container.eContainer();
+ }
+ // Type doesn't have a name, or a control with a name, nothing useful
+ return null;
+ } else
+ return type.getName();
+ }
+
+ /**
+ * Return the type definition for the primitive with name xsdName (note, this is not the human-readable
+ * name, but the actual XSD type name.) Return null if a type with this name is not in the list of
+ * all primitives
+ * @param xsdName
+ * @return
+ */
+ public static XSDSimpleTypeDefinition getPrimitive(String xsdName) {
+ for(Iterator<XSDTypeDefinition> i = getAdvancedPrimitives().iterator(); i.hasNext();) {
+ XSDSimpleTypeDefinition next = (XSDSimpleTypeDefinition) i.next();
+ if(next.getName().equals(xsdName)) {
+ return next;
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @return Returns a list of XSDSimpleTypeDefinitions representing each of the supported primitives.
+ * These will have their XSD spec names (e.g. xsd:dateTime) so they will likely need to be fed to
+ * getDisplayName() if they are going to be presented to humans
+ */
+ public static List<XSDSimpleTypeDefinition> getPrimitives() {
+ if(primitives == null) {
+ primitives = new ArrayList<XSDSimpleTypeDefinition>();
+
+ // Get the schema for schemas instance to use when resolving primitives
+ XSDSchema schemaForSchemas = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
+
+ // Start adding the simple types from the XSD short list
+ for(Iterator<String> i = xsdShortList.iterator(); i.hasNext(); ) {
+ String typeName = i.next();
+
+ XSDSimpleTypeDefinition type = schemaForSchemas.resolveSimpleTypeDefinition(typeName);
+ primitives.add(type);
+ }
+
+ // Return primitives in alpha order
+ Collections.sort(primitives, new Comparator() {
+
+ public int compare(Object o1, Object o2) {
+ if(o1 == null || o2 == null || getDisplayNameFromXSDType((XSDTypeDefinition) o1) == null)
+ return 0;
+ return getDisplayNameFromXSDType((XSDTypeDefinition) o1).compareTo(getDisplayNameFromXSDType((XSDTypeDefinition) o2));
+ }
+ });
+ }
+ return primitives;
+ }
+
+ /**
+ * Return a collection of all types referenced by the properties (XSDFeatures) of source. This
+ * method is non-recursive (i.e. the list only contains direct references, not references-of-references)
+ * Will not return null, but may return an empty set. This will not return a BO reference if the file
+ * has been deleted (or just doesn't exist).
+ * @param source The complex type to examine for references
+ * @return a Collection of XSDComplexTypeDefinition instances -- no duplicates
+ */
+ public static Collection<XSDComplexTypeDefinition> getReferencedTypes(XSDComplexTypeDefinition source) {
+ if(source == null)
+ return Collections.emptySet();
+
+ List<XSDComplexTypeDefinition> results = new ArrayList<XSDComplexTypeDefinition>();
+ for(Iterator<XSDFeature> i = getChildElements(source).iterator(); i.hasNext(); ) {
+ XSDFeature element = i.next();
+ XSDComplexTypeDefinition elementType = getResolvedComplexType(element);
+ if(elementType != null && !results.contains(elementType) && !XSDConstants.isSchemaForSchemaNamespace(elementType.getTargetNamespace()))
+ results.add(elementType);
+ }
+ return results;
+ }
+
+ /**
+ * Return a collection of all types referenced by the properties (XSDFeatures) of source. This
+ * method is non-recursive (i.e. the list only contains direct references, not references-of-references)
+ * Will not return null, but may return an empty set. This will return a BO reference if the file
+ * has been deleted (or just doesn't exist).
+ * @param source The complex type to examine for references
+ * @return a Collection of XSDTypeDefinition (could be complex or simple type) instances -- no duplicates
+ */
+ public static Collection<XSDTypeDefinition> getAllReferencedTypes(XSDComplexTypeDefinition source)
+ {
+ return getAllReferencedTypes(source, false);
+ }
+
+ /**
+ * Return a collection of all types referenced by the properties (XSDFeatures) of source. This
+ * method is non-recursive (i.e. the list only contains direct references, not references-of-references)
+ * Will not return null, but may return an empty set. This will return a BO reference if the file
+ * has been deleted (or just doesn't exist).
+ * @param source The complex type to examine for references
+ * @param includeAnonymous if true, the returned list will include anonymous inlined types as well. These
+ * are not technically "referenced", however it allows this method to be used as a way to get all non-primitive
+ * types used in any way by source
+ * @return a Collection of XSDTypeDefinition (could be complex or simple type) instances -- no duplicates
+ */
+ public static Collection<XSDTypeDefinition> getAllReferencedTypes(XSDComplexTypeDefinition source, boolean includeAnonymous)
+ {
+ if (source == null)
+ return Collections.emptySet();
+
+ List<XSDTypeDefinition> results = new ArrayList<XSDTypeDefinition>();
+ XSDTypeDefinition elementType = null;
+ for (Iterator<XSDFeature> i = getChildElements(source).iterator(); i.hasNext();)
+ {
+ XSDFeature next = i.next();
+ elementType = getResolvedType(next);
+
+ // Only add non-null, non-duplicate, non-primitive types. If includeAnonymous is false,
+ // anonymous types should be filtered out as well
+ if( elementType != null &&
+ !results.contains(elementType) &&
+ !XSDConstants.isSchemaForSchemaNamespace(elementType.getTargetNamespace()) &&
+ (includeAnonymous || elementType.eContainer() != next) )
+ results.add(elementType);
+ }
+ return results;
+ }
+
+ /**
+ * Given an parameter, return its complex type, or null if it does not have a complex type. This is
+ * slightly more complicated than just calling getType() since an parameter may not have a type at all, it
+ * may reference another parameter.
+ * @param parameter
+ * @return
+ */
+ public static XSDComplexTypeDefinition getResolvedComplexType(XSDFeature feature) {
+ // The contents of this method have been adapted to the more general getResolvedType,
+ // but this method is maintained for compatibility and convenience
+ XSDTypeDefinition resolvedType = getResolvedType(feature);
+ if(resolvedType instanceof XSDComplexTypeDefinition)
+ return (XSDComplexTypeDefinition) resolvedType;
+ return null;
+ }
+
+ /**
+ * Given an parameter, return its type, or null if it does not have a type. This is
+ * slightly more complicated than just calling getType() since an parameter may not have
+ * a type at all, it may reference another parameter.
+ * @param parameter
+ * @return
+ */
+ public static XSDTypeDefinition getResolvedType(XSDFeature feature) {
+
+ // Special case of elements referencing stale XSD complex types
+ if (feature instanceof XSDElementDeclaration && ((XSDElementDeclaration) feature).getTypeDefinition() instanceof XSDComplexTypeDefinition) {
+
+ XSDElementDeclaration element = (XSDElementDeclaration) feature;
+
+ // We have a type, but types can be proxies, and proxies can become
+ // stale if the referenced
+ // type changes, so before we return it, re-resolve the proxy and
+ // then return it
+ XSDComplexTypeDefinition oldType = (XSDComplexTypeDefinition) element.getTypeDefinition();
+ EObject newType = EcoreUtil.resolve(element.getTypeDefinition(), element);
+ if (oldType != newType) {
+ // We only return the resolved type if the name and the namespace has not changed. Changing the name
+ // and namespace is essentially an unresolved BO.
+ String oldName = oldType.getName();
+ String newName = ((XSDTypeDefinition)newType).getName();
+ String oldTNS = oldType.getTargetNamespace();
+ String newTNS = ((XSDTypeDefinition)newType).getTargetNamespace();
+
+ if ( ((oldName==newName) || (oldName!=null && oldName.equals(newName))) &&
+ ((oldTNS==newTNS) || (oldTNS!=null && oldTNS.equals(newTNS))) )
+ element.setTypeDefinition((XSDTypeDefinition) newType);
+ }
+ return element.getTypeDefinition();
+
+ } else if (feature.getType() != null) {
+ return feature.getType();
+ } else if (feature.getResolvedFeature() != null && feature.getResolvedFeature().getType() != null) {
+ // We reference another parameter
+ return feature.getResolvedFeature().getType();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Return the base type from which this type inherits - that is, all xsd types are
+ * either xsd:anyType or xsd:anySimpleType at the topmost level of inheritance, so return the second
+ * topmost level of type's inheritance. The first specific type from which type inherits.
+ * @param type
+ * @return
+ */
+ public static XSDTypeDefinition getRootType(XSDTypeDefinition type) {
+ if(type == null)
+ return null;
+
+ XSDTypeDefinition baseType = type.getBaseType();
+ while(baseType != null && !XSDConstants.isAnySimpleType(baseType) && !XSDConstants.isAnyType(baseType)) {
+ // walk one more step up the hierarchy
+ type = baseType;
+ baseType = type.getBaseType();
+ }
+
+ // Since baseType, type's immediate parent, broke the while condition, we know that type is now
+ // as high up the tree as we want to be
+ return type;
+
+
+
+ }
+
+ /**
+ * Given a schema, return the list of XSDSimpleTypeDefinitions found within it. Will not return null,
+ * but may return an empty list
+ * @param schema
+ * @return
+ */
+ public static List<XSDSimpleTypeDefinition> getUserDefinedSimpleTypes(XSDSchema schema) {
+ if(schema == null)
+ return Collections.emptyList();
+
+ List<XSDSimpleTypeDefinition> result = new ArrayList<XSDSimpleTypeDefinition>();
+ for (XSDSchemaContent next : schema.getContents()) {
+ if(next instanceof XSDSimpleTypeDefinition)
+ result.add((XSDSimpleTypeDefinition)next);
+ }
+ return result;
+ }
+
+ /**
+ * Given a display name for a BO attribute type, return the XSD type name.
+ * If the given input is not a display name, the input is returned.
+ * @param displayName
+ * @return
+ */
+ public static String getXSDTypeFromDisplayName(String displayName)
+ {
+ // Now a no-op since we no longer translate XSD type names to "human readable" ones
+ return displayName;
+ }
+
+ /**
+ * Return true iff type is a descendant of a primitive xsd type. Will not return true for primitives
+ * themselves.
+ * @param type
+ * @return
+ */
+ public static boolean isRestrictedPrimitiveType(XSDTypeDefinition type) {
+ if(type instanceof XSDComplexTypeDefinition)
+ return false;
+
+ XSDTypeDefinition baseType = getRootType(type);
+ return getAdvancedPrimitives().contains(baseType);
+ }
+
+ /**
+ * Gets the "minOccurs" attribute value for the given XSDFeature, if
+ * there is none then it returns the default 1.
+ * @param xsdElem
+ * @return
+ */
+ public static int getMinOccurs(XSDFeature xsdElem)
+ {
+ if (xsdElem.eContainer() instanceof XSDAttributeUse)
+ {
+ return (((XSDAttributeUse)xsdElem.eContainer()).getUse()==XSDAttributeUseCategory.REQUIRED_LITERAL?1:0);
+ }
+
+ XSDParticle particle = (XSDParticle)xsdElem.eContainer();
+ int min = 1;
+ if (particle.isSetMinOccurs())
+ min = particle.getMinOccurs();
+
+ return min;
+ }
+
+ /**
+ * Gets the "maxOccurs" attribute value for the given XSDFeature, if
+ * there is none then it returns the default 1.
+ * @param xsdElem
+ * @return
+ */
+ public static int getMaxOccurs(XSDFeature xsdElem)
+ {
+ int max = 1;
+
+ // not a particle means an attribute use. properties are maxed at 1.
+ if ( !(xsdElem.eContainer() instanceof XSDParticle) )
+ return max;
+
+ XSDParticle particle = (XSDParticle)xsdElem.eContainer();
+ if (particle.isSetMaxOccurs())
+ max = particle.getMaxOccurs();
+
+ return max;
+ }
+
+ /**
+ * Return the Data Type from the given schema with the given name.
+ * @param schema - The schema containing the type.
+ * @param boName - The local name of the type to retrieve -- if null method returns first type found.
+ * @return The XSDTypeDefinition if one exists, null otherwise
+ */
+ public static XSDTypeDefinition getDataType(XSDSchema schema, String typeName) {
+ if(schema == null)
+ return null;
+
+ boolean pickFirstFound = (typeName==null || typeName.length()<1);
+
+ EList<XSDSchemaContent> contents = schema.getContents();
+
+ // First try the easy approach -- if this XSD contains a type definition with the right name, that's
+ // our type, return it. This is the recommended path, and the way our tooling does things.
+ for(Iterator<XSDSchemaContent> i = contents.iterator(); i.hasNext(); ) {
+ Object item = i.next();
+ if(item instanceof XSDTypeDefinition)
+ if (pickFirstFound)
+ return (XSDTypeDefinition) item;
+ else if ( typeName.equals(getDisplayName((XSDTypeDefinition)item)))
+ return (XSDTypeDefinition) item;
+ }
+
+ // If we failed, we try a second pass, this time looking for an parameter with an anonymous
+ // type defined in line
+ for(Iterator<XSDSchemaContent> i = contents.iterator(); i.hasNext(); ) {
+ Object item = i.next();
+ if(item instanceof XSDFeature) {
+ XSDFeature element = (XSDFeature) item;
+ XSDTypeDefinition resolvedType = getResolvedType(element);
+ if(resolvedType != null && resolvedType.getSchema() == schema) {
+ if (pickFirstFound)
+ return resolvedType;
+ else if (typeName.equals(getDisplayName(element)))
+ return resolvedType;
+ }
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * Gets the "default" attribute value for the given XSDFeature, if there
+ * is none then it returns an empty string.
+ * @param xsdElem
+ * @return
+ */
+ public static String getDefaultValue(XSDFeature xsdElem)
+ {
+ XSDConstraint constraint = null;
+ if (xsdElem instanceof XSDAttributeDeclaration)
+ {
+ // attribute declarations store their default values in
+ // their containers (attribute uses)
+ XSDAttributeUse use = (XSDAttributeUse)xsdElem.getContainer();
+ if (use.isSetConstraint())
+ constraint = use.getConstraint();
+
+ if (constraint!=null && constraint.equals(XSDConstraint.DEFAULT_LITERAL))
+ if (use.getLexicalValue()!=null)
+ return use.getLexicalValue();
+ else
+ return ""; //$NON-NLS-1$
+ }
+ else if (xsdElem instanceof XSDElementDeclaration)
+ {
+ if (xsdElem.isSetConstraint())
+ constraint = xsdElem.getConstraint();
+
+ if (constraint!=null && constraint.equals(XSDConstraint.DEFAULT_LITERAL))
+ if (xsdElem.getLexicalValue()!=null)
+ return xsdElem.getLexicalValue();
+ else
+ return ""; //$NON-NLS-1$
+
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Return the enclosing Complex Type definition.
+ * @param component
+ * @return
+ */
+ public static XSDComplexTypeDefinition getEnclosingTypeDefinition(EObject component)
+ {
+ if (component == null)
+ return null;
+
+ if (component instanceof XSDComplexTypeDefinition)
+ return (XSDComplexTypeDefinition)component;
+
+ return getEnclosingTypeDefinition(component.eContainer());
+ }
+
+ /**
+ * Given an XSD schema with a new target namespace set, this method will cycle through the XSD schema directives
+ * (i.e. imports/includes/redefines) and remove as appropriate.
+ *
+ * I.e. this method will remove all includes/redefines if the new TNS is different than the old TNS and it will remove
+ * all imports that have the same namespace as the new TNS (since these should now be includes).
+ *
+ * @param schema - has the new target namespace set
+ * @param oldTNS
+ */
+ public static void removeImportsAndIncludes(XSDSchema schema, String oldTNS)
+ {
+ if (schema==null)
+ return;
+
+ String newTNS = schema.getTargetNamespace();
+
+ // namespace hasn't changed
+ if (newTNS==null && oldTNS==null)
+ return;
+
+ // namespace hasn't changed
+ if (newTNS!=null && newTNS.equals(oldTNS))
+ return;
+
+ // namespace has changed so remove all includes and remove any imports to the new namespace
+ ArrayList schemaContents = new ArrayList(schema.getContents());
+ for (Iterator i = schemaContents.iterator(); i.hasNext();)
+ {
+ Object next = i.next();
+ if (next instanceof XSDImport)
+ {
+ XSDImport nextImport = (XSDImport) next;
+ if (nextImport.getNamespace()==null && newTNS==null)
+ schema.getContents().remove(nextImport);
+ else if (nextImport.getNamespace()!=null && nextImport.getNamespace().equals(newTNS))
+ schema.getContents().remove(nextImport);
+ }
+ else if (next instanceof XSDSchemaCompositor)
+ {
+ schema.getContents().remove(next);
+ }
+ }
+
+ }
+
+ /**
+ * Given an XSD complex type, return a list of the XSDFeatures (parameter
+ * and attribute declarations) within the complex type.
+ */
+ public static List<XSDFeature> getXSDElementsAndAttributes(XSDComplexTypeDefinition complexType)
+ {
+ List<XSDFeature> result = getChildElements(complexType);
+ result.addAll( getChildAttributes(complexType));
+
+ return result;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BPMN2ModelView.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BPMN2ModelView.java
index 38b47e7..5949fa9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BPMN2ModelView.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BPMN2ModelView.java
@@ -1,104 +1,104 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.views;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceAdapter;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * This sample class demonstrates how to plug-in a new workbench view. The view shows data obtained from the model. The
- * sample creates a dummy model on the fly, but a real implementation would connect to the model available either in
- * this or another plug-in (e.g. the workspace). The view is connected to the model using a content provider.
- * <p>
- * The view uses a label provider to define how model objects should be presented in the view. Each view can present the
- * same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared
- * between views in order to ensure that objects of the same description are presented in the same way everywhere.
- * <p>
- */
-
-public class BPMN2ModelView extends ViewPart {
-
- private final class BpmnModelDragSourceLisener extends DragSourceAdapter {
- @Override
- public void dragStart(DragSourceEvent event) {
- if (((IStructuredSelection) viewer.getSelection()).getFirstElement() instanceof TreeObject) {
-
- IStructuredSelection iStructuredSelection = (IStructuredSelection) viewer.getSelection();
- TreeObject treeObject = (TreeObject) iStructuredSelection.getFirstElement();
- BaseElement baseElement = treeObject.getBaseElement();
- LocalSelectionTransfer.getTransfer().setSelection(new StructuredSelection(baseElement));
- }
-
- }
- }
-
- /**
- * The ID of the view as specified by the extension.
- */
- public static final String ID = "org.eclipse.bpmn2.modeler.ui.views.BPMN2ModelView";
-
- private TreeViewer viewer;
- private ISelectionListener listener;
-
- /**
- * The constructor.
- */
- public BPMN2ModelView() {
- }
-
- /**
- * This is a callback that will allow us to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-
- final ViewContentProvider contentProvider = new ViewContentProvider();
- viewer.setContentProvider(contentProvider);
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setInput(getViewSite());
-
- viewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, new Transfer[] { LocalSelectionTransfer.getTransfer() },
- new BpmnModelDragSourceLisener());
-
- listener = new BpmnModelViewerSelectionListener(viewer);
- getSite().getPage().addSelectionListener(listener);
-
- // Create the help context id for the viewer's control
- PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.eclipse.bpmn2.modeler.ui.viewer");
- }
-
- @Override
- public void dispose() {
- getSite().getPage().removeSelectionListener(listener);
- super.dispose();
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.views;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSourceAdapter;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * This sample class demonstrates how to plug-in a new workbench view. The view shows data obtained from the model. The
+ * sample creates a dummy model on the fly, but a real implementation would connect to the model available either in
+ * this or another plug-in (e.g. the workspace). The view is connected to the model using a content provider.
+ * <p>
+ * The view uses a label provider to define how model objects should be presented in the view. Each view can present the
+ * same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared
+ * between views in order to ensure that objects of the same description are presented in the same way everywhere.
+ * <p>
+ */
+
+public class BPMN2ModelView extends ViewPart {
+
+ private final class BpmnModelDragSourceLisener extends DragSourceAdapter {
+ @Override
+ public void dragStart(DragSourceEvent event) {
+ if (((IStructuredSelection) viewer.getSelection()).getFirstElement() instanceof TreeObject) {
+
+ IStructuredSelection iStructuredSelection = (IStructuredSelection) viewer.getSelection();
+ TreeObject treeObject = (TreeObject) iStructuredSelection.getFirstElement();
+ BaseElement baseElement = treeObject.getBaseElement();
+ LocalSelectionTransfer.getTransfer().setSelection(new StructuredSelection(baseElement));
+ }
+
+ }
+ }
+
+ /**
+ * The ID of the view as specified by the extension.
+ */
+ public static final String ID = "org.eclipse.bpmn2.modeler.ui.views.BPMN2ModelView";
+
+ private TreeViewer viewer;
+ private ISelectionListener listener;
+
+ /**
+ * The constructor.
+ */
+ public BPMN2ModelView() {
+ }
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+
+ final ViewContentProvider contentProvider = new ViewContentProvider();
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(new ViewLabelProvider());
+ viewer.setInput(getViewSite());
+
+ viewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, new Transfer[] { LocalSelectionTransfer.getTransfer() },
+ new BpmnModelDragSourceLisener());
+
+ listener = new BpmnModelViewerSelectionListener(viewer);
+ getSite().getPage().addSelectionListener(listener);
+
+ // Create the help context id for the viewer's control
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.eclipse.bpmn2.modeler.ui.viewer");
+ }
+
+ @Override
+ public void dispose() {
+ getSite().getPage().removeSelectionListener(listener);
+ super.dispose();
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BpmnModelViewerSelectionListener.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BpmnModelViewerSelectionListener.java
index fb9a4a1..2151753 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BpmnModelViewerSelectionListener.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/BpmnModelViewerSelectionListener.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.views;
-
-import java.io.IOException;
-
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-class BpmnModelViewerSelectionListener implements ISelectionListener {
- private final ViewContentProvider contentProvider;
- private BPMN2Editor editor;
- private final TreeViewer viewer;
-
- public BpmnModelViewerSelectionListener(TreeViewer viewer) {
- this.viewer = viewer;
- this.contentProvider = (ViewContentProvider) viewer.getContentProvider();
- }
-
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
- Object bpmn2Editor = part.getAdapter(BPMN2Editor.class);
- if (bpmn2Editor instanceof BPMN2Editor) {
- editor = (BPMN2Editor)bpmn2Editor;
- try {
- ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(editor.getDiagramTypeProvider()
- .getDiagram().eResource());
- contentProvider.updateModel(modelHandler);
- viewer.refresh(true);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- Object[] selected = contentProvider.getSelected(selection);
- if (selected != null) {
- viewer.setSelection(new StructuredSelection(selected), true);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.views;
+
+import java.io.IOException;
+
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
+
+class BpmnModelViewerSelectionListener implements ISelectionListener {
+ private final ViewContentProvider contentProvider;
+ private BPMN2Editor editor;
+ private final TreeViewer viewer;
+
+ public BpmnModelViewerSelectionListener(TreeViewer viewer) {
+ this.viewer = viewer;
+ this.contentProvider = (ViewContentProvider) viewer.getContentProvider();
+ }
+
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+
+ Object bpmn2Editor = part.getAdapter(BPMN2Editor.class);
+ if (bpmn2Editor instanceof BPMN2Editor) {
+ editor = (BPMN2Editor)bpmn2Editor;
+ try {
+ ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(editor.getDiagramTypeProvider()
+ .getDiagram().eResource());
+ contentProvider.updateModel(modelHandler);
+ viewer.refresh(true);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ Object[] selected = contentProvider.getSelected(selection);
+ if (selected != null) {
+ viewer.setSelection(new StructuredSelection(selected), true);
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeObject.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeObject.java
index 5e59177..d1389a0 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeObject.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeObject.java
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.views;
-
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-
-class TreeObject implements IAdaptable {
- private String name;
- private TreeParent parent;
- private BaseElement f;
-
- public TreeObject(final String name) {
- this.name = name;
- }
-
- public TreeObject(final BaseElement f) {
- this.f = f;
- if (f instanceof FlowElement) {
- FlowElement flowElem = (FlowElement) f;
- name = flowElem.getName() == null ? "" : flowElem.getName();
- name += " (" + f.eClass().getName() + ")";
- } else {
- name = f.eClass().getName();
- }
- }
-
- public String getName() {
- return name;
- }
-
- public void setParent(final TreeParent parent) {
- this.parent = parent;
- }
-
- public TreeParent getParent() {
- return parent;
- }
-
- public String toString() {
- return getName();
- }
-
- public Object getAdapter(final Class key) {
- if (key.equals(EObject.class)) {
- return getBaseElement();
- }
- return null;
- }
-
- public void setBaseElement(final BaseElement f) {
- this.f = f;
- }
-
- public BaseElement getBaseElement() {
- return f;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.views;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+
+class TreeObject implements IAdaptable {
+ private String name;
+ private TreeParent parent;
+ private BaseElement f;
+
+ public TreeObject(final String name) {
+ this.name = name;
+ }
+
+ public TreeObject(final BaseElement f) {
+ this.f = f;
+ if (f instanceof FlowElement) {
+ FlowElement flowElem = (FlowElement) f;
+ name = flowElem.getName() == null ? "" : flowElem.getName();
+ name += " (" + f.eClass().getName() + ")";
+ } else {
+ name = f.eClass().getName();
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setParent(final TreeParent parent) {
+ this.parent = parent;
+ }
+
+ public TreeParent getParent() {
+ return parent;
+ }
+
+ public String toString() {
+ return getName();
+ }
+
+ public Object getAdapter(final Class key) {
+ if (key.equals(EObject.class)) {
+ return getBaseElement();
+ }
+ return null;
+ }
+
+ public void setBaseElement(final BaseElement f) {
+ this.f = f;
+ }
+
+ public BaseElement getBaseElement() {
+ return f;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeParent.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeParent.java
index 43cba58..81ad485 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeParent.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/TreeParent.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.views;
-
-import java.util.ArrayList;
-
-import org.eclipse.bpmn2.BaseElement;
-
-class TreeParent extends TreeObject {
- private ArrayList<TreeObject> children;
-
- public TreeParent(String name) {
- super(name);
- children = new ArrayList<TreeObject>();
- }
-
- public TreeParent(BaseElement elem) {
- super(elem);
- children = new ArrayList<TreeObject>();
- }
-
- public void addChild(TreeObject child) {
- children.add(child);
- child.setParent(this);
- }
-
- public void removeChild(TreeObject child) {
- children.remove(child);
- child.setParent(null);
- }
-
- public TreeObject[] getChildren() {
- return (TreeObject[]) children.toArray(new TreeObject[children.size()]);
- }
-
- public boolean hasChildren() {
- return children.size() > 0;
- }
-
- public void removeChildren() {
- children.clear();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.views;
+
+import java.util.ArrayList;
+
+import org.eclipse.bpmn2.BaseElement;
+
+class TreeParent extends TreeObject {
+ private ArrayList<TreeObject> children;
+
+ public TreeParent(String name) {
+ super(name);
+ children = new ArrayList<TreeObject>();
+ }
+
+ public TreeParent(BaseElement elem) {
+ super(elem);
+ children = new ArrayList<TreeObject>();
+ }
+
+ public void addChild(TreeObject child) {
+ children.add(child);
+ child.setParent(this);
+ }
+
+ public void removeChild(TreeObject child) {
+ children.remove(child);
+ child.setParent(null);
+ }
+
+ public TreeObject[] getChildren() {
+ return (TreeObject[]) children.toArray(new TreeObject[children.size()]);
+ }
+
+ public boolean hasChildren() {
+ return children.size() > 0;
+ }
+
+ public void removeChildren() {
+ children.clear();
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewContentProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewContentProvider.java
index 3856d9f..0a9a19e 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewContentProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewContentProvider.java
@@ -1,178 +1,178 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.views;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.LaneSet;
-import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.RootElement;
-import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.modeler.core.ModelHandler;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramLink;
-import org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IViewSite;
-
-class ViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
- private TreeParent invisibleRoot;
-
- @Override
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public Object[] getElements(Object parent) {
- if (parent instanceof IViewSite) {
- if (invisibleRoot == null) {
- initialize();
- }
- return getChildren(invisibleRoot);
- }
- return getChildren(parent);
- }
-
- @Override
- public Object getParent(Object child) {
- if (child instanceof TreeObject) {
- return ((TreeObject) child).getParent();
- }
- return null;
- }
-
- @Override
- public Object[] getChildren(Object parent) {
- if (parent instanceof TreeParent) {
- return ((TreeParent) parent).getChildren();
- }
- return new Object[0];
- }
-
- @Override
- public boolean hasChildren(Object parent) {
- if (parent instanceof TreeParent) {
- return ((TreeParent) parent).hasChildren();
- }
- return false;
- }
-
- /*
- * We will set up a dummy model to initialize tree heararchy. In a real code, you will connect to a real model and
- * expose its hierarchy.
- */
- private void initialize() {
- invisibleRoot = new TreeParent("");
- }
-
- void updateModel(ModelHandler mh) {
- invisibleRoot.removeChildren();
- if (mh == null) {
- return;
- }
-
- Definitions definitions = mh.getDefinitions();
-
- List<RootElement> rootElements = definitions.getRootElements();
- for (RootElement element : rootElements) {
-
- if (element instanceof Process) {
- Process process = (Process) element;
- TreeParent proc = new TreeParent("Process");
-
- createLaneSets(proc, process.getLaneSets());
- createFlowElementTree(proc, process.getFlowElements());
- invisibleRoot.addChild(proc);
- }
- }
-
- }
-
- private void createLaneSets(TreeParent proc, List<LaneSet> laneSets) {
- for (LaneSet laneSet : laneSets) {
- createLaneSetTree(proc, laneSet);
-
- }
- }
-
- private void createLaneSetTree(TreeParent proc, LaneSet laneSet) {
- if (laneSet == null) {
- return;
- }
- for (Lane lane : laneSet.getLanes()) {
- TreeParent parent = new TreeParent(lane);
- proc.addChild(parent);
- createLaneSetTree(parent, lane.getChildLaneSet());
- }
- }
-
- private void createFlowElementTree(TreeParent proc, List<FlowElement> flowElements) {
- for (FlowElement f : flowElements) {
- if (!(f instanceof SequenceFlow)) {
- TreeObject treeObject = new TreeObject(f);
- proc.addChild(treeObject);
- }
- }
- }
-
- @SuppressWarnings("restriction")
- public Object[] getSelected(ISelection selection) {
- if (selection instanceof StructuredSelection) {
- StructuredSelection sel = (StructuredSelection) selection;
- List<Object> selected = Arrays.asList(sel.toArray());
- if (selected.size() == 0 || !(selected.get(0) instanceof ContainerShapeEditPart)) {
- return null;
- }
-
- PictogramLink link = ((ContainerShapeEditPart) selected.get(0)).getPictogramElement().getLink();
- if (link == null) {
- return null;
- }
-
- EList<EObject> businessObjects = link.getBusinessObjects();
- TreeObject[] children = invisibleRoot.getChildren();
- ArrayList<TreeObject> list = getSelectionFromList(businessObjects, children);
- return list.toArray();
- }
- return null;
- }
-
- private ArrayList<TreeObject> getSelectionFromList(EList<EObject> businessObjects, TreeObject[] children) {
- ArrayList<TreeObject> list = new ArrayList<TreeObject>();
- for (TreeObject treeObject : children) {
- if (treeObject instanceof TreeParent) {
- if (businessObjects.contains(treeObject.getBaseElement())) {
- list.add(treeObject);
- }
- list.addAll(getSelectionFromList(businessObjects, ((TreeParent) treeObject).getChildren()));
- } else if (businessObjects.contains(treeObject.getBaseElement())) {
- list.add(treeObject);
- }
- }
- return list;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.views;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.LaneSet;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.RootElement;
+import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.graphiti.mm.pictograms.PictogramLink;
+import org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IViewSite;
+
+class ViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
+ private TreeParent invisibleRoot;
+
+ @Override
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public Object[] getElements(Object parent) {
+ if (parent instanceof IViewSite) {
+ if (invisibleRoot == null) {
+ initialize();
+ }
+ return getChildren(invisibleRoot);
+ }
+ return getChildren(parent);
+ }
+
+ @Override
+ public Object getParent(Object child) {
+ if (child instanceof TreeObject) {
+ return ((TreeObject) child).getParent();
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren(Object parent) {
+ if (parent instanceof TreeParent) {
+ return ((TreeParent) parent).getChildren();
+ }
+ return new Object[0];
+ }
+
+ @Override
+ public boolean hasChildren(Object parent) {
+ if (parent instanceof TreeParent) {
+ return ((TreeParent) parent).hasChildren();
+ }
+ return false;
+ }
+
+ /*
+ * We will set up a dummy model to initialize tree heararchy. In a real code, you will connect to a real model and
+ * expose its hierarchy.
+ */
+ private void initialize() {
+ invisibleRoot = new TreeParent("");
+ }
+
+ void updateModel(ModelHandler mh) {
+ invisibleRoot.removeChildren();
+ if (mh == null) {
+ return;
+ }
+
+ Definitions definitions = mh.getDefinitions();
+
+ List<RootElement> rootElements = definitions.getRootElements();
+ for (RootElement element : rootElements) {
+
+ if (element instanceof Process) {
+ Process process = (Process) element;
+ TreeParent proc = new TreeParent("Process");
+
+ createLaneSets(proc, process.getLaneSets());
+ createFlowElementTree(proc, process.getFlowElements());
+ invisibleRoot.addChild(proc);
+ }
+ }
+
+ }
+
+ private void createLaneSets(TreeParent proc, List<LaneSet> laneSets) {
+ for (LaneSet laneSet : laneSets) {
+ createLaneSetTree(proc, laneSet);
+
+ }
+ }
+
+ private void createLaneSetTree(TreeParent proc, LaneSet laneSet) {
+ if (laneSet == null) {
+ return;
+ }
+ for (Lane lane : laneSet.getLanes()) {
+ TreeParent parent = new TreeParent(lane);
+ proc.addChild(parent);
+ createLaneSetTree(parent, lane.getChildLaneSet());
+ }
+ }
+
+ private void createFlowElementTree(TreeParent proc, List<FlowElement> flowElements) {
+ for (FlowElement f : flowElements) {
+ if (!(f instanceof SequenceFlow)) {
+ TreeObject treeObject = new TreeObject(f);
+ proc.addChild(treeObject);
+ }
+ }
+ }
+
+ @SuppressWarnings("restriction")
+ public Object[] getSelected(ISelection selection) {
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection sel = (StructuredSelection) selection;
+ List<Object> selected = Arrays.asList(sel.toArray());
+ if (selected.size() == 0 || !(selected.get(0) instanceof ContainerShapeEditPart)) {
+ return null;
+ }
+
+ PictogramLink link = ((ContainerShapeEditPart) selected.get(0)).getPictogramElement().getLink();
+ if (link == null) {
+ return null;
+ }
+
+ EList<EObject> businessObjects = link.getBusinessObjects();
+ TreeObject[] children = invisibleRoot.getChildren();
+ ArrayList<TreeObject> list = getSelectionFromList(businessObjects, children);
+ return list.toArray();
+ }
+ return null;
+ }
+
+ private ArrayList<TreeObject> getSelectionFromList(EList<EObject> businessObjects, TreeObject[] children) {
+ ArrayList<TreeObject> list = new ArrayList<TreeObject>();
+ for (TreeObject treeObject : children) {
+ if (treeObject instanceof TreeParent) {
+ if (businessObjects.contains(treeObject.getBaseElement())) {
+ list.add(treeObject);
+ }
+ list.addAll(getSelectionFromList(businessObjects, ((TreeParent) treeObject).getChildren()));
+ } else if (businessObjects.contains(treeObject.getBaseElement())) {
+ list.add(treeObject);
+ }
+ }
+ return list;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewLabelProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewLabelProvider.java
index d47a613..ebc77f1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewLabelProvider.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/views/ViewLabelProvider.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.views;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-class ViewLabelProvider extends LabelProvider {
-
- public String getText(Object obj) {
- return obj.toString();
- }
-
- public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- if (obj instanceof TreeParent)
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
-
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.views;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+class ViewLabelProvider extends LabelProvider {
+
+ public String getText(Object obj) {
+ return obj.toString();
+ }
+
+ public Image getImage(Object obj) {
+ String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
+ if (obj instanceof TreeParent)
+ imageKey = ISharedImages.IMG_OBJ_FOLDER;
+
+ return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramCreator.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramCreator.java
index bd85da6..73eb487 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramCreator.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramCreator.java
@@ -1,245 +1,245 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.wizards;
-
-import org.eclipse.bpmn2.modeler.core.utils.ErrorUtils;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
-import org.eclipse.graphiti.ui.services.GraphitiUi;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-public class BPMN2DiagramCreator {
-
- private final static String TEMPFILE_EXTENSION = "bpmn2d";
- private IFolder diagramFolder;
- private IFile diagramFile;
- private URI uri;
-
- public Bpmn2DiagramEditorInput createDiagram(Bpmn2DiagramType diagramType, String targetNamespace) throws CoreException {
- return createDiagram(diagramType, targetNamespace, null);
- }
-
- public Bpmn2DiagramEditorInput createDiagram(Bpmn2DiagramType diagramType, String targetNamespace, BPMN2Editor diagramEditor) throws CoreException {
- if (diagramFolder != null && !diagramFolder.exists()) {
- diagramFolder.create(false, true, null);
- }
-
- final Diagram diagram = Graphiti.getPeCreateService().createDiagram("BPMN2",
- diagramFile.getFullPath().removeFileExtension().lastSegment(), true);
- uri = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
-
- TransactionalEditingDomain domain = FileService.createEmfFileForDiagram(uri, diagram, diagramEditor);
-
- String providerId = GraphitiUi.getExtensionManager().getDiagramTypeProviderId(diagram.getDiagramTypeId());
- final Bpmn2DiagramEditorInput editorInput = new Bpmn2DiagramEditorInput(EcoreUtil.getURI(diagram), domain,
- providerId);
- editorInput.setInitialDiagramType(diagramType);
- editorInput.setTargetNamespace(targetNamespace);
-
- if (diagramEditor==null) {
- openEditor(editorInput);
- }
-
- return editorInput;
- }
-
- private void openEditor(final DiagramEditorInput editorInput) {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- @Override
- public void run() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .openEditor(editorInput, BPMN2Editor.EDITOR_ID);
-
- } catch (PartInitException e) {
- String error = "Error while opening diagram editor";
- IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e);
- ErrorUtils.showErrorWithLogging(status);
- }
- }
- });
- }
-
- public IFolder getDiagramFolder() {
- return diagramFolder;
- }
-
- public void setDiagramFolder(IFolder diagramFolder) {
- this.diagramFolder = diagramFolder;
- }
-
- public IFile getDiagramFile() {
- return diagramFile;
- }
-
- public void setDiagramFile(IFile diagramFile) {
- this.diagramFile = diagramFile;
- }
-
- public URI getUri() {
- return uri;
- }
-
- /**
- * Construct a temporary folder based on the given path. The folder is constructed
- * in the project root and its name will be the same as the given path's file extension.
- *
- * @param fullPath - path of the actual BPMN2 model file
- * @return an IFolder for the temporary folder.
- * @throws CoreException
- */
- public static IFolder getTempFolder(IPath fullPath) throws CoreException {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-
- String name = fullPath.getFileExtension();
- if (name==null || name.length()==0)
- name = "bpmn2";
- IFolder folder = root.getProject(fullPath.segment(0)).getFolder("."+name);
- if (!folder.exists()) {
- folder.create(true, true, null);
- }
- String[] segments = fullPath.segments();
- for (int i = 1; i < segments.length - 1; i++) {
- String segment = segments[i];
- folder = folder.getFolder(segment);
- if (!folder.exists()) {
- folder.create(true, true, null);
- }
- }
- return folder;
- }
-
- /**
- * Return the temporary file to be used as editor input. Conceptually, this is the
- * "diagramFile" mentioned here which is just a placeholder for use by Graphiti
- * as the DiagramEditorInput file.
- *
- * @param fullPath - path of the actual BPMN2 model file
- * @param folder - folder containing the model file
- * @return an IFile for the temporary file. If the file exists, it is first deleted.
- */
- public static IFile getTempFile(IPath fullPath, IFolder folder) {
- IPath path = fullPath.removeFileExtension().addFileExtension(TEMPFILE_EXTENSION);
- IFile tempFile = folder.getFile(path.lastSegment());
-
- // We don't need anything from that file and to be sure there are no side effects we delete the file
- if (tempFile.exists()) {
- try {
- tempFile.delete(true, null);
- } catch (CoreException e) {
- Activator.showErrorWithLogging(e);
- }
- }
- return tempFile;
- }
-
- /**
- * Return the BPMN2 model file given a path to either the "diagramFile" temporary file,
- * or the actual model file.
- *
- * @param fullPath - path of the actual BPMN2 model file
- * @return an IFile for the model file.
- */
- public static IFile getModelFile(IPath fullPath) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getFile(fullPath).getProject();
- int matchingSegments = project.getFullPath().matchingFirstSegments(fullPath);
- int totalSegments = fullPath.segmentCount();
- String ext = fullPath.getFileExtension();
- // sanity check: make sure the fullPath is not the project
- if (totalSegments<=matchingSegments)
- return null;
-
- String[] segments = fullPath.segments();
- IPath path = null;
-
- if (TEMPFILE_EXTENSION.equals(ext)) {
- // this is a tempFile - rebuild the BPMN2 model file name from its path
- ext = fullPath.segment(matchingSegments);
- if (ext.startsWith("."))
- ext = ext.substring(1);
- path = project.getFullPath();
- for (int i=matchingSegments+1; i<segments.length; ++i) {
- path = path.append(segments[i]);
- }
- path = path.removeFileExtension().addFileExtension(ext);
- }
- else {
- // this is a model file - normalize path
- path = fullPath.makeAbsolute();
- }
-
- return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
-
- /**
- * Delete the temporary diagram file. If the containing folder hierarchy is empty,
- * it will also be deleted.
- *
- * @param file - the temporary diagram file.
- */
- public static void dispose(IFile file) {
- try {
- IContainer container = file.getParent();
- file.delete(true, null);
- while ( isEmptyFolder(container) ) {
- container.delete(true, null);
- container = container.getParent();
- }
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- /**
- * Check if the given folder is empty. This is true if it contains no files, or only
- * empty folders.
- *
- * @param control - folder to check
- * @return true if the folder is empty.
- */
- public static boolean isEmptyFolder(IContainer container) {
- try {
- IResource[] members = container.members();
- for ( IResource res : members ) {
- int type = res.getType();
- if (type==IResource.FILE || type==IResource.PROJECT || type==IResource.ROOT)
- return false;
- if ( !isEmptyFolder((IContainer)res) )
- return false;
- }
- } catch (CoreException e) {
- return false;
- }
- return true;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.wizards;
+
+import org.eclipse.bpmn2.modeler.core.utils.ErrorUtils;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
+import org.eclipse.graphiti.ui.services.GraphitiUi;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+public class BPMN2DiagramCreator {
+
+ private final static String TEMPFILE_EXTENSION = "bpmn2d";
+ private IFolder diagramFolder;
+ private IFile diagramFile;
+ private URI uri;
+
+ public Bpmn2DiagramEditorInput createDiagram(Bpmn2DiagramType diagramType, String targetNamespace) throws CoreException {
+ return createDiagram(diagramType, targetNamespace, null);
+ }
+
+ public Bpmn2DiagramEditorInput createDiagram(Bpmn2DiagramType diagramType, String targetNamespace, BPMN2Editor diagramEditor) throws CoreException {
+ if (diagramFolder != null && !diagramFolder.exists()) {
+ diagramFolder.create(false, true, null);
+ }
+
+ final Diagram diagram = Graphiti.getPeCreateService().createDiagram("BPMN2",
+ diagramFile.getFullPath().removeFileExtension().lastSegment(), true);
+ uri = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
+
+ TransactionalEditingDomain domain = FileService.createEmfFileForDiagram(uri, diagram, diagramEditor);
+
+ String providerId = GraphitiUi.getExtensionManager().getDiagramTypeProviderId(diagram.getDiagramTypeId());
+ final Bpmn2DiagramEditorInput editorInput = new Bpmn2DiagramEditorInput(EcoreUtil.getURI(diagram), domain,
+ providerId);
+ editorInput.setInitialDiagramType(diagramType);
+ editorInput.setTargetNamespace(targetNamespace);
+
+ if (diagramEditor==null) {
+ openEditor(editorInput);
+ }
+
+ return editorInput;
+ }
+
+ private void openEditor(final DiagramEditorInput editorInput) {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .openEditor(editorInput, BPMN2Editor.EDITOR_ID);
+
+ } catch (PartInitException e) {
+ String error = "Error while opening diagram editor";
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e);
+ ErrorUtils.showErrorWithLogging(status);
+ }
+ }
+ });
+ }
+
+ public IFolder getDiagramFolder() {
+ return diagramFolder;
+ }
+
+ public void setDiagramFolder(IFolder diagramFolder) {
+ this.diagramFolder = diagramFolder;
+ }
+
+ public IFile getDiagramFile() {
+ return diagramFile;
+ }
+
+ public void setDiagramFile(IFile diagramFile) {
+ this.diagramFile = diagramFile;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ /**
+ * Construct a temporary folder based on the given path. The folder is constructed
+ * in the project root and its name will be the same as the given path's file extension.
+ *
+ * @param fullPath - path of the actual BPMN2 model file
+ * @return an IFolder for the temporary folder.
+ * @throws CoreException
+ */
+ public static IFolder getTempFolder(IPath fullPath) throws CoreException {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+ String name = fullPath.getFileExtension();
+ if (name==null || name.length()==0)
+ name = "bpmn2";
+ IFolder folder = root.getProject(fullPath.segment(0)).getFolder("."+name);
+ if (!folder.exists()) {
+ folder.create(true, true, null);
+ }
+ String[] segments = fullPath.segments();
+ for (int i = 1; i < segments.length - 1; i++) {
+ String segment = segments[i];
+ folder = folder.getFolder(segment);
+ if (!folder.exists()) {
+ folder.create(true, true, null);
+ }
+ }
+ return folder;
+ }
+
+ /**
+ * Return the temporary file to be used as editor input. Conceptually, this is the
+ * "diagramFile" mentioned here which is just a placeholder for use by Graphiti
+ * as the DiagramEditorInput file.
+ *
+ * @param fullPath - path of the actual BPMN2 model file
+ * @param folder - folder containing the model file
+ * @return an IFile for the temporary file. If the file exists, it is first deleted.
+ */
+ public static IFile getTempFile(IPath fullPath, IFolder folder) {
+ IPath path = fullPath.removeFileExtension().addFileExtension(TEMPFILE_EXTENSION);
+ IFile tempFile = folder.getFile(path.lastSegment());
+
+ // We don't need anything from that file and to be sure there are no side effects we delete the file
+ if (tempFile.exists()) {
+ try {
+ tempFile.delete(true, null);
+ } catch (CoreException e) {
+ Activator.showErrorWithLogging(e);
+ }
+ }
+ return tempFile;
+ }
+
+ /**
+ * Return the BPMN2 model file given a path to either the "diagramFile" temporary file,
+ * or the actual model file.
+ *
+ * @param fullPath - path of the actual BPMN2 model file
+ * @return an IFile for the model file.
+ */
+ public static IFile getModelFile(IPath fullPath) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getFile(fullPath).getProject();
+ int matchingSegments = project.getFullPath().matchingFirstSegments(fullPath);
+ int totalSegments = fullPath.segmentCount();
+ String ext = fullPath.getFileExtension();
+ // sanity check: make sure the fullPath is not the project
+ if (totalSegments<=matchingSegments)
+ return null;
+
+ String[] segments = fullPath.segments();
+ IPath path = null;
+
+ if (TEMPFILE_EXTENSION.equals(ext)) {
+ // this is a tempFile - rebuild the BPMN2 model file name from its path
+ ext = fullPath.segment(matchingSegments);
+ if (ext.startsWith("."))
+ ext = ext.substring(1);
+ path = project.getFullPath();
+ for (int i=matchingSegments+1; i<segments.length; ++i) {
+ path = path.append(segments[i]);
+ }
+ path = path.removeFileExtension().addFileExtension(ext);
+ }
+ else {
+ // this is a model file - normalize path
+ path = fullPath.makeAbsolute();
+ }
+
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ }
+
+ /**
+ * Delete the temporary diagram file. If the containing folder hierarchy is empty,
+ * it will also be deleted.
+ *
+ * @param file - the temporary diagram file.
+ */
+ public static void dispose(IFile file) {
+ try {
+ IContainer container = file.getParent();
+ file.delete(true, null);
+ while ( isEmptyFolder(container) ) {
+ container.delete(true, null);
+ container = container.getParent();
+ }
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Check if the given folder is empty. This is true if it contains no files, or only
+ * empty folders.
+ *
+ * @param control - folder to check
+ * @return true if the folder is empty.
+ */
+ public static boolean isEmptyFolder(IContainer container) {
+ try {
+ IResource[] members = container.members();
+ for ( IResource res : members ) {
+ int type = res.getType();
+ if (type==IResource.FILE || type==IResource.PROJECT || type==IResource.ROOT)
+ return false;
+ if ( !isEmptyFolder((IContainer)res) )
+ return false;
+ }
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizard.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizard.java
index e9ec065..0715e48 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizard.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizard.java
@@ -1,110 +1,110 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-public class BPMN2DiagramWizard extends Wizard implements INewWizard {
- private BPMN2DiagramWizardPage1 page1;
- private BPMN2DiagramWizardPage2 page2;
- private ISelection selection;
-
- /**
- * Constructor for BPMN2DiagramWizard.
- */
- public BPMN2DiagramWizard() {
- super();
- setNeedsProgressMonitor(true);
- }
-
- /**
- * Adding the page2 to the wizard.
- */
-
- @Override
- public void addPages() {
- page1 = new BPMN2DiagramWizardPage1(selection);
- addPage(page1);
- page2 = new BPMN2DiagramWizardPage2(selection);
- addPage(page2);
- }
-
- /**
- * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
- * wizard as execution context.
- */
- @Override
- public boolean performFinish() {
- final String fileName = page2.getFileName();
- final IResource container = page2.getDiagramContainer();
- final String targetNamespace = page2.getTargetNamespace();
-
- IRunnableWithProgress op = new IRunnableWithProgress() {
- @Override
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
- IPath path = container.getFullPath().append(fileName);
- IFolder folder = null;
- BPMN2DiagramCreator factory = new BPMN2DiagramCreator();
-
- folder = BPMN2DiagramCreator.getTempFolder(path);
-
- factory.setDiagramFile(BPMN2DiagramCreator.getTempFile(path,folder));
-
- factory.setDiagramFolder(folder);
-
- factory.createDiagram(page1.getDiagramType(), targetNamespace);
-
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- };
- try {
- getContainer().run(true, false, op);
- } catch (InterruptedException e) {
- return false;
- } catch (InvocationTargetException e) {
- Throwable realException = e.getTargetException();
- MessageDialog.openError(getShell(), "Error", realException.getMessage());
- return false;
- }
- return true;
- }
-
- /**
- * We will accept the selection in the workbench to see if we can initialize from it.
- *
- * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
- */
- @Override
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+
+public class BPMN2DiagramWizard extends Wizard implements INewWizard {
+ private BPMN2DiagramWizardPage1 page1;
+ private BPMN2DiagramWizardPage2 page2;
+ private ISelection selection;
+
+ /**
+ * Constructor for BPMN2DiagramWizard.
+ */
+ public BPMN2DiagramWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * Adding the page2 to the wizard.
+ */
+
+ @Override
+ public void addPages() {
+ page1 = new BPMN2DiagramWizardPage1(selection);
+ addPage(page1);
+ page2 = new BPMN2DiagramWizardPage2(selection);
+ addPage(page2);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
+ * wizard as execution context.
+ */
+ @Override
+ public boolean performFinish() {
+ final String fileName = page2.getFileName();
+ final IResource container = page2.getDiagramContainer();
+ final String targetNamespace = page2.getTargetNamespace();
+
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ IPath path = container.getFullPath().append(fileName);
+ IFolder folder = null;
+ BPMN2DiagramCreator factory = new BPMN2DiagramCreator();
+
+ folder = BPMN2DiagramCreator.getTempFolder(path);
+
+ factory.setDiagramFile(BPMN2DiagramCreator.getTempFile(path,folder));
+
+ factory.setDiagramFolder(folder);
+
+ factory.createDiagram(page1.getDiagramType(), targetNamespace);
+
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage1.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage1.java
index 50b5ae3..028fe14 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage1.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage1.java
@@ -1,158 +1,158 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-
-package org.eclipse.bpmn2.modeler.ui.wizards;
-
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-import org.eclipse.bpmn2.modeler.ui.Activator;
-import org.eclipse.bpmn2.modeler.ui.IConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * @author Bob Brodt
- *
- */
-public class BPMN2DiagramWizardPage1 extends WizardPage implements IConstants {
-
- private Bpmn2DiagramType diagramType = Bpmn2DiagramType.NONE;
- private final ISelection selection;
-
- /**
- * Constructor for SampleNewWizardPage.
- *
- * @param pageName
- */
- public BPMN2DiagramWizardPage1(ISelection selection) {
- super("wizardPage1");
- setTitle("BPMN2 Diagram Type");
- setDescription("Select a BPMN 2.0 Diagram Type.");
- this.selection = selection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout(2,false);
- container.setLayout(layout);
-
- Point sz = parent.getSize();
- int labelWidth = (int)(0.5 * sz.x);
- GridData data;
-
- final Button processButton = new Button(container, SWT.RADIO | SWT.PUSH);
-// processButton.setText("Process");
- processButton.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false,1,1));
- processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
-
- Label processLabel = new Label(container, SWT.WRAP | SWT.NONE);
- data = new GridData(SWT.LEFT,SWT.FILL,false,false,1,1);
- data.widthHint = labelWidth;
- processLabel.setLayoutData(data);
- processLabel.setText(
- "A Process describes a sequence or flow of Activities in an organization" +
- " with the objective of carrying out work. A Process contains Activities,"+
- " Events, Gateways, and Sequence Flows that define its execution semantics.");
-
- final Button collaborationButton = new Button(container, SWT.RADIO | SWT.PUSH);
-// collaborationButton.setText("Collaboration");
- collaborationButton.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false,1,1));
- collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
-
- Label collaborationLabel = new Label(container, SWT.WRAP | SWT.NONE);
- data = new GridData(SWT.LEFT,SWT.FILL,false,false,1,1);
- data.widthHint = labelWidth;
- collaborationLabel.setLayoutData(data);
- collaborationLabel.setText(
- "A Collaboration is a collection of Participants shown as Pools,"+
- " and their interactions as shown by Message Flows."+
- " A Collaboration Diagram may also include Processes within the"+
- " Pools and/or Choreographies between the Pools.");
-
- final Button choreographyButton = new Button(container, SWT.RADIO | SWT.PUSH);
-// choreographyButton.setText("Choreography");
- choreographyButton.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false,1,1));
- choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
-
- Label choreographyLabel = new Label(container, SWT.WRAP | SWT.NONE);
- data = new GridData(SWT.LEFT,SWT.FILL,false,false,1,1);
- data.widthHint = labelWidth;
- choreographyLabel.setLayoutData(data);
- choreographyLabel.setText(
- "A Choreography formalizes the way business Participants"+
- " coordinate their interactions. The focus is not on orchestrations"+
- " of the work performed within these Participants, but rather on the"+
- " exchange of information (Messages) between these Participants.");
-
- SelectionAdapter buttonListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == processButton) {
- diagramType = Bpmn2DiagramType.PROCESS;
- processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS_PUSHED));
- collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
- choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
- }
- else if (e.widget == collaborationButton) {
- diagramType = Bpmn2DiagramType.COLLABORATION;
- processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
- collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION_PUSHED));
- choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
- }
- else if (e.widget == choreographyButton) {
- diagramType = Bpmn2DiagramType.CHOREOGRAPHY;
- processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
- collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
- choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY_PUSHED));
- }
- else {
- diagramType = Bpmn2DiagramType.NONE;
- processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
- collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
- choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
- }
- setPageComplete(canFlipToNextPage());
- }
- };
- processButton.addSelectionListener(buttonListener);
- collaborationButton.addSelectionListener(buttonListener);
- choreographyButton.addSelectionListener(buttonListener);
-
- setControl(container);
- }
-
- @Override
- public boolean isPageComplete() {
- return diagramType != Bpmn2DiagramType.NONE;
- }
-
- @Override
- public boolean canFlipToNextPage() {
- return diagramType != Bpmn2DiagramType.NONE;
- }
-
- public Bpmn2DiagramType getDiagramType() {
- return diagramType;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.ui.wizards;
+
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.IConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Bob Brodt
+ *
+ */
+public class BPMN2DiagramWizardPage1 extends WizardPage implements IConstants {
+
+ private Bpmn2DiagramType diagramType = Bpmn2DiagramType.NONE;
+ private final ISelection selection;
+
+ /**
+ * Constructor for SampleNewWizardPage.
+ *
+ * @param pageName
+ */
+ public BPMN2DiagramWizardPage1(ISelection selection) {
+ super("wizardPage1");
+ setTitle("BPMN2 Diagram Type");
+ setDescription("Select a BPMN 2.0 Diagram Type.");
+ this.selection = selection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout(2,false);
+ container.setLayout(layout);
+
+ Point sz = parent.getSize();
+ int labelWidth = (int)(0.5 * sz.x);
+ GridData data;
+
+ final Button processButton = new Button(container, SWT.RADIO | SWT.PUSH);
+// processButton.setText("Process");
+ processButton.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false,1,1));
+ processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
+
+ Label processLabel = new Label(container, SWT.WRAP | SWT.NONE);
+ data = new GridData(SWT.LEFT,SWT.FILL,false,false,1,1);
+ data.widthHint = labelWidth;
+ processLabel.setLayoutData(data);
+ processLabel.setText(
+ "A Process describes a sequence or flow of Activities in an organization" +
+ " with the objective of carrying out work. A Process contains Activities,"+
+ " Events, Gateways, and Sequence Flows that define its execution semantics.");
+
+ final Button collaborationButton = new Button(container, SWT.RADIO | SWT.PUSH);
+// collaborationButton.setText("Collaboration");
+ collaborationButton.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false,1,1));
+ collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
+
+ Label collaborationLabel = new Label(container, SWT.WRAP | SWT.NONE);
+ data = new GridData(SWT.LEFT,SWT.FILL,false,false,1,1);
+ data.widthHint = labelWidth;
+ collaborationLabel.setLayoutData(data);
+ collaborationLabel.setText(
+ "A Collaboration is a collection of Participants shown as Pools,"+
+ " and their interactions as shown by Message Flows."+
+ " A Collaboration Diagram may also include Processes within the"+
+ " Pools and/or Choreographies between the Pools.");
+
+ final Button choreographyButton = new Button(container, SWT.RADIO | SWT.PUSH);
+// choreographyButton.setText("Choreography");
+ choreographyButton.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false,1,1));
+ choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
+
+ Label choreographyLabel = new Label(container, SWT.WRAP | SWT.NONE);
+ data = new GridData(SWT.LEFT,SWT.FILL,false,false,1,1);
+ data.widthHint = labelWidth;
+ choreographyLabel.setLayoutData(data);
+ choreographyLabel.setText(
+ "A Choreography formalizes the way business Participants"+
+ " coordinate their interactions. The focus is not on orchestrations"+
+ " of the work performed within these Participants, but rather on the"+
+ " exchange of information (Messages) between these Participants.");
+
+ SelectionAdapter buttonListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (e.widget == processButton) {
+ diagramType = Bpmn2DiagramType.PROCESS;
+ processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS_PUSHED));
+ collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
+ choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
+ }
+ else if (e.widget == collaborationButton) {
+ diagramType = Bpmn2DiagramType.COLLABORATION;
+ processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
+ collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION_PUSHED));
+ choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
+ }
+ else if (e.widget == choreographyButton) {
+ diagramType = Bpmn2DiagramType.CHOREOGRAPHY;
+ processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
+ collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
+ choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY_PUSHED));
+ }
+ else {
+ diagramType = Bpmn2DiagramType.NONE;
+ processButton.setImage(Activator.getDefault().getImage(IMAGE_PROCESS));
+ collaborationButton.setImage(Activator.getDefault().getImage(IMAGE_COLLABORATION));
+ choreographyButton.setImage(Activator.getDefault().getImage(IMAGE_CHOREOGRAPHY));
+ }
+ setPageComplete(canFlipToNextPage());
+ }
+ };
+ processButton.addSelectionListener(buttonListener);
+ collaborationButton.addSelectionListener(buttonListener);
+ choreographyButton.addSelectionListener(buttonListener);
+
+ setControl(container);
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ return diagramType != Bpmn2DiagramType.NONE;
+ }
+
+ @Override
+ public boolean canFlipToNextPage() {
+ return diagramType != Bpmn2DiagramType.NONE;
+ }
+
+ public Bpmn2DiagramType getDiagramType() {
+ return diagramType;
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage2.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage2.java
index 51e1f0b..fc4bcc7 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage2.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/BPMN2DiagramWizardPage2.java
@@ -1,331 +1,331 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Innar Made
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.ui.wizards;
-
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-public class BPMN2DiagramWizardPage2 extends WizardPage {
- private Text containerText;
-
- private Text fileText;
- private Text targetNamespaceText;
-
- private ISelection selection;
-
- private IResource diagramContainer;
- private Bpmn2DiagramType diagramType = Bpmn2DiagramType.NONE;
-
- /**
- * Constructor for SampleNewWizardPage.
- *
- * @param pageName
- */
- public BPMN2DiagramWizardPage2(ISelection selection) {
- super("wizardPage2");
- setTitle("BPMN2 Diagram File");
- setDescription("Select file name.");
- this.selection = selection;
- }
-
- /**
- * @see IDialogPage#createControl(Composite)
- */
- @Override
- public void createControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- container.setLayout(layout);
- layout.numColumns = 3;
- layout.verticalSpacing = 9;
- Label label = new Label(container, SWT.NULL);
- label.setText("&Location:");
-
- containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- containerText.setLayoutData(gd);
- containerText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- dialogChanged();
- }
- });
-
- Button button = new Button(container, SWT.PUSH);
- button.setText("Browse...");
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- handleBrowse();
- }
- });
- label = new Label(container, SWT.NULL);
- label.setText("&File name:");
-
- fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
- fileText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
- fileText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- dialogChanged();
- }
- });
-
- label = new Label(container, SWT.NULL);
- label.setText("&Target Namespace:");
-
- targetNamespaceText = new Text(container, SWT.BORDER | SWT.SINGLE);
- targetNamespaceText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
- targetNamespaceText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- dialogChanged();
- }
- });
-
- updatePageDescription();
- updateFilename();
- dialogChanged();
- setControl(container);
- }
-
- private Bpmn2DiagramType getDiagramType() {
- BPMN2DiagramWizardPage1 page1 = (BPMN2DiagramWizardPage1)getWizard().getPage("wizardPage1");
- return page1.getDiagramType();
- }
-
- /**
- * Tests if the current workbench selection is a suitable diagramContainer to use.
- */
-
- private void updatePageDescription() {
- BPMN2DiagramWizardPage1 page1 = (BPMN2DiagramWizardPage1)getWizard().getPage("wizardPage1");
- String descriptionType = "Unknown Diagram Type";
- switch (page1.getDiagramType()) {
- case PROCESS:
- descriptionType = "Process Diagram";
- break;
- case COLLABORATION:
- descriptionType = "Collaboration Diagram";
- break;
- case CHOREOGRAPHY:
- descriptionType = "Choreography Diagram";
- break;
- }
- setDescription("Enter a file name for the new "+descriptionType);
- }
-
- private void updateFilename() {
- BPMN2DiagramWizardPage1 page1 = (BPMN2DiagramWizardPage1)getWizard().getPage("wizardPage1");
- String fileType = "unknown";
- String filename = fileType+".bpmn";
- switch (page1.getDiagramType()) {
- case PROCESS:
- fileType = "process";
- break;
- case COLLABORATION:
- fileType = "collaboration";
- break;
- case CHOREOGRAPHY:
- fileType = "choreography";
- break;
- default:
- return;
- }
-
- IContainer container = getFileContainer();
- if (container!=null) {
- String text = container.getFullPath().toString();
- if (text!=null && !text.equals(containerText.getText()))
- containerText.setText(text);
- for (int i=1; ; ++i) {
- filename = fileType+"_" + i + ".bpmn";
- IResource file = container.findMember(filename);
- if (file==null) {
- break;
- }
- }
- }
-
- String oldFileText = fileText.getText();
- if (filename!=null && !filename.equals(oldFileText))
- fileText.setText(filename);
- }
-
- private IContainer getFileContainer() {
- if (selection != null && selection.isEmpty() == false && selection instanceof IStructuredSelection) {
- IStructuredSelection ssel = (IStructuredSelection) selection;
- if (ssel.size() == 1) {
- Object obj = ssel.getFirstElement();
- if (obj instanceof IAdaptable) {
- Object res = ((IAdaptable)obj).getAdapter(IResource.class);
- if (res!=null)
- obj = res;
- }
- if (obj instanceof Path) {
- obj = ResourcesPlugin.getWorkspace().getRoot().findMember((Path)obj);
- }
- if (obj instanceof IResource) {
- if (obj instanceof IContainer) {
- return (IContainer) obj;
- } else {
- return ((IResource) obj).getParent();
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public void setVisible(boolean visible) {
- if (visible) {
- updatePageDescription();
- updateFilename();
- }
- super.setVisible(visible);
- }
-
- /**
- * Uses the standard diagramContainer selection dialog to choose the new value for the diagramContainer field.
- */
-
- private void handleBrowse() {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace()
- .getRoot(), false, "Select Folder for the diagram");
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- if (result.length == 1) {
- selection = new TreeSelection(new TreePath(result));
- containerText.setText(((Path) result[0]).toString());
- }
- }
- }
-
- /**
- * Ensures that both text fields are set.
- */
-
- private void dialogChanged() {
- diagramContainer = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
- String fileName = getFileName();
-
- if (getContainerName().length() == 0) {
- updateStatus("Folder must be specified");
- return;
- }
- if (diagramContainer == null || (diagramContainer.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
- updateStatus("Folder must exist");
- return;
- }
- if (!diagramContainer.isAccessible()) {
- updateStatus("Project must be writable");
- return;
- }
- if (fileName.length() == 0) {
- updateStatus("Name must be specified");
- return;
- }
- if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
- updateStatus("Name must be valid");
- return;
- }
- int dotLoc = fileName.lastIndexOf('.');
- if (dotLoc != -1) {
- String ext = fileName.substring(dotLoc + 1);
- if (ext.equalsIgnoreCase("bpmn") == false && ext.equalsIgnoreCase("bpmn2") == false) {
- updateStatus("File extension must be \"bpmn\" or \"bpmn2\"");
- return;
- }
- }
-
- TargetRuntime rt = Bpmn2Preferences.getInstance(diagramContainer.getProject()).getRuntime();
- String targetNamespace = rt.getRuntimeExtension().getTargetNamespace(getDiagramType());
- if (targetNamespace==null)
- targetNamespace = "";
- if (!targetNamespaceText.getText().equals(targetNamespace)) {
- targetNamespaceText.setText(targetNamespace);
- updateFilename();
- }
-
- updateStatus(null);
- }
-
- @Override
- public boolean isPageComplete() {
- IContainer container = getFileContainer();
- if (container!=null) {
- String filename = fileText.getText();
- IResource file = container.findMember(filename);
- if (file==null) {
- String targetNamespace = targetNamespaceText.getText();
- if (!targetNamespace.isEmpty()) {
- setErrorMessage(null);
- return true;
- }
- else
- setErrorMessage("A Target Namespace must be specified");
- }
- else
- setErrorMessage("The file "+filename+" already exists in this project");
- }
- return false;
- }
-
- private void updateStatus(String message) {
- setErrorMessage(message);
- setPageComplete(message == null);
- }
-
- public String getContainerName() {
- return containerText.getText();
- }
-
- public String getFileName() {
- return fileText.getText();
- }
-
- public IResource getDiagramContainer() {
- return diagramContainer;
- }
-
- public String getTargetNamespace() {
- return targetNamespaceText.getText();
- }
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Innar Made
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.wizards;
+
+import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+public class BPMN2DiagramWizardPage2 extends WizardPage {
+ private Text containerText;
+
+ private Text fileText;
+ private Text targetNamespaceText;
+
+ private ISelection selection;
+
+ private IResource diagramContainer;
+ private Bpmn2DiagramType diagramType = Bpmn2DiagramType.NONE;
+
+ /**
+ * Constructor for SampleNewWizardPage.
+ *
+ * @param pageName
+ */
+ public BPMN2DiagramWizardPage2(ISelection selection) {
+ super("wizardPage2");
+ setTitle("BPMN2 Diagram File");
+ setDescription("Select file name.");
+ this.selection = selection;
+ }
+
+ /**
+ * @see IDialogPage#createControl(Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+ Label label = new Label(container, SWT.NULL);
+ label.setText("&Location:");
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText("Browse...");
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ label = new Label(container, SWT.NULL);
+ label.setText("&File name:");
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ fileText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
+ fileText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText("&Target Namespace:");
+
+ targetNamespaceText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ targetNamespaceText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
+ targetNamespaceText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ updatePageDescription();
+ updateFilename();
+ dialogChanged();
+ setControl(container);
+ }
+
+ private Bpmn2DiagramType getDiagramType() {
+ BPMN2DiagramWizardPage1 page1 = (BPMN2DiagramWizardPage1)getWizard().getPage("wizardPage1");
+ return page1.getDiagramType();
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable diagramContainer to use.
+ */
+
+ private void updatePageDescription() {
+ BPMN2DiagramWizardPage1 page1 = (BPMN2DiagramWizardPage1)getWizard().getPage("wizardPage1");
+ String descriptionType = "Unknown Diagram Type";
+ switch (page1.getDiagramType()) {
+ case PROCESS:
+ descriptionType = "Process Diagram";
+ break;
+ case COLLABORATION:
+ descriptionType = "Collaboration Diagram";
+ break;
+ case CHOREOGRAPHY:
+ descriptionType = "Choreography Diagram";
+ break;
+ }
+ setDescription("Enter a file name for the new "+descriptionType);
+ }
+
+ private void updateFilename() {
+ BPMN2DiagramWizardPage1 page1 = (BPMN2DiagramWizardPage1)getWizard().getPage("wizardPage1");
+ String fileType = "unknown";
+ String filename = fileType+".bpmn";
+ switch (page1.getDiagramType()) {
+ case PROCESS:
+ fileType = "process";
+ break;
+ case COLLABORATION:
+ fileType = "collaboration";
+ break;
+ case CHOREOGRAPHY:
+ fileType = "choreography";
+ break;
+ default:
+ return;
+ }
+
+ IContainer container = getFileContainer();
+ if (container!=null) {
+ String text = container.getFullPath().toString();
+ if (text!=null && !text.equals(containerText.getText()))
+ containerText.setText(text);
+ for (int i=1; ; ++i) {
+ filename = fileType+"_" + i + ".bpmn";
+ IResource file = container.findMember(filename);
+ if (file==null) {
+ break;
+ }
+ }
+ }
+
+ String oldFileText = fileText.getText();
+ if (filename!=null && !filename.equals(oldFileText))
+ fileText.setText(filename);
+ }
+
+ private IContainer getFileContainer() {
+ if (selection != null && selection.isEmpty() == false && selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() == 1) {
+ Object obj = ssel.getFirstElement();
+ if (obj instanceof IAdaptable) {
+ Object res = ((IAdaptable)obj).getAdapter(IResource.class);
+ if (res!=null)
+ obj = res;
+ }
+ if (obj instanceof Path) {
+ obj = ResourcesPlugin.getWorkspace().getRoot().findMember((Path)obj);
+ }
+ if (obj instanceof IResource) {
+ if (obj instanceof IContainer) {
+ return (IContainer) obj;
+ } else {
+ return ((IResource) obj).getParent();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ if (visible) {
+ updatePageDescription();
+ updateFilename();
+ }
+ super.setVisible(visible);
+ }
+
+ /**
+ * Uses the standard diagramContainer selection dialog to choose the new value for the diagramContainer field.
+ */
+
+ private void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace()
+ .getRoot(), false, "Select Folder for the diagram");
+ if (dialog.open() == Window.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 1) {
+ selection = new TreeSelection(new TreePath(result));
+ containerText.setText(((Path) result[0]).toString());
+ }
+ }
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+
+ private void dialogChanged() {
+ diagramContainer = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
+ String fileName = getFileName();
+
+ if (getContainerName().length() == 0) {
+ updateStatus("Folder must be specified");
+ return;
+ }
+ if (diagramContainer == null || (diagramContainer.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+ updateStatus("Folder must exist");
+ return;
+ }
+ if (!diagramContainer.isAccessible()) {
+ updateStatus("Project must be writable");
+ return;
+ }
+ if (fileName.length() == 0) {
+ updateStatus("Name must be specified");
+ return;
+ }
+ if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
+ updateStatus("Name must be valid");
+ return;
+ }
+ int dotLoc = fileName.lastIndexOf('.');
+ if (dotLoc != -1) {
+ String ext = fileName.substring(dotLoc + 1);
+ if (ext.equalsIgnoreCase("bpmn") == false && ext.equalsIgnoreCase("bpmn2") == false) {
+ updateStatus("File extension must be \"bpmn\" or \"bpmn2\"");
+ return;
+ }
+ }
+
+ TargetRuntime rt = Bpmn2Preferences.getInstance(diagramContainer.getProject()).getRuntime();
+ String targetNamespace = rt.getRuntimeExtension().getTargetNamespace(getDiagramType());
+ if (targetNamespace==null)
+ targetNamespace = "";
+ if (!targetNamespaceText.getText().equals(targetNamespace)) {
+ targetNamespaceText.setText(targetNamespace);
+ updateFilename();
+ }
+
+ updateStatus(null);
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ IContainer container = getFileContainer();
+ if (container!=null) {
+ String filename = fileText.getText();
+ IResource file = container.findMember(filename);
+ if (file==null) {
+ String targetNamespace = targetNamespaceText.getText();
+ if (!targetNamespace.isEmpty()) {
+ setErrorMessage(null);
+ return true;
+ }
+ else
+ setErrorMessage("A Target Namespace must be specified");
+ }
+ else
+ setErrorMessage("The file "+filename+" already exists in this project");
+ }
+ return false;
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ public String getContainerName() {
+ return containerText.getText();
+ }
+
+ public String getFileName() {
+ return fileText.getText();
+ }
+
+ public IResource getDiagramContainer() {
+ return diagramContainer;
+ }
+
+ public String getTargetNamespace() {
+ return targetNamespaceText.getText();
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/Bpmn2DiagramEditorInput.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/Bpmn2DiagramEditorInput.java
index 86e6418..2dbd9b9 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/Bpmn2DiagramEditorInput.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/Bpmn2DiagramEditorInput.java
@@ -12,6 +12,7 @@
******************************************************************************/
package org.eclipse.bpmn2.modeler.ui.wizards;
+import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
@@ -24,7 +25,8 @@
private final TransactionalEditingDomain domain;
private Bpmn2DiagramType initialDiagramType = Bpmn2DiagramType.NONE;
private String targetNamespace;
-
+ private BPMNDiagram bpmnDiagram;
+
Bpmn2DiagramEditorInput(URI diagramUri, TransactionalEditingDomain domain, String providerId) {
super(diagramUri, providerId);
this.domain = domain;
@@ -78,6 +80,14 @@
return super.getAdapter(adapter);
}
+ public BPMNDiagram getBpmnDiagram() {
+ return bpmnDiagram;
+ }
+
+ public void setBpmnDiagram(BPMNDiagram bpmnDiagram) {
+ this.bpmnDiagram = bpmnDiagram;
+ }
+
// public class Bpmn2TransactionalEditingDomain implements TransactionalEditingDomain {
//
// }
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/.project b/org.eclipse.bpmn2.modeler.updatesite.feature/.project
index 70528bd..4c27ac0 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/.project
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/.project
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.updatesite.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.updatesite.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/about.html b/org.eclipse.bpmn2.modeler.updatesite.feature/about.html
index dd1a159..3408ea2 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/about.html
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/about.html
@@ -1,26 +1,26 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/build.properties b/org.eclipse.bpmn2.modeler.updatesite.feature/build.properties
index 2223643..838a6a9 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/build.properties
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/build.properties
@@ -1,8 +1,8 @@
-bin.includes = feature.xml,\
- about.html,\
- epl-v10.html,\
- license.html,\
- notice.html
-category.id.org.eclipse.bpmn2.modeler.cat=BPMN2 Editor
-category.members.org.eclipse.bpmn2.modeler.cat=org.eclipse.bpmn2.modeler
-category.description.org.eclipse.bpmn2.modeler.cat=BPMN2 Editor using Graphiti
+bin.includes = feature.xml,\
+ about.html,\
+ epl-v10.html,\
+ license.html,\
+ notice.html
+category.id.org.eclipse.bpmn2.modeler.cat=BPMN2 Editor
+category.members.org.eclipse.bpmn2.modeler.cat=org.eclipse.bpmn2.modeler
+category.description.org.eclipse.bpmn2.modeler.cat=BPMN2 Editor using Graphiti
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/build.xml b/org.eclipse.bpmn2.modeler.updatesite.feature/build.xml
index 8d254ac..9c99201 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/build.xml
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/build.xml
@@ -1,103 +1,103 @@
-<project default="custom.build" name="aggregate site builder">
- <!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here. -->
- <condition property="output.dir" value="${WORKSPACE}/results" else="${basedir}">
- <available file="${WORKSPACE}/results" />
- </condition>
-
- <property name="update.site.source.dir" value="${output.dir}/target/site" />
-
- <!-- load properties from default (or alternate) properties file -->
- <property name="associate.properties" value="associate.properties" />
- <property file="${associate.properties}" />
-
- <target name="init">
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- </target>
-
- <!-- don't do collect.zips,collect.metadata,create.summary.file -->
- <target name="custom.build" description="aggregate update site extras" depends="init,check.target,add.associate.sites,pack.zip" />
-
- <target name="add.associate.sites" if="associate.sites">
- <if>
- <and>
- <!-- Defined in associate.properties -->
- <isset property="associate.sites" />
- <not>
- <equals arg1="${associate.sites}" arg2="" />
- </not>
- </and>
- <then>
- <if>
- <available file="${update.site.source.dir}/content.jar" type="file" />
- <then>
- <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
- <delete file="${update.site.source.dir}/content.jar" />
- </then>
- </if>
- <!-- counter variable -->
- <var name="associate.sites.0" value="" />
- <for param="associate.site" list="${associate.sites}" delimiter=",
- ">
- <sequential>
- <var name="associate.sites.0" value="${associate.sites.0}00" />
- </sequential>
- </for>
- <length property="associate.sites.length" string="${associate.sites.0}" />
-
- <loadfile srcfile="${update.site.source.dir}/content.xml" property="content.xml">
- <filterchain>
- <tailfilter lines="-1" skip="1" />
- </filterchain>
- </loadfile>
- <echo file="${update.site.source.dir}/content.xml" message="${content.xml}" />
- <echo file="${update.site.source.dir}/content.xml" append="true"> <references size='${associate.sites.length}'>
-</echo>
- <for param="associate.site" list="${associate.sites}" delimiter=",
- ">
- <sequential>
- <!-- insert into content.xml -->
- <echo file="${update.site.source.dir}/content.xml" append="true"> <repository uri='@{associate.site}' url='@{associate.site}' type='0' options='1'/>
- <repository uri='@{associate.site}' url='@{associate.site}' type='1' options='1'/>
-</echo>
- </sequential>
- </for>
- <echo file="${update.site.source.dir}/content.xml" append="true"> </references>
-</repository>
-</echo>
- <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
- <delete file="${update.site.source.dir}/content.xml" />
- </then>
- </if>
- </target>
-
- <target name="unpack.zip">
- <unzip src="${output.dir}/target/site_assembly.zip" dest="${update.site.source.dir}" />
- </target>
-
- <target name="pack.zip">
- <zip destfile="${output.dir}/target/site_assembly.zip" update="true" basedir="${update.site.source.dir}" includes="content.* index.html, web/*.css, README*" />
- </target>
-
- <target name="check.target">
- <if>
- <or>
- <not>
- <available file="${output.dir}/target/site" type="dir" />
- </not>
- <not>
- <available file="${output.dir}/target/site_assembly.zip" type="file" />
- </not>
- </or>
- <then>
- <fail>
---
-This script must ONLY be called via the pom.xml in this directory, not run directly.
-Cannot adjust an update site w/o first building it!
---
-To run this build, use Tycho. Try `mvn3 clean install -fae -e -B`
-</fail>
- </then>
- </if>
- </target>
-
-</project>
+<project default="custom.build" name="aggregate site builder">
+ <!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here. -->
+ <condition property="output.dir" value="${WORKSPACE}/results" else="${basedir}">
+ <available file="${WORKSPACE}/results" />
+ </condition>
+
+ <property name="update.site.source.dir" value="${output.dir}/target/site" />
+
+ <!-- load properties from default (or alternate) properties file -->
+ <property name="associate.properties" value="associate.properties" />
+ <property file="${associate.properties}" />
+
+ <target name="init">
+ <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+ </target>
+
+ <!-- don't do collect.zips,collect.metadata,create.summary.file -->
+ <target name="custom.build" description="aggregate update site extras" depends="init,check.target,add.associate.sites,pack.zip" />
+
+ <target name="add.associate.sites" if="associate.sites">
+ <if>
+ <and>
+ <!-- Defined in associate.properties -->
+ <isset property="associate.sites" />
+ <not>
+ <equals arg1="${associate.sites}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <if>
+ <available file="${update.site.source.dir}/content.jar" type="file" />
+ <then>
+ <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
+ <delete file="${update.site.source.dir}/content.jar" />
+ </then>
+ </if>
+ <!-- counter variable -->
+ <var name="associate.sites.0" value="" />
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <var name="associate.sites.0" value="${associate.sites.0}00" />
+ </sequential>
+ </for>
+ <length property="associate.sites.length" string="${associate.sites.0}" />
+
+ <loadfile srcfile="${update.site.source.dir}/content.xml" property="content.xml">
+ <filterchain>
+ <tailfilter lines="-1" skip="1" />
+ </filterchain>
+ </loadfile>
+ <echo file="${update.site.source.dir}/content.xml" message="${content.xml}" />
+ <echo file="${update.site.source.dir}/content.xml" append="true"> <references size='${associate.sites.length}'>
+</echo>
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <!-- insert into content.xml -->
+ <echo file="${update.site.source.dir}/content.xml" append="true"> <repository uri='@{associate.site}' url='@{associate.site}' type='0' options='1'/>
+ <repository uri='@{associate.site}' url='@{associate.site}' type='1' options='1'/>
+</echo>
+ </sequential>
+ </for>
+ <echo file="${update.site.source.dir}/content.xml" append="true"> </references>
+</repository>
+</echo>
+ <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
+ <delete file="${update.site.source.dir}/content.xml" />
+ </then>
+ </if>
+ </target>
+
+ <target name="unpack.zip">
+ <unzip src="${output.dir}/target/site_assembly.zip" dest="${update.site.source.dir}" />
+ </target>
+
+ <target name="pack.zip">
+ <zip destfile="${output.dir}/target/site_assembly.zip" update="true" basedir="${update.site.source.dir}" includes="content.* index.html, web/*.css, README*" />
+ </target>
+
+ <target name="check.target">
+ <if>
+ <or>
+ <not>
+ <available file="${output.dir}/target/site" type="dir" />
+ </not>
+ <not>
+ <available file="${output.dir}/target/site_assembly.zip" type="file" />
+ </not>
+ </or>
+ <then>
+ <fail>
+--
+This script must ONLY be called via the pom.xml in this directory, not run directly.
+Cannot adjust an update site w/o first building it!
+--
+To run this build, use Tycho. Try `mvn3 clean install -fae -e -B`
+</fail>
+ </then>
+ </if>
+ </target>
+
+</project>
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/epl-v10.html b/org.eclipse.bpmn2.modeler.updatesite.feature/epl-v10.html
index 1107453..b398acc 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/epl-v10.html
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/epl-v10.html
@@ -1,259 +1,259 @@
-<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Eclipse Public License - Version 1.0</title>
-<style type="text/css">
- body {
- size: 8.5in 11.0in;
- margin: 0.25in 0.5in 0.25in 0.5in;
- tab-interval: 0.5in;
- }
- p {
- margin-left: auto;
- margin-top: 0.5em;
- margin-bottom: 0.5em;
- }
- p.list {
- margin-left: 0.5in;
- margin-top: 0.05em;
- margin-bottom: 0.05em;
- }
- </style>
-
-</head>
-
-<body lang="EN-US">
-
-<h2>Eclipse Public License - v 1.0</h2>
-
-<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
-AGREEMENT.</p>
-
-<p><b>1. DEFINITIONS</b></p>
-
-<p>"Contribution" means:</p>
-
-<p class="list">a) in the case of the initial Contributor, the initial
-code and documentation distributed under this Agreement, and</p>
-<p class="list">b) in the case of each subsequent Contributor:</p>
-<p class="list">i) changes to the Program, and</p>
-<p class="list">ii) additions to the Program;</p>
-<p class="list">where such changes and/or additions to the Program
-originate from and are distributed by that particular Contributor. A
-Contribution 'originates' from a Contributor if it was added to the
-Program by such Contributor itself or anyone acting on such
-Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in
-conjunction with the Program under their own license agreement, and (ii)
-are not derivative works of the Program.</p>
-
-<p>"Contributor" means any person or entity that distributes
-the Program.</p>
-
-<p>"Licensed Patents" mean patent claims licensable by a
-Contributor which are necessarily infringed by the use or sale of its
-Contribution alone or when combined with the Program.</p>
-
-<p>"Program" means the Contributions distributed in accordance
-with this Agreement.</p>
-
-<p>"Recipient" means anyone who receives the Program under
-this Agreement, including all Contributors.</p>
-
-<p><b>2. GRANT OF RIGHTS</b></p>
-
-<p class="list">a) Subject to the terms of this Agreement, each
-Contributor hereby grants Recipient a non-exclusive, worldwide,
-royalty-free copyright license to reproduce, prepare derivative works
-of, publicly display, publicly perform, distribute and sublicense the
-Contribution of such Contributor, if any, and such derivative works, in
-source code and object code form.</p>
-
-<p class="list">b) Subject to the terms of this Agreement, each
-Contributor hereby grants Recipient a non-exclusive, worldwide,
-royalty-free patent license under Licensed Patents to make, use, sell,
-offer to sell, import and otherwise transfer the Contribution of such
-Contributor, if any, in source code and object code form. This patent
-license shall apply to the combination of the Contribution and the
-Program if, at the time the Contribution is added by the Contributor,
-such addition of the Contribution causes such combination to be covered
-by the Licensed Patents. The patent license shall not apply to any other
-combinations which include the Contribution. No hardware per se is
-licensed hereunder.</p>
-
-<p class="list">c) Recipient understands that although each Contributor
-grants the licenses to its Contributions set forth herein, no assurances
-are provided by any Contributor that the Program does not infringe the
-patent or other intellectual property rights of any other entity. Each
-Contributor disclaims any liability to Recipient for claims brought by
-any other entity based on infringement of intellectual property rights
-or otherwise. As a condition to exercising the rights and licenses
-granted hereunder, each Recipient hereby assumes sole responsibility to
-secure any other intellectual property rights needed, if any. For
-example, if a third party patent license is required to allow Recipient
-to distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.</p>
-
-<p class="list">d) Each Contributor represents that to its knowledge it
-has sufficient copyright rights in its Contribution, if any, to grant
-the copyright license set forth in this Agreement.</p>
-
-<p><b>3. REQUIREMENTS</b></p>
-
-<p>A Contributor may choose to distribute the Program in object code
-form under its own license agreement, provided that:</p>
-
-<p class="list">a) it complies with the terms and conditions of this
-Agreement; and</p>
-
-<p class="list">b) its license agreement:</p>
-
-<p class="list">i) effectively disclaims on behalf of all Contributors
-all warranties and conditions, express and implied, including warranties
-or conditions of title and non-infringement, and implied warranties or
-conditions of merchantability and fitness for a particular purpose;</p>
-
-<p class="list">ii) effectively excludes on behalf of all Contributors
-all liability for damages, including direct, indirect, special,
-incidental and consequential damages, such as lost profits;</p>
-
-<p class="list">iii) states that any provisions which differ from this
-Agreement are offered by that Contributor alone and not by any other
-party; and</p>
-
-<p class="list">iv) states that source code for the Program is available
-from such Contributor, and informs licensees how to obtain it in a
-reasonable manner on or through a medium customarily used for software
-exchange.</p>
-
-<p>When the Program is made available in source code form:</p>
-
-<p class="list">a) it must be made available under this Agreement; and</p>
-
-<p class="list">b) a copy of this Agreement must be included with each
-copy of the Program.</p>
-
-<p>Contributors may not remove or alter any copyright notices contained
-within the Program.</p>
-
-<p>Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.</p>
-
-<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
-
-<p>Commercial distributors of software may accept certain
-responsibilities with respect to end users, business partners and the
-like. While this license is intended to facilitate the commercial use of
-the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create
-potential liability for other Contributors. Therefore, if a Contributor
-includes the Program in a commercial product offering, such Contributor
-("Commercial Contributor") hereby agrees to defend and
-indemnify every other Contributor ("Indemnified Contributor")
-against any losses, damages and costs (collectively "Losses")
-arising from claims, lawsuits and other legal actions brought by a third
-party against the Indemnified Contributor to the extent caused by the
-acts or omissions of such Commercial Contributor in connection with its
-distribution of the Program in a commercial product offering. The
-obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In
-order to qualify, an Indemnified Contributor must: a) promptly notify
-the Commercial Contributor in writing of such claim, and b) allow the
-Commercial Contributor to control, and cooperate with the Commercial
-Contributor in, the defense and any related settlement negotiations. The
-Indemnified Contributor may participate in any such claim at its own
-expense.</p>
-
-<p>For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.</p>
-
-<p><b>5. NO WARRANTY</b></p>
-
-<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
-ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with its
-exercise of rights under this Agreement , including but not limited to
-the risks and costs of program errors, compliance with applicable laws,
-damage to or loss of data, programs or equipment, and unavailability or
-interruption of operations.</p>
-
-<p><b>6. DISCLAIMER OF LIABILITY</b></p>
-
-<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
-NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
-
-<p><b>7. GENERAL</b></p>
-
-<p>If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further action
-by the parties hereto, such provision shall be reformed to the minimum
-extent necessary to make such provision valid and enforceable.</p>
-
-<p>If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging that the
-Program itself (excluding combinations of the Program with other
-software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the
-date such litigation is filed.</p>
-
-<p>All Recipient's rights under this Agreement shall terminate if it
-fails to comply with any of the material terms or conditions of this
-Agreement and does not cure such failure in a reasonable period of time
-after becoming aware of such noncompliance. If all Recipient's rights
-under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive.</p>
-
-<p>Everyone is permitted to copy and distribute copies of this
-Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The
-Agreement Steward reserves the right to publish new versions (including
-revisions) of this Agreement from time to time. No one other than the
-Agreement Steward has the right to modify this Agreement. The Eclipse
-Foundation is the initial Agreement Steward. The Eclipse Foundation may
-assign the responsibility to serve as the Agreement Steward to a
-suitable separate entity. Each new version of the Agreement will be
-given a distinguishing version number. The Program (including
-Contributions) may always be distributed subject to the version of the
-Agreement under which it was received. In addition, after a new version
-of the Agreement is published, Contributor may elect to distribute the
-Program (including its Contributions) under the new version. Except as
-expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
-rights or licenses to the intellectual property of any Contributor under
-this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under this
-Agreement are reserved.</p>
-
-<p>This Agreement is governed by the laws of the State of New York and
-the intellectual property laws of the United States of America. No party
-to this Agreement will bring a legal action under this Agreement more
-than one year after the cause of action arose. Each party waives its
-rights to a jury trial in any resulting litigation.</p>
-
-
-
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/feature.xml b/org.eclipse.bpmn2.modeler.updatesite.feature/feature.xml
index fe723d1..0e1667a 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/feature.xml
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/feature.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.bpmn2.modeler.updatesite.feature"
- label="BPMN2 Modeler Updatesite"
- version="0.0.1.qualifier"
- provider-name="Eclipse.org">
-
- <description url="http://www.example.com/description">
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.bpmn2.modeler.updatesite.feature"
+ label="BPMN2 Modeler Updatesite"
+ version="0.0.1.qualifier"
+ provider-name="Eclipse.org">
+
+ <description url="http://www.example.com/description">
Copyright (c) 2011 Red Hat, Inc.
All rights reserved.
This program is made available under the terms of the
@@ -13,19 +13,19 @@
and is available at http://www.eclipse.org/legal/epl-v10.html
Contributors:
Red Hat, Inc. - initial API and implementation
-Author: Ivar Meikas
- </description>
-
- <copyright url="http://www.example.com/copyright">
- [Enter Copyright Description here.]
- </copyright>
-
- <license url="http://www.example.com/license">
- [Enter License Description here.]
- </license>
-
- <includes
- id="org.eclipse.bpmn2.modeler.feature"
- version="0.0.0"/>
-
-</feature>
+Author: Ivar Meikas
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <includes
+ id="org.eclipse.bpmn2.modeler.feature"
+ version="0.0.0"/>
+
+</feature>
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/license.html b/org.eclipse.bpmn2.modeler.updatesite.feature/license.html
index b8b0438..6e579a5 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/license.html
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/license.html
@@ -1,164 +1,164 @@
-<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>February 1, 2011</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse
- Foundation is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also
- available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse Foundation
-source code
- repository ("Repository") in software modules ("Modules") and made
-available as downloadable archives ("Downloads").</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to
-facilitate delivering, extending, and upgrading the Content. Typical
-modules may include plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or
-Fragments and associated material. Each Feature may be packaged as a
-sub-directory in a directory named "features". Within a Feature, files
-named "feature.xml" may contain a list of the names and version numbers
-of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features ("Included
-Features"). Within a Feature, files named "feature.xml" may contain a
-list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be
-contained in files named "about.html" ("Abouts"). The terms and
-conditions governing Features and
-Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
- directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is
-installed using the Provisioning Technology (as defined below), you must
- agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the
-Feature Update License should either provide you with the terms and
-conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be
-found in the "license" property of files named "feature.properties"
-found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the
-terms and conditions (or references to such terms and conditions) that
-govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
- SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
-CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
-or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions
-govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software,
-examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager ("Provisioning Technology") for the purpose of
-allowing users to install software, documentation, information and/or
- other materials (collectively "Installable Software"). This
-capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about
-packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- ("Specification").</p>
-
-<p>You may use Provisioning Technology to allow other parties to install
- Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to
- be presented to, and accepted by, the users of the Provisioning
-Technology
- in accordance with the Specification. By using Provisioning
-Technology in such a manner and making it available in accordance with
-the
- Specification, you further acknowledge your agreement to, and the
-acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur ("Provisioning Process") in
-which a user may execute the Provisioning Technology
- on a machine ("Target Machine") with the intent of installing,
-extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology
-may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user
-the terms and conditions that govern the use of the Installable
- Software ("Installable Software Agreement") and such Installable
-Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable
-Software Agreement must inform the user of the terms and conditions that
- govern
- the Installable Software and must solicit acceptance by the end
-user in the manner prescribed in such Installable Software Agreement.
-Upon such
- indication of agreement by the user, the provisioning Technology
-will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are
- currently may have restrictions on the import, possession, and use,
-and/or re-export to
- another country, of encryption software. BEFORE using any encryption
-software, please check the country's laws, regulations and policies
-concerning the import,
- possession, or use, and re-export of encryption software, to see if
-this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-
-
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse
+ Foundation is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also
+ available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code,
+documentation and other files maintained in the Eclipse Foundation
+source code
+ repository ("Repository") in software modules ("Modules") and made
+available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to
+facilitate delivering, extending, and upgrading the Content. Typical
+modules may include plug-ins ("Plug-ins"), plug-in fragments
+("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or
+Fragments and associated material. Each Feature may be packaged as a
+sub-directory in a directory named "features". Within a Feature, files
+named "feature.xml" may contain a list of the names and version numbers
+of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included
+Features"). Within a Feature, files named "feature.xml" may contain a
+list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be
+contained in files named "about.html" ("Abouts"). The terms and
+conditions governing Features and
+Included Features should be contained in files named "license.html"
+("Feature Licenses"). Abouts and Feature Licenses may be located in any
+ directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is
+installed using the Provisioning Technology (as defined below), you must
+ agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the
+Feature Update License should either provide you with the terms and
+conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be
+found in the "license" property of files named "feature.properties"
+found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the
+terms and conditions (or references to such terms and conditions) that
+govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
+ SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
+CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
+or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions
+govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software,
+examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of
+allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This
+capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about
+packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install
+ Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to
+ be presented to, and accepted by, the users of the Provisioning
+Technology
+ in accordance with the Specification. By using Provisioning
+Technology in such a manner and making it available in accordance with
+the
+ Specification, you further acknowledge your agreement to, and the
+acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur ("Provisioning Process") in
+which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing,
+extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology
+may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user
+the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable
+Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable
+Software Agreement must inform the user of the terms and conditions that
+ govern
+ the Installable Software and must solicit acceptance by the end
+user in the manner prescribed in such Installable Software Agreement.
+Upon such
+ indication of agreement by the user, the provisioning Technology
+will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are
+ currently may have restrictions on the import, possession, and use,
+and/or re-export to
+ another country, of encryption software. BEFORE using any encryption
+software, please check the country's laws, regulations and policies
+concerning the import,
+ possession, or use, and re-export of encryption software, to see if
+this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/notice.html b/org.eclipse.bpmn2.modeler.updatesite.feature/notice.html
index b8b0438..6e579a5 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/notice.html
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/notice.html
@@ -1,164 +1,164 @@
-<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>February 1, 2011</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse
- Foundation is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also
- available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse Foundation
-source code
- repository ("Repository") in software modules ("Modules") and made
-available as downloadable archives ("Downloads").</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to
-facilitate delivering, extending, and upgrading the Content. Typical
-modules may include plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or
-Fragments and associated material. Each Feature may be packaged as a
-sub-directory in a directory named "features". Within a Feature, files
-named "feature.xml" may contain a list of the names and version numbers
-of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features ("Included
-Features"). Within a Feature, files named "feature.xml" may contain a
-list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be
-contained in files named "about.html" ("Abouts"). The terms and
-conditions governing Features and
-Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
- directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is
-installed using the Provisioning Technology (as defined below), you must
- agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the
-Feature Update License should either provide you with the terms and
-conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be
-found in the "license" property of files named "feature.properties"
-found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the
-terms and conditions (or references to such terms and conditions) that
-govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
- SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
-CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
-or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions
-govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software,
-examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager ("Provisioning Technology") for the purpose of
-allowing users to install software, documentation, information and/or
- other materials (collectively "Installable Software"). This
-capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about
-packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- ("Specification").</p>
-
-<p>You may use Provisioning Technology to allow other parties to install
- Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to
- be presented to, and accepted by, the users of the Provisioning
-Technology
- in accordance with the Specification. By using Provisioning
-Technology in such a manner and making it available in accordance with
-the
- Specification, you further acknowledge your agreement to, and the
-acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur ("Provisioning Process") in
-which a user may execute the Provisioning Technology
- on a machine ("Target Machine") with the intent of installing,
-extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology
-may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user
-the terms and conditions that govern the use of the Installable
- Software ("Installable Software Agreement") and such Installable
-Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable
-Software Agreement must inform the user of the terms and conditions that
- govern
- the Installable Software and must solicit acceptance by the end
-user in the manner prescribed in such Installable Software Agreement.
-Upon such
- indication of agreement by the user, the provisioning Technology
-will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are
- currently may have restrictions on the import, possession, and use,
-and/or re-export to
- another country, of encryption software. BEFORE using any encryption
-software, please check the country's laws, regulations and policies
-concerning the import,
- possession, or use, and re-export of encryption software, to see if
-this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-
-
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse
+ Foundation is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also
+ available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code,
+documentation and other files maintained in the Eclipse Foundation
+source code
+ repository ("Repository") in software modules ("Modules") and made
+available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to
+facilitate delivering, extending, and upgrading the Content. Typical
+modules may include plug-ins ("Plug-ins"), plug-in fragments
+("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or
+Fragments and associated material. Each Feature may be packaged as a
+sub-directory in a directory named "features". Within a Feature, files
+named "feature.xml" may contain a list of the names and version numbers
+of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included
+Features"). Within a Feature, files named "feature.xml" may contain a
+list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be
+contained in files named "about.html" ("Abouts"). The terms and
+conditions governing Features and
+Included Features should be contained in files named "license.html"
+("Feature Licenses"). Abouts and Feature Licenses may be located in any
+ directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is
+installed using the Provisioning Technology (as defined below), you must
+ agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the
+Feature Update License should either provide you with the terms and
+conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be
+found in the "license" property of files named "feature.properties"
+found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the
+terms and conditions (or references to such terms and conditions) that
+govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
+ SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
+CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
+or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions
+govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software,
+examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of
+allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This
+capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about
+packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install
+ Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to
+ be presented to, and accepted by, the users of the Provisioning
+Technology
+ in accordance with the Specification. By using Provisioning
+Technology in such a manner and making it available in accordance with
+the
+ Specification, you further acknowledge your agreement to, and the
+acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur ("Provisioning Process") in
+which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing,
+extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology
+may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user
+the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable
+Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable
+Software Agreement must inform the user of the terms and conditions that
+ govern
+ the Installable Software and must solicit acceptance by the end
+user in the manner prescribed in such Installable Software Agreement.
+Upon such
+ indication of agreement by the user, the provisioning Technology
+will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are
+ currently may have restrictions on the import, possession, and use,
+and/or re-export to
+ another country, of encryption software. BEFORE using any encryption
+software, please check the country's laws, regulations and policies
+concerning the import,
+ possession, or use, and re-export of encryption software, to see if
+this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+
+
</body></html>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/pom.xml b/org.eclipse.bpmn2.modeler.updatesite.feature/pom.xml
index 8c4836f..f25c72e 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/pom.xml
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/pom.xml
@@ -1,114 +1,114 @@
-<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>
- <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.eclipse.bpmn2.modeler</groupId>
- <artifactId>org.eclipse.bpmn2.modeler.updatesite.feature</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>eclipse-update-site</packaging>
- <name>BPMN2 Modeler Update Site</name>
- <description>Update Site feature for BPMN2 Modeler</description>
- <properties>
- <maven.antrun.plugin.version>1.3</maven.antrun.plugin.version>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-packaging-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <format>'v'yyyyMMdd-HHmm</format>
- <archiveSite>true</archiveSite>
- <environments>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${maven.antrun.plugin.version}</version>
- <executions>
- <execution>
- <id>install</id>
- <phase>install</phase>
- <configuration>
- <quiet>true</quiet>
- <tasks>
- <!-- called AFTER generating update site + zip to add in extra content -->
- <ant antfile="build.xml">
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- <version>1.4.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.7.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- <version>1.7.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.7.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-commons-net</artifactId>
- <version>1.7.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-apache-regexp</artifactId>
- <version>1.7.1</version>
- </dependency>
- <dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>ant-contrib</artifactId>
- <version>1.0b3</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
+<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>
+ <artifactId>org.eclipse.bpmn2.modeler.parent</artifactId>
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.eclipse.bpmn2.modeler</groupId>
+ <artifactId>org.eclipse.bpmn2.modeler.updatesite.feature</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-update-site</packaging>
+ <name>BPMN2 Modeler Update Site</name>
+ <description>Update Site feature for BPMN2 Modeler</description>
+ <properties>
+ <maven.antrun.plugin.version>1.3</maven.antrun.plugin.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-packaging-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <format>'v'yyyyMMdd-HHmm</format>
+ <archiveSite>true</archiveSite>
+ <environments>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${maven.antrun.plugin.version}</version>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <configuration>
+ <quiet>true</quiet>
+ <tasks>
+ <!-- called AFTER generating update site + zip to add in extra content -->
+ <ant antfile="build.xml">
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>commons-net</groupId>
+ <artifactId>commons-net</artifactId>
+ <version>1.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-commons-net</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-apache-regexp</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b3</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.updatesite.feature/site.xml b/org.eclipse.bpmn2.modeler.updatesite.feature/site.xml
index a569a7f..a5d3d6c 100644
--- a/org.eclipse.bpmn2.modeler.updatesite.feature/site.xml
+++ b/org.eclipse.bpmn2.modeler.updatesite.feature/site.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <description url="http://eclipse.org/bpmn2-modeler">
- Eclipse BPMN2 Modeler.
- </description>
- <copyright url="http://www.example.com/copyright">
- Copyright (c) 2011 Red Hat, Inc.
- All rights reserved.
-This program is made available under the terms of the
-Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
-Contributors:
-Red Hat, Inc. - initial API and implementation
-Author: Ivar Meikas
- </copyright>
- <feature url="features/org.eclipse.bpmn2.modeler.feature_0.0.0.jar" id="org.eclipse.bpmn2.modeler.feature" version="0.0.0" patch="false">
- <category name="Eclipse BPMN2 Modeler (Incubation)"/>
- </feature>
- <category-def name="Eclipse BPMN2 Modeler (Incubation)" label="Eclipse BPMN2 Modeler (Incubation)">
- <description>
- Eclipse BPMN2 Modeler (Incubation)
- </description>
- </category-def>
-</site>
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description url="http://eclipse.org/bpmn2-modeler">
+ Eclipse BPMN2 Modeler.
+ </description>
+ <copyright url="http://www.example.com/copyright">
+ Copyright (c) 2011 Red Hat, Inc.
+ All rights reserved.
+This program is made available under the terms of the
+Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+Contributors:
+Red Hat, Inc. - initial API and implementation
+Author: Ivar Meikas
+ </copyright>
+ <feature url="features/org.eclipse.bpmn2.modeler.feature_0.0.0.jar" id="org.eclipse.bpmn2.modeler.feature" version="0.0.0" patch="false">
+ <category name="Eclipse BPMN2 Modeler (Incubation)"/>
+ </feature>
+ <category-def name="Eclipse BPMN2 Modeler (Incubation)" label="Eclipse BPMN2 Modeler (Incubation)">
+ <description>
+ Eclipse BPMN2 Modeler (Incubation)
+ </description>
+ </category-def>
+</site>
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.classpath b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.classpath
index 8a8f166..ad32c83 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.classpath
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.project b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.project
index dd7d39d..7104708 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.project
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests</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>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests</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/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/META-INF/MANIFEST.MF
index f6240cd..19af236 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/META-INF/MANIFEST.MF
@@ -1,14 +1,14 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: jbpm5 runtime Tests
-Bundle-SymbolicName: org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: JBoss.org
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.junit,
- org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;bundle-version="0.0.1",
- org.eclipse.core.runtime,
- org.eclipse.ui
-Bundle-Activator: org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests.Activator
-Export-Package: org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests
-Bundle-ActivationPolicy: lazy
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: jbpm5 runtime Tests
+Bundle-SymbolicName: org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: JBoss.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.junit,
+ org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;bundle-version="0.0.1",
+ org.eclipse.core.runtime,
+ org.eclipse.ui
+Bundle-Activator: org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests.Activator
+Export-Package: org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests
+Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/build.properties b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/build.properties
index 41eb6ad..34d2e4d 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/build.properties
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/build.properties
@@ -1,4 +1,4 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/Activator.java b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/Activator.java
index b9049b1..ecb7b04 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/Activator.java
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/Activator.java
@@ -1,97 +1,97 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * @author Bob Brodt
- ******************************************************************************/
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- public static void logStatus(IStatus status) {
- Platform.getLog(plugin.getBundle()).log(status);
- }
-
- public static void logError(Exception e) {
- logStatus(createStatus(e));
- }
-
- private static Status createStatus(Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- }
-
- public static void showErrorWithLogging(Exception e){
- Status s = createStatus(e);
- logStatus(s);
- ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "An error occured", null, s);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static void logStatus(IStatus status) {
+ Platform.getLog(plugin.getBundle()).log(status);
+ }
+
+ public static void logError(Exception e) {
+ logStatus(createStatus(e));
+ }
+
+ private static Status createStatus(Exception e) {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+
+ public static void showErrorWithLogging(Exception e){
+ Status s = createStatus(e);
+ logStatus(s);
+ ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "An error occured", null, s);
+ }
+
+}
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/AllTests.java b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/AllTests.java
index 6eddf6b..a8b5c1a 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/AllTests.java
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/AllTests.java
@@ -1,21 +1,21 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ TestWIDHandler.class })
-public class AllTests {
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ TestWIDHandler.class })
+public class AllTests {
+
+}
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/TestWIDHandler.java b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/TestWIDHandler.java
index cf5246e..e84496b 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/TestWIDHandler.java
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/tests/TestWIDHandler.java
@@ -1,144 +1,144 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Scanner;
-
-import junit.framework.Assert;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDException;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDHandler;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * Basic tests for the WIDHandler
- * @author bfitzpat
- *
- */
-public class TestWIDHandler {
-
- private String getFile( String filepath ) {
- try {
- if (filepath == null) {
- Bundle bundle = Activator.getDefault().getBundle();
- IPath path = new Path("widfiles/logemail.wid");
- URL setupUrl = FileLocator.find(bundle, path, Collections.EMPTY_MAP);
- File setupFile = new File(FileLocator.toFileURL(setupUrl).toURI());
- filepath = setupFile.getAbsolutePath();
- } else {
- Bundle bundle = Activator.getDefault().getBundle();
- IPath path = new Path(filepath);
- URL setupUrl = FileLocator.find(bundle, path, Collections.EMPTY_MAP);
- File setupFile = new File(FileLocator.toFileURL(setupUrl).toURI());
- filepath = setupFile.getAbsolutePath();
- }
- } catch (URISyntaxException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- StringBuilder text = new StringBuilder();
- String NL = System.getProperty("line.separator");
- Scanner scanner = null;
- try {
- scanner = new Scanner(new FileInputStream(filepath), "UTF-8");
- while (scanner.hasNextLine()){
- text.append(scanner.nextLine() + NL);
- }
- return text.toString();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } finally {
- if (scanner != null)
- scanner.close();
- }
- return null;
- }
-
- @Test
- public void testBasic() {
- System.out.println("testBasic: logemail.wid");
- String content = getFile(null);
- HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
- try {
- WIDHandler.evaluateWorkDefinitions(widMap, content);
- } catch (WIDException e) {
- Assert.fail("Failed with exception " + e.getMessage());
- }
- Assert.assertTrue(!widMap.isEmpty());
- java.util.Iterator<WorkItemDefinition> widIterator = widMap.values().iterator();
- while(widIterator.hasNext())
- System.out.println(widIterator.next().toString());
- }
-
- @Test
- public void testComplex() {
- System.out.println("testComplex: widfiles/Email.wid");
- String content = getFile("widfiles/Email.wid");
- HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
- try {
- WIDHandler.evaluateWorkDefinitions(widMap, content);
- } catch (WIDException e) {
- Assert.fail("Failed with exception " + e.getMessage());
- }
- Assert.assertTrue(!widMap.isEmpty());
- java.util.Iterator<WorkItemDefinition> widIterator = widMap.values().iterator();
- while(widIterator.hasNext()) {
- WorkItemDefinition wid = widIterator.next();
- Assert.assertTrue(wid.getEclipseCustomEditor() != null &&
- wid.getEclipseCustomEditor().trim().length() > 0);
- System.out.println(wid.toString());
- };
- }
-
- @Test
- public void testResults() {
- System.out.println("testResults: widfiles/java.wid");
- String content = getFile("widfiles/java.wid");
- HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
- try {
- WIDHandler.evaluateWorkDefinitions(widMap, content);
- } catch (WIDException e) {
- Assert.fail("Failed with exception " + e.getMessage());
- }
- Assert.assertTrue(!widMap.isEmpty());
- java.util.Iterator<WorkItemDefinition> widIterator = widMap.values().iterator();
- while(widIterator.hasNext()) {
- WorkItemDefinition wid = widIterator.next();
- Assert.assertTrue(!wid.getResults().isEmpty());
- System.out.println(wid.toString());
- }
- }
-
- @Test
- public void testFail() {
- System.out.println("testFail: no wid");
- HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
- try {
- WIDHandler.evaluateWorkDefinitions(widMap, null);
- } catch (WIDException e) {
- Assert.assertTrue(e != null);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Scanner;
+
+import junit.framework.Assert;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDException;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDHandler;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+/**
+ * Basic tests for the WIDHandler
+ * @author bfitzpat
+ *
+ */
+public class TestWIDHandler {
+
+ private String getFile( String filepath ) {
+ try {
+ if (filepath == null) {
+ Bundle bundle = Activator.getDefault().getBundle();
+ IPath path = new Path("widfiles/logemail.wid");
+ URL setupUrl = FileLocator.find(bundle, path, Collections.EMPTY_MAP);
+ File setupFile = new File(FileLocator.toFileURL(setupUrl).toURI());
+ filepath = setupFile.getAbsolutePath();
+ } else {
+ Bundle bundle = Activator.getDefault().getBundle();
+ IPath path = new Path(filepath);
+ URL setupUrl = FileLocator.find(bundle, path, Collections.EMPTY_MAP);
+ File setupFile = new File(FileLocator.toFileURL(setupUrl).toURI());
+ filepath = setupFile.getAbsolutePath();
+ }
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ StringBuilder text = new StringBuilder();
+ String NL = System.getProperty("line.separator");
+ Scanner scanner = null;
+ try {
+ scanner = new Scanner(new FileInputStream(filepath), "UTF-8");
+ while (scanner.hasNextLine()){
+ text.append(scanner.nextLine() + NL);
+ }
+ return text.toString();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } finally {
+ if (scanner != null)
+ scanner.close();
+ }
+ return null;
+ }
+
+ @Test
+ public void testBasic() {
+ System.out.println("testBasic: logemail.wid");
+ String content = getFile(null);
+ HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
+ try {
+ WIDHandler.evaluateWorkDefinitions(widMap, content);
+ } catch (WIDException e) {
+ Assert.fail("Failed with exception " + e.getMessage());
+ }
+ Assert.assertTrue(!widMap.isEmpty());
+ java.util.Iterator<WorkItemDefinition> widIterator = widMap.values().iterator();
+ while(widIterator.hasNext())
+ System.out.println(widIterator.next().toString());
+ }
+
+ @Test
+ public void testComplex() {
+ System.out.println("testComplex: widfiles/Email.wid");
+ String content = getFile("widfiles/Email.wid");
+ HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
+ try {
+ WIDHandler.evaluateWorkDefinitions(widMap, content);
+ } catch (WIDException e) {
+ Assert.fail("Failed with exception " + e.getMessage());
+ }
+ Assert.assertTrue(!widMap.isEmpty());
+ java.util.Iterator<WorkItemDefinition> widIterator = widMap.values().iterator();
+ while(widIterator.hasNext()) {
+ WorkItemDefinition wid = widIterator.next();
+ Assert.assertTrue(wid.getEclipseCustomEditor() != null &&
+ wid.getEclipseCustomEditor().trim().length() > 0);
+ System.out.println(wid.toString());
+ };
+ }
+
+ @Test
+ public void testResults() {
+ System.out.println("testResults: widfiles/java.wid");
+ String content = getFile("widfiles/java.wid");
+ HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
+ try {
+ WIDHandler.evaluateWorkDefinitions(widMap, content);
+ } catch (WIDException e) {
+ Assert.fail("Failed with exception " + e.getMessage());
+ }
+ Assert.assertTrue(!widMap.isEmpty());
+ java.util.Iterator<WorkItemDefinition> widIterator = widMap.values().iterator();
+ while(widIterator.hasNext()) {
+ WorkItemDefinition wid = widIterator.next();
+ Assert.assertTrue(!wid.getResults().isEmpty());
+ System.out.println(wid.toString());
+ }
+ }
+
+ @Test
+ public void testFail() {
+ System.out.println("testFail: no wid");
+ HashMap<String, WorkItemDefinition> widMap = new HashMap<String, WorkItemDefinition>();
+ try {
+ WIDHandler.evaluateWorkDefinitions(widMap, null);
+ } catch (WIDException e) {
+ Assert.assertTrue(e != null);
+ }
+ }
+}
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Email.wid b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Email.wid
index 3b6bd25..a4e4766 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Email.wid
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Email.wid
@@ -1,25 +1,25 @@
-import org.drools.process.core.datatype.impl.type.StringDataType;
-[
- [
- "name" : "Email WID",
- "description" : "Sending emails",
- "version" : "1.0",
- "parameters" : [
- "From" : new StringDataType(),
- "To" : new StringDataType(),
- "Subject" : new StringDataType(),
- "Body" : new StringDataType()
- ],
- "displayName" : "Email (WID) Task",
- "icon" : "email.gif",
- "eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.EmailCustomEditor",
- "category" : "Communication",
- "defaultHandler" : "org.jbpm.process.workitem.email.EmailWorkItemHandler",
- "documentation" : "index.html",
- "dependencies" : [
- "file:./lib/jbpm-email.jar",
- "file:./lib/mail-1.4.jar",
- "file:./lib/activation-1.1.jar"
- ]
- ]
-]
+import org.drools.process.core.datatype.impl.type.StringDataType;
+[
+ [
+ "name" : "Email WID",
+ "description" : "Sending emails",
+ "version" : "1.0",
+ "parameters" : [
+ "From" : new StringDataType(),
+ "To" : new StringDataType(),
+ "Subject" : new StringDataType(),
+ "Body" : new StringDataType()
+ ],
+ "displayName" : "Email (WID) Task",
+ "icon" : "email.gif",
+ "eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.EmailCustomEditor",
+ "category" : "Communication",
+ "defaultHandler" : "org.jbpm.process.workitem.email.EmailWorkItemHandler",
+ "documentation" : "index.html",
+ "dependencies" : [
+ "file:./lib/jbpm-email.jar",
+ "file:./lib/mail-1.4.jar",
+ "file:./lib/activation-1.1.jar"
+ ]
+ ]
+]
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Twitter.wid b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Twitter.wid
index 33f06c2..113006d 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Twitter.wid
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/Twitter.wid
@@ -1,24 +1,24 @@
-import org.drools.process.core.datatype.impl.type.StringDataType;
-
-[
-
- [
- "name" : "Twitter WID",
- "description" : "Send a twitter message",
- "version" : "1.0",
- "parameters" : [
- "Message" : new StringDataType()
- ],
- "displayName" : "Twitter (WID) Task",
- "icon" : "twitter.gif",
- "category" : "Communication",
- "eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor",
- "defaultHandler" : "org.jbpm.process.workitem.twitter.TwitterHandler",
- "documentation" : "index.html",
- "dependencies" : [
- "file:./lib/jbpm-twitter.jar",
- "file:./lib/twitter4j-core-2.2.2.jar"
- ]
- ]
-
-]
+import org.drools.process.core.datatype.impl.type.StringDataType;
+
+[
+
+ [
+ "name" : "Twitter WID",
+ "description" : "Send a twitter message",
+ "version" : "1.0",
+ "parameters" : [
+ "Message" : new StringDataType()
+ ],
+ "displayName" : "Twitter (WID) Task",
+ "icon" : "twitter.gif",
+ "category" : "Communication",
+ "eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor",
+ "defaultHandler" : "org.jbpm.process.workitem.twitter.TwitterHandler",
+ "documentation" : "index.html",
+ "dependencies" : [
+ "file:./lib/jbpm-twitter.jar",
+ "file:./lib/twitter4j-core-2.2.2.jar"
+ ]
+ ]
+
+]
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/java.wid b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/java.wid
index 34d461c..893f608 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/java.wid
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/java.wid
@@ -1,19 +1,19 @@
-import org.drools.process.core.datatype.impl.type.StringDataType;
-[
-
- [
- "name" : "Java",
- "parameters" : [
- "Class" : new StringDataType(),
- "Method" : new StringDataType(),
- "Object" : new ObjectDataType(),
- "ParameterTypes" : new ListDataType(new StringDataType()),
- "Parameters" : new ListDataType(new ObjectDataType())
- ],
- "results" : [
- "Result" : new ObjectDataType()
- ]
- "displayName" : "Java",
- "customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor"
- ]
+import org.drools.process.core.datatype.impl.type.StringDataType;
+[
+
+ [
+ "name" : "Java",
+ "parameters" : [
+ "Class" : new StringDataType(),
+ "Method" : new StringDataType(),
+ "Object" : new ObjectDataType(),
+ "ParameterTypes" : new ListDataType(new StringDataType()),
+ "Parameters" : new ListDataType(new ObjectDataType())
+ ],
+ "results" : [
+ "Result" : new ObjectDataType()
+ ]
+ "displayName" : "Java",
+ "customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor"
+ ]
]
\ No newline at end of file
diff --git a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/logemail.wid b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/logemail.wid
index 5a35c1f..c373a6a 100644
--- a/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/logemail.wid
+++ b/tests/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.tests/widfiles/logemail.wid
@@ -1,29 +1,29 @@
-import org.drools.process.core.datatype.impl.type.StringDataType;
-[
-
- [
- "name" : "SimpleEmail",
- "parameters" : [
- "From" : new StringDataType(),
- "To" : new StringDataType(),
- "Subject" : new StringDataType(),
- "Body" : new StringDataType()
- ],
- "displayName" : "Simple Email",
- "icon" : "icons/import_statement.gif",
- "customEditor" :
-"org.drools.eclipse.flow.common.editor.editpart.work.EmailCustomEditor"
- ],
-
- [
- "name" : "Log",
- "parameters" : [
- "Message" : new StringDataType()
- ],
- "displayName" : "Log",
- "icon" : "icons/open.gif",
- "customEditor" :
-"org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor"
- ]
-
+import org.drools.process.core.datatype.impl.type.StringDataType;
+[
+
+ [
+ "name" : "SimpleEmail",
+ "parameters" : [
+ "From" : new StringDataType(),
+ "To" : new StringDataType(),
+ "Subject" : new StringDataType(),
+ "Body" : new StringDataType()
+ ],
+ "displayName" : "Simple Email",
+ "icon" : "icons/import_statement.gif",
+ "customEditor" :
+"org.drools.eclipse.flow.common.editor.editpart.work.EmailCustomEditor"
+ ],
+
+ [
+ "name" : "Log",
+ "parameters" : [
+ "Message" : new StringDataType()
+ ],
+ "displayName" : "Log",
+ "icon" : "icons/open.gif",
+ "customEditor" :
+"org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor"
+ ]
+
]
\ No newline at end of file