add test tools for bot tests
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/.classpath b/tests/org.eclipse.graphiti.testtool.ecore/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/.project b/tests/org.eclipse.graphiti.testtool.ecore/.project
new file mode 100644
index 0000000..2e65b23
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.graphiti.testtool.ecore</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.graphiti.testtool.ecore/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..25c6cc0
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Apr 06 16:33:57 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/META-INF/MANIFEST.MF b/tests/org.eclipse.graphiti.testtool.ecore/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d9a0672
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.graphiti.sample.ecore;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.emf.transaction,
+ org.eclipse.gef,
+ org.eclipse.graphiti,
+ org.eclipse.graphiti.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.ui.views.properties.tabbed,
+ org.eclipse.graphiti.pattern;bundle-version="0.7.0",
+ org.eclipse.graphiti.examples.common;bundle-version="0.7.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.graphiti.sample.ecore,
+ org.eclipse.graphiti.sample.ecore.features.association,
+ org.eclipse.graphiti.sample.ecore.features.clazz,
+ org.eclipse.graphiti.sample.ecore.features.pack
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/about.html b/tests/org.eclipse.graphiti.testtool.ecore/about.html
new file mode 100644
index 0000000..c258ef5
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 5, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/build.properties b/tests/org.eclipse.graphiti.testtool.ecore/build.properties
new file mode 100644
index 0000000..f4b0c26
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/build.properties
@@ -0,0 +1,27 @@
+###############################################################################
+# <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,\
+               plugin.xml,\
+               about.html
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = src/,\
+               META-INF/,\
+               plugin.properties
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/plugin.properties b/tests/org.eclipse.graphiti.testtool.ecore/plugin.properties
new file mode 100644
index 0000000..1e71ee2
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/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 Sample Ecore (Incubation)
+providerName = Eclipse Modeling Project 
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/plugin.xml b/tests/org.eclipse.graphiti.testtool.ecore/plugin.xml
new file mode 100644
index 0000000..8315298
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/plugin.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<!--
+    <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>
+   
+ -->
+<plugin>
+
+   <extension
+         point="org.eclipse.graphiti.ui.diagramTypes">
+      <diagramType
+            description="diagram type for demo samples"
+            id="org.eclipse.graphiti.sample.ecore.EcoreDiagramType"
+            name="Sample Ecore DT"
+            type="sample.ecore">
+      </diagramType>
+   </extension>   
+   
+   <extension
+         point="org.eclipse.graphiti.ui.diagramTypeProviders">
+      <diagramTypeProvider
+            class="org.eclipse.graphiti.sample.ecore.TestDiagramTypeProvider"
+            description="This is a small Ecore test editor for the automated junit tests"
+            id="org.eclipse.graphiti.sample.ecore.TestDiagramTypeProvider"
+            name="Ecore sample editor">
+         <diagramType
+               id="org.eclipse.graphiti.sample.ecore.EcoreDiagramType">
+         </diagramType>
+         <imageProvider
+               id="org.eclipse.graphiti.examples.common.SampleImageProvider">
+         </imageProvider>
+      </diagramTypeProvider>
+   </extension>
+   
+  
+</plugin>
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestDiagramTypeProvider.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestDiagramTypeProvider.java
new file mode 100644
index 0000000..ca7fd7a
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestDiagramTypeProvider.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore;
+
+import org.eclipse.graphiti.dt.AbstractDiagramTypeProvider;
+import org.eclipse.graphiti.tb.IToolBehaviorProvider;
+
+/**
+ * The Class TestDiagramTypeProvider.
+ */
+public class TestDiagramTypeProvider extends AbstractDiagramTypeProvider {
+
+	private IToolBehaviorProvider[] availableToolBehaviorProviders;
+
+	/**
+	 * Instantiates a new test diagram type provider.
+	 */
+	public TestDiagramTypeProvider() {
+		super();
+		setFeatureProvider(new TestFeatureProvider(this));
+	}
+
+	/**
+	 * definition of a new diagram type.
+	 * 
+	 * @return the available tool behavior providers
+	 */
+
+	@Override
+	public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() {
+		if (availableToolBehaviorProviders == null) {
+			availableToolBehaviorProviders = new IToolBehaviorProvider[] { new TestToolBehaviour(this) };
+		}
+		return availableToolBehaviorProviders;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestFeatureProvider.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestFeatureProvider.java
new file mode 100644
index 0000000..e85af12
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestFeatureProvider.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.graphiti.dt.IDiagramTypeProvider;
+import org.eclipse.graphiti.features.IAddFeature;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.ICreateFeature;
+import org.eclipse.graphiti.features.IDirectEditingFeature;
+import org.eclipse.graphiti.features.ILayoutFeature;
+import org.eclipse.graphiti.features.IMoveShapeFeature;
+import org.eclipse.graphiti.features.IResizeShapeFeature;
+import org.eclipse.graphiti.features.IUpdateFeature;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.context.IResizeShapeContext;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.sample.ecore.features.association.TestAddAssociationFeature;
+import org.eclipse.graphiti.sample.ecore.features.association.TestCreateAssociationFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestAddClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestCreateClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestDirectEditingClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestLayoutClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestMoveClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestResizeClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.clazz.TestUpdateClassFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.RenamePackageFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.TestAddPackageFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.TestCreatePackageFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.TestLayoutPackageFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.TestMovePackageFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.TestResizePackageFeature;
+import org.eclipse.graphiti.sample.ecore.features.pack.TestUpdatePackageFeature;
+import org.eclipse.graphiti.ui.features.DefaultFeatureProvider;
+
+/**
+ * The Class TestFeatureProvider.
+ */
+public class TestFeatureProvider extends DefaultFeatureProvider {
+
+	/**
+	 * Instantiates a new test feature provider.
+	 * 
+	 * @param dtp
+	 *            the dtp
+	 */
+	public TestFeatureProvider(IDiagramTypeProvider dtp) {
+		super(dtp);
+	}
+
+	@Override
+	public IAddFeature getAddFeature(IAddContext context) {
+
+		if (context.getNewObject() instanceof EPackage) {
+			return new TestAddPackageFeature(this);
+		} else if (context.getNewObject() instanceof EClass) {
+			return new TestAddClassFeature(this);
+		} else if (context.getNewObject() instanceof EReference) {
+			return new TestAddAssociationFeature(this);
+		}
+
+		return super.getAddFeature(context);
+	}
+
+	@Override
+	public ICreateFeature[] getCreateFeatures() {
+		return new ICreateFeature[] { new TestCreatePackageFeature(this), new TestCreateClassFeature(this) };
+	}
+
+	@Override
+	public IUpdateFeature getUpdateFeature(IUpdateContext context) {
+		PictogramElement pictogramElement = context.getPictogramElement();
+		if (pictogramElement instanceof ContainerShape) {
+			Object bo = getBusinessObjectForPictogramElement(pictogramElement);
+			if (bo instanceof EPackage) {
+				return new TestUpdatePackageFeature(this);
+			} else if (bo instanceof EClass) {
+				return new TestUpdateClassFeature(this);
+			}
+		}
+		return super.getUpdateFeature(context);
+	}
+
+	@Override
+	public IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context) {
+		Shape shape = context.getShape();
+		Object bo = getBusinessObjectForPictogramElement(shape);
+		if (bo instanceof EPackage) {
+			return new TestMovePackageFeature(this);
+		} else if (bo instanceof EClass) {
+			return new TestMoveClassFeature(this);
+		}
+		return super.getMoveShapeFeature(context);
+	}
+
+	@Override
+	public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context) {
+		Shape shape = context.getShape();
+		Object bo = getBusinessObjectForPictogramElement(shape);
+		if (bo instanceof EPackage) {
+			return new TestResizePackageFeature(this);
+		} else if (bo instanceof EClass) {
+			return new TestResizeClassFeature(this);
+		}
+		return super.getResizeShapeFeature(context);
+	}
+
+	@Override
+	public ILayoutFeature getLayoutFeature(ILayoutContext context) {
+		PictogramElement pictogramElement = context.getPictogramElement();
+		Object bo = getBusinessObjectForPictogramElement(pictogramElement);
+		if (bo instanceof EPackage) {
+			return new TestLayoutPackageFeature(this);
+		} else if (bo instanceof EClass) {
+			return new TestLayoutClassFeature(this);
+		}
+		return super.getLayoutFeature(context);
+	}
+
+	
+	@Override
+	public ICustomFeature[] getCustomFeatures(ICustomContext context) {
+		
+		return new ICustomFeature[] { new RenamePackageFeature(this) };
+	}
+
+	@Override
+	public ICreateConnectionFeature[] getCreateConnectionFeatures() {
+		return new ICreateConnectionFeature[] { new TestCreateAssociationFeature(this) };
+	}
+
+	@Override
+	public IDirectEditingFeature getDirectEditingFeature(IDirectEditingContext context) {
+		PictogramElement pe = context.getPictogramElement();
+		Object bo = getBusinessObjectForPictogramElement(pe);
+		if (bo instanceof EClass) {
+			return new TestDirectEditingClassFeature(this);
+		}
+		return super.getDirectEditingFeature(context);
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestToolBehaviour.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestToolBehaviour.java
new file mode 100644
index 0000000..c6f95e3
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/TestToolBehaviour.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore;
+
+import org.eclipse.graphiti.DiagramScrollingBehavior;
+import org.eclipse.graphiti.dt.IDiagramTypeProvider;
+import org.eclipse.graphiti.features.ICreateConnectionFeature;
+import org.eclipse.graphiti.features.IFeature;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.context.IPictogramElementContext;
+import org.eclipse.graphiti.features.context.impl.CustomContext;
+import org.eclipse.graphiti.features.custom.ICustomFeature;
+import org.eclipse.graphiti.mm.pictograms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.tb.ContextButtonEntry;
+import org.eclipse.graphiti.tb.DefaultToolBehaviorProvider;
+import org.eclipse.graphiti.tb.IContextButtonPadData;
+
+/**
+ * The Class TestToolBehaviour.
+ */
+public class TestToolBehaviour extends DefaultToolBehaviorProvider {
+
+	/**
+	 * Instantiates a new test tool behaviour.
+	 * 
+	 * @param diagramTypeProvider
+	 *            the diagram type provider
+	 */
+	public TestToolBehaviour(IDiagramTypeProvider diagramTypeProvider) {
+		super(diagramTypeProvider);
+	}
+
+	@Override
+	protected boolean isContextMenuApplicable(IFeature feature) {
+		// consider all custom features as candidates for the context menu
+		boolean ret = (feature instanceof ICustomFeature);
+		return ret;
+	}
+
+	@Override
+	public IContextButtonPadData getContextButtonPadData(IPictogramElementContext context) {
+		IContextButtonPadData data = super.getContextButtonPadData(context);
+
+		ICustomContext cc = getCustomContext(context);
+		IFeatureProvider featureProvider = getFeatureProvider();
+		ICreateConnectionFeature[] createConnectionFeatures = featureProvider.getCreateConnectionFeatures();
+		ICreateConnectionFeature connecFeature = createConnectionFeatures[0];
+
+		ContextButtonEntry button = new ContextButtonEntry(connecFeature, cc);
+		button.setText("Connection");
+		button.setDescription("Create a new Conenction");
+		button.addDragAndDropFeature(connecFeature);
+		data.getDomainSpecificContextButtons().add(button);
+
+		return data;
+	}
+
+	private ICustomContext getCustomContext(IPictogramElementContext context) {
+		CustomContext result = new CustomContext(new PictogramElement[] { context.getPictogramElement() });
+		GraphicsAlgorithm ga = context.getPictogramElement().getGraphicsAlgorithm();
+		result.setX(ga.getX());
+		result.setY(ga.getY() + 2 * 50);
+		return result;
+	}
+
+	@Override
+	public DiagramScrollingBehavior getDiagramScrollingBehavior() {
+		return DiagramScrollingBehavior.SCROLLBARS_ALWAYS_VISIBLE;
+	}
+
+	@Override
+	public String getContributorId() {
+		return null; // property sheet not supported
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/association/TestAddAssociationFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/association/TestAddAssociationFeature.java
new file mode 100644
index 0000000..aeb3599
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/association/TestAddAssociationFeature.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.association;
+
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddConnectionContext;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.impl.AbstractAddFeature;
+import org.eclipse.graphiti.mm.datatypes.Color;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.mm.pictograms.GraphicsAlgorithmContainer;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Polygon;
+import org.eclipse.graphiti.mm.pictograms.Polyline;
+import org.eclipse.graphiti.mm.pictograms.Text;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeCreateService;
+import org.eclipse.graphiti.util.IColorConstant;
+
+/**
+ * The Class TestAddAssociationFeature.
+ */
+public class TestAddAssociationFeature extends AbstractAddFeature {
+
+	/**
+	 * Instantiates a new test add association feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestAddAssociationFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public PictogramElement add(IAddContext context) {
+
+		IAddConnectionContext addConnectionContext = (IAddConnectionContext) context;
+
+		// add graphical representation for this connection
+		IPeCreateService pecService = Graphiti.getPeCreateService();
+		IGaService gaService = Graphiti.getGaService();
+		Connection newConnection = pecService.createFreeFormConnection(getDiagram());
+		Polyline p = gaService.createPolyline(newConnection);
+		p.setLineWidth(2);
+		p.setForeground(manageColor(IColorConstant.BLACK));
+		newConnection.setStart(addConnectionContext.getSourceAnchor());
+		newConnection.setEnd(addConnectionContext.getTargetAnchor());
+
+		// add dynamic text decorator for the association name
+		ConnectionDecorator labelDecorator = pecService.createConnectionDecorator(newConnection, true, 0.5, true);
+		Text text = gaService.createDefaultText(labelDecorator);
+		text.setForeground(manageColor(IColorConstant.BLACK));
+		gaService.setLocationAndSize(text, 30, 20, 50, 12);
+
+		// add static graphical decorators (composition and navigable)
+		ConnectionDecorator cd;
+		cd = pecService.createConnectionDecorator(newConnection, false, 0.0, true);
+		createArrow(cd);
+		cd = pecService.createConnectionDecorator(newConnection, false, 1.0, true);
+		createRhombus(cd, true);
+
+		// set association name in the text decorator
+		EReference association = (EReference) context.getNewObject();
+		text.setValue(association.getName());
+
+		return newConnection;
+	}
+
+	public boolean canAdd(IAddContext context) {
+		// return true if given business object is of instance association
+		if (context instanceof IAddConnectionContext && context.getNewObject() instanceof EReference) {
+			return true;
+		}
+		return false;
+	}
+
+	// create an arrow
+	private Polyline createArrow(GraphicsAlgorithmContainer gaContainer) {
+
+		Color fg = manageColor(IColorConstant.BLACK);
+
+		Polyline p = Graphiti.getGaCreateService().createPolyline(gaContainer, new int[] { -9, 6, 0, 0, -9, -6 });
+		p.setForeground(fg);
+		p.setLineWidth(2);
+
+		return p;
+	}
+
+	// rhombus
+	private Polygon createRhombus(GraphicsAlgorithmContainer gaContainer, boolean isFilled) {
+
+		Color fg = manageColor(IColorConstant.BLACK);
+		Color fillColor;
+		if (isFilled) {
+			fillColor = manageColor(IColorConstant.BLACK);
+		} else {
+			fillColor = manageColor(IColorConstant.WHITE);
+		}
+
+		Polygon p = Graphiti.getGaCreateService().createPolygon(gaContainer, new int[] { 0, 0, -6, 6, -12, 0, -6, -6 });
+		p.setForeground(fg);
+		p.setBackground(fillColor);
+
+		p.setLineWidth(2);
+
+		return p;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/association/TestCreateAssociationFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/association/TestCreateAssociationFeature.java
new file mode 100644
index 0000000..810025d
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/association/TestCreateAssociationFeature.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.association;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateConnectionContext;
+import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
+import org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.Connection;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+/**
+ * The Class TestCreateAssociationFeature.
+ */
+public class TestCreateAssociationFeature extends AbstractCreateConnectionFeature {
+
+	/**
+	 * Instantiates a new test create association feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestCreateAssociationFeature(IFeatureProvider fp) {
+		/*
+		 * provide name and description for the UI, e.g. the palette
+		 */
+		super(fp, "Association", "create association");
+	}
+
+	public boolean canCreate(ICreateConnectionContext context) {
+		EClass source = getEClass(context.getSourceAnchor());
+		EClass target = getEClass(context.getTargetAnchor());
+
+		if (source != null && target != null && source != target) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean canStartConnection(ICreateConnectionContext context) {
+		/*
+		 * return true if start anchor belongs to a EClass
+		 */
+		if (getEClass(context.getSourceAnchor()) != null) {
+			return true;
+		}
+		return false;
+	}
+
+	public Connection create(ICreateConnectionContext context) {
+		Connection newConnection = null;
+
+		// get eclasses which should be connected
+		EClass source = getEClass(context.getSourceAnchor());
+		EClass target = getEClass(context.getTargetAnchor());
+
+		if (source != null && target != null) {
+
+			// create business object for the new connection
+			EReference association = createAssociation(source, target);
+
+			// use existing add feature for the creation of the graphical
+			// representation
+			AddConnectionContext addContext = new AddConnectionContext(context.getSourceAnchor(), context.getTargetAnchor());
+			addContext.setNewObject(association);
+			PictogramElement pe = getFeatureProvider().addIfPossible(addContext);
+			if (pe instanceof Connection) {
+				newConnection = (Connection) pe;
+
+				// link new pictogram element with business object
+				link(newConnection, association);
+			}
+
+		}
+
+		return newConnection;
+	}
+
+	/**
+	 * If the parent of the anchor is connected with an EClass, this method <br>
+	 * returns the EClass.
+	 * 
+	 * @param anchor
+	 * @return the EClass or null if no EClass is connected
+	 */
+	private EClass getEClass(Anchor anchor) {
+		if (anchor != null) {
+			Object eObject = getBusinessObjectForPictogramElement(anchor.getParent());
+			if (eObject instanceof EClass) {
+				return (EClass) eObject;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Creates the business object(s) for the new connection between the two
+	 * classes.<br>
+	 * It creates an association with two association ends which both point to
+	 * an EClass.
+	 * 
+	 * @param source
+	 * @param target
+	 * @return the newly created association
+	 */
+	private EReference createAssociation(EClass source, EClass target) {
+
+		EReference eReference = EcoreFactory.eINSTANCE.createEReference();
+		eReference.setName("new EReference"); //$NON-NLS-1$
+
+		eReference.setEType(target);
+		eReference.setLowerBound(0);
+		eReference.setUpperBound(-1);
+		source.getEStructuralFeatures().add(eReference);
+
+		return eReference;
+	}
+
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestAddClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestAddClassFeature.java
new file mode 100644
index 0000000..aae6ac1
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestAddClassFeature.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.Orientation;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Polyline;
+import org.eclipse.graphiti.mm.pictograms.RoundedRectangle;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.mm.pictograms.Text;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeCreateService;
+import org.eclipse.graphiti.util.ColorConstant;
+import org.eclipse.graphiti.util.IColorConstant;
+
+/**
+ * The Class TestAddClassFeature.
+ */
+public class TestAddClassFeature extends AbstractAddShapeFeature {
+
+	/**
+	 * The Constant CLASS_TEXT_FOREGROUND.
+	 */
+	static final IColorConstant CLASS_TEXT_FOREGROUND = new ColorConstant(51, 51, 153);
+
+	/**
+	 * The Constant CLASS_FOREGROUND.
+	 */
+	static final IColorConstant CLASS_FOREGROUND = IColorConstant.BLUE;
+
+	/**
+	 * The Constant CLASS_BACKGROUND.
+	 */
+	static final IColorConstant CLASS_BACKGROUND = IColorConstant.LIGHT_BLUE;
+
+	/**
+	 * Instantiates a new test add class feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestAddClassFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public boolean canAdd(IAddContext context) {
+		// check if user wants to add a EClass
+		if (context.getNewObject() instanceof EClass) {
+
+			ContainerShape targetContainer = context.getTargetContainer();
+
+			if (targetContainer instanceof Diagram) {
+				return true;
+			}
+
+			if (getBusinessObjectForPictogramElement(targetContainer) instanceof EPackage) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public PictogramElement add(IAddContext context) {
+		EClass addedClass = (EClass) context.getNewObject();
+		ContainerShape targetContainer = context.getTargetContainer();
+
+		// CONTAINER SHAPE WITH ROUNDED RECTANGLE
+		IPeCreateService pecService = Graphiti.getPeCreateService();
+		IGaService gaService=Graphiti.getGaService();
+		ContainerShape containerShape = pecService.createContainerShape(targetContainer, true);
+
+		// check whether valid size is available, e.g. if called from the create
+		// feature
+		int width = context.getWidth() <= 0 ? 150 : context.getWidth();
+		int height = context.getHeight() <= 0 ? 150 : context.getHeight();
+
+		{
+			// create and set graphics algorithm
+			RoundedRectangle roundedRectangle = gaService.createRoundedRectangle(containerShape, 5, 5);
+			roundedRectangle.setForeground(manageColor(CLASS_FOREGROUND));
+			roundedRectangle.setBackground(manageColor(CLASS_BACKGROUND));
+			roundedRectangle.setLineWidth(2);
+			gaService.setLocationAndSize(roundedRectangle, context.getX(), context.getY(), width, height);
+
+			// create link and wire it
+			link(containerShape, addedClass);
+		}
+
+		// SHAPE WITH LINE
+		{
+			// create shape for line
+			Shape shape = pecService.createShape(containerShape, false);
+
+			// create and set graphics algorithm
+			Polyline polyline = gaService.createPolyline(shape, new int[] { 0, 20, width, 20 });
+			polyline.setForeground(manageColor(CLASS_FOREGROUND));
+			polyline.setLineWidth(2);
+		}
+
+		// SHAPE WITH TEXT
+		{
+			// create shape for text
+			Shape shape = pecService.createShape(containerShape, false);
+
+			// create and set text graphics algorithm
+			Text text = gaService.createDefaultText(shape, addedClass.getName());
+			text.setForeground(manageColor(CLASS_TEXT_FOREGROUND));
+			text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
+			text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
+			text.getFont().setBold(true);
+			gaService.setLocationAndSize(text, 0, 0, width, 20);
+
+			// create link and wire it
+			link(shape, addedClass);
+		}
+
+		layoutPictogramElement(containerShape);
+
+		pecService.createChopboxAnchor(containerShape);
+
+		return containerShape;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestCreateClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestCreateClassFeature.java
new file mode 100644
index 0000000..a5a4614
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestCreateClassFeature.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+
+/**
+ * The Class TestCreateClassFeature.
+ */
+public class TestCreateClassFeature extends AbstractCreateFeature {
+
+	// private static final String TITLE = "Create Class";
+	//
+	// private static final String USER_QUESTION = "Enter new class name";
+
+	/**
+	 * Instantiates a new test create class feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestCreateClassFeature(IFeatureProvider fp) {
+		// set name and description of the creation feature
+		super(fp, "Class", "Create Class");
+	}
+
+	public boolean canCreate(ICreateContext context) {
+
+		ContainerShape targetContainer = context.getTargetContainer();
+
+		if (targetContainer instanceof Diagram) {
+			return true;
+		}
+
+		if (getBusinessObjectForPictogramElement(targetContainer) instanceof EPackage) {
+			return true;
+		}
+
+		return false;
+	}
+
+	public Object[] create(ICreateContext context) {
+		// ask user for Class name
+		// String newClassName = getPlatformService().askString(TITLE,
+		// USER_QUESTION, "");
+		// if (newClassName == null || newClassName.trim().length() == 0) {
+		// return EMPTY;
+		// }
+
+		String newClassName = "NewClass";
+
+		// create new Class
+		EClass newClass = EcoreFactory.eINSTANCE.createEClass();
+		newClass.setName(newClassName);
+		getDiagram().eResource().getContents().add(newClass);
+
+		// do the add
+		addGraphicalRepresentation(context, newClass);
+
+		// return newly created business object(s)
+		return new Object[] { newClass };
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestDirectEditingClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestDirectEditingClassFeature.java
new file mode 100644
index 0000000..0d27679
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestDirectEditingClassFeature.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.context.IDirectEditingContext;
+import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+
+/**
+ * The Class TestDirectEditingClassFeature.
+ */
+public class TestDirectEditingClassFeature extends AbstractDirectEditingFeature {
+
+	private static final String SPACE = " ";
+
+	/**
+	 * Instantiates a new test direct editing class feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestDirectEditingClassFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public int getEditingType() {
+		return TYPE_TEXT;
+	}
+
+	public String getInitialValue(IDirectEditingContext context) {
+		String ret = null;
+		PictogramElement pe = context.getPictogramElement();
+		Object bo = getBusinessObjectForPictogramElement(pe);
+		if (bo instanceof EClass) {
+			EClass ge = (EClass) bo;
+			ret = ge.getName();
+		}
+		return ret;
+	}
+
+	@Override
+	public String checkValueValid(String value, IDirectEditingContext context) {
+		if (value.length() < 1) {
+			return "Please enter any text as class name.";
+		}
+		if (value.contains(SPACE)) {
+			return "Spaces are not allowed in class names.";
+		}
+		if (value.contains("\n")) {
+			return "Line breakes are not allowed in class names.";
+		}
+		if (value.contains(":")) {
+			return "Colons are not allowed in class names.";
+		}
+
+		return null;
+	}
+
+	public void setValue(String value, IDirectEditingContext context) {
+		PictogramElement pe = context.getPictogramElement();
+		Object bo = getBusinessObjectForPictogramElement(pe);
+		if (bo instanceof EClass) {
+			EClass ge = (EClass) bo;
+			ge.setName(value);
+			if (pe instanceof Shape) {
+				updatePictogramElement(((Shape) pe).getContainer());
+			}
+		}
+	}
+
+	@Override
+	public boolean canExecute(IContext context) {
+		boolean ret = super.canExecute(context);
+		if (context instanceof IDirectEditingContext) {
+			IDirectEditingContext deContext = (IDirectEditingContext) context;
+			PictogramElement pe = deContext.getPictogramElement();
+			Object bo = getBusinessObjectForPictogramElement(pe);
+			if (bo instanceof EClass) {
+				ret = true;
+			}
+		}
+		return ret;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestLayoutClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestLayoutClassFeature.java
new file mode 100644
index 0000000..acb7b9c
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestLayoutClassFeature.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.datatypes.IDimension;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
+import org.eclipse.graphiti.mm.datatypes.Point;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.Polyline;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+/**
+ * The Class TestLayoutClassFeature.
+ */
+public class TestLayoutClassFeature extends AbstractLayoutFeature {
+	private static final int MIN_HEIGHT = 40;
+
+	private static final int MIN_WIDTH = 25;
+
+	/**
+	 * Instantiates a new test layout class feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestLayoutClassFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public boolean canLayout(ILayoutContext context) {
+		if (!(context.getPictogramElement() instanceof ContainerShape)) {
+			return false;
+		}
+
+		// return true, if linked business object is a MOF Class
+		Object bo = getBusinessObjectForPictogramElement(context.getPictogramElement());
+		return (bo instanceof EClass);
+	}
+
+	public boolean layout(ILayoutContext context) {
+		boolean ret = false;
+		ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+		GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
+
+		// height
+		{
+			int containerHeight = containerGa.getHeight();
+			if (containerHeight < MIN_HEIGHT) {
+				containerGa.setHeight(MIN_HEIGHT);
+				ret = true;
+			}
+		}
+
+		// width
+		{
+			int containerWidth = containerGa.getWidth();
+
+			if (containerWidth < MIN_WIDTH) {
+				containerGa.setWidth(MIN_WIDTH);
+				ret = true;
+			}
+
+			Collection<Shape> children = containerShape.getChildren();
+			for (Shape shape : children) {
+				GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm();
+				IGaService gaService = Graphiti.getGaService();
+				IDimension size = gaService.calculateSize(graphicsAlgorithm);
+				if (containerWidth != size.getWidth()) {
+					if (graphicsAlgorithm instanceof Polyline) {
+						Polyline polyline = (Polyline) graphicsAlgorithm;
+						Point secondPoint = polyline.getPoints().get(1);
+						polyline.getPoints().set(1, gaService.createPoint(containerWidth, secondPoint.getY()));
+						ret = true;
+					} else {
+						gaService.setWidth(graphicsAlgorithm, containerWidth);
+						ret = true;
+					}
+				}
+			}
+		}
+		return ret;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestMoveClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestMoveClassFeature.java
new file mode 100644
index 0000000..51bc35c
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestMoveClassFeature.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
+
+/**
+ * The Class TestMoveClassFeature.
+ */
+public class TestMoveClassFeature extends DefaultMoveShapeFeature {
+
+	/**
+	 * Instantiates a new test move class feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestMoveClassFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	@Override
+	public boolean canMoveShape(IMoveShapeContext context) {
+
+		if (getBusinessObjectForPictogramElement(context.getTargetContainer()) instanceof EClass) {
+			return false;
+		}
+		return true;
+	}
+
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestResizeClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestResizeClassFeature.java
new file mode 100644
index 0000000..d918519
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestResizeClassFeature.java
@@ -0,0 +1,20 @@
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+
+/**
+ * The Class TestResizeClassFeature.
+ */
+public class TestResizeClassFeature extends DefaultResizeShapeFeature {
+
+	/**
+	 * Instantiates a new test resize class feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestResizeClassFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestUpdateClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestUpdateClassFeature.java
new file mode 100644
index 0000000..152b06d
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/clazz/TestUpdateClassFeature.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.clazz;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.mm.pictograms.Text;
+
+/**
+ * The Class TestUpdateClassFeature.
+ */
+public class TestUpdateClassFeature extends AbstractUpdateFeature {
+
+	/**
+	 * The Constructor.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestUpdateClassFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public boolean canUpdate(IUpdateContext context) {
+		// return true, if linked business object is a MOF Class
+		Object bo = getBusinessObjectForPictogramElement(context.getPictogramElement());
+		return (bo instanceof EClass);
+	}
+
+	public IReason updateNeeded(IUpdateContext context) {
+		// two strings that have to be retrieved and compared
+		String pictogramName = null;
+		String businessName = null;
+
+		// Retrieve value from pictogram model
+		org.eclipse.graphiti.mm.pictograms.PictogramElement pictogramElement = context.getPictogramElement();
+		if (pictogramElement instanceof ContainerShape) {
+			ContainerShape cs = (ContainerShape) pictogramElement;
+			Collection<Shape> children = cs.getChildren();
+			for (Shape shape : children) {
+				if (shape.getGraphicsAlgorithm() instanceof Text) {
+					Text text = (org.eclipse.graphiti.mm.pictograms.Text) shape.getGraphicsAlgorithm();
+					pictogramName = text.getValue();
+				}
+			}
+		}
+
+		// Retrieve value from business model
+		Object bo = getBusinessObjectForPictogramElement(pictogramElement);
+		if (bo instanceof EClass) {
+			EClass eClass = (EClass) bo;
+			businessName = eClass.getName();
+		}
+
+		// compare values
+		boolean needed = (pictogramName == null || !pictogramName.equals(businessName));
+		if (needed) {
+			return Reason.createTrueReason("Name is out of date");
+		} else {
+			return Reason.createFalseReason();
+		}
+	}
+
+	public boolean update(IUpdateContext context) {
+
+		String businessName = null;
+
+		// Retrieve value from business model
+		PictogramElement pictogramElement = context.getPictogramElement();
+		Object bo = getBusinessObjectForPictogramElement(pictogramElement);
+		if (bo instanceof EClass) {
+			EClass mofClass = (EClass) bo;
+			businessName = mofClass.getName();
+		}
+
+		// Set value in pictogram model
+		if (pictogramElement instanceof ContainerShape) {
+			ContainerShape cs = (ContainerShape) pictogramElement;
+
+			Collection<Shape> children = cs.getChildren();
+			for (Shape shape : children) {
+				if (shape.getGraphicsAlgorithm() instanceof Text) {
+					Text text = (Text) shape.getGraphicsAlgorithm();
+					text.setValue(businessName);
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/RenamePackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/RenamePackageFeature.java
new file mode 100644
index 0000000..485e9cf
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/RenamePackageFeature.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.graphiti.examples.common.SampleUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICustomContext;
+import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+
+/**
+ * The Class RenamePackageFeature.
+ */
+public class RenamePackageFeature extends AbstractCustomFeature {
+
+	private static final String NAME = "Rename Package...";
+
+	private static final String DESCRIPTION = "Change Package Name";
+
+	/**
+	 * Instantiates a new rename package feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public RenamePackageFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	@Override
+	public String getName() {
+		return NAME;
+	}
+
+	@Override
+	public String getDescription() {
+		return DESCRIPTION;
+	}
+
+	@Override
+	public boolean canExecute(ICustomContext context) {
+		// allow rename if exactly one pictogram element (which represents a
+		// package) is selected
+		boolean ret = false;
+		PictogramElement[] pes = context.getPictogramElements();
+		if (pes != null && pes.length == 1) {
+			Object bo = getBusinessObjectForPictogramElement(pes[0]);
+			if (bo instanceof EPackage) {
+				ret = true;
+			}
+		}
+		return ret;
+	}
+
+	public void execute(ICustomContext context) {
+		PictogramElement[] pes = context.getPictogramElements();
+		if (pes != null && pes.length == 1) {
+			Object bo = getBusinessObjectForPictogramElement(pes[0]);
+			if (bo instanceof EPackage) {
+				EPackage p = (EPackage) bo;
+				String currentPackageName = p.getName();
+				// ask user for a new package name
+				String newPackageName = SampleUtil.askString(NAME, DESCRIPTION, currentPackageName);
+				if (newPackageName != null) {
+					p.setName(newPackageName);
+				}
+			}
+		}
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestAddPackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestAddPackageFeature.java
new file mode 100644
index 0000000..3a69a73
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestAddPackageFeature.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.Orientation;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Polyline;
+import org.eclipse.graphiti.mm.pictograms.RoundedRectangle;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.mm.pictograms.Text;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+import org.eclipse.graphiti.services.IPeCreateService;
+import org.eclipse.graphiti.util.ColorConstant;
+import org.eclipse.graphiti.util.IColorConstant;
+
+/**
+ * The Class TestAddPackageFeature.
+ */
+public class TestAddPackageFeature extends AbstractAddShapeFeature {
+
+	private static final IColorConstant PACKAGE_TEXT_FOREGROUND = new ColorConstant(51, 51, 153);
+
+	private static final IColorConstant PACKAGE_FOREGROUND = IColorConstant.BLACK;
+
+	private static final IColorConstant PACKAGE_BACKGROUND = new ColorConstant(255, 204, 153);
+
+	/**
+	 * Instantiates a new test add package feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestAddPackageFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public boolean canAdd(IAddContext context) {
+		// check if user wants to add a MOF package
+		if (context.getNewObject() instanceof EPackage) {
+
+			// check if user wants to add to a diagram
+			if (context.getTargetContainer() instanceof Diagram) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public PictogramElement add(IAddContext context) {
+		EPackage addedPackage = (EPackage) context.getNewObject();
+		Diagram targetDiagram = (Diagram) context.getTargetContainer();
+
+		// CONTAINER SHAPE WITH ROUNDED RECTANGLE
+		IPeCreateService pecService = Graphiti.getPeCreateService();
+		IGaService gaService=Graphiti.getGaService();
+		ContainerShape containerShape = pecService.createContainerShape(targetDiagram, true);
+
+		// check whether valid size is available, e.g. if called from the create
+		// feature
+		int width = context.getWidth() <= 0 ? 100 : context.getWidth();
+		int height = context.getHeight() <= 0 ? 50 : context.getHeight();
+
+		{
+			// create and set graphics algorithm
+			RoundedRectangle roundedRectangle = gaService.createRoundedRectangle(containerShape, 5, 5);
+			roundedRectangle.setForeground(manageColor(PACKAGE_FOREGROUND));
+			roundedRectangle.setBackground(manageColor(PACKAGE_BACKGROUND));
+			roundedRectangle.setLineWidth(2);
+			gaService.setLocationAndSize(roundedRectangle, context.getX(), context.getY(), width, height);
+
+			// create link and wire it
+			link(containerShape, addedPackage);
+		}
+
+		// SHAPE WITH LINE
+		{
+			// create shape for line
+			Shape shape = pecService.createShape(containerShape, false);
+
+			// create and set graphics algorithm
+			Polyline polyline = gaService.createPolyline(shape, new int[] { 0, 20, width, 20 });
+			polyline.setForeground(manageColor(PACKAGE_FOREGROUND));
+			polyline.setLineWidth(2);
+		}
+
+		// SHAPE WITH TEXT
+		{
+			// create shape for text
+			Shape shape = pecService.createShape(containerShape, false);
+
+			// create and set text graphics algorithm
+			Text text = gaService.createDefaultText(shape, addedPackage.getName());
+			text.setForeground(manageColor(PACKAGE_TEXT_FOREGROUND));
+			text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
+			text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
+			text.getFont().setBold(true);
+			gaService.setLocationAndSize(text, 0, 0, width, 20);
+
+			// create link and wire it
+			link(shape, addedPackage);
+		}
+
+		layoutPictogramElement(containerShape);
+
+		return containerShape;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestCreatePackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestCreatePackageFeature.java
new file mode 100644
index 0000000..c7448db
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestCreatePackageFeature.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.graphiti.examples.common.SampleUtil;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ICreateContext;
+import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+
+/**
+ * The Class TestCreatePackageFeature.
+ */
+public class TestCreatePackageFeature extends AbstractCreateFeature {
+
+	private static final String TITLE = "Create Package";
+
+	private static final String USER_QUESTION = "Enter new package name";
+
+	/**
+	 * Instantiates a new test create package feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestCreatePackageFeature(IFeatureProvider fp) {
+		// set name and description of the creation feature
+		super(fp, "Package", "Create Package");
+	}
+
+	public boolean canCreate(ICreateContext context) {
+		return context.getTargetContainer() instanceof Diagram;
+	}
+
+	public Object[] create(ICreateContext context) {
+		// ask user for package name
+		String newPackageName = SampleUtil.askString(TITLE, USER_QUESTION, "");
+		if (newPackageName == null || newPackageName.trim().length() == 0) {
+			return EMPTY;
+		}
+
+		// create new package
+		EPackage newPackage = EcoreFactory.eINSTANCE.createEPackage();
+		newPackage.setName(newPackageName);
+
+		getDiagram().eResource().getContents().add(newPackage);
+
+		// do the add
+		addGraphicalRepresentation(context, newPackage);
+
+		// return newly created business object(s)
+		return new Object[] { newPackage };
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestLayoutPackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestLayoutPackageFeature.java
new file mode 100644
index 0000000..f20bfe3
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestLayoutPackageFeature.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.graphiti.datatypes.IDimension;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.ILayoutContext;
+import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
+import org.eclipse.graphiti.mm.datatypes.Point;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.Polyline;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.services.IGaService;
+
+/**
+ * The Class TestLayoutPackageFeature.
+ */
+public class TestLayoutPackageFeature extends AbstractLayoutFeature {
+	private static final int MIN_HEIGHT = 40;
+
+	private static final int MIN_WIDTH = 25;
+
+	/**
+	 * Instantiates a new test layout package feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestLayoutPackageFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public boolean canLayout(ILayoutContext context) {
+		if (!(context.getPictogramElement() instanceof ContainerShape)) {
+			return false;
+		}
+
+		// return true, if linked business object is a EPackage
+		Object bo = getBusinessObjectForPictogramElement(context.getPictogramElement());
+		return (bo instanceof EPackage);
+	}
+
+	public boolean layout(ILayoutContext context) {
+		boolean ret = false;
+		ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
+		GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
+
+		// height
+		{
+			int containerHeight = containerGa.getHeight();
+			if (containerHeight < MIN_HEIGHT) {
+				containerGa.setHeight(MIN_HEIGHT);
+				ret = true;
+			}
+		}
+
+		// width
+		{
+			int containerWidth = containerGa.getWidth();
+
+			if (containerWidth < MIN_WIDTH) {
+				containerGa.setWidth(MIN_WIDTH);
+				ret = true;
+			}
+
+			Collection<Shape> children = containerShape.getChildren();
+			for (Shape shape : children) {
+				if (!(getBusinessObjectForPictogramElement(shape) instanceof EClass)) {
+					GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm();
+					IGaService gaService = Graphiti.getGaService();
+					IDimension size = gaService.calculateSize(graphicsAlgorithm);
+					if (containerWidth != size.getWidth()) {
+						if (graphicsAlgorithm instanceof Polyline) {
+							Polyline polyline = (Polyline) graphicsAlgorithm;
+							Point secondPoint = polyline.getPoints().get(1);
+							polyline.getPoints().set(1, gaService.createPoint(containerWidth, secondPoint.getY()));
+							ret = true;
+						} else {
+							gaService.setWidth(graphicsAlgorithm, containerWidth);
+							ret = true;
+						}
+
+					}
+				}
+			}
+		}
+		return ret;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestMovePackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestMovePackageFeature.java
new file mode 100644
index 0000000..d5f515d
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestMovePackageFeature.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IMoveShapeContext;
+import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
+
+/**
+ * The Class TestMovePackageFeature.
+ */
+public class TestMovePackageFeature extends DefaultMoveShapeFeature {
+
+	/**
+	 * Instantiates a new test move package feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestMovePackageFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	@Override
+	public boolean canMoveShape(IMoveShapeContext context) {
+
+		boolean ret = super.canMoveShape(context);
+
+		// check further details only if move allowed by default feature
+		if (ret) {
+
+			// don't allow move if package name has the length of one
+			Object bo = getBusinessObjectForPictogramElement(context.getShape());
+			if (bo instanceof EPackage) {
+				EPackage p = (EPackage) bo;
+				if (p.getName() != null && p.getName().length() == 1) {
+					ret = false;
+				}
+			}
+		}
+		return ret;
+	}
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestResizePackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestResizePackageFeature.java
new file mode 100644
index 0000000..225a96f
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestResizePackageFeature.java
@@ -0,0 +1,50 @@
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
+
+/**
+ * The Class TestResizePackageFeature.
+ */
+public class TestResizePackageFeature extends DefaultResizeShapeFeature {
+
+	/**
+	 * Instantiates a new test resize package feature.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestResizePackageFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	// @Override
+	// public boolean canResizeShape(IResizeShapeContext context) {
+	// GraphicsAlgorithm ga =
+	// context.getPictogramElement().getGraphicsAlgorithm();
+	// return (ga instanceof Polygon);
+	// }
+	//
+	// @Override
+	// public void resizeShape(IResizeShapeContext context) {
+	// PictogramElement pe = context.getPictogramElement();
+	// GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
+	// Polygon polygon = (Polygon) ga;
+	// Point point0 = (Point) polygon.getPoints().get(0);
+	// Point point1 = (Point) polygon.getPoints().get(1);
+	// Point point2 = (Point) polygon.getPoints().get(2);
+	// Point point3 = (Point) polygon.getPoints().get(3);
+	//
+	// int x = point0.getX();
+	// int y = point0.getY();
+	// int width = context.getWidth();
+	// int height = context.getHeight();
+	//
+	// point1.setX(x + width);
+	// point2.setX(x + width);
+	// point2.setY(y + height);
+	// point3.setY(y + height);
+	//
+	// layoutPictogramElement(pe);
+	// }
+}
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestUpdatePackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestUpdatePackageFeature.java
new file mode 100644
index 0000000..26c2a43
--- /dev/null
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/sample/ecore/features/pack/TestUpdatePackageFeature.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * <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>
+ *
+ *******************************************************************************/
+package org.eclipse.graphiti.sample.ecore.features.pack;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.IReason;
+import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.impl.AbstractUpdateFeature;
+import org.eclipse.graphiti.features.impl.Reason;
+import org.eclipse.graphiti.mm.pictograms.ContainerShape;
+import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.graphiti.mm.pictograms.Shape;
+import org.eclipse.graphiti.mm.pictograms.Text;
+
+/**
+ * The Class TestUpdatePackageFeature.
+ */
+public class TestUpdatePackageFeature extends AbstractUpdateFeature {
+
+	/**
+	 * The Constructor.
+	 * 
+	 * @param fp
+	 *            the fp
+	 */
+	public TestUpdatePackageFeature(IFeatureProvider fp) {
+		super(fp);
+	}
+
+	public boolean canUpdate(IUpdateContext context) {
+		// return true, if linked business object is a MOF package
+		Object bo = getBusinessObjectForPictogramElement(context.getPictogramElement());
+		return (bo instanceof EPackage);
+	}
+
+	public IReason updateNeeded(IUpdateContext context) {
+		// test
+		return Reason.createFalseReason();
+
+	}
+
+	public boolean update(IUpdateContext context) {
+
+		String businessName = null;
+
+		// Retrieve value from business model
+		PictogramElement pictogramElement = context.getPictogramElement();
+		Object bo = getBusinessObjectForPictogramElement(pictogramElement);
+		if (bo instanceof EPackage) {
+			EPackage mofPackage = (EPackage) bo;
+			businessName = mofPackage.getName();
+		}
+
+		// Set value in pictogram model
+		if (pictogramElement instanceof ContainerShape) {
+			ContainerShape cs = (ContainerShape) pictogramElement;
+			Collection<Shape> children = cs.getChildren();
+			for (Shape shape : children) {
+				if (shape.getGraphicsAlgorithm() instanceof Text) {
+					Text text = (Text) shape.getGraphicsAlgorithm();
+					text.setValue(businessName);
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+}