Initial coding contribution
diff --git a/examples/org.eclipse.graphiti.doc/META-INF/MANIFEST.MF b/examples/org.eclipse.graphiti.doc/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..cd6d3b6
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.graphiti.doc;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.help
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/examples/org.eclipse.graphiti.doc/about.html b/examples/org.eclipse.graphiti.doc/about.html
new file mode 100644
index 0000000..061cb23
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/about.html
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?><!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 content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
+<title>About</title>
+
+<script src="../../advanced/synchWithToc.js" type="text/javascript" xml:space="preserve"> </script>
+<script type="text/javascript">if( self == top ){ window.location.replace( "../../index.jsp?topic=/org.eclipse.acceleo.doc/about.html");}</script>
+<script type="text/javascript">
+<!--
+if (parent.ContentToolbarFrame && parent.ContentToolbarFrame.setButtonState) parent.ContentToolbarFrame.setButtonState("toggle_highlight","hidden");
+-->
+</script>
+
+</head>
+<body lang="EN-US">
+ <h3>About This Content</h3>
+
+ <p>April 14, 2010</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/org/documents/epl-v10.php" shape="rect">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/" shape="rect">http://www.eclipse.org</a>.</p>
+ <p align="right"><small><a href="#top" shape="rect">go to top</a></small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/org.eclipse.graphiti.doc/build.properties b/examples/org.eclipse.graphiti.doc/build.properties
new file mode 100644
index 0000000..00d20cc
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/build.properties
@@ -0,0 +1,35 @@
+###############################################################################
+# <copyright>
+#
+# Copyright (c) 2005, 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:
+# SAP AG - initial API, implementation and documentation
+#
+# </copyright>
+#
+###############################################################################
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.properties,\
+ about.html,\
+ resources/,\
+ toc.xml,\
+ toc_graphiti.xml,\
+ javadoc_toc.xml
+jars.compile.order = .
+src.includes = api/,\
+ META-INF/,\
+ plugin.properties,\
+ toc_graphiti.xml,\
+ toc.xml,\
+ resources/,\
+ plugin.xml,\
+ javadoc_toc.xml,\
+ about.html
+
\ No newline at end of file
diff --git a/examples/org.eclipse.graphiti.doc/plugin.properties b/examples/org.eclipse.graphiti.doc/plugin.properties
new file mode 100644
index 0000000..d60bbf0
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/plugin.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# <copyright>
+#
+# Copyright (c) 2005, 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:
+# SAP AG - initial API, implementation and documentation
+#
+# </copyright>
+#
+###############################################################################
+pluginName = Graphiti Documentation (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/examples/org.eclipse.graphiti.doc/plugin.xml b/examples/org.eclipse.graphiti.doc/plugin.xml
new file mode 100644
index 0000000..dc74450
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/plugin.xml
Binary files differ
diff --git a/examples/org.eclipse.graphiti.doc/resources/book.css b/examples/org.eclipse.graphiti.doc/resources/book.css
new file mode 100644
index 0000000..088d4e8
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/book.css
@@ -0,0 +1,22 @@
+@import "../../PRODUCT_PLUGIN/book.css";
+
+
+
+/* Adding comments: */
+/* In your Document enclose your comments in a span block like this: <span class="comment">Comment</span> */
+.comment {
+/* use "display:run-in;" to make comments visible */
+/* use "display:none;" to hide comments */
+ display:none;
+ font-weight:bold;
+ color:red;
+}
+
+
+/* this doesnt work with IE */
+kom {
+ display:none;
+ font-weight:bold;
+ color:red;
+}
+
\ No newline at end of file
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/Legal.html b/examples/org.eclipse.graphiti.doc/resources/docu/Legal.html
new file mode 100644
index 0000000..4aef031
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/Legal.html
@@ -0,0 +1,35 @@
+<!-- Copyright (c) SAP AG 2005, 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) SAP AG 2005, 2010.">
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="STYLESHEET" href="stylesheet.css" charset="ISO-8859-1"
+ type="text/css">
+<title>Legal Notices</title>
+
+
+<script type="text/javascript" src="../../../advanced/synchWithToc.js"></script>
+
+<link rel="stylesheet" href="../content/PLUGINS_ROOT/org.eclipse.help.webapp/advanced/breadcrumbs.css" charset="ISO-8859-1" type="text/css"></link>
+<script type="text/javascript" src="../content/PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
+<script type="text/javascript">if( self == top ){ window.location.replace( "../../../index.jsp?topic=/org.eclipse.graphiti.doc/resources/docu/Legal.html");}</script>
+<script type="text/javascript">
+<!--
+if (parent.ContentToolbarFrame && parent.ContentToolbarFrame.setButtonState) parent.ContentToolbarFrame.setButtonState("toggle_highlight","hidden");
+-->
+</script>
+
+</head>
+
+<body>
+<h3><a name="Notices"></a>Notices</h3>
+
+<p>The material in these guides are Copyright (c) SAP AG 2005, 2010.</p>
+
+<p><a href="../../about.html">Terms and conditions regarding the use
+of these guides.</a></p>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/book.css b/examples/org.eclipse.graphiti.doc/resources/docu/book.css
new file mode 100644
index 0000000..667b77e
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/book.css
@@ -0,0 +1 @@
+@import "../book.css";
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/diagramTypeProviders.html b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/diagramTypeProviders.html
new file mode 100644
index 0000000..bf55c18
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/diagramTypeProviders.html
@@ -0,0 +1,136 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<title>Diagram Type Providers</title>
+
+<style type="text/css">
+@import url("file:/C:/Eclipse/IDE/eclipse/configuration/org.eclipse.osgi/bundles/1059/1/.cp/book.css");
+</style>
+
+<style type="text/css">
+@import url("file:/C:/Eclipse/IDE/eclipse/configuration/org.eclipse.osgi/bundles/1070/1/.cp/schema.css");
+</style>
+</head>
+<body>
+<h1 style="text-align:center">Diagram Type Providers</h1>
+<h6 class="CaptionFigColumn SchemaHeader">Identifier:</h6>
+org.eclipse.graphiti.ui.diagramTypeProviders
+<h6 class="CaptionFigColumn SchemaHeader">Description:</h6>
+Customers of Graphiti can use this extension point to register
+their own diagram type providers.
+<h6 class="CaptionFigColumn SchemaHeader">Configuration
+Markup:</h6>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.extension" id=
+"e.extension">extension</a> (<a href=
+"#e.diagramTypeProvider">diagramTypeProvider</a>*)></p>
+<p class="code SchemaDtd"><!ATTLIST extension</p>
+<p class="code SchemaDtdAttlist">point CDATA #REQUIRED</p>
+<p class="code SchemaDtdAttlist">id CDATA
+#IMPLIED</p>
+<p class="code SchemaDtdAttlist">name CDATA
+#IMPLIED</p>
+>
+<ul class="ConfigMarkupAttlistDesc"></ul>
+<br>
+<p class="code SchemaDtd"><!ELEMENT <a name=
+"e.diagramTypeProvider" id=
+"e.diagramTypeProvider">diagramTypeProvider</a> (<a href=
+"#e.diagramType">diagramType</a> , <a href=
+"#e.imageProvider">imageProvider</a>)*></p>
+<p class="code SchemaDtd"><!ATTLIST diagramTypeProvider</p>
+<p class="code SchemaDtdAttlist">
+id CDATA
+#REQUIRED</p>
+<p class="code SchemaDtdAttlist">
+name CDATA
+#REQUIRED</p>
+<p class="code SchemaDtdAttlist">description CDATA
+#IMPLIED</p>
+<p class="code SchemaDtdAttlist">
+class CDATA
+#REQUIRED</p>
+>
+<ul class="ConfigMarkupAttlistDesc">
+<li><b>id</b> - a unique name in the NWDS environment that will
+be used to identify this diagram type provider</li>
+<li><b>name</b> - a name that will be used in the editor UI for
+this diagram type provider</li>
+<li><b>description</b> - an optional description that will be
+used in the editor UI for this diagram type provider</li>
+<li><b>class</b> - the name of a class that implements
+<samp>org.eclipse.graphiti.dt.IDiagramTypeProviderr</samp>.</li>
+</ul>
+<br>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.diagramType"
+id="e.diagramType">diagramType</a> EMPTY></p>
+<p class="code SchemaDtd"><!ATTLIST diagramType</p>
+<p class="code SchemaDtdAttlist">id IDREF #REQUIRED</p>
+>
+<p class="ConfigMarkupElementDesc">Advertises that the containing
+diagram type provider understands the given diagram type and is
+suitable for editing/viewing diagrams of that type.</p>
+<br>
+<ul class="ConfigMarkupAttlistDesc">
+<li><b>id</b> - The diagram type identifier. This is an ID
+defined by the 'org.eclipse.graphiti.ui.diagramTypes' extension
+point.</li>
+</ul>
+<br>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.imageProvider"
+id="e.imageProvider">imageProvider</a> EMPTY></p>
+<p class="code SchemaDtd"><!ATTLIST imageProvider</p>
+<p class="code SchemaDtdAttlist">id IDREF #REQUIRED</p>
+>
+<p class="ConfigMarkupElementDesc">Advertises that the containing
+diagram type provider needs the given image provider for
+rendering purposes.</p>
+<br>
+<ul class="ConfigMarkupAttlistDesc">
+<li><b>id</b> - The image provider identifier. This is an ID
+defined by the 'org.eclipse.graphiti.ui.imageProviders' extension
+point.</li>
+</ul>
+<br>
+<h6 class="CaptionFigColumn SchemaHeader">Examples:</h6>
+<pre class="Example">
+<span class="code SchemaTag">
+ <extension
+ point=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.ui.diagramTypeProviders"</span><span class="code SchemaTag">>
+ <diagramTypeProvider
+ class=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.examples.ecore.TestDiagramTypeProvider"</span><span class="code SchemaTag">
+ description=</span><span class=
+"code SchemaCstring">"This is a small Ecore test editor for the automated junit tests"</span><span class="code SchemaTag">
+ id=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.examples.ecore.TestDiagramTypeProvider"</span><span class="code SchemaTag">
+ name=</span><span class=
+"code SchemaCstring">"Ecore example editor"</span><span class=
+"code SchemaTag">>
+ <diagramType
+ id=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.examples.ecore.EcoreDiagramType"</span><span class="code SchemaTag">>
+ </diagramType>
+ <imageProvider
+ id=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.examples.common.SampleImageProvider"</span><span class="code SchemaTag">>
+ </imageProvider>
+ </diagramTypeProvider>
+ </extension>
+</span>
+</pre>
+<h6 class="CaptionFigColumn SchemaHeader">API Information:</h6>
+Instead of implementing the interface
+<samp>"org.eclipse.graphiti.dt.IDiagramTypeProvider</samp>
+directly, the customer should extend the base class
+<samp>"org.eclipse.graphiti.dt.AbstractDiagramTypeProvider</samp>.<br>
+
+<hr>
+<a href="http://www.eclipse.org/legal/epl-v10.html" shape=
+"rect">Copyright (c) SAP AG 2005, 2010.</a>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/diagramTypes.html b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/diagramTypes.html
new file mode 100644
index 0000000..7f84147
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/diagramTypes.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<title>Diagram Types</title>
+
+<style type="text/css">
+@import url("file:/C:/Eclipse/IDE/eclipse/configuration/org.eclipse.osgi/bundles/1059/1/.cp/book.css");
+</style>
+
+<style type="text/css">
+@import url("file:/C:/Eclipse/IDE/eclipse/configuration/org.eclipse.osgi/bundles/1070/1/.cp/schema.css");
+</style>
+</head>
+<body>
+<h1 style="text-align:center">Diagram Types</h1>
+<h6 class="CaptionFigColumn SchemaHeader">Identifier:</h6>
+org.eclipse.graphiti.ui.diagramTypes
+<h6 class="CaptionFigColumn SchemaHeader">Description:</h6>
+Customers of Graphiti can use this extension point to register
+their own diagram types.
+<h6 class="CaptionFigColumn SchemaHeader">Configuration
+Markup:</h6>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.extension" id=
+"e.extension">extension</a> (<a href=
+"#e.diagramType">diagramType</a>*)></p>
+<p class="code SchemaDtd"><!ATTLIST extension</p>
+<p class="code SchemaDtdAttlist">point CDATA #REQUIRED</p>
+<p class="code SchemaDtdAttlist">id CDATA
+#IMPLIED</p>
+<p class="code SchemaDtdAttlist">name CDATA
+#IMPLIED</p>
+>
+<ul class="ConfigMarkupAttlistDesc"></ul>
+<br>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.diagramType"
+id="e.diagramType">diagramType</a> EMPTY></p>
+<p class="code SchemaDtd"><!ATTLIST diagramType</p>
+<p class="code SchemaDtdAttlist">
+id CDATA
+#REQUIRED</p>
+<p class="code SchemaDtdAttlist">
+type CDATA
+#REQUIRED</p>
+<p class="code SchemaDtdAttlist">
+name CDATA
+#REQUIRED</p>
+<p class="code SchemaDtdAttlist">description CDATA
+#IMPLIED</p>
+>
+<ul class="ConfigMarkupAttlistDesc">
+<li><b>id</b> - a unique name in the NWDS environment that will
+be used to identify this diagram type</li>
+<li><b>type</b> - a unique type (e.g. "GalaxyTriggernetDiagram",
+"sample.mof"). Stored diagrams must always contain a valid
+type.</li>
+<li><b>name</b> - the name of this diagram type that will be used
+in the UI</li>
+<li><b>description</b> - an optional description of this diagram
+type that will be used in the UI</li>
+</ul>
+<br>
+<h6 class="CaptionFigColumn SchemaHeader">Examples:</h6>
+<pre class="Example">
+<span class="code SchemaTag">
+ <extension
+ point=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.ui.diagramTypes"</span><span class="code SchemaTag">>
+ <diagramType
+ description=</span><span class=
+"code SchemaCstring">"diagram type for demo examples"</span><span class="code SchemaTag">
+ id=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.examples.ecore.EcoreDiagramType"</span><span class="code SchemaTag">
+ name=</span><span class=
+"code SchemaCstring">"Sample Ecore DT"</span><span class=
+"code SchemaTag">
+ type=</span><span class=
+"code SchemaCstring">"sample.ecore"</span><span class=
+"code SchemaTag">>
+ </diagramType>
+ </extension>
+</span>
+</pre>
+<hr>
+<a href="http://www.eclipse.org/legal/epl-v10.html" shape=
+"rect">Copyright (c) SAP AG 2005, 2010.</a>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/imageProviders.html b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/imageProviders.html
new file mode 100644
index 0000000..3a1ab77
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/imageProviders.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<title>Image Providers</title>
+
+<style type="text/css">
+@import url("file:/C:/Eclipse/IDE/eclipse/configuration/org.eclipse.osgi/bundles/1059/1/.cp/book.css");
+</style>
+
+<style type="text/css">
+@import url("file:/C:/Eclipse/IDE/eclipse/configuration/org.eclipse.osgi/bundles/1070/1/.cp/schema.css");
+</style>
+</head>
+<body>
+<h1 style="text-align:center">Image Providers</h1>
+<h6 class="CaptionFigColumn SchemaHeader">Identifier:</h6>
+org.eclipse.graphiti.ui.imageProviders
+<h6 class="CaptionFigColumn SchemaHeader">Description:</h6>
+Customers of Graphiti can use this extension point to register
+their own image providers.
+<h6 class="CaptionFigColumn SchemaHeader">Configuration
+Markup:</h6>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.extension" id=
+"e.extension">extension</a> (<a href=
+"#e.imageProvider">imageProvider</a>*)></p>
+<p class="code SchemaDtd"><!ATTLIST extension</p>
+<p class="code SchemaDtdAttlist">point CDATA #REQUIRED</p>
+<p class="code SchemaDtdAttlist">id CDATA
+#IMPLIED</p>
+<p class="code SchemaDtdAttlist">name CDATA
+#IMPLIED</p>
+>
+<ul class="ConfigMarkupAttlistDesc"></ul>
+<br>
+<p class="code SchemaDtd"><!ELEMENT <a name="e.imageProvider"
+id="e.imageProvider">imageProvider</a> EMPTY></p>
+<p class="code SchemaDtd"><!ATTLIST imageProvider</p>
+<p class="code SchemaDtdAttlist">id CDATA
+#REQUIRED</p>
+<p class="code SchemaDtdAttlist">class CDATA #REQUIRED</p>
+>
+<ul class="ConfigMarkupAttlistDesc">
+<li><b>id</b> - a unique name in the NWDS environment that will
+be used to identify this image provider</li>
+<li><b>class</b> - the name of a class that implements
+<samp>org.eclipse.graphiti.ui.platform.IImageProvider</samp>.</li>
+</ul>
+<br>
+<h6 class="CaptionFigColumn SchemaHeader">Examples:</h6>
+<pre class="Example">
+<span class="code SchemaTag">
+ <extension
+ point=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.ui.imageProviders"</span><span class="code SchemaTag">>
+ <imageProvider
+ id=</span><span class=
+"code SchemaCstring">"org.eclipse.graphiti.examples.common.SampleImageProvider"</span><span class="code SchemaTag">>
+ </imageProvider>
+ </extension>
+</span>
+</pre>
+<h6 class="CaptionFigColumn SchemaHeader">API Information:</h6>
+Instead of implementing the interface
+<samp>org.eclipse.graphiti.ui.platform.IImageProvider</samp>
+directly, the customer should extend the base class
+<samp>org.eclipse.graphiti.ui.platform.AbstractImageProvider</samp>.<br>
+
+<hr>
+<a href="http://www.eclipse.org/legal/epl-v10.html" shape=
+"rect">Copyright (c) SAP AG 2005, 2010.</a>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/index.html b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/index.html
new file mode 100644
index 0000000..aeca222
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/extension-points/index.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Graphiti Extension Points</title>
+<link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css">
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<center>
+<h1>EMF Migration and Frameworks Extension Points </h1>
+</center>The following extension points can be used to extend the capabilities of
+Graphiti:
+<h3><a name="metamodeling"></a><a name="graphics"></a>Graphical Modeling</h3>
+<ul>
+ <li><a href="diagramTypeProviders.html">
+ diagramTypeProviders</a></li>
+ <li><a href="diagramTypes.html">
+ diagramTypes</a></li>
+ <li><a href="imageProviders.html">
+ imageProviders</a></li>
+</ul>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/add-connection-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/add-connection-feature.htm
new file mode 100644
index 0000000..279aeab
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/add-connection-feature.htm
@@ -0,0 +1,530 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Providing add connection functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"Heading 2 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"Heading 3 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"Heading 4 Char";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"Heading 5 Char";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Preformatted Char";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Balloon Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-link:"Heading 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-link:"Heading 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.Heading3Char
+ {mso-style-name:"Heading 3 Char";
+ mso-style-link:"Heading 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.Heading4Char
+ {mso-style-name:"Heading 4 Char";
+ mso-style-link:"Heading 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.Heading5Char
+ {mso-style-name:"Heading 5 Char";
+ mso-style-link:"Heading 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.HTMLPreformattedChar
+ {mso-style-name:"HTML Preformatted Char";
+ mso-style-link:"HTML Preformatted";
+ font-family:"Consolas","serif";}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-link:"Balloon Text";
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+span.code0
+ {mso-style-name:code0;
+ font-style:italic;}
+span.code00
+ {mso-style-name:code00;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><span lang=EN-GB>Providing Add Connection Functionality</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In a previous chapter
+it was explained how an <a href="add-feature.htm">add feature</a> is used to
+create graphical representations (in that case shapes with rectangles) for
+existing business-objects (in that case EClasses). </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this chapter the
+same functionality shall be provided for connections. Concretely an add feature
+for connections shall be implemented, which creates a graphical representations
+(connections with polylines) for an existing business objects (EReferences).</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>An add connection
+feature has to implement the interface </span><span class=code1><span
+lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IAddFeature.html"><span
+style='font-style:normal'>IAddFeature</span></a>.</span></span><span
+lang=EN-GB style='color:black'> Instead of implementing it directly it should
+extend one of the available base classes. In this example we extend the base
+class<span class=code1> </span></span><span class=code1><span lang=EN-US
+style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/impl/AbstractAddFeature.html"><span
+style='font-style:normal'>AbstractAddFeature</span></a></span></span><span
+lang=EN-GB style='color:black'>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite two methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IAdd.html#canAdd(com.sap.tc.emf.gfw.features.context.IAddContext)"><span
+style='font-style:normal'>canAdd</span></a></span></span><span lang=EN-US
+style='color:black'> </span><span lang=EN-GB style='color:black'>has to check
+the given context and therefore it decides if a business object can be added.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IAdd.html#add(com.sap.tc.emf.gfw.features.context.IAddContext)"><span
+style='font-style:normal'>add</span></a> </span></span><span lang=EN-GB
+style='color:black'>finally has to create the pictogram element (connection)
+and has to establish the linkage to the business object. Additionally we have
+to create the graphics algorithm (polyline). </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the add connection feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> TutorialAddEReferenceFeature
+ <b><span style='color:#7F0055'>extends</span></b><span style='color:black'>
+ AbstractAddFeature {</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>TutorialAddEReferenceFeature
+ <span style='color:black'>(IFeatureProvider fp) {</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>super</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> PictogramElement add(IAddContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IAddConnectionContext addConContext = (IAddConnectionContext) context;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>EReference
+ addedEReference = (EReference) context.getNewObject();<br>
+ IPeCreateService peCreateService =
+ Graphiti.getPeCreateService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang="en-us">
+ <font size="2"><span style="font-family: Courier New">
+ </span></font></span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// CONNECTION WITH POLYLINE</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Connection connection = </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ peCreateService<br>
+ </span>
+ <span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>createFreeFormConnection</i>(getDiagram());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ connection.setStart(addConContext.getSourceAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ connection.setEnd(addConContext.getTargetAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang="en-us">
+ <font size="2"><span style="font-family: Courier New">
+ </span></font></span>
+ <span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>IGaService gaService =
+ Graphiti.getGaService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Polyline polyline = </span>
+ <span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>gaService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.createPolyline(connection);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ polyline.setLineWidth(2);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ polyline.setForeground(manageColor(IColorConstant.</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>BLACK</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create link and wire it</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ link(connection, </span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New"'>addedEReference<span style='color:black'>);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> connection;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canAdd(IAddContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// return true if given business object is an EReference</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// note, that the context must be an instance of IAddConnectionContext</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (context </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IAddConnectionContext</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ && context.getNewObject() </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EReference) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the feature
+provider has to deliver our newly created feature (overwrite the method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getAddFeature(com.sap.tc.emf.gfw.features.context.IAddContext)">getAdd<span
+lang=EN-US>Feature</span></a></span><span class=code00><span lang=EN-US
+style='color:black;font-style:normal'>)</span></span><span class=code0><span
+lang=EN-US style='color:black;font-style:normal'>.</span></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#646464'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> IAddFeature getAddFeature(IAddContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// is object for add request a EClass or EReference?</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (context.getNewObject() </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> TutorialAddEClassFeature(</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ } </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>else</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (context.getNewObject() </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EReference) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialAddEReferenceFeature(</span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>.getAddFeature(context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Before this new add connection
+feature can be tested, we have to <a href="create-connection-feature.htm">provide
+create connection functionality</a> as described in the next chapter. </span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/add-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/add-feature.htm
new file mode 100644
index 0000000..f998538
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/add-feature.htm
@@ -0,0 +1,848 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Providing add functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"Überschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"Überschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"Überschrift 3 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"Überschrift 4 Zchn";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"Überschrift 5 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
+ {mso-style-link:"Fußnotentext Zchn";
+ margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:0cm;
+ margin-bottom:.0001pt;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
+ {mso-style-link:"Kommentartext Zchn";
+ margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:0cm;
+ margin-bottom:.0001pt;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+span.MsoFootnoteReference
+ {vertical-align:super;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Vorformatiert Zchn";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"Überschrift 1 Zchn";
+ mso-style-link:"Überschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"Überschrift 2 Zchn";
+ mso-style-link:"Überschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift3Zchn
+ {mso-style-name:"Überschrift 3 Zchn";
+ mso-style-link:"Überschrift 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift4Zchn
+ {mso-style-name:"Überschrift 4 Zchn";
+ mso-style-link:"Überschrift 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.berschrift5Zchn
+ {mso-style-name:"Überschrift 5 Zchn";
+ mso-style-link:"Überschrift 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.HTMLVorformatiertZchn
+ {mso-style-name:"HTML Vorformatiert Zchn";
+ mso-style-link:"HTML Vorformatiert";
+ font-family:"Consolas","serif";}
+span.FunotentextZchn
+ {mso-style-name:"Fußnotentext Zchn";
+ mso-style-link:Fußnotentext;
+ font-family:"Times New Roman","serif";}
+span.KommentartextZchn
+ {mso-style-name:"Kommentartext Zchn";
+ mso-style-link:Kommentartext;
+ font-family:"Times New Roman","serif";}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099517"><span lang=EN-GB>Providing Add Functionality</span></a></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Architecture: Pictogram Model Linked With Domain Model</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In the terms of
+Graphiti add means to add a graphical representation of an existing
+domain model object (= business object) to the diagram. What kinds of business
+objects can be added to a diagram of a specific type is decided by the add
+features delivered by the feature provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>For our example the
+graphical representation of a EClass is illustrated in the Figure. We want to
+see a rounded rectangle containing a separator like horizontal line and above
+that line the name of the corresponding EClass.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span style='color:black'><img width=155 height=117
+src="visio/package-shape.gif"></span></p>
+
+<p class=MsoCaption><a name="_Ref136666137"></a><a name="_Toc176747803"></a><a
+name="_Ref136407489"></a><span lang=EN-US>Figure: Graphical representation of a
+EClass</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Graphiti
+supports a kind of linkage between elements of the domain model and elements of
+the model defining the graphical representation the so called <em>Pictograms
+Model</em>. These links are called <i>pictogram links</i>. Each diagram
+contains one container for all pictogram links called <i>diagram link</i>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the linkage
+structure of the example in the Figure: Column one shows the entity model of
+the graphical representation of exactly one EClass. A container shape
+aggregates two child shapes (a container shape itself can be aggregated in
+another container shape or in a diagram). All three shapes themselves aggregate
+specific graphics algorithms, providing the complete information to allow the
+rendering on a screen. Examples for this information are background color,
+foreground color, size, position, visibility and line width. In our example we
+have a rounded rectangle providing an additional corner radius, a polyline
+having defined end- and bendpoints and a text label containing a text
+value.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span style='color:black'><img width=557 height=350
+src="visio/pictogram-model.png"></span></p>
+
+<p class=MsoCaption><a name="_Ref136408238"></a><a name="_Toc176747804"></a><span
+lang=EN-US>Figure: Linkage structure example</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The container shape and
+likewise the shape containing the text label are related to a corresponding
+EClass. This relationship is realized through special link objects (pictogram
+link) holding references to both sides: to the pictograms side and to the
+business side.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Creating an add feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+to enable the editors users to add EClasses to the diagram. As a result it
+should be possible to drag an EClass from the tree and drop it on the diagram.
+Therefore we have to create an add feature and make it available in the feature
+provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>An add feature has to
+implement the interface </span><span class=code1><span lang=EN-US
+style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IAddFeature.html"><span
+style='font-style:normal'>IAddFeature</span></a>.</span></span><span
+lang=EN-GB style='color:black'> Instead of implementing it directly it should
+extend one of the available base classes. In this example we extend the base
+class<span class=code1> </span></span><span class=code1><span lang=EN-US
+style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/jam/AbstractAddShapeFeature.html"><span
+style='font-style:normal'>AbstractAddShapeFeature</span></a></span></span><span
+lang=EN-GB style='color:black'>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite two methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IAdd.html#canAdd(com.sap.tc.emf.gfw.features.context.IAddContext)"><span
+style='font-style:normal'>canAdd</span></a></span></span><span lang=EN-US
+style='color:black'> </span><span lang=EN-GB style='color:black'>has to check
+the given context and therefore it decides if a business object can be added.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IAdd.html#add(com.sap.tc.emf.gfw.features.context.IAddContext)"><span
+style='font-style:normal'>add</span></a></span></span><span lang=EN-GB
+style='color:black'> finally has to create the pictogram structure described
+above and has to establish the linkage to the business object. Additionally we
+have to create graphics algorithms and place them at the appropriate</span><span lang=EN-GB
+style='color:black'> location</span><span lang=EN-GB
+style='color:black'> (get
+location from given context). Additionally, the name of the EClass has
+to be set as the text labels value. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the add feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialAddEClassFeature </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>extends</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AbstractAddShapeFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>private</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IColorConstant </span><i><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#0000C0'>CLASS_TEXT_FOREGROUND</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ColorConstant(51, 51, 153);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>private</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> IColorConstant
+ </span><i><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#0000C0'>CLASS_FOREGROUND</span></i><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'> =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ColorConstant(255, 102, 0);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>private</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IColorConstant </span><i><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#0000C0'>CLASS_BACKGROUND</span></i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ColorConstant(255, 204, 153);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ TutorialAddEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>super</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canAdd(IAddContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// check if user wants to add a EClass</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (context.getNewObject() </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// check if user wants to add to a diagram</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (context.getTargetContainer() </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Diagram) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> PictogramElement add(IAddContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass addedClass = (EClass) context.getNewObject();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Diagram targetDiagram = (Diagram) context.getTargetContainer();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// CONTAINER SHAPE WITH ROUNDED RECTANGLE</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IPeCreateService peCreateService = Graphiti.getPeCreateService();<br>
+ ContainerShape containerShape =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ peCreateService.<i>createContainerShape</i>(targetDiagram, </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// define a default size for the shape</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>int</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> width = 100;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>int</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> height = 50; </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>
+ IGaService gaService = Graphiti.getGaService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'> </p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create and set graphics algorithm</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ RoundedRectangle roundedRectangle =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>gaService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>createRoundedRectangle</i>(containerShape, 5, 5);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ roundedRectangle.setForeground(manageColor(</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>CLASS_FOREGROUND</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ roundedRectangle.setBackground(manageColor(</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>CLASS_BACKGROUND</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ roundedRectangle.setLineWidth(2);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>gaService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>setLocationAndSizeOfGraphicsAlgorithm</i>(roundedRectangle,</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ context.getX(), context.getY(), width, height);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ <span style='color:green'>// if added Class has no resource we add it to the
+ resource <br>
+ // of the
+ diagram</span></span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>
+ // in a real scenario the business model would have its own resource</span></p>
+ <p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>
+ if</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ (addedClass.eResource() == <b><span style='color:#7F0055'>null</span></b>) {</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ getDiagram().eResource().getContents().add(addedClass);</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create link and wire it</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ link(containerShape, addedClass);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// SHAPE WITH LINE</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create shape for line</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Shape shape = </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>peCreateService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>createShape</i>(containerShape, </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create and set graphics algorithm</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Polyline polyline =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>gaService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>createPolyline</i>(shape,
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>int</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>[]
+ { 0, 20, width, 20 });</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ polyline.setForeground(manageColor(</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>CLASS_FOREGROUND</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ polyline.setLineWidth(2);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// SHAPE WITH TEXT</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create shape for text</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Shape shape = </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>peCreateService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>createShape</i>(containerShape, </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create and set text graphics algorithm</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Text text = </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>gaService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>createDefaultText</i>(shape, addedClass.getName());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setForeground(manageColor(</span><i><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#0000C0'>CLASS_TEXT_FOREGROUND</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setHorizontalAlignment(Orientation.</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>ALIGNMENT_CENTER</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setVerticalAlignment(Orientation.</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>ALIGNMENT_CENTER</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.getFont().setBold(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>true</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>gaService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.<i>setLocationAndSizeOfGraphicsAlgorithm</i>(text, 0, 0, width, 20);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create link and wire it</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ link(shape, addedClass);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ containerShape;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang="en-gb">T</span><span lang=EN-GB style='color:black'>he
+feature provider has to deliver our newly created feature (overwrite the method
+<a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getAddFeature(com.sap.tc.emf.gfw.features.context.IAddContext)">getAddFeature</a>).
+</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> IAddFeature getAddFeature(IAddContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// is object for add request a EClass?</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (context.getNewObject() </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialAddEClassFeature(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>this</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>.getAddFeature(context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Add a EClass</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><i><span lang=EN-GB style='color:black'>Note: if the project
+wizard for a "<a href="example-projects.htm">New Graphiti Sample Project</a>"
+does not work correctly and you can not test the add feature as described
+below, please continue with the next chapter and <a href="create-feature.htm">provide
+create functionality</a>. That will allow to test the add feature directly in
+the diagram.</span></i></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now we can start the
+editor again. It should be possible to drop an EClass from the tree of the
+Graphiti "Test" project into the diagram Test-1. </span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><img border=0
+src="visio/predefined-eclass.png"></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoCaption><a name="Figure:_Add_PredefinedEClass_to_the_edit"><span
+lang=EN-US>Figure: Add PredefinedEClass to the editor</span></a></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Without any further
+implementations it should be possible to move the EClass shapes around, resize
+them, remove them (context menu) and even delete them.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/anchors.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/anchors.htm
new file mode 100644
index 0000000..30b769b
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/anchors.htm
@@ -0,0 +1,569 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<meta name="Generator" content="Microsoft Word 12 (filtered)">
+<title>Connection anchors</title>
+<link rel="Stylesheet" type="text/css" media="all" href=
+"../book.css">
+<style type="text/css">
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"Überschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"Überschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"Überschrift 3 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"Überschrift 4 Zchn";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"Überschrift 5 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Vorformatiert Zchn";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"Überschrift 1 Zchn";
+ mso-style-link:"Überschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"Überschrift 2 Zchn";
+ mso-style-link:"Überschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift3Zchn
+ {mso-style-name:"Überschrift 3 Zchn";
+ mso-style-link:"Überschrift 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift4Zchn
+ {mso-style-name:"Überschrift 4 Zchn";
+ mso-style-link:"Überschrift 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.berschrift5Zchn
+ {mso-style-name:"Überschrift 5 Zchn";
+ mso-style-link:"Überschrift 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.HTMLVorformatiertZchn
+ {mso-style-name:"HTML Vorformatiert Zchn";
+ mso-style-link:"HTML Vorformatiert";
+ font-family:Consolas;}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+span.code0
+ {mso-style-name:code0;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+<body bgcolor="white" lang="DE" link="blue" vlink="purple" style=
+'margin-bottom:12.0pt'>
+<div class="Section1">
+<h1><span lang="EN-GB">Connection Anchors</span></h1>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><span lang="EN-US">Different Types of Connection
+Anchors</span></h2>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'>Currently the following different types of
+connection anchors are supported:</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><b><span lang="EN-US" style=
+'color:black'>Chop Box Anchor</span></b></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>It
+can be created calling <a href=
+"file://///wdfd00184898a/../javadoc/com/sap/tc/emf/gfw/util/PeUtil.html#createChopboxAnchor(AnchorContainer)">
+createChopboxAnchor</a>. A chop box anchor is located virtually
+in the center of the parent. However, the connection line does
+not end at the center of the parent but already at the
+intersection-point with the parent boundaries. This means
+especially, that the intersection-point is re-calculated not only
+when the parents size or location changes, but also when the
+direction of the connection changes.</span></p>
+<p class="MsoNormal"><span style='color:black'><img border="0"
+width="164" height="104" src="visio/anchor-chopbox.gif" alt=
+""></span></p>
+<p class="MsoCaption"><span class="code1"><span lang="EN-US"
+style='font-style:normal'>Figure: Chop box anchor (always
+pointing to the center)</span></span></p>
+<p class="MsoNormal"><b><span lang="EN-US" style=
+'color:black'>Box Relative Anchor</span></b></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>It
+can be created calling <a href=
+"file://///wdfd00184898a/../javadoc/com/sap/tc/emf/gfw/util/PeUtil.html#createBoxRelativeAnchor(AnchorContainer)">
+createBoxRelativeAnchor</a>. A box relative anchor is located
+relative to the size and location of the parent. The
+x/y-coordinates are defined as percentage values between 0.0 and
+1.0. This allows for example to locate an anchor always at the
+middle-right border of the parent (x=1.0, y=0.5). The location of
+the anchor is re-calculated whenever the parents size or location
+changes.</span></p>
+<p class="MsoNormal"><span style='color:black'><img border="0"
+width="165" height="95" src="visio/anchor-boxrelative.gif" alt=
+""></span></p>
+<p class="MsoCaption"><span class="code1"><span lang="EN-US"
+style='font-style:normal'>Figure: Box relative anchor (on
+middle-right border)</span></span></p>
+<p class="MsoNormal"><b><span lang="EN-US" style=
+'color:black'>Fix Point Anchor</span></b></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>It
+can be created calling <a href=
+"file://///wdfd00184898a/../javadoc/com/sap/tc/emf/gfw/util/PeUtil.html#createFixPointAnchor(AnchorContainer)">
+createFixPointAnchor</a>. A fix point anchor is located at fix
+x/y-coordinates (relative to the parent).</span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<h2><span lang="EN-US">Connection Anchor Points
+Explained</span></h2>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>Every
+connection has two connection anchors which provide the points
+where the connection starts/ends. Additionally the connection can
+have multiple bend-points in between.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>An
+anchor has two points: the “reference-point” is the
+logical end-point of the connection and the
+“location” is the visible end-point of the
+connection.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>The
+following sketch explains those points for a chop box
+anchor.</span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<p class="MsoNormal"><img border="0" width="444" height="154"
+src="visio/anchor-points.gif" alt=""></p>
+<p class="MsoCaption"><span class="code1"><span lang="EN-US"
+style='font-style:normal'>Figure: Points of a chop box
+anchor</span></span></p>
+<p class="MsoNormal"><span lang="EN-US">The reference-point (R)
+of the chop box anchor is the middle of the figure, because this
+is the point where the connection logically ends. The
+reference-point changes if the figure changes, but it does not
+change depending on the connection.</span></p>
+<p class="MsoNormal"><span lang="EN-US">We define the point (O)
+as the other point where the connection logically ends. If the
+connection has bend-points, then (O) is the bend-point (B) next
+to the anchor, otherwise (O) is the reference-point (R) of the
+other connection anchor. This means, that logically the
+connection is a line from (R) to (O).</span></p>
+<p class="MsoNormal"><span lang="EN-US">But a line drawn from (R)
+to (O) would overlap the figure. To avoid this overlap the
+location (L) of an anchor is calculated from (R) and (O) as the
+visible end-point of the connection. In case of the chop box
+anchor (L) is the intersection between the line (R - O) and the
+border of the figure.</span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<p class="MsoNormal"><span lang="EN-US">The same algorithm is
+applied for all other anchor types, although often the
+calculation is much simpler. For example in a fix point anchor
+the reference-point (R) is the point the anchor was initialized
+with and the location (L) is identical to (R).</span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<h2><span lang="EN-US">Creating Connections with Drag & Drop
+from Anchors</span></h2>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>If
+the user shall be able to create connections directly via drag
+& drop from an anchor without the connection-tool, this can
+be implemented by so called drag & drop features. This does
+not work for chop box anchors, because they have no visible
+anchor which can be dragged.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>To
+offer drag & drop functionality from anchors we have to
+overwrite the <a href=
+"file://///wdfd00184898a/../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getDragAndDropFeatures(com.sap.tc.emf.gfw.features.context.IPictogramElementContext)">
+getDragAndDropFeatures</a>.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>If
+this method returns exactly one feature it will be executed
+directly on drop (if applicable). If you provide more than one
+feature the user will be presented a popup menu on drop showing
+all applicable features (applicable means <a href=
+"file://///wdfd00184898a/../javadoc/com/sap/tc/emf/gfw/features/IFeature.html#canExecute(com.sap.tc.emf.gfw.features.context.IContext)">
+canExecute</a> returns true). The user can select the desired
+feature which will be executed then.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>In
+this example we first add a box relative anchor on the
+middle-right border of a EClass. Then we support drag & drop
+from that anchor to another EClass, which will create a new
+connection.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>First
+the box relative anchors have to be created at end of the add
+method of the</span> <span class="code1"><span lang="EN-US"
+style='color:black'>TutorialAddEClassFeature</span></span><span class="code1"><span lang="EN-US"
+style='color:black;font-style:normal'>, as explained in the
+following code snippet. Note, that the previously created chop
+box anchor (see <a href="create-connection-feature.htm">create
+connection feature</a>) remains, so that the EClass has then two
+anchors:</span></span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<table class="MsoNormalTable" border="0" cellspacing="0"
+cellpadding="0" width="851" style=
+'width:18.0cm;border-collapse:collapse'>
+<tr>
+<td width="851" valign="top" style=
+'width:18.0cm;border:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-GB" style=
+'font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<b><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#7F0055'>public</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt; font-family:"Courier New";color:black'>PictogramElement
+add(IAddContext context) {</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#3F7F5F'>//
+... EXiSTING CODING ...</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#3F7F5F'>//
+add a chopbox anchor to the shape</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>
+IPeCreateService peCreateService =
+Graphiti.getPeCreateService();</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>peCreateService<span style='color:black'>.createChopboxAnchor(containerShape);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#3F7F5F'>//
+add a box relative anchor to the shape at middle-right</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+BoxRelativeAnchor boxAnchor =</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>peCreateService<span style='color:black'>.createBoxRelativeAnchor(containerShape);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+boxAnchor.setRelativeWidth(1.0);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+boxAnchor.setRelativeHeight(0.5);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#3F7F5F'>//
+assign a rectangle graphics algorithm for the box relative
+anchor</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#3F7F5F'>//
+note, that the rectangle is inside the border of the rectangle
+shape</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>IGaService gaService
+= Graphiti.getGaService();</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+Rectangle boxRect =</span> <span lang="EN-US" style=
+'font-size:10.0pt; font-family:"Courier New"'>gaService<span style='color:black'>.createRectangle(boxAnchor);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>gaService<span style='color:black'>.setLocationAndSizeOfGraphicsAlgorithm(boxRect,
+-8, -4, 8, 8);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+Color c =</span> <span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>gaService<span style='color:black'>.manageColor(getDiagram(),
+IColorConstant.</span><i><span style=
+'color:#0000C0'>DARK_BLUE</span></i><span style=
+'color:black'>);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+boxRect.setBackground(c);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> <span style=
+'color:black'> </span>
+<span style='color:#3F7F5F'>// call the layout
+feature</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>layoutPictogramElement(containerShape);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<b><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#7F0055'>return</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt; font-family:"Courier New";color:black'>containerShape;</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-size:10.0pt; font-family:"Courier New";color:black'> </span></p>
+</td>
+</tr>
+</table>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'>Additionally the feature provider has to deliver
+the drag & drop features (overwrite the method <a href=
+"file://///wdfd00184898a/../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getDragAndDropFeatures(com.sap.tc.emf.gfw.features.context.IPictogramElementContext)">
+getDragAndDropFeatures</a><span class=
+"code1">)</span>.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>In
+this very simple implementation all create connection features
+are returned independent of the given context:</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<table class="MsoNormalTable" border="0" cellspacing="0"
+cellpadding="0" width="851" style=
+'width:18.0cm;border-collapse:collapse'>
+<tr>
+<td width="851" valign="top" style=
+'width:18.0cm;border:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style='color:black'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#646464'>@Override</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<b><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#7F0055'>public</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt; font-family:"Courier New";color:black'>IFeature[]
+getDragAndDropFeatures(IPictogramElementContext context)
+{</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:#3F7F5F'>//
+simply return all create connection features</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<b><span style=
+'font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b>
+<span style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>getCreateConnectionFeatures();</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-size:10.0pt; font-family:"Courier New";color:black'>
+}</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-size:10.0pt; font-family:"Courier New";color:black'> </span></p>
+</td>
+</tr>
+</table>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><span lang="EN-GB">Test: Create a Connection with Drag &
+Drop from Anchor</span></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>Start
+the editor again and create two new EClasses (existing EClasses
+don’t work, because they have no anchor at the middle-right
+border).</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'>Then</span> <span lang="EN-US" style=
+'color:black'>drag the anchor at the middle-right border of the
+first EClass and drop it onto the second EClass. This will create
+a new connection between those two EClasses.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/color-schemas.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/color-schemas.htm
new file mode 100644
index 0000000..46c4109
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/color-schemas.htm
@@ -0,0 +1,528 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<meta name="Generator" content="Microsoft Word 12 (filtered)">
+<title>Color schemas</title>
+<link rel="Stylesheet" type="text/css" media="all" href=
+"../book.css">
+<style type="text/css">
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"\00DCberschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"\00DCberschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"\00DCberschrift 3 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"\00DCberschrift 4 Zchn";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"\00DCberschrift 5 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h6
+ {mso-style-link:"\00DCberschrift 6 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Vorformatiert Zchn";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"\00DCberschrift 1 Zchn";
+ mso-style-link:"\00DCberschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"\00DCberschrift 2 Zchn";
+ mso-style-link:"\00DCberschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift3Zchn
+ {mso-style-name:"\00DCberschrift 3 Zchn";
+ mso-style-link:"\00DCberschrift 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift4Zchn
+ {mso-style-name:"\00DCberschrift 4 Zchn";
+ mso-style-link:"\00DCberschrift 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.berschrift5Zchn
+ {mso-style-name:"\00DCberschrift 5 Zchn";
+ mso-style-link:"\00DCberschrift 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.berschrift6Zchn
+ {mso-style-name:"\00DCberschrift 6 Zchn";
+ mso-style-link:"\00DCberschrift 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+span.HTMLVorformatiertZchn
+ {mso-style-name:"HTML Vorformatiert Zchn";
+ mso-style-link:"HTML Vorformatiert";
+ font-family:Consolas;}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+p.comment, li.comment, div.comment
+ {mso-style-name:comment;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+</head>
+<body bgcolor="white" lang="DE" link="blue" vlink="purple" style=
+'margin-bottom:12.0pt'>
+<div class="Section1">
+<h1><span lang="EN-GB">Color Schemas</span></h1>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>Up to
+now we rendered EClass shapes using a single background color
+(see implementation of class StyleUtil in chapter “<a href=
+"styles.htm">Using styles</a>”). It is also possible to use
+a complex background color schema instead. This offers the
+following enhancements:</span></p>
+<ul style='margin-top:0cm' type="disc">
+<li class="MsoNormal" style='color:black'><span lang=
+"EN-US">Instead of a single background color multiple colors can
+be defined, which are either separated by a hard boundary or by a
+soft gradient color flow. Examples are a gradient blue-to-white
+color flow or a rainbow of colors separated by hard
+boundaries.</span></li>
+<li class="MsoNormal" style='color:black'><span lang="EN-US">The
+background colors can change depending on the current interaction
+state. Examples for interaction states are shape selection
+(unselected, primary selected, secondary selected) or actions
+like dropping a child on a shape (allowed or
+forbidden).</span></li>
+</ul>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'>Technically a complex background color schema is
+defined in a <a href=
+"../../../javadoc/com/sap/mi/gfw/mm/pictograms/RenderingStyle.html">
+RenderingStyle</a>. Take care, that this has nothing to do with
+<a href="styles.htm">styles</a>, except the confusing name! Also
+note that only background colors are defined in a
+<i>RenderingStyle</i> and not foreground colors. Maybe this will
+be enhanced in the future.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'>Always keep in mind the following rule: if a
+graphics algorithm has both a background color and a
+<i>RenderingStyle</i> defined, then the <i>RenderingStyle</i> is
+used and the background color is ignored.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>A
+<i>RenderingStyle</i> has only the attribute
+“predefined-style-id”, which must be one of those
+defined in <a href=
+"../../../javadoc/com/sap/tc/emf/gfw/util/IPredefinedRenderingStyle.html">
+IPredefinedRenderingStyle</a>. There are only a few predefined
+rendering styles, which are defined by the UX group and are
+hard-coded in the system. Tools can not define further rendering
+styles, but only refer the predefined rendering styles. The
+reason is that only by this a consistent look and feel over all
+tools can be guaranteed.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US"> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span><span style='color:black'><img border=
+"0" width="732" height="186" src="visio/blue-white-gloss.jpg"
+alt=""></span></p>
+<p class="MsoCaption"><a name="_Ref136666137"></a><a name=
+"_Toc176747803"></a><a name="_Ref136407489"></a><span lang=
+"EN-US">Figure: Example screenshot of the different interaction
+states for the predefined style
+“blue-white-gloss”</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>In
+general it is highly recommended to use a rendering style instead
+of a simple background color, because of the following
+advantages:</span></p>
+<ul style='margin-top:0cm' type="disc">
+<li class="MsoNormal"><span lang="EN-US">It is ensured that the
+colors are allowed by the UX group</span></li>
+<li class="MsoNormal"><span lang="EN-US">Slight adjustments of
+the color schema can be done centrally in Graphiti without a
+changing a persisted tool-specific model, because the
+tool-specific model only contains the
+predefined-style-id.</span></li>
+</ul>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US">To use a <span style=
+'color:black'><a href=
+"../../../javadoc/com/sap/mi/gfw/mm/pictograms/RenderingStyle.html">
+RenderingStyle</a></span> we have to change the <span style=
+'color:black'>implementation of class StyleUtil, which we created
+in the chapter “<a href="styles.htm">Using
+styles</a>”.</span></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'>Instead of setting a background color we will now
+set a predefined-style-id.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>You
+can see the complete implementation of the style utility class
+here:</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<table class="MsoNormalTable" border="0" cellspacing="0"
+cellpadding="0" width="851" style=
+'width:18.0cm;border-collapse:collapse'>
+<tr>
+<td width="851" valign="top" style=
+'width:18.0cm;border:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
+<p class="MsoNormal" style='text-autospace:none'><b><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+<p class="MsoNormal" style='text-autospace:none'><b><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><span style=
+'color:black'>org.eclipse.graphiti.examples.tutorial;</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><b><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>class</span></b> <span style=
+'color:black'>StyleUtil {</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>private</span></b> <b><span style=
+'color:#7F0055'>static</span></b> <b><span style=
+'color:#7F0055'>final</span></b> <span style=
+'color:black'>IColorConstant</span> <i><span style=
+'color:#0000C0'>E_CLASS_TEXT_FOREGROUND</span></i> <span style=
+'color:black'>=</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>new</span></b> <span style=
+'color:black'>ColorConstant(51, 51, 153);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>private</span></b> <b><span style=
+'color:#7F0055'>static</span></b> <b><span style=
+'color:#7F0055'>final</span></b> <span style=
+'color:black'>IColorConstant</span> <i><span style=
+'color:#0000C0'>E_CLASS_FOREGROUND</span></i> <span style=
+'color:black'>=</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>new</span></b> <span style=
+'color:black'>ColorConstant(255, 102, 0);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>public</span></b> <b><span style=
+'color:#7F0055'>static</span></b> <span style='color:black'>Style
+getStyleForEClass(Diagram diagram) {</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>final</span></b> <span style='color:black'>String
+styleId =</span> <span style=
+'color:#2A00FF'>"E-CLASS"</span><span style=
+'color:black'>;</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+Style style = findStyle(diagram, styleId);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>if</span></b> <span style='color:black'>(style
+==</span> <b><span style=
+'color:#7F0055'>null</span></b><span style='color:black'>)
+{</span> <span style='color:#3F7F5F'>// style not found - create
+new style</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>IGaService gaService
+= Graphiti.getGaService();</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+style =</span> <span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>gaService<span style='color:black'>.createStyle(diagram,
+styleId);</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+style.setForeground(</span><span lang="EN-US" style=
+'font-size:10.0pt; font-family:"Courier New"'>gaService<span style='color:black'>.<i>manageColor</i>(diagram,<br>
+
+
+ </span> <i><span style=
+'color:#0000C0'>E_CLASS_FOREGROUND</span></i><span style=
+'color:black'>));</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>gaService<span style='color:black'>.setRenderingStyle(style,</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+ IPredefinedRenderingStyle.</span><i><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:#0000C0'>BLUE_WHITE_GLOSS_ID</span></i><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+style.setLineWidth(2);</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+}</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><b><span style=
+'color:#7F0055'>return</span></b> <span style=
+'color:black'>style;</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'>
+}</span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'><span style=
+'color:#3F7F5F'>// ... EXiSTING CODING ...</span></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-size:10.0pt; font-family:"Courier New";color:black'>}</span></p>
+<p class="MsoNormal" style='text-align:justify'><span lang=
+"EN-GB" style='font-size:10.0pt;color:black'> </span></p>
+</td>
+</tr>
+</table>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style='color:black'>Keep
+in mind that from now on the background color attribute will not
+work any more. So you might consider to delete the custom feature
+changing the background color, which was created in the chapter
+about <a href="styles.htm">styles</a>.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><span lang="EN-US">Test: EClass Has Complex Background Color
+Schema</span></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'>Create a new diagram and inside it create a new
+EClass. Verify that the background color is a blue-white
+gradient. Also verify, that the background color changes, if you
+select the EClass shape.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/connection-visualization.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/connection-visualization.htm
new file mode 100644
index 0000000..fb43afb
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/connection-visualization.htm
@@ -0,0 +1,469 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Connection visualization</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Cambria;
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"\00DCberschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"\00DCberschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"\00DCberschrift 1 Zchn";
+ mso-style-link:"\00DCberschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"\00DCberschrift 2 Zchn";
+ mso-style-link:"\00DCberschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.msochpdefault, li.msochpdefault, div.msochpdefault
+ {mso-style-name:msochpdefault;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-link:"Heading 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+p.Heading1, li.Heading1, div.Heading1
+ {mso-style-name:"Heading 1";
+ mso-style-link:"Heading 1 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-link:"Heading 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+p.Heading2, li.Heading2, div.Heading2
+ {mso-style-name:"Heading 2";
+ mso-style-link:"Heading 2 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-link:"Balloon Text";
+ font-family:"Tahoma","sans-serif";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ mso-style-link:"Balloon Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.rschrift1, li.rschrift1, div.rschrift1
+ {mso-style-name:"\00BErschrift 1";
+ mso-style-link:"\00BErschrift 1 Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.rschrift1Zchn
+ {mso-style-name:"\00BErschrift 1 Zchn";
+ mso-style-link:"\00BErschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+p.rschrift2, li.rschrift2, div.rschrift2
+ {mso-style-name:"\00BErschrift 2";
+ mso-style-link:"\00BErschrift 2 Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.rschrift2Zchn
+ {mso-style-name:"\00BErschrift 2 Zchn";
+ mso-style-link:"\00BErschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.code0
+ {mso-style-name:code0;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.3pt 841.9pt;
+ margin:70.85pt 70.85pt 2.0cm 70.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<div>
+
+<h1><span lang=EN-GB>Connection Visualization</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This chapter describes
+advanced connection visualization possibilities.</span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<h2><span lang=EN-US>Connection Decorators</span></h2>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The framework supports
+two different connection decorators:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Static decorators
+(inactive pictogram elements) are usually used for connection ends.</span></p>
+
+<p class=MsoNormal><span style='color:black'><img width=501 height=202
+src="visio/connection-decorator-static.png"></span></p>
+
+<p class=MsoCaption><span lang=EN-GB>Figure: Static connection decorators</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Dynamic decorators
+(active pictogram elements) are usually of type text; these decorators can be
+moved via drag & drop; they can be placed anywhere in the diagram.</span></p>
+
+<p class=MsoNormal><span style='color:black'><img width=501 height=211
+src="visio/connection-decorator-dynamic.png"></span></p>
+
+<p class=MsoCaption><span lang=EN-GB>Figure: Dynamic connection decorators</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>To create such
+connection decorators we have to do the following in the graphics model:</span></p>
+
+<ul style='margin-top:0cm' type=disc>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'>create
+ a connection decorator</li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>add a valid graphics algorithm to the connection decorator</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>add this connection decorator to a connection</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>optional: link connection decorator with the business object</span></li>
+</ul>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>There are some
+technical limitations for static decorators: they are only supported for
+graphics algorithm of type polyline or polygon (otherwise they can not be
+rotated) and they can only be placed at the beginning or at the end of a
+connection.</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+create two static connection decorators as shown above and one dynamic
+connection decorator which displays the name of the association.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>For simplification
+those static connection decorators will be created without consideration of the
+real values in the business model (types of association ends).</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The decorators will be
+added in the</span><span lang=EN-GB> </span><span class=code0><span lang=EN-US
+style='color:black'><a href="add-connection-feature.htm"><span
+style='font-style:normal'>add connection feature</span></a></span></span><span
+lang=EN-GB style='color:black'>. The following changes must be done in this
+feature.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>First add some helper
+methods to the add connection feature which create the graphics algorithms for
+the static decorators:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>private</span></b><span lang=EN-US> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>Polyline
+ createArrow(GraphicsAlgorithmContainer gaContainer) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>
+ IGaService gaService = Graphiti.getGaService();<span style='color:black'><br>
+ Polyline polyline =</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>gaService<span
+ style='color:black'>.createPolyline(gaContainer,</span> <b><span
+ style='color:#7F0055'>new</span></b> <b><span style='color:#7F0055'>int</span></b><span
+ style='color:black'>[] { -15, 10, 0, 0, -15,</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ -10 });</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ polyline.setForeground(manageColor(IColorConstant.</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>BLACK</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ polyline.setLineWidth(2);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>return</span></b><span lang=EN-US> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>polyline;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Then create the
+connection decorators at the end of the add method of the add connection
+feature, as explained in the following code snippet:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>public</span></b><span lang=EN-US> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>PictogramElement
+ add(IAddContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ... EXISTING CODING ...</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// add dynamic text decorator for the association name</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>IPeCreateService
+ peCreateService = Graphiti.getPeCreateService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ConnectionDecorator textDecorator =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>peCreateService<span
+ style='color:black'>.createConnectionDecorator(connection,</span> <b><span
+ style='color:#7F0055'>true</span></b><span style='color:black'>,<br>
+ 0.5,</span>
+ <b><span style='color:#7F0055'>true</span></b><span style='color:black'>);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>
+ IGaService gaService = Graphiti.getGaService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Text text =</span><span lang=EN-US> </span><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New"'>gaService<span style='color:black'>.createDefaultText(textDecorator);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setForeground(manageColor(IColorConstant.</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>BLACK</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>gaService<span
+ style='color:black'>.setLocationOfGraphicsAlgorithm(text, 10, 0);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// set reference name in the text decorator</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>´
+ EReference eReference = (EReference) context.getNewObject();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=FR
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=FR> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:black'>text.setValue(</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New"'>eReference<span style='color:black'>.getName());</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// add static graphical decorator (composition and navigable)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ConnectionDecorator cd;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ cd =</span><span lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New"'>peCreateService<span style='color:black'><br>
+
+ .<i>createConnectionDecorator</i>(connection,</span> <b><span
+ style='color:#7F0055'>false</span></b><span style='color:black'>, 0.0,</span>
+ <b><span style='color:#7F0055'>true</span></b><span style='color:black'>);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ createArrow(cd);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US> </span><b><span style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b> <span style='font-size:10.0pt;font-family:
+ "Courier New";color:black'>connection;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Display and Move Connection Decorators</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Start the editor again
+and test these new connection decorators:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>create or open a diagram</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>create a new EReference between two EClasses; you can see the
+ three decorators on the EReference</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>move the EClasses; you can see that the static decorator
+ (arrow) rotate automatically</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>move the dynamic decorator (text) via drag & drop</span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+</div>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/context-buttons.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/context-buttons.htm
new file mode 100644
index 0000000..1ce0701
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/context-buttons.htm
@@ -0,0 +1,694 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Providing context buttons</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Cambria;
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"Heading 2 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"Heading 3 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"Heading 4 Char";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"Heading 5 Char";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h6
+ {mso-style-link:"Heading 6 Char";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Preformatted Char";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Balloon Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-link:"Heading 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-link:"Heading 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.Heading3Char
+ {mso-style-name:"Heading 3 Char";
+ mso-style-link:"Heading 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.Heading4Char
+ {mso-style-name:"Heading 4 Char";
+ mso-style-link:"Heading 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.Heading5Char
+ {mso-style-name:"Heading 5 Char";
+ mso-style-link:"Heading 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.Heading6Char
+ {mso-style-name:"Heading 6 Char";
+ mso-style-link:"Heading 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+span.HTMLPreformattedChar
+ {mso-style-name:"HTML Preformatted Char";
+ mso-style-link:"HTML Preformatted";
+ font-family:Consolas;}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-link:"Balloon Text";
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+p.msochpdefault, li.msochpdefault, div.msochpdefault
+ {mso-style-name:msochpdefault;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+p.comment, li.comment, div.comment
+ {mso-style-name:comment;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+span.heading1char0
+ {mso-style-name:heading1char;
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.heading2char0
+ {mso-style-name:heading2char;
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.heading3char0
+ {mso-style-name:heading3char;
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.heading4char0
+ {mso-style-name:heading4char;
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.heading5char0
+ {mso-style-name:heading5char;
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.heading6char0
+ {mso-style-name:heading6char;
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+span.htmlpreformattedchar0
+ {mso-style-name:htmlpreformattedchar;
+ font-family:Consolas;}
+span.balloontextchar0
+ {mso-style-name:balloontextchar;
+ font-family:"Tahoma","sans-serif";}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+span.code0
+ {mso-style-name:code0;
+ font-style:italic;}
+span.code2
+ {mso-style-name:code2;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099521"><span lang=EN-GB>Providing </span></a>
+<span lang="en-gb">C</span><span
+lang=EN-GB>ontext Buttons</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Context buttons allow
+adding actions as small, automatically appearing icons for each pictogram
+element in the diagram.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>They are shown along
+the borders of a pictogram element when the mouse is positioned on that
+pictogram element. They are hidden again when the mouse it positioned outside
+the area build by the pictogram element and the context buttons.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Context buttons can
+provide the same functionality as a <a href="context-menu.htm">context menu</a>,
+but in a nicer and quicker way: the context buttons are shown immediately.
+Another advantage of context buttons over context menus is, that each context
+button can have several drag and drop features, which get activated when the
+user drags from a context button and drops onto the canvas or another object.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Enhancing the Tool Behavior Provider</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Context buttons are
+defined in the tool behavior provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>If you didnt do so
+already you must <b>first create a tool behavior provider and add it to the
+diagram type provider as described <a href="tool-behavior-provider.htm">here</a>.</b></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>There is one method of
+the tool behavior provider to overwrite: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/IToolBehaviorProvider.html#getContextButtonPadData(com.sap.tc.emf.gfw.features.context.IPictogramElementContext)">getContextButtonPadData</a>
+has to return the context buttons for the given context (which implement <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/IContextButtonEntry.html">IContextButtonEntry</a>).
+</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>There are different groups
+of context buttons:</span></p>
+
+<ul style='margin-top:0cm' type=disc>
+ <li class=MsoNormal style='color:black'><span lang=EN-GB>Generic context
+ buttons: their look and behaviour is standardized for all tools (e.g.
+ delete, remove and update). They are shown at the top of the
+ pictogram element in a predefined order. A specific tool can only choose
+ which of the generic context buttons to switch on/off.</span></li>
+ <li class=MsoNormal style='color:black'><span lang=EN-GB>Domain specific
+ context buttons: they are specific for each tool (e.g. create sub-class
+ in a class editor). They are shown at the right (and if necessary also
+ bottom) of the pictogram element. A specific tool must define the look and
+ behaviour for all domain specific context buttons. </span></li>
+ <li class=MsoNormal style='color:black'><span lang=EN-GB>Collapse context
+ button: the look and position for the collapse context button is
+ standardized for all tools. A specific tool must define the behavior of
+ the collapse context button by defining the feature to call (see <a
+ href="../../../javadoc/com/sap/tc/emf/gfw/tb/ContextEntryHelper.html#createCollapseContextButton(boolean, com.sap.tc.emf.gfw.features.IFeature, com.sap.tc.emf.gfw.features.context.IContext">createCollapseContextButton</a>).</span></li>
+</ul>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The following
+restrictions are defined by UX (but currently not checked technically): there
+can be 0-3 generic context buttons, 0-5 domain specific context buttons and 0-1
+collapse context button.</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The functionality of
+context buttons is always provided by features. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Each context button can
+have one click-feature, which is executed when clicking the context-button,
+and/or several drag&drop features, which are executed when the user starts
+dragging a connection from the context button. If several drag&drop
+features are available, a context-menu will be offered to the user when he
+drops the connection, and he can choose the feature to execute.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+create one context button, which offers all available <a
+href="create-connection-feature.htm">create connection features</a> as
+drag&drop features, but has no click-feature. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span style='color:black'><img border=0 width=353
+height=120 src="visio/context-buttons-click.gif"></span><span lang=EN-GB
+style='color:black'> </span></p>
+
+<p class=MsoCaption><span lang=EN-GB>Figure: A context button, which the user
+can click or start drag&drop from it</span></p>
+
+<p class=MsoNormal><span style='color:black'><img border=0 width=353
+height=102 src="visio/context-buttons-drag.gif"></span></p>
+
+<p class=MsoCaption><span lang=EN-GB>Figure: The user started dragging from the
+context button</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the context button here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> IContextButtonPadData getContextButtonPadData(</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IPictogramElementContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IContextButtonPadData data = </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>.getContextButtonPadData(context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ PictogramElement pe = context.getPictogramElement();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// 1. set the generic context buttons</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// note, that we do not add 'remove' (just as an example)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ setGenericContextButtons(data, pe, </span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>CONTEXT_BUTTON_DELETE</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> | </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><i><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#0000C0'>CONTEXT_BUTTON_UPDATE</span></i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// 2. set the collapse button </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// simply use the first custom feature (senseless example)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ CustomContext cc = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ CustomContext(</span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>new</span></b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'> PictogramElement[] { pe });</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature[] cf = getFeatureProvider().getCustomFeatures(cc);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (cf.</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ >= 1) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IContextButtonEntry collapseButton = ContextEntryHelper</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ .<i>createCollapseContextButton</i>(</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>,
+ cf[0], cc);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ data.setCollapseContextButton(collapseButton);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// 3. add one domain specific context-button, which offers all
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// available connection-features as drag&drop features...</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// 3.a. create new CreateConnectionContext</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ CreateConnectionContext ccc = </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ CreateConnectionContext();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ccc.setSourcePictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Anchor anchor = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (pe </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Anchor) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ anchor = (Anchor) pe;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ } </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>else</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pe </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> AnchorContainer) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// assume, that our shapes always have <u>chopbox</u> anchors</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=FR style='font-size:10.0pt;font-family:"Courier New";
+ color:black'>anchor = Graphiti.getPeService()<br>
+ .<i>getChopboxAnchor</i>((AnchorContainer) pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=FR
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ccc.setSourceAnchor(anchor);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// 3.b. create context button and add all applicable features</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ContextButtonEntry button = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ContextButtonEntry(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>, context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ button.setText(</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#2A00FF'>"Create connection"</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ button.setIconId(TutorialImageProvider.</span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>IMG_EREFERENCE</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICreateConnectionFeature[] features =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ getFeatureProvider().getCreateConnectionFeatures();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>for</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (ICreateConnectionFeature feature :
+ features) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (feature.isAvailable(ccc) &&
+ feature.canStartConnection(ccc))</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ button.addDragAndDropFeature(feature);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// 3.c. add context button, if it contains at least one feature</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ (button.getDragAndDropFeatures().size() > 0) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ data.getDomainSpecificContextButtons().add(button);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> data;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-US>The context button entries contain
+information about icon, display text and tooltip description.</span></p>
+
+<p class=MsoNormal><span lang=EN-US>The positioning of the context buttons can
+be influenced by changing the rectangle around which the context buttons are
+placed (see <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/IContextButtonPadData.html#getPadLocation()">getPadLocation</a>).
+By default the selection area is used (see <a href="selection-behavior.htm">selection
+behavior</a>) if defined, or otherwise the bounds of the pictogram elements
+main graphics algorithm are used.</span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Create a Connection by Drag&Drop from a Context
+Button</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Note that previously we
+implemented one <a href="create-connection-feature.htm">create connection
+feature</a> which allows creating an association between two EClasses.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+and test this new context button:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Create
+ or open a diagram and create two EClasses in the diagram.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Position
+ the mouse on top of the first EClass and the context button should appear
+ in the south-east of the shape.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Start
+ dragging with the mouse from the context-button.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Drop
+ the connection onto the second EClass, which will result in one of the
+ following possibilities:</span></li>
+</ol>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>If
+ only one create connection feature for the EClass exists, then the
+ association will be created immediately.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>If
+ several create connection features for the EClass exist, then a context-menu
+ will be shown to the user, where he can choose the feature to execute.
+ Tip: if you have only one create connection feature you can try this
+ behaviour by simply duplicating the line </span><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New"'>button.addDragAndDropFeature(feature);</span><span
+ lang=EN-GB>.</span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Note, that our implementation
+of the create connection feature does not allow a connection, if the source and
+target business object are identical. If you have two different shapes
+associated with the same business object (e.g. via copy & paste), then
+creating a connection between them is not possible.</span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/context-menu.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/context-menu.htm
new file mode 100644
index 0000000..57aef65
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/context-menu.htm
@@ -0,0 +1,372 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Providing a context menu</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:windowtext;}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-style:italic;}
+span.heading2char
+ {font-family:Arial;
+ color:black;
+ font-weight:bold;
+ font-style:italic;}
+span.code1
+ {font-style:italic;}
+span.code0
+ {font-style:italic;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099520"><span lang=EN-GB>Providing </span></a><span
+lang=EN-GB>a Context Menu</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Enhancing the Tool Behavior Provider</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Context menus are
+defined in the tool behavior provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>If you didnt do so
+already you must <b>first create a tool behavior provider and add it to the
+diagram type provider as described <a href="tool-behavior-provider.htm">here</a>.</b></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>There is one method of
+the tool behavior provider to overwrite: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/IToolBehaviorProvider.html#getContextMenu(com.sap.tc.emf.gfw.features.context.IContext)">getContextMenu</a>
+has to return the context menu entries for the given context (which implement <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/IContextMenuEntry.html">IContextMenuEntry</a>)</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The functionality of
+the context menu entries is always provided by features. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>It is possible to
+create a context menu entry with children, which build a group of other
+context menu entries. Such a group can be shown in the context menu either as a
+sub-menu or as a flat list separated by separator-lines. This behaviour can be
+switched with a simple flag. You can also use the <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/DynamicContextMenuEntry.html">DynamicContextMenuEntry</a>,
+which will automatically create a sub-menu, if there are more than a predefined
+number of children, and a flat list otherwise.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+create one context menu entry, which offers all available <a
+href="custom-feature.htm">custom features</a> as menu entries in a new
+sub-menu. </span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the context menu here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> IContextMenuEntry[]
+ getContextMenu(IContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create a sub-menu for all custom features</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ContextMenuEntry subMenu = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ContextMenuEntry(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>, context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ subMenu.setText(</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#2A00FF'>"Custom"</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ subMenu.setDescription(</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#2A00FF'>"Custom features submenu"</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// display sub-menu hierarchical or flat</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ subMenu.setSubmenu(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>true</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create a menu-entry in the sub-menu for each custom feature</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>if</span></b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'> (context </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomContext) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomContext customContext = (ICustomContext) context;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature[] customFeatures =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ getFeatureProvider().getCustomFeatures(customContext);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>for</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (</span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>int</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> i
+ = 0; i < customFeatures.</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#0000C0'>length</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>; i++) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature customFeature = customFeatures[i];</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ (customFeature.isAvailable(customContext)) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ContextMenuEntry menuEntry =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ContextMenuEntry(customFeature,
+ context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ subMenu.add(menuEntry);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IContextMenuEntry ret[] = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IContextMenuEntry[] { subMenu };</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> ret;</span></p>
+ <p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
+ color:black'> }</span></p>
+ <p class=MsoNormal><span style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Note, that our
+implementation overwrites the standard behavior in the DefaultToolBehaviorProvider,
+which used <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/DefaultToolBehaviorProvider.html#isContextMenuApplicable(com.sap.tc.emf.gfw.features.IFeature)">isContextMenuApplicable</a>
+to decide which features to add to the context menu. We based on this standard
+behavior when the <a href="custom-feature.htm">custom feature</a> was initially
+implemented and added to the context menu.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In our overwriting
+implementation we no longer use <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/DefaultToolBehaviorProvider.html#isContextMenuApplicable(com.sap.tc.emf.gfw.features.IFeature)">isContextMenuApplicable</a>,
+so that this method can be deleted now.</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<h2><span lang=EN-GB>Test: Create a Connection by Drag&Drop from a Context
+Button</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Note that previously we
+implemented one <a href="custom-feature.htm">Rename EClass feature</a>
+which allows renaming a EClass in a popup dialog.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+and test this new context menu:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Create
+ or open a diagram and create a EClass in the diagram.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Open
+ the context-menu on the diagram, and verify that the Rename EClass
+ feature is available but disabled in the custom sub-menu.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Open
+ the context-menu on the EClass, and verify that the Rename EClass
+ feature is available and enabled in the custom sub-menu.</span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'>Next you may change the
+hierarchical sub-menu to a flat sub-menu (change the coding to </span><span
+lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>subMenu.setSubmenu(</span><b><span
+lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>))</span><span
+lang=EN-US style='color:black'>. Start the editor and repeat the test to view
+the difference in the context-menu. </span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/copy-and-paste-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/copy-and-paste-feature.htm
new file mode 100644
index 0000000..a1f5d68
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/copy-and-paste-feature.htm
@@ -0,0 +1,741 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Providing copy & paste functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:windowtext;}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:blue;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-style:italic;}
+span.code1
+ {font-style:italic;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=blue style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><span lang=EN-GB>Providing Copy & Paste Functionality</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-US>Copy & Paste Functionality</span></h2>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-US>The copy & paste of graphical elements
+is integrated with the general copy and paste concept for models</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-US>Note, that copy & paste in graphical
+editors is always executed on the graphical model-elements. This gives the
+freedom to implement copy & paste with different semantics</span></p>
+
+<ul style='margin-top:0cm' type=disc>
+ <li class=MsoNormal><span lang=EN-US>On paste a duplicate of the graphical
+ pictogram element and of the underlying business-model element is created.
+ However, it is sometimes difficult to create a duplicate of the
+ business-model element, because the semantic boundaries of it may be
+ ambiguous, think of a
+ deep copy.</span></li>
+ <li class=MsoNormal><span lang=EN-US>On paste a duplicate of the graphical
+ pictogram element is created, which is associated to the same underlying
+ business-model element as the originally copied graphical pictogram
+ element.</span></li>
+</ul>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-US>Below we will explain an example, which
+provides copy & paste functionality for EClasses. For simplicity reasons
+we only create a duplicate of the graphical pictogram element and not also of
+the business-model element.</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<h2><span lang=EN-GB>Creating a Copy Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>First we have to create
+a copy feature and make it available in the feature provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A copy feature has to
+implement the interface <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/ICopyFeature.html">ICopyFeature</a>.
+Instead of implementing it directly it should extend one of the available base
+classes. In this example we extend the base class <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/jam/AbstractCopyFeature.html">AbstractCopyFeature</a>,
+which offers methods to easily access the clipboard. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite two methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/ICopyFeature.html#canCopy(com.sap.tc.emf.gfw.features.context.ICopyContext)">canCopy</a>
+has to check if the given context (containing the selected elements) can be
+copied to the clipboard.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/ICopyFeature.html#copy(com.sap.tc.emf.gfw.features.context.ICopyContext)">copy</a>
+finally has to copy the given context to the clipboard. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the copy feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialCopyEClassFeature </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>extends</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AbstractCopyFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialCopyEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canCopy(ICopyContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pes == </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>null</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> || pes.</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> ==
+ 0) { </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// nothing selected</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ return true, if all selected elements are a EClasses</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>for</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> (PictogramElement
+ pe : pes) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Object bo = getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (!(bo </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass)) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>void</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> copy(ICopyContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ get the business-objects for all pictogram-elements</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ we already verified, that all business-objets are EClasses</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Object[] bos = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>new</span></b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'> Object[pes.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>];</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>for</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> (</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>int</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> i
+ = 0; i < pes.</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#0000C0'>length</span><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'>; i++) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement
+ pe = pes[i];</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ bos[i] = getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ put all business objects to the clipboard</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>putToClipboard(bos);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the
+feature provider has to deliver our newly created feature (overwrite the method
+<a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getCopyFeature(com.sap.tc.emf.gfw.features.context.ICopyContext)">getCopyFeature</a>).
+</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICopyFeature getCopyFeature(ICopyContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>TutorialCopyEClassFeature</span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>(</span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Creating a Paste Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'>Now</span><span
+lang=EN-GB style='color:black'> we have to create a corresponding paste feature
+and make it available in the feature provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A paste feature has to implement
+the interface <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IPasteFeature.html">IPasteFeature</a>.
+Instead of implementing it directly it should extend one of the available base
+classes. In this example we extend the base class <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/jam/AbstractPasteFeature.html">AbstractPasteFeature</a>,
+which offers methods to easily access the clipboard. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite two methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IPasteFeature.html#canPaste(com.sap.tc.emf.gfw.features.context.IPasteContext)">canPaste</a>
+has to check if the current clipboard contents can be pasted on the given
+context (containing the target object).</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IPasteFeature.html#paste(com.sap.tc.emf.gfw.features.context.IPasteContext)">paste</a>
+finally has to paste the current clipboard contents on the given context.
+ </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the paste feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ com.sap.tc.emf.gfw.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialPasteEClassFeature </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>extends</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AbstractPasteFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialPasteEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canPaste(IPasteContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ only support pasting directly in the diagram (nothing else selected)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pes.</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#0000C0'>length</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> != 1 || !(pes[0] </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Diagram)) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ can paste, if all objects on the clipboard are EClasses</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object[]
+ fromClipboard = getFromClipboard();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (fromClipboard == </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> || fromClipboard.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> ==
+ 0) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>for</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (Object object : fromClipboard) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (!(object </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>instanceof</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> EClass)) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>void</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ paste(IPasteContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ we already verified, that we paste directly in the diagram</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Diagram diagram = (Diagram) pes[0];</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ get the EClasses from the clipboard without copying them</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ (only copy the pictogram element, not the business object)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ then create new pictogram elements using the add feature</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object[]
+ objects = getFromClipboard();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>for</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (Object object : objects) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> AddContext
+ ac = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> AddContext();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ac.setLocation(0, 0); </span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#3F7F5F'>// for simplicity paste at (0, 0)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> ac.setTargetContainer(diagram);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ addGraphicalRepresentation(ac, object);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the
+feature provider has to deliver our newly created feature (overwrite the method
+<a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getPasteFeature(com.sap.tc.emf.gfw.features.context.IPasteContext)">getPasteFeature</a>).
+</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IPasteFeature getPasteFeature(IPasteContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialPasteEClassFeature(</span><b><span style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>this</span></b><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Copy & Paste a EClass</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+again </span></p>
+
+<ul style='margin-top:0cm' type=disc>
+ <li class=MsoNormal style='color:black'><span lang=EN-US>Create a new EClass.</span></li>
+ <li class=MsoNormal style='color:black'><span lang=EN-GB>Copy the EClass to
+ the clipboard using the context-menu.</span></li>
+ <li class=MsoNormal style='color:black'><span lang=EN-US>Paste the clipboard
+ to the diagram using the context-menu, so that a new EClass is created
+ in the upper-left corner of the diagram (in future versions of the
+ graphics framework it will be possible to paste at the current
+ mouse-location).</span></li>
+ <li class=MsoNormal style='color:black'><span lang=EN-US>Verify that in the
+ context-menu of a EClass the paste action is disabled.</span></li>
+ <li class=MsoNormal style='color:black'><span lang=EN-US>Rename the new EClass, and verify that the other
+ EClass is also renamed. This happens,
+ because the implementation only duplicates the graphical pictogram element
+ and not the underlying business-model element. <br>
+ Note: it might be necessary to explicitly call the update-action on the
+ other EClass. This is currently in discussion in Graphitti. </span></li>
+</ul>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/create-connection-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/create-connection-feature.htm
new file mode 100644
index 0000000..eace243
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/create-connection-feature.htm
@@ -0,0 +1,926 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Providing create connection functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Cambria;
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"Überschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"Überschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"Überschrift 3 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"Überschrift 4 Zchn";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"Überschrift 5 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h6
+ {mso-style-link:"Überschrift 6 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Vorformatiert Zchn";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"Überschrift 1 Zchn";
+ mso-style-link:"Überschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"Überschrift 2 Zchn";
+ mso-style-link:"Überschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift3Zchn
+ {mso-style-name:"Überschrift 3 Zchn";
+ mso-style-link:"Überschrift 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift4Zchn
+ {mso-style-name:"Überschrift 4 Zchn";
+ mso-style-link:"Überschrift 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.berschrift5Zchn
+ {mso-style-name:"Überschrift 5 Zchn";
+ mso-style-link:"Überschrift 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.berschrift6Zchn
+ {mso-style-name:"Überschrift 6 Zchn";
+ mso-style-link:"Überschrift 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+span.HTMLVorformatiertZchn
+ {mso-style-name:"HTML Vorformatiert Zchn";
+ mso-style-link:"HTML Vorformatiert";
+ font-family:Consolas;}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+p.msochpdefault, li.msochpdefault, div.msochpdefault
+ {mso-style-name:msochpdefault;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-link:"Heading 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+p.Heading1, li.Heading1, div.Heading1
+ {mso-style-name:"Heading 1";
+ mso-style-link:"Heading 1 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-link:"Heading 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+p.Heading2, li.Heading2, div.Heading2
+ {mso-style-name:"Heading 2";
+ mso-style-link:"Heading 2 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading3Char
+ {mso-style-name:"Heading 3 Char";
+ mso-style-link:"Heading 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+p.Heading3, li.Heading3, div.Heading3
+ {mso-style-name:"Heading 3";
+ mso-style-link:"Heading 3 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading4Char
+ {mso-style-name:"Heading 4 Char";
+ mso-style-link:"Heading 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+p.Heading4, li.Heading4, div.Heading4
+ {mso-style-name:"Heading 4";
+ mso-style-link:"Heading 4 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading5Char
+ {mso-style-name:"Heading 5 Char";
+ mso-style-link:"Heading 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+p.Heading5, li.Heading5, div.Heading5
+ {mso-style-name:"Heading 5";
+ mso-style-link:"Heading 5 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading6Char
+ {mso-style-name:"Heading 6 Char";
+ mso-style-link:"Heading 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+p.Heading6, li.Heading6, div.Heading6
+ {mso-style-name:"Heading 6";
+ mso-style-link:"Heading 6 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.HTMLPreformattedChar
+ {mso-style-name:"HTML Preformatted Char";
+ mso-style-link:"HTML Preformatted";
+ font-family:Consolas;}
+p.HTMLPreformatted, li.HTMLPreformatted, div.HTMLPreformatted
+ {mso-style-name:"HTML Preformatted";
+ mso-style-link:"HTML Preformatted Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-link:"Balloon Text";
+ font-family:"Tahoma","sans-serif";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ mso-style-link:"Balloon Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+span.code0
+ {mso-style-name:code0;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><span lang=EN-GB>Providing Create Connection Functionality</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Creating a Create Connection Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Usually a new
+connection object is created graphically by using the corresponding connection
+tool from the editors tool palette. When using Graphiti you only have to
+provide a so called create connection feature. The integration into the
+platforms UI is done by the framework.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A create connection
+feature has to implement the interface <i><a
+href="file:///\\wdfd00184898a\..\javadoc\com\sap\tc\emf\gfw\features\ICreateConnectionFeature.html">ICreateConnectionFeature</a></i></span><span
+class=code1><span lang=EN-US style='color:black'>.</span></span><span
+lang=EN-US style='color:black'> </span><span lang=EN-GB style='color:black'>Instead
+of implementing it directly it should extend one of the available base classes.
+In this example we extend the base class<span class=code1> </span></span><i><span
+style='color:black'><a
+href="file:///\\wdfd00184898a\..\javadoc\com\sap\tc\emf\gfw\features\jam\AbstractCreateConnectionFeature.html"><span
+lang=EN-GB>AbstractCreateConnectionFeature</span></a></span></i><span
+lang=EN-GB style='color:black'>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>We have to
+implement/overwrite 3 methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="file:///\\wdfd00184898a\..\javadoc\com\sap\tc\emf\gfw\func\ICreateConnection.html#canCreate(com.sap.tc.emf.gfw.features.context.ICreateConnectionContext)">c<span
+lang=EN-US>anCreate</span></a> has to check whether the connection can be
+created for the given context. It has to check the business objects which are
+behind the source and the target anchors.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="file:///\\wdfd00184898a\..\javadoc\com\sap\tc\emf\gfw\func\ICreateConnection.html#canStartConnection(com.sap.tc.emf.gfw.features.context.ICreateConnectionContext)"><span
+style='font-style:normal'>canStartConnection</span></a></span></span><span
+lang=EN-GB style='color:black'> has to check whether the connection can be
+started at the given source anchor.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="file:///\\wdfd00184898a\..\javadoc\com\sap\tc\emf\gfw\func\ICreateConnection.html#create(com.sap.tc.emf.gfw.features.context.ICreateConnectionContext)"><span
+style='font-style:normal'>create</span></a></span></span><span lang=EN-GB
+style='color:black'> has to create the business object for the connection and
+also has to add the graphical representation of the newly created business
+object to the diagram. The creation of the business object must be implemented
+here. To add the graphical representation, an <a
+href="add-connection-feature.htm">add connection feature</a> should be used.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+create an EReference between EClasses via the connection tool from the palette.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span style='color:black'><img border=0 width=281
+height=170 src="visio/connection-routing-direct.gif"></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the create connection feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialCreateEReferenceFeature </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>extends<br>
+ </span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>AbstractCreateConnectionFeature
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> TutorialCreateEReferenceFeature
+ (IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// provide name and description for the UI, e.g. the palette</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>super</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>(fp, </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"EReference"</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Create
+ EReference"</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canCreate(ICreateConnectionContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#3F7F5F'>// return true if both anchors
+ belong to an EClass</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// and those EClasses are not identical</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass source = getEClass(context.getSourceAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass target = getEClass(context.getTargetAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (source != </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ && target != </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> &&
+ source != target) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canStartConnection(ICreateConnectionContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// return true if start anchor belongs to a EClass</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (getEClass(context.getSourceAnchor()) != </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> Connection
+ create(ICreateConnectionContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Connection newConnection = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// get EClasses which should be connected</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass source = getEClass(context.getSourceAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass target = getEClass(context.getTargetAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (source != </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ && target != </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create new business object </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>EReference eReference =
+ createEReference(source, target);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// add connection for business object</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AddConnectionContext addContext =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> AddConnectionContext(context.getSourceAnchor(),
+ context</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ .getTargetAnchor());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ addContext.setNewObject(</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New"'>eReference<span style='color:black'>);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ newConnection =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (Connection) getFeatureProvider().addIfPossible(addContext);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> newConnection;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F5FBF'>/**</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F5FBF'>*</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:black'> </span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#3F5FBF'>Returns</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>the</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>EClass</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>belonging</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>to</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>the</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>anchor,</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>or</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>null</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>if</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>not</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F5FBF'>available.</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F5FBF'>*/</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>private</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass getEClass(Anchor anchor) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (anchor != </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Object object =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ getBusinessObjectForPictogramElement(anchor.getParent());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (object </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (EClass) object;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F5FBF'>/**</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F5FBF'> *</span><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New"'> <span style='color:#3F5FBF'>Creates</span>
+ <span style='color:#3F5FBF'>a</span> <span style='color:#3F5FBF'>EReference</span>
+ <span style='color:#3F5FBF'>between</span> <span style='color:#3F5FBF'>two</span>
+ <span style='color:#3F5FBF'>EClasses.</span></span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F5FBF'> */</span></p>
+ <p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'> private</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> EReference
+ createEReference(EClass source, EClass target) {</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ EReference eReference = EcoreFactory.<i><span style='color:#0000C0'>eINSTANCE</span></i>.createEReference();</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ eReference.setName(<span style='color:#2A00FF'>"new EReference"</span>);</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ eReference.setEType(target);</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ eReference.setLowerBound(0);</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ eReference.setUpperBound(1);</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ source.getEStructuralFeatures().add(eReference);</span></p>
+ <p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'> </span></b><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New"'> eReference;</span></p>
+ <p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the
+feature provider has to deliver our newly created feature (overwrite the method
+</span><span class=code0><span lang=EN-US style='color:black;font-style:normal'><a
+href="file:///\\wdfd00184898a\..\javadoc\com\sap\tc\emf\gfw\features\IFeatureProvider.html#getCreateConnectionFeatures()">getCreateConnectionFeatures</a>)</span></span><span
+class=code1><span lang=EN-US style='color:black;font-style:normal'>.</span></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ICreateConnectionFeature[]
+ getCreateConnectionFeatures() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICreateConnectionFeature[] { </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>TutorialCreateEReferenceFeature
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>(</span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>) };</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Before we can run the
+editor we have to add <a href="anchors.htm">anchors</a> to the container shapes
+of the EClasses. Anchors are explained later in detail. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>For now simply create
+an anchor at end of the add method of the </span><span class=code1><span
+lang=EN-US style='color:black'>TutorialAddEClassFeature</span></span><span
+class=code1><span lang=EN-US style='color:black;font-style:normal'>, as shown
+in the following code snippet:</span></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> PictogramElement add(IAddContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ... EXiSTING CODING ...</span><span lang=EN-US> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// add a chopbox anchor to the shape</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'>
+ IPeCreateService peCreateService = Graphiti.getPeCreateService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>peCreateService<span
+ style='color:black'>.<i>createChopboxAnchor</i>(containerShape);</span></span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// call the layout feature</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ layoutPictogramElement(containerShape);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> containerShape;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span><span
+ lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'> </p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Create a Connection</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> Now start the
+editor and test the create connection feature:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>create or open a diagram </span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>create two new EClasses (existing EClasses dont work because
+ they have no anchor)</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>click on EReference which should be now available as
+ connection tool in the palette</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>move the mouse over the EClasses; you can see that it is
+ allowed to start the connection</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>click on one EClass</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>move mouse over the start EClass; you can see that it is not
+ allowed to end the connection on the same EClass</span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>move the mouse over the other EClass and click </span></li>
+ <li class=MsoNormal style='color:black;margin-top:6.0pt;text-align:justify'><span
+ lang=EN-GB>the new connection should be created</span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/create-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/create-feature.htm
new file mode 100644
index 0000000..58c0c42
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/create-feature.htm
@@ -0,0 +1,622 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Providing create functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"Heading 2 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"Heading 3 Char";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"Heading 4 Char";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"Heading 5 Char";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h6
+ {mso-style-link:"Heading 6 Char";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Preformatted Char";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Balloon Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-link:"Heading 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-link:"Heading 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.Heading3Char
+ {mso-style-name:"Heading 3 Char";
+ mso-style-link:"Heading 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.Heading4Char
+ {mso-style-name:"Heading 4 Char";
+ mso-style-link:"Heading 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.Heading5Char
+ {mso-style-name:"Heading 5 Char";
+ mso-style-link:"Heading 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.Heading6Char
+ {mso-style-name:"Heading 6 Char";
+ mso-style-link:"Heading 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+span.HTMLPreformattedChar
+ {mso-style-name:"HTML Preformatted Char";
+ mso-style-link:"HTML Preformatted";
+ font-family:Consolas;}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-link:"Balloon Text";
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+span.code1
+ {mso-style-name:code1;
+ font-style:italic;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099518"><span lang=EN-GB>Providing Create Functionality</span></a></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Creating a Create Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Usually a new business
+object is created graphically by using the corresponding creation tool from the
+editors tool palette. When using Graphiti you only have to provide
+a so called create feature. The integration into the platforms UI is done by
+the framework.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A create feature has to
+implement the interface </span><span class=code1><span lang=EN-US
+style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/ICreateFeature.html"><span
+style='font-style:normal'>ICreateFeature</span></a>.</span></span><span
+lang=EN-US style='color:black'> </span><span lang=EN-GB style='color:black'>Instead
+of implementing it directly it should extend one of the available base classes.
+In this example we extend the base class<span class=code1> </span></span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/impl/AbstractCreateFeature.html"><span
+style='font-style:normal'>AbstractCreateFeature</span></a></span></span><span
+lang=EN-GB style='color:black'>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite two methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/ICreate.html#canCreate(com.sap.tc.emf.gfw.features.context.ICreateContext)">c<span
+lang=EN-US>anCreate</span></a> has to check whether the business object can be
+created for the given context. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/ICreate.html#create(com.sap.tc.emf.gfw.features.context.ICreateContext)"><span
+style='font-style:normal'>create</span></a></span></span><span lang=EN-GB
+style='color:black'> has to create the business object and also has to add the
+graphical representation of the newly created business object to the diagram.
+The creation of the business object must be implemented here. For adding the
+graphical representation, the existing add feature should be used (see <a
+href="add-feature.htm">providing add functionality</a>). </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+create a EClass via the palette. The creation should be possible anywhere on
+the diagram. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the create feature here: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> TutorialCreateEClassFeature
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>extends</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> AbstractCreateFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>private</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String </span><i><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#0000C0'>TITLE</span></i><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> = </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Create
+ class"</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>private</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String </span><i><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#0000C0'>USER_QUESTION</span></i><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'> = </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Enter
+ new class name"</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>
+ TutorialCreateEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// set name and description of the creation feature</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>super</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>(fp, </span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"EClass"</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Create
+ EClass"</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canCreate(ICreateContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> context.getTargetContainer() </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Diagram;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> Object[] create(ICreateContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ask user for EClass name</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String newClassName = SampleUtil.askString(</span><i><span lang="EN-US" style="font-size:
+ 10.0pt;font-family:"Courier New";color:#0000C0">TITLE</span></i><font face="Courier New" size="2">,
+ </font><i>
+ <span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#0000C0">
+ USER_QUESTION, "");</span></i></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (newClassName == </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> ||
+ newClassName.trim().length() == 0) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><i><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>EMPTY</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class=MsoNormal style='text-autospace:none'> </p>
+ <p class=MsoNormal><font face="Courier New" size="2"><span lang=EN-US> </span></font><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:green'>// create EClass</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>
+ EClass newClass = EcoreFactory.<i><span style='color:#0000C0'>eINSTANCE</span></i>.createEClass();</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // Add model
+ element to resource.</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // We add the model
+ element to the resource of the diagram for</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // simplicity's
+ sake. Normally, a customer would use its own</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // model
+ persistence layer for storing the business model separately.</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>
+ <font size="2"> </font>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>getDiagram().eResource().getContents().add(newClass);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ newClass.setName(newClassName);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// do the add</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ addGraphicalRepresentation(context, newClass);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// return newly created business object(s)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object[] {
+ newClass };</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the
+feature provider has to deliver our newly created feature (overwrite the method
+</span><span class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getCreateFeatures()"><span
+style='font-style:normal'>getCreateFeatures</span></a>)</span></span><span
+lang=EN-GB style='color:black'>. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ICreateFeature[] getCreateFeatures()
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICreateFeature[] { </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialCreateEClassFeature(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>this</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>) };</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal> </p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Create a EClass</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+again. EClass should be available in the palette of the editor. It should be
+possible to create a EClass: Select the palette entry EClass and then take
+the mouse and create size and location of the new object in the diagram. Insert
+a name and press OK. The new EClass should be visible in the diagram.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Correct Size of Created EClass</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>As you can see the size
+of the created EClass is not correct. To correct this its necessary to update
+the implementation of the add feature. The add method of the add feature must
+use the given size and location. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The implementation of
+the changed add-method can be seen here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=851
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=851 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> PictogramElement add(IAddContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass addedClass = (EClass) context.getNewObject();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Diagram targetDiagram = (Diagram) context.getTargetContainer();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// CONTAINER SHAPE WITH ROUNDED RECTANGLE</span></p>
+ <p class=MsoNormal style='text-autospace:none'>
+ <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
+ IPeCreateService peCreateService = Graphiti.getPeCreateService();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ContainerShape containerShape =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span>
+ <span lang="EN-US" style="font-size: 10pt; color: black; font-family: Courier New">
+ peCreateService</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.createContainerShape(targetDiagram, </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// check whether the context has a size (e.g. from a create
+ feature)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// otherwise define a default size for the shape</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>int</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> width = context.getWidth() <= 0 ?
+ 100 : context.getWidth();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>int</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> height = context.getHeight() <= 0
+ ? 50 : context.getHeight();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ... EXISTING CODING COMES HERE ...</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> containerShape;</span></p>
+ <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:black'> </span><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal> </p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Start the editor again
+and see if it works correctly.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/custom-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/custom-feature.htm
new file mode 100644
index 0000000..035482d
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/custom-feature.htm
@@ -0,0 +1,608 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Providing custom functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:windowtext;}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-style:italic;}
+span.code1
+ {font-style:italic;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><span lang=EN-GB>Providing Custom Functionality</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>If the editor developer
+wants to add some editor specific functionality (e.g. context menu actions
+which can change the business and/or the pictogram model) the predefined
+features are not enough. In this case we need a more generally feature. For
+that purpose the framework provides a custom feature. Examples for a custom
+feature are rename, change color, check out,
</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Create a Custom Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A custom feature has to
+implement the interface </span><span class=code1><span lang=EN-US
+style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/ICustomFeature.html"><span
+style='font-style:normal'>ICustomFeature</span></a>.</span></span><span
+lang=EN-US style='color:black'> </span><span lang=EN-GB style='color:black'>Instead
+of implementing it directly it should extend one of the available base classes.
+In this example we extend the base class<span class=code1> </span></span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/AbstractCustomFeature.html"><span
+style='font-style:normal'>AbstractCustomFeature</span></a></span></span><span
+lang=EN-GB style='color:black'>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite 4 methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/ICustomFeature.html#canExecute(com.sap.tc.emf.gfw.features.context.ICustomContext)">c<span
+lang=EN-US>anExecute</span></a> has to check whether the custom feature can be
+executed on the current pictogram element of the given context.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/ICustomFeature.html#execute(com.sap.tc.emf.gfw.features.context.ICustomContext)"><span
+style='font-style:normal'>execute</span></a></span></span><span lang=EN-US
+style='color:black'> </span><span lang=EN-GB style='color:black'>has to perform
+the custom specific stuff.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>These two methods
+receive a custom context as parameter. Interface </span><span class=code1><span
+lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/context/ICustomContext.html"><span
+style='font-style:normal'>ICustomContext</span></a></span></span><span
+lang=EN-GB style='color:black'> provides the inner pictogram element and the
+inner graphics algorithm additionally to the (selected) pictogram element.
+These are the inner elements the mouse pointer is placed / clicked on.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Currently only custom
+features receive the information on the inner elements additionally to the
+selected/selectable ones. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The methods </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/ICustomFeature.html#getName()"><span
+style='font-style:normal'>getName</span></a> / <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/ICustomFeature.html#getDescription()"><span
+style='font-style:normal'>getDescription</span></a></span></span><span
+lang=EN-GB style='color:black'> have to return the information for the UI
+representation. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+to implement a custom feature which opens a popup-dialog to change the EClass name. This custom feature should be available and enabled in the context
+menu if exactly one EClass is selected.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the custom feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialRenameEClassFeature </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>extends</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AbstractCustomFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialRenameEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getName() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Rename
+ EClass"</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getDescription() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Change
+ the name of the EClass"</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canExecute(ICustomContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ allow rename if exactly one pictogram element</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ representing a EClass is selected</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>false</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ PictogramElement[] pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pes != </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>null</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> && pes.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> ==
+ 1) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object
+ bo = getBusinessObjectForPictogramElement(pes[0]);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (bo </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>true</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>void</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ execute(ICustomContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pes != </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>null</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> && pes.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> ==
+ 1) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object
+ bo = getBusinessObjectForPictogramElement(pes[0]);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (bo </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass eClass = (EClass) bo;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String currentName = eClass.getName();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ask user for a new class name</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String newName =SampleUtil.askString(getName(), getDescription(),</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ currentName);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (newName != </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ eClass.setName(newName);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the
+feature provider has to deliver our newly created custom feature (overwrite the
+method </span><span class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getCustomFeatures(com.sap.tc.emf.gfw.features.context.ICustomContext)"><span
+style='font-style:normal'>getCustomFeatures</span></a></span></span><span
+class=code1><span lang=EN-US style='color:black;font-style:normal'>)</span></span><i><span
+lang=EN-GB style='color:black'>. </span></i></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature[] getCustomFeatures(ICustomContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature[] { </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialRenameEClassFeature(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>this</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>) };</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Create a Tool Behavior Provider</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally we have to
+define that this custom feature can appear in the context menu. For that
+purpose we have to define it in the <a href="tool-behavior-provider.htm">tool
+behavior provider</a>. The concept of the tool behaviour provider will be discussed
+later in this tutorial in more detail. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>For this example of a
+custom feature it is enough to <b>create a tool behavior provider and add it to
+the diagram type provider as described <a href="tool-behavior-provider.htm">here</a>.
+</b>Afterwards you can add the custom feature to the context menu.</span></p>
+
+<p class=MsoNormal><b><span lang=EN-GB style='color:black'> </span></b></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the tool behavior provider here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.diagram;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialToolBehaviorProvider </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>extends</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AdvancedToolBehaviorProvider {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialToolBehaviorProvider(IDiagramTypeProvider dtp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(dtp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>protected</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ isContextMenuApplicable(IFeature feature) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ use all custom features as candidates for the context menu</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret = (feature </span><b><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#7F0055'>instanceof</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> ret;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Rename a EClass with a Custom Popup-Dialog</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+and test this new custom feature:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>create
+ or open a diagram </span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>create
+ a new EClass A</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>open
+ the context menu on this newly created EClass; choose Rename EClass</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>rename
+ this EClass to B</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>the
+ diagram will be updated automatically with new class name</span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/dark-feature-processing.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/dark-feature-processing.htm
new file mode 100644
index 0000000..ec2eb24
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/dark-feature-processing.htm
@@ -0,0 +1,172 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Dark feature processing</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:windowtext;}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:blue;
+ text-decoration:underline;}
+p
+ {margin-top:7.5pt;
+ margin-right:0cm;
+ margin-bottom:7.5pt;
+ margin-left:0cm;
+ font-size:12.0pt;}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:4.5pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-style:italic;}
+p.comment, li.comment, div.comment
+ {margin-top:7.5pt;
+ margin-right:0cm;
+ margin-bottom:7.5pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;}
+@page Section1
+ {size:595.3pt 841.9pt;
+ margin:70.85pt 70.85pt 2.0cm 70.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=blue style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><span lang=EN-US>Why Should I Need Dark Feature Processing?</span></h1>
+
+<p class=MsoNormal><span lang=EN-US>Dark feature processing can be used to
+modify diagram data as well as business data through existing Graphiti features,
+without the need to have any Graphiti editor open.</span></p>
+
+<h1><span lang=EN-US>What Do I Have to Do to Process My Features Dark?</span></h1>
+
+<p class=MsoNormal><span lang=EN-US>You just have to create the suitable
+diagram type provider (DTP) and feature provider combination for the diagram to
+be modified. The service class <i>ExtensionManager</i> provides some useful methods:
+<i>createDiagramTypeProvider(IDiagram)</i> can be called to receive a DTP loaded with
+all the infrastructure to process your existing features. But keep in mind that
+these features can not show any kind of UI because there is no real visible
+editor running.</span></p>
+
+<h1><a name="_Pitfalls:"></a><span lang=EN-US>Pitfalls</span></h1>
+
+<ul style='margin-top:0cm' type=disc>
+ <li class=MsoNormal><span lang=EN-US>Dark processed features really have to be
+ dark! No pop up dialogs, please
</span></li>
+ <li class=MsoNormal><span lang=EN-US>No selection</span></li>
+ <li class=MsoNormal><span lang=EN-US>No (auto) direct editing</span></li>
+</ul>
+
+<p class=MsoNormal><span lang=EN-US>So eventually you have to prepare your
+features to fit that needs.</span></p>
+
+<p class=MsoNormal> </p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/diagram.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/diagram.htm
new file mode 100644
index 0000000..8cff910
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/diagram.htm
@@ -0,0 +1,610 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<meta name="Generator" content="Microsoft Word 12 (filtered)">
+<title>Diagram</title>
+<link rel="Stylesheet" type="text/css" media="all" href=
+"../book.css">
+<style type="text/css">
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Cambria;
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"\00DCberschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"\00DCberschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"\00DCberschrift 3 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"\00DCberschrift 4 Zchn";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"\00DCberschrift 5 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h6
+ {mso-style-link:"\00DCberschrift 6 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
+ {mso-style-link:"Kommentartext Zchn";
+ margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:0cm;
+ margin-bottom:.0001pt;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Vorformatiert Zchn";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"\00DCberschrift 1 Zchn";
+ mso-style-link:"\00DCberschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"\00DCberschrift 2 Zchn";
+ mso-style-link:"\00DCberschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift3Zchn
+ {mso-style-name:"\00DCberschrift 3 Zchn";
+ mso-style-link:"\00DCberschrift 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift4Zchn
+ {mso-style-name:"\00DCberschrift 4 Zchn";
+ mso-style-link:"\00DCberschrift 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.berschrift5Zchn
+ {mso-style-name:"\00DCberschrift 5 Zchn";
+ mso-style-link:"\00DCberschrift 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.berschrift6Zchn
+ {mso-style-name:"\00DCberschrift 6 Zchn";
+ mso-style-link:"\00DCberschrift 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+span.HTMLVorformatiertZchn
+ {mso-style-name:"HTML Vorformatiert Zchn";
+ mso-style-link:"HTML Vorformatiert";
+ font-family:Consolas;}
+span.KommentartextZchn
+ {mso-style-name:"Kommentartext Zchn";
+ mso-style-link:Kommentartext;
+ font-family:"Times New Roman","serif";}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+p.msochpdefault, li.msochpdefault, div.msochpdefault
+ {mso-style-name:msochpdefault;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-link:"Heading 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+p.Heading1, li.Heading1, div.Heading1
+ {mso-style-name:"Heading 1";
+ mso-style-link:"Heading 1 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-link:"Heading 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+p.Heading2, li.Heading2, div.Heading2
+ {mso-style-name:"Heading 2";
+ mso-style-link:"Heading 2 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading3Char
+ {mso-style-name:"Heading 3 Char";
+ mso-style-link:"Heading 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+p.Heading3, li.Heading3, div.Heading3
+ {mso-style-name:"Heading 3";
+ mso-style-link:"Heading 3 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading4Char
+ {mso-style-name:"Heading 4 Char";
+ mso-style-link:"Heading 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+p.Heading4, li.Heading4, div.Heading4
+ {mso-style-name:"Heading 4";
+ mso-style-link:"Heading 4 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading5Char
+ {mso-style-name:"Heading 5 Char";
+ mso-style-link:"Heading 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+p.Heading5, li.Heading5, div.Heading5
+ {mso-style-name:"Heading 5";
+ mso-style-link:"Heading 5 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.Heading6Char
+ {mso-style-name:"Heading 6 Char";
+ mso-style-link:"Heading 6";
+ font-family:"Cambria","serif";
+ color:#243F60;
+ font-style:italic;}
+p.Heading6, li.Heading6, div.Heading6
+ {mso-style-name:"Heading 6";
+ mso-style-link:"Heading 6 Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.HTMLPreformattedChar
+ {mso-style-name:"HTML Preformatted Char";
+ mso-style-link:"HTML Preformatted";
+ font-family:Consolas;}
+p.HTMLPreformatted, li.HTMLPreformatted, div.HTMLPreformatted
+ {mso-style-name:"HTML Preformatted";
+ mso-style-link:"HTML Preformatted Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.CommentTextChar
+ {mso-style-name:"Comment Text Char";
+ mso-style-link:"Comment Text";
+ font-family:"Times New Roman","serif";}
+p.CommentText, li.CommentText, div.CommentText
+ {mso-style-name:"Comment Text";
+ mso-style-link:"Comment Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-link:"Balloon Text";
+ font-family:"Tahoma","sans-serif";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ mso-style-link:"Balloon Text Char";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.3pt 841.9pt;
+ margin:70.85pt 70.85pt 2.0cm 70.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+</head>
+<body bgcolor="white" lang="DE" link="blue" vlink="purple" style=
+'margin-bottom:12.0pt'>
+<div class="Section1">
+<div>
+<h1><span lang="EN-US">Diagram</span></h1>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>For
+the creation of an editor, it is necessary to implement a
+<b>diagram type agent</b>. This diagram type agent consists of a
+<b>diagram type provider</b> and a <b>feature provider</b>. The
+minimum implementation of the diagram type provider is described
+in this chapter.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><a name="_Toc176747724"><span lang="EN-GB">Create a
+Plug-In</span></a></h2>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><span lang="EN-US">Create a plug-in project
+for your diagram type specific graphical editor. Please keep in
+mind <b>not to use</b> the ID
+<i>org.eclipse.graphiti.tutorial</i>, which is the ID of our
+implementation of the tutorial. Additionally use different ID's
+for implementations of our extension points, see
+below.</span></p>
+<p class="MsoNormal"><span lang="EN-US">You should have
+references to following plug-ins: <i>org.eclipse.graphiti</i>,
+<i>org.eclipse.graphiti.ui</i>,
+<i>org.eclipse.graphiti.examples.common</i>,
+<i>org.eclipse.core.resources</i>,
+<i>org.eclipse.core.runtime</i>,
+<i>org.eclipse.ui.views.properties.tabbed</i>.</span></p>
+<h2><a name="_Toc176747725"><span lang="EN-GB">Create a Diagram
+Type Provider</span></a></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>A
+diagram type provider has to implement the interface</span>
+<span class="code1"><span lang="EN-US" style=
+'color:black'><a href=
+"../../../javadoc/com/sap/tc/emf/gfw/dt/IDiagramTypeProvider.html">
+IDiagramTypeProvider</a></span></span><span lang="EN-GB" style=
+'color:black'>. Instead of implementing it directly it should
+extend one of the available base classes. In this example we
+extend the base class</span> <span class="code1"><span lang=
+"EN-US" style='color:black'><a href=
+"../../../javadoc/com/sap/tc/emf/gfw/dt/AbstractDiagramTypeProvider.html">
+AbstractDiagramTypeProvider</a>.</span></span></p>
+<p class="MsoNormal"><span class="code1"><span lang="EN-US"
+style='color:black'> </span></span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>You
+can see the complete implementation of the diagram type provider
+here:</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<table class="MsoNormalTable" border="0" cellspacing="0"
+cellpadding="0" width="851" style=
+'width:18.0cm;border-collapse:collapse'>
+<tr>
+<td width="851" valign="top" style=
+'width:18.0cm;border:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
+<p class="MsoNormal" style='text-autospace:none'><b><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+<p class="MsoNormal"><b><span lang="EN-US" style=
+'font-size:10.0pt;font-family: "Courier New";color:#7F0055'>package</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>org.eclipse.graphiti.examples.tutorial.diagram;</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal"><b><span lang="EN-US" style=
+'font-size:10.0pt;font-family: "Courier New";color:#7F0055'>public</span></b>
+<b><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b>
+<span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'>MyTutorialDiagramTypeProvider
+<b><span style='color:#7F0055'>extends</span></b>
+AbstractDiagramTypeProvider {</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal"><b><span style=
+'font-size:10.0pt;font-family:"Courier New"; color:#7F0055'>public</span></b>
+<span style=
+'font-size:10.0pt;font-family: "Courier New"'>MyTutorialDiagramTypeProvider()
+{</span></p>
+<p class="MsoNormal"><b><span style=
+'font-size:10.0pt;font-family:"Courier New"; color:#7F0055'>
+super</span></b><span style=
+'font-size: 10.0pt;font-family:"Courier New"'>();</span></p>
+<p class="MsoNormal"><span style=
+'font-size:10.0pt;font-family:"Courier New"'>}</span></p>
+<p class="MsoNormal"> </p>
+</td>
+</tr>
+</table>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><a name="_Toc176747726"><span lang="EN-GB">Create a Diagram
+Type</span></a></h2>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>If
+you create a diagram type provider for a diagram type which does
+not exist in the repository, it is necessary to provide also
+information about this new diagram type.</span> <span lang=
+"EN-US" style='color:black'>The diagram type</span> <span lang=
+"EN-US">advertises that the containing diagram type provider
+understands the given diagram type and is suitable for editing
+and viewing diagrams of that type.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>The
+information about a diagram type must be declared in the
+plugin.xml.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><a name="_Toc176747727"><span lang="EN-GB">Register the
+Diagram Type Provider and Diagram Type</span></a></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB">The newly created diagram
+type provider and diagram type are registered through the
+extension points:</span></p>
+<ul style='margin-top:0cm' type="disc">
+<li class="MsoNormal" style=
+'margin-top:6.0pt;text-align:justify'><span class=
+"code0"><span lang="EN-US"><a href=
+"../extension-points/diagramTypes.html">diagramTypes</a></span></span></li>
+<li class="MsoNormal" style=
+'margin-top:6.0pt;text-align:justify'><span class=
+"code0"><span lang="EN-US"><a href=
+"../extension-points/diagramTypeProviders.html">diagramTypeProviders</a></span></span></li>
+</ul>
+<p class="MsoNormal"><span lang="EN-GB"> <span style=
+'color:black'> </span></span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>The
+corresponding <i>plugin.xml</i> looks similar to this:</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<table class="MsoNormalTable" border="0" cellspacing="0"
+cellpadding="0" width="851" style=
+'width:18.0cm;margin-left:1.9pt;border-collapse:collapse'>
+<tr>
+<td width="851" valign="top" style=
+'width:18.0cm;border:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-GB" style=
+'font-size:10.0pt;font-family:"Courier New";color:gray'> </span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:gray'><?xml
+version="1.0" encoding="UTF-8"?></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:gray'><?eclipse
+version="3.0"?></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'><plugin></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span lang=
+"EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:black'> </span><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'><extension</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+point=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"org.eclipse.graphiti.ui.diagramTypes"</span><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'>></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+<diagramType</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+description=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"This is
+the diagram type for my Graphiti tutorial"</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+id=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType"</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+name=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"My
+Graphiti Tutorial Diagram Type"</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+type=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"mytutorial"</span><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'>></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+</diagramType></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+</extension></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"'> </span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+<extension</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+point=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"org.eclipse.graphiti.ui.diagramTypeProviders"</span><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'>></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+<diagramTypeProvider</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+class=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"org.eclipse.graphiti.examples.tutorial.diagram.<br>
+
+
+MyTutorialDiagramTypeProvider"</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+description=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"This is
+my editor for the Graphiti tutorial"</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+id=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"org.eclipse.graphiti.examples.tutorial.diagram.<br>
+
+
+MyTutorialDiagramTypeProvider"</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+name=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"My
+tutorial editor"</span><span lang="EN-US" style=
+'font-size:10.0pt; font-family:"Courier New";color:navy'>></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+<diagramType</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+id=</span><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New";color:green'>"org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType"</span><span lang="EN-US"
+style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'>></span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'> </span>
+<span style=
+'font-size:10.0pt;font-family:"Courier New";color:navy'></diagramType></span></p>
+<p class="MsoNormal"><span style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+</diagramTypeProvider></span></p>
+<p class="MsoNormal"><span style=
+'font-size:10.0pt;font-family:"Courier New"; color:navy'>
+</extension></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-size:10.0pt; font-family:"Courier New";color:navy'></plugin></span></p>
+<p class="MsoNormal" style='text-autospace:none'><span style=
+'font-size:10.0pt; font-family:"Courier New";color:black'> </span><span lang="EN-GB"
+style='color:black'> </span></p>
+</td>
+</tr>
+</table>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span><span lang="EN-US">For further
+information to these extension points, see the extension point
+description in the Eclipse IDE.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+</div>
+<div class="MsoNormal" align="center" style='text-align:center'>
+<hr size="3" width="100%" align="center"></div>
+<p class="MsoNormal"><a href=
+"http://www.eclipse.org/legal/epl-v10.html" shape=
+"rect">Copyright (c) SAP AG 2005, 2010.</a></p>
+</div>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/direct-editing-activation.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/direct-editing-activation.htm
new file mode 100644
index 0000000..d3ff5a5
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/direct-editing-activation.htm
@@ -0,0 +1,397 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 12 (filtered)">
+<title>Direct editing activation</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New"}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif"; margin-left:0cm; margin-right:0cm; margin-top:0cm}
+span.Heading1Char
+ {font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold}
+span.Heading2Char
+ {font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold}
+span.Heading3Char
+ {font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold}
+span.Heading4Char
+ {font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic}
+span.Heading5Char
+ {font-family:"Cambria","serif";
+ color:#243F60}
+span.HTMLPreformattedChar
+ {font-family:Consolas}
+span.BalloonTextChar
+ {font-family:"Tahoma","sans-serif"}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif"}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic}
+span.code1
+ {font-style:italic}
+span.code0
+ {font-style:italic}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+
+
+<h1><span lang="EN-GB">Direct Editing Activation after Object Creation</span></h1>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black">Often it is useful to
+activate a <a href="direct-editing-feature.htm">direct editing feature</a>
+directly after object creation. For example after creating a class the
+text-editor is opened and the user can immediately change the class name. </span></p>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black">It is very simple to
+invoke the direct editing feature automatically, but it depends on the
+implementation of the shape how to do this. </span></p>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span></p>
+
+<h2><span lang="EN-US">Direct Editing Activation, if Shape is Implemented by Features</span></h2>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black">Prerequisite: the shape
+of the EClass is implemented by features, and we already implemented a <a href="direct-editing-feature.htm">direct editing feature</a>, which can edit
+the name of the EClass.</span></p>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black">As an example we want
+to activate this direct editing of the name after creating a EClass.</span></p>
+
+<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">At creation time of a
+new shape different features are called: <a href="create-feature.htm">create
+feature</a>, <a href="add-feature.htm">add feature</a> and <a href="update-feature.htm">update feature</a>. </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">For the automatic
+switch into the direct editing mode we need to collect some information in
+those features and store it in the interface </span><span class="code0"><span lang="EN-US" style="color:black"><a href="../../../javadoc/com/sap/tc/emf/gfw/features/IDirectEditingInfo.html"><span style="font-style:normal">IDirectEditingInfo</span></a>. </span></span><span lang="EN-GB" style="color:black">All features have access to this direct editing
+info calling </span><span class="code0"><span lang="EN-US" style="color:black"><a href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getDirectEditingInfo()"><span style="font-style:normal">getFeatureProvider().getDirectEditingInfo()</span></a>
+</span></span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">In the <a href="create-feature.htm">create feature</a> the automatic direct editing for
+this creation process has to be activated.</span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">This has to be done at
+the end of the <a href="../../../javadoc/com/sap/tc/emf/gfw/func/ICreate.html#create(com.sap.tc.emf.gfw.features.context.ICreateContext)">create</a>
+method.</span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">Note, that previously
+in this tutorial we implemented the create method in a way, that at the
+beginning the user is asked for the class name in a popup-dialog. This becomes
+obsolete now and has to be deleted.</span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">You can see the new
+create method here: </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="851" style="width:18.0cm;border-collapse:collapse">
+ <tr>
+ <td width="851" valign="top" style="width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt">
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="color:black"> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang="EN-US" style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> Object[] create(ICreateContext
+ context) {</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create new Class</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'>EClass
+ newClass = EcoreFactory.<i><span style="color:#0000C0">eINSTANCE</span></i>.createEClass();</span></p>
+ <p class="MsoNormal"><span lang="EN-US"> </span></p>
+ <p class="MsoNormal"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'>
+ <span style="color:green">// Add model element to resource.</span></span></p>
+ <p class="MsoNormal"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // We add the model
+ element to the resource of the diagram for</span></p>
+ <p class="MsoNormal"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // simplicity's
+ sake. Normally, a customer would use its own</span></p>
+ <p class="MsoNormal"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'> // model
+ persistence layer for storing the business model separately.</span></p>
+ <p class="MsoNormal"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'>
+ getDiagram().eResource().getContents().add(newClass);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// do the add</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ addGraphicalRepresentation(context, newClass);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// activate direct editing after object creation</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ getFeatureProvider().getDirectEditingInfo().setActive(</span><b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// return newly created business object(s)</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> Object[] {
+ newClass };</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">In the <a href="add-feature.htm">add feature</a> the outer container shape of the newly
+created object must be set (the main pictogram element of the EClass).</span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">Additionally the shape
+(pictogram element) and its graphics algorithm have to be specified, where the
+direct editing editor shall be opened.</span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">You have to do this at
+the end of the <a href="../../../javadoc/com/sap/tc/emf/gfw/func/IAdd.html#add(com.sap.tc.emf.gfw.features.context.IAddContext)">add</a>
+method as shown here:</span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="851" style="width:18.0cm;border-collapse:collapse">
+ <tr>
+ <td width="851" valign="top" style="width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt">
+ <p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang="EN-US" style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> PictogramElement add(IAddContext
+ context) {</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ... EXISTING CODING ...</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IPeCreateService peCreateService = Graphiti.getPeCreateService();<br>
+ IGaService gaService =
+ Graphiti.getGaService();</span></p>
+ <p class="MsoNormal" style="text-autospace:none"> </p>
+ <p class="MsoNormal" style="text-autospace:none"> </p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// SHAPE WITH TEXT</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ {</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create shape for text</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Shape shape = </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>peCreateService</span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>.createShape(containerShape, </span><b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create and set text graphics algorithm</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Text text = </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>gaService</span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>.createDefaultText(shape, addedClass.getName());</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setForeground(manageColor(</span><i><span lang="EN-US" style='font-size:
+ 10.0pt;font-family:"Courier New";color:#0000C0'>CLASS_TEXT_FOREGROUND</span></i><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>));</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setHorizontalAlignment(OrientationEnum.</span><i><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>ALIGNMENT_CENTER</span></i><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.setVerticalAlignment(OrientationEnum.</span><i><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>ALIGNMENT_CENTER</span></i><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ text.getFont().setBold(</span><b><span lang="EN-US" style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>true</span></b><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>gaService</span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>.setLocationAndSizeOfGraphicsAlgorithm(text, 0, 0,
+ <br>
+ width, 20);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// create link and wire it</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ link(shape, addedClass);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// provide information to support direct-editing directly </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// after object creation (must be activated additionally)</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IDirectEditingInfo directEditingInfo =</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ getFeatureProvider().getDirectEditingInfo();</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// set container shape for direct editing after object
+ creation</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ directEditingInfo.setMainPictogramElement(containerShape);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// set shape and graphics algorithm where the editor for</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// direct editing shall be opened after object creation</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ directEditingInfo.setPictogramElement(shape);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ directEditingInfo.setGraphicsAlgorithm(text);</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ }</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// ... EXISTING CODING ...</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class="MsoNormal" style="text-autospace:none"><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<h2><span lang="EN-GB">Test: Direct Editing after Creation of a EClass</span></h2>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black"> </span></p>
+
+<p class="MsoNormal"><span lang="EN-GB" style="color:black">Open a diagram and
+create a new EClass from the palette. The shape for the EClass should
+immediately allow the direct editing of the class name.</span></p>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/direct-editing-feature.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/direct-editing-feature.htm
new file mode 100644
index 0000000..f4d912a
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/direct-editing-feature.htm
@@ -0,0 +1,598 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Providing direct editing functionality</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:windowtext;}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-style:italic;}
+span.code1
+ {font-style:italic;}
+span.code0
+ {font-style:italic;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099521"><span lang=EN-GB>Providing Direct Editing
+Functionality</span></a></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Direct editing means
+the possibility to change values directly in the graphical editor. Technically
+the user clicks on a pictogram-element and an editor is shown, where the user
+can change the values of this pictogram element. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A typical use case is,
+that the user clicks on a text (either in a shape or a connection decorator)
+and then the text is overlaid with a text-edit-field, where the user can change
+the text value. To the user this actually looks as if the text is replaced with
+the text-edit-field.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>
+<img width=199
+height=201 src="visio/direct-editing.png"></span></p>
+
+<p class=MsoCaption><span lang=EN-US>Figure: Direct editing of a text</span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Creating a Direct Editing Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+to enable the users to edit the name of a EClass directly in the diagram.
+Therefore we have to create a direct editing feature and make it available in
+the feature provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A direct editing
+feature has to implement the interface </span><span class=code1><span
+lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IDirectEditingFeature.html"><span
+style='font-style:normal'>IDirectEditingFeature</span></a>.</span></span><span
+lang=EN-GB style='color:black'> Instead of implementing it directly it should
+extend one of the available base classes. In this example we extend the base
+class<span class=code1> </span></span><span class=code1><span lang=EN-US
+style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/impl/AbstractDirectEditingFeature.html"><span
+style='font-style:normal'>AbstractDirectEditingFeature</span></a></span></span><span
+lang=EN-GB style='color:black'>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case we have to
+implement/overwrite several methods:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IDirectEditing.html#getEditingType()">getEditingType</a>
+has to return the editor type which shall be used to edit the value, in this
+example a text editor.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method </span><span
+class=code1><span lang=EN-US style='color:black;font-style:normal'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IDirectEditing.html#canDirectEdit(com.sap.tc.emf.gfw.features.context.IDirectEditingContext)">canDirectEdit</a></span></span><span
+lang=EN-US style='color:black'> </span><span lang=EN-GB style='color:black'>has
+to check the given context and therefore it decides if direct editing is
+supported.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IDirectEditing.html#getInitialValue(com.sap.tc.emf.gfw.features.context.IDirectEditingContext)">getInitialValue</a>
+has to return the initial value with which the editor is initialized, which is
+usually the currently displayed value.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IDirectEditing.html#checkValueValid(java.lang.String, com.sap.tc.emf.gfw.features.context.IDirectEditingContext)">checkValueValid</a>
+performs a check of the current editor value on each value change.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/func/IDirectEditing.html#setValue(java.lang.String, com.sap.tc.emf.gfw.features.context.IDirectEditingContext)">setValue</a>
+has to set the edited value to the model at the end of the editing process.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the direct editing feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'> </span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialDirectEditEClassFeature </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>extends</span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> AbstractDirectEditingFeature
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialDirectEditEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>int</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ getEditingType() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ there are several possible editor-types supported:</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ text-field, checkbox, color-chooser, combobox, ...</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>TYPE_TEXT</span></i><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canDirectEdit(IDirectEditingContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement
+ pe = context.getPictogramElement();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object
+ bo = getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> GraphicsAlgorithm
+ ga = context.getGraphicsAlgorithm();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ support direct editing, if it is a EClass, and the user clicked</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ directly on the text and not somewhere else in the rectangle</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (bo </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass && ga </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Text) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><font color="#800080">
+ <span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";font-weight:700'>
+ true</span></font><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ direct editing not supported in all other cases</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getInitialValue(IDirectEditingContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ return the current name of the EClass</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement
+ pe = context.getPictogramElement();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass eClass = (EClass) getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ eClass.getName();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String checkValueValid(String value, IDirectEditingContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (value.length() < 1)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Please
+ enter any text as class name."</span><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (value.contains(</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#2A00FF'>" "</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>))</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Spaces
+ are not allowed in class names."</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (value.contains(</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:#2A00FF'>"\n"</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>))</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Line
+ breakes are not allowed in class names."</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ null means, that the value is valid</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>void</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ setValue(String value, IDirectEditingContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ set the new name for the MOF class</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement
+ pe = context.getPictogramElement();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> EClass
+ eClass = (EClass) getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> eClass.setName(value);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ Explicitly update the shape to display the new value in the diagram</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ Note, that this might not be necessary in future versions of the GFW</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ (currently in discussion)</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ we know, that pe is the Shape of the Text, so its container is the</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ main shape of the EClass</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>updatePictogramElement(((Shape)
+ pe).getContainer());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Additionally the
+feature provider has to deliver our newly created feature (overwrite the method
+<a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getDirectEditingFeature(com.sap.tc.emf.gfw.features.context.IDirectEditingContext)">getDirectEditingFeature</a>).
+</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#646464'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IDirectEditingFeature getDirectEditingFeature(</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ IDirectEditingContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement
+ pe = context.getPictogramElement();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object
+ bo = getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (bo </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialDirectEditEClassFeature(</span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.getDirectEditingFeature(context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Edit the Name of a Class Directly In the Diagram</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+and test this new direct editing feature:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Create
+ or open a diagram and create an EClass Address</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Click
+ on the class name and the value Address should become editable in the
+ text-editor</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Change
+ the value to Customer Address. Now the editor should be highlighted and
+ an error-message (no space allowed) should be displayed in the
+ status-bar.</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Change
+ the value to CustomerAddress. The highlight and error-message should
+ disappear. </span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>Press
+ return or make the editor loose focus otherwise to overtake the edited
+ value, or press ESC to cancel the editing.</span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/double-click.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/double-click.htm
new file mode 100644
index 0000000..bc73d42
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/double-click.htm
@@ -0,0 +1,235 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Providing double-click behavior</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:windowtext;}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-style:italic;}
+span.heading2char
+ {font-family:Arial;
+ color:black;
+ font-weight:bold;
+ font-style:italic;}
+span.code1
+ {font-style:italic;}
+span.code0
+ {font-style:italic;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099520"><span lang=EN-GB>Providing </span></a>
+<span lang="en-gb">D</span><span
+lang=EN-GB>ouble-Click Behavior</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Enhancing the Tool Behavior Provider</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The double-click
+behaviour is defined in the tool behavior provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>If you didnt do so
+already you must <b>first create a tool behavior provider and add it to the
+diagram type provider as described <a href="tool-behavior-provider.htm">here</a>.</b></span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>There is one method of
+the tool behavior provider to overwrite: </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The method <a
+href="../../../javadoc/com/sap/tc/emf/gfw/tb/IToolBehaviorProvider.html#getDoubleClickFeature(com.sap.tc.emf.gfw.features.context.IDoubleClickContext)">getDoubleClickFeature</a>
+has to return the <a href="custom-feature.htm">custom feature</a> to execute on
+double-click for the given context.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+to execute the <a href="custom-feature.htm">Rename EClass feature</a> we
+implemented previously on double-click. </span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the double-click behavior here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature getDoubleClickFeature(IDoubleClickContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> ICustomFeature
+ customFeature =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialRenameEClassFeature(getFeatureProvider());</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ canExecute() tests especially if the context contains a EClass</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> (customFeature.canExecute(context))
+ {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> customFeature;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>.getDoubleClickFeature(context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal> </p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Rename a EClass on Double-Click</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+and create a new EClass. Double-click that EClass and the rename dialog
+appears, which allows changing the class name.</span></p>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/drill-down.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/drill-down.htm
new file mode 100644
index 0000000..96f8da7
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/drill-down.htm
@@ -0,0 +1,699 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 11 (filtered)">
+<title>Providing drill-down behavior</title>
+<link rel=Stylesheet type="text/css" media=all href="../book.css">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+h1
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman";
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman";
+ font-weight:bold;}
+h4
+ {margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman";
+ font-weight:bold;}
+h6
+ {margin-right:0cm;
+ margin-left:0cm;
+ font-size:7.5pt;
+ font-family:"Times New Roman";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+pre
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.code, li.code, div.code
+ {margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+p.note, li.note, div.note
+ {margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman";
+ font-style:italic;}
+span.heading2char
+ {font-family:Arial;
+ color:black;
+ font-weight:bold;
+ font-style:italic;}
+span.code1
+ {font-style:italic;}
+span.code0
+ {font-style:italic;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0cm;}
+ul
+ {margin-bottom:0cm;}
+-->
+</style>
+
+</head>
+
+<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
+
+<div class=Section1>
+
+<h1><a name="_Toc179099520"><span lang=EN-GB>Providing </span></a>
+<span lang="en-gb">D</span><span
+lang=EN-GB>rill-Down Behavior</span></h1>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Often the information
+which is shown in a diagram has a certain abstraction level, and the further details
+are shown in a separate diagram. For example if a workflow connects several
+sub-workflows, then one overview-diagram might show the complete workflow
+without the inner details of the sub-workflows, and several detail-diagrams
+show the inner details of each sub-workflow.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this case the user
+wants to have an easy possibility to navigate from the overview-diagram into
+the detail-diagrams and vice versa. We call this drill-down behavior.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Although going from
+overview to detail is the most typical example, there are other examples, where
+the user navigates to more independent diagrams. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>All those use cases
+have one thing in common: the user wants to navigate to a diagram, which
+represents the selected business object (meaning this business object is
+central for the diagram). </span></p>
+
+<p class=MsoNormal><span lang="en-gb">Graphiti</span><span lang=EN-GB style='color:black'>
+offers the possibility to link business objects to pictogram elements
+(including the diagram). The drill-down feature works in a way that it searches
+for all diagrams having a given business object associated. Then the user can
+choose from the found diagrams to which to navigate (if only one diagram is
+found, than this is directly opened).</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This is different to a
+where-used functionality, where the user would search for all diagrams using a
+business object, no matter if the diagram really represents the business
+object.</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<h2><span lang=EN-GB>Creating a Drill-Down Feature</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>In this example we want
+to enable the users to navigate to the diagram(s) which have the currently
+selected EClass associated. Therefore we have to create a drill-down feature
+and make it available in the feature provider.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>A drill-down feature is
+a <a href="custom-feature.htm">custom feature</a> which can easily be
+implemented by extending the base class <a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/custom/impl/AbstractDrillDownFeature.html">AbstractDrillDownFeature</a>.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>The functionality of
+the AbstractDrillDownFeature is tool-independent, so there is no specific
+behavior which has to be provided. We just overwrite the canExecute() method,
+so that the feature is only enabled if exactly one EClass is selected.</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of the drill-down feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialDrillDownEClassFeature </span><b><span lang=EN-US style='font-size:
+ 10.0pt;font-family:"Courier New";color:#7F0055'>extends</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AbstractDrillDownFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialDrillDownEClassFeature(IFeatureProvider fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getName() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Open
+ associated diagram"</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getDescription() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Open
+ the diagram associated with this EClass"</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> canExecute(ICustomContext
+ context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ first check, if one EClass is selected</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pes != </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>null</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> && pes.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> ==
+ 1) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> Object
+ bo = getBusinessObjectForPictogramElement(pes[0]);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (bo </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>instanceof</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> EClass) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// then forward to super-implementation, which checks if</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#3F7F5F'>// this EClass is associated with other diagrams</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>.canExecute(context);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal> </p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Before we test our
+drill-down feature, we have link EClasses to our diagrams. In our small
+example there is no obvious reasoning, which EClass to assign to a diagram.
+Because of that we create a new custom feature, where the user himself can
+assign selected EClasses to the current diagram. </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
+complete implementation of this custom feature here:</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>package</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ org.eclipse.graphiti.examples.tutorial.features;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialAssociateDiagramEClassFeature </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>extends</span></b></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ AbstractCustomFeature {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> TutorialAssociateDiagramEClassFeature(IFeatureProvider
+ fp) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>super</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>(fp);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getName() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Associate
+ diagram"</span><span lang=EN-US style='font-size:10.0pt;font-family:
+ "Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ String getDescription() {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"Associate
+ the diagram with this EClass"</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ canExecute(ICustomContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>boolean</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>false</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ PictogramElement[] pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>if</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (pes != </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>null</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> && pes.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ >= 1) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> ret
+ = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>true</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>for</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (PictogramElement pe : pes) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ Object bo = getBusinessObjectForPictogramElement(pe);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>if</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> (! (bo </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>instanceof</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass)) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret = </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>false</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ } </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>return</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ret;</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>void</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ execute(ICustomContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> PictogramElement[]
+ pes = context.getPictogramElements();</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ EClass eClasses[] = </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> EClass[pes.</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>length</span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>];</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>for</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> (</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>int</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> i
+ = 0; i < eClasses.</span><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#0000C0'>length</span><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>; i++) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> eClasses[i]
+ =</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ (EClass) getBusinessObjectForPictogramElement(pes[i]);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'>//
+ associate selected EClass with diagram</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>link(getDiagram(),
+ eClasses);</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> }</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New"'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
+ font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal> </p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Finally the feature provider
+has to deliver our newly created custom features (overwrite the method </span><span
+class=code1><span lang=EN-US style='color:black'><a
+href="../../../javadoc/com/sap/tc/emf/gfw/features/IFeatureProvider.html#getCustomFeatures(com.sap.tc.emf.gfw.features.context.ICustomContext)"><span
+style='font-style:normal'>getCustomFeatures</span></a></span></span><span
+class=code1><span lang=EN-US style='color:black;font-style:normal'>)</span></span><i><span
+lang=EN-GB style='color:black'>. </span></i></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>This implementation can
+be seen here:</span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=907
+ style='width:18.0cm;border-collapse:collapse'>
+ <tr>
+ <td width=907 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
+ style='font-size:10.0pt;font-family:"Courier New";color:#3F7F5F'> </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#646464'>@Override</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> ICustomFeature[]
+ getCustomFeatures(ICustomContext context) {</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>return</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> </span><b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ ICustomFeature[] { </span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>new</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ TutorialRenameEClassFeature(</span><b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:#7F0055'>this</span></b><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>),</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> TutorialAutoLayoutFeature(</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>false</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>),</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> TutorialAutoLayoutFeature(</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>true</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>),</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> TutorialDrillDownEClassFeature(</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>), </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><b><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
+ color:#7F0055'>new</span></b><span lang=EN-US style='font-size:10.0pt;
+ font-family:"Courier New";color:black'> TutorialAssociateDiagramEClassFeature(</span><b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>this</span></b><span
+ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>)
+ };</span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>
+ </span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}</span></p>
+ <p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+ </td>
+ </tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<h2><span lang=EN-GB>Test: Navigate to Diagram Associated with a EClass</span></h2>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'> </span></p>
+
+<p class=MsoNormal><span lang=EN-GB style='color:black'>Now start the editor
+and test this new drill-down feature:</span></p>
+
+<ol style='margin-top:0cm' start=1 type=1>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>create
+ or open two diagrams</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-US>in
+ the first diagram </span><span lang=EN-GB>create a new EClass</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>use
+ copy & paste to copy this EClass to the second diagram (the
+ underlying business object is remains the same!)</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>open
+ the context menu on the EClass in the second diagram; choose Associate
+ diagram</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>save
+ both diagrams and close the second diagram</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>open
+ the context menu on the EClass in the first diagram; choose Open
+ associated diagram</span></li>
+ <li class=MsoNormal style='color:black;text-align:justify'><span lang=EN-GB>now
+ the second diagram is opened again </span></li>
+</ol>
+
+<p class=MsoNormal><span lang=EN-US style='color:black'> </span></p>
+
+</div>
+<hr>
+ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>
+
+</body>
+
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/example-projects.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/example-projects.htm
new file mode 100644
index 0000000..7a102c2
--- /dev/null
+++ b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/example-projects.htm
@@ -0,0 +1,334 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=utf-8">
+<meta name="Generator" content="Microsoft Word 12 (filtered)">
+<title>Prepared example projects</title>
+<link rel="Stylesheet" type="text/css" media="all" href=
+"../book.css">
+<style type="text/css">
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;}
+@font-face
+ {font-family:Consolas;
+ panose-1:2 11 6 9 2 2 4 3 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+h1
+ {mso-style-link:"�berschrift 1 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h2
+ {mso-style-link:"�berschrift 2 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h3
+ {mso-style-link:"�berschrift 3 Zchn";
+ margin-top:12.0pt;
+ margin-right:0cm;
+ margin-bottom:3.0pt;
+ margin-left:0cm;
+ page-break-after:avoid;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+h4
+ {mso-style-link:"�berschrift 4 Zchn";
+ margin-top:11.25pt;
+ margin-right:0cm;
+ margin-bottom:1.7pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;
+ font-style:italic;}
+h5
+ {mso-style-link:"�berschrift 5 Zchn";
+ margin-right:0cm;
+ margin-left:0cm;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+p.MsoCaption, li.MsoCaption, div.MsoCaption
+ {margin-top:6.0pt;
+ margin-right:0cm;
+ margin-bottom:24.0pt;
+ margin-left:0cm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p
+ {margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+pre
+ {mso-style-link:"HTML Vorformatiert Zchn";
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:3.4pt;
+ margin-bottom:.0001pt;
+ font-size:11.0pt;
+ font-family:"Courier New";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-link:"Sprechblasentext Zchn";
+ margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";}
+span.berschrift1Zchn
+ {mso-style-name:"�berschrift 1 Zchn";
+ mso-style-link:"�berschrift 1";
+ font-family:"Cambria","serif";
+ color:#365F91;
+ font-weight:bold;}
+span.berschrift2Zchn
+ {mso-style-name:"�berschrift 2 Zchn";
+ mso-style-link:"�berschrift 2";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift3Zchn
+ {mso-style-name:"�berschrift 3 Zchn";
+ mso-style-link:"�berschrift 3";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;}
+span.berschrift4Zchn
+ {mso-style-name:"�berschrift 4 Zchn";
+ mso-style-link:"�berschrift 4";
+ font-family:"Cambria","serif";
+ color:#4F81BD;
+ font-weight:bold;
+ font-style:italic;}
+span.berschrift5Zchn
+ {mso-style-name:"�berschrift 5 Zchn";
+ mso-style-link:"�berschrift 5";
+ font-family:"Cambria","serif";
+ color:#243F60;}
+span.HTMLVorformatiertZchn
+ {mso-style-name:"HTML Vorformatiert Zchn";
+ mso-style-link:"HTML Vorformatiert";
+ font-family:"Consolas","serif";}
+span.SprechblasentextZchn
+ {mso-style-name:"Sprechblasentext Zchn";
+ mso-style-link:Sprechblasentext;
+ font-family:"Tahoma","sans-serif";}
+p.code, li.code, div.code
+ {mso-style-name:code;
+ margin-top:0cm;
+ margin-right:0cm;
+ margin-bottom:0cm;
+ margin-left:15.0pt;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";}
+p.note, li.note, div.note
+ {mso-style-name:note;
+ margin-top:19.5pt;
+ margin-right:0cm;
+ margin-bottom:19.5pt;
+ margin-left:30.0pt;
+ font-size:13.0pt;
+ font-family:"Times New Roman","serif";
+ font-style:italic;}
+p.comment, li.comment, div.comment
+ {mso-style-name:comment;
+ margin-top:5.65pt;
+ margin-right:0cm;
+ margin-bottom:5.65pt;
+ margin-left:0cm;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ font-weight:bold;}
+.MsoChpDefault
+ {font-size:10.0pt;}
+@page Section1
+ {size:595.45pt 841.7pt;
+ margin:72.0pt 89.85pt 72.0pt 89.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+<body bgcolor="white" lang="DE" link="blue" vlink="purple" style=
+'margin-bottom:12.0pt'>
+<div class="Section1">
+<h1><span lang="EN-GB">Prepared Example Project</span></h1>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>There
+is one prepared example project containing the sources for this
+tutorial. It shows more or less the <b>resulting project</b>,
+which you should have <b>at the end of this
+tutorial</b>.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><i><span lang="EN-GB" style=
+'color:black'>Note: it can happen that the code snippets in the
+tutorial are different from the code in the example project. This
+means that the example project is outdated. In such a case please
+tell us, and we will update the example project
+immediately.</span></i></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><span lang="EN-GB">The Example Project</span></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> <i>org.eclipse.graphiti.examples.tutorial</i></span></p>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>This
+plug-in contains the complete sources for the graphics framework
+tutorial.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><span lang="EN-GB">Installation Of the Example
+Project</span></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'>Ensure that plug-ins</span> <span lang="EN-GB"
+style='color:black'><i>org.eclipse.graphiti.examples.tutorial
+and</i></span> <span lang="EN-GB" style=
+'color:black'><i>org.eclipse.graphiti.examples.common</i> are
+installed in your IDE. The latter includes inter alia wizards for
+project and diagram creation, and a tree.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<h2><span lang="EN-GB">Test: Open the Empty Diagram
+Editor</span></h2>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>It
+should at least be possible to create and open a
+diagram.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style='color:black'>For
+this first test perform the following steps:</span></p>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><span lang="EN-GB">1. Run your target
+platform.</span></p>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><span lang="EN-GB">2. Open the project
+explorer (e.g. activate Resource perspective)</span></p>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><img width="561" height="130" src=
+"visio/file-new-project.png" alt=""></p>
+<p class="MsoNormal"> </p>
+<p class="MsoCaption"><span lang="EN-US"><a name=
+"Figure:_3._Start_the_New_project...-wizard" id=
+"Figure:_3._Start_the_New_project...-wizard">Figure: Start the
+"New" </a></span><span style="font-family: Symbol" lang="EN-GB">
+<a name=
+"Figure:_On_the_selected_project_open_context_menu:_New__�_Diagram0">
+®</a> </span><span lang="EN-US">
+<a name=
+"Figure:_3._Start_the_New_project...-wizard" id=
+"Figure:_3._Start_the_New_project...-wizard">"Project..."-wizard</a></span></p>
+<p class="MsoNormal"><img border="0" src=
+"visio/new-gfw-project.png" width="511" height="495" alt=""></p>
+<p class="MsoNormal"> </p>
+<p class="MsoCaption"><span lang="en-gb"><a name=
+"Figure:_Select_New_GFW_Sample_Project_as_project_type" id=
+"Figure:_Select_New_GFW_Sample_Project_as_project_type">Figure:
+Select "Graphiti Sample Project" as project type</a></span></p>
+<p class="MsoNormal"><img border="0" src=
+"visio/new-gfw-project-2.png" width="511" height="495" alt=
+""></p>
+<p class="MsoNormal"> </p>
+<p class="MsoCaption"><a name=
+"Figure:_Insert_a_name_for_your_project" id=
+"Figure:_Insert_a_name_for_your_project">Figure: Insert a name
+for your project</a> and hit "Finish" button</p>
+<p class="MsoNormal"><img border="0" src=
+"visio/project-explorer.png" alt=""></p>
+<p class="MsoNormal"> </p>
+<p class="MsoCaption"><a name="Figure:_The_newly_created_project"
+id="Figure:_The_newly_created_project">Figure: The newly created
+project</a></p>
+<p class="MsoCaption">
+<img border="0" src="visio/new-other.png" width="544" height="306"></p>
+<p class="MsoCaption">Figure: <span lang="EN-GB">
+<a name="Figure:_On_the_selected_project_open_context_menu:_New__�_Diagram1">
+On the selected project open context menu: "New"
+<span style="font-family: Symbol">®</span> </a>"Other..."</span></p>
+<p class="MsoCaption">
+<img border="0" src="new-diagram.png" width="500" height="500"></p>
+<p class="MsoCaption">
+<span lang="EN-GB"><a name=
+"Figure:_On_the_selected_project_open_context_menu:_New__�_Diagram">
+Figure: From the list of wizards select "Graphiti
+Diagram</a>"</span></p>
+<p class="MsoNormal"><img border="0" src=
+"visio/digram-type-tutorial.png" width="437" height="414" alt=
+""></p>
+<p class="MsoNormal"> </p>
+<p class="MsoCaption"><span lang="EN-GB"><a name=
+"Figure:_Specify_diagram_type:_�tutorial�_and_push_Next_button">Figure:
+Specify diagram type: "tutorial" and hit "Next"
+button</a></span></p>
+<p class="MsoNormal"><img border="0" src="visio/diagram-name.png"
+width="438" height="415" alt=""></p>
+<p class="MsoNormal"> </p>
+<p class="MsoCaption"><span lang="EN-GB"><a name=
+"Figure:_Specify_diagram_name_and_push_Finish_button" id=
+"Figure:_Specify_diagram_name_and_push_Finish_button">Figure: Specify the
+diagram name and hit "Finish" button</a></span></p>
+<p class="MsoNormal"><span lang="EN-GB">Diagram is opened
+automatically with your editor. Result is shown in the image
+below.</span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> <img border="0" src=
+"visio/project-explorer-editor.png" alt=""></span></p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'> </span></p>
+<p class="MsoCaption"><span lang="EN-US"><a name=
+"_Toc176747802">Figure: Empty diagram is opened in
+editor</a></span></p>
+<p class="MsoNormal"> </p>
+<p class="MsoNormal"><span lang="EN-GB" style=
+'color:black'>Depending on the functionality already provided in
+your editor, you can continue to test further
+functionality.</span></p>
+<p class="MsoNormal"><span lang="EN-US" style=
+'color:black'> </span></p>
+</div>
+<hr>
+<a href="http://www.eclipse.org/legal/epl-v10.html" shape=
+"rect">Copyright (c) SAP AG 2005, 2010.</a>
+</body>
+</html>
diff --git a/examples/org.eclipse.graphiti.doc/resources/docu/gfw/features.htm b/examples/org.eclipse.graphiti.doc/resources/docu/gfw/features.htm