From 5ad2abeb570b51902a7ea4ce0efdcfaf8802a55a Mon Sep 17 00:00:00 2001
From: Lukas Ladenberger <lukas.ladenberger@googlemail.com>
Date: Wed, 25 Jul 2012 15:54:33 +0200
Subject: [PATCH] implemented table control

---
 .../icons/eclipse16/image_obj.gif             | Bin 0 -> 1051 bytes
 .../icons/eclipse16/overview_obj.gif          | Bin 0 -> 570 bytes
 .../icons/eclipse16/prop_ps.gif               | Bin 0 -> 343 bytes
 .../icons/eclipse16/prop_ps2.gif              | Bin 0 -> 335 bytes
 .../icons/eclipse16/prop_ps3.gif              | Bin 0 -> 336 bytes
 .../icons/icon_table.gif                      | Bin 0 -> 343 bytes
 de.bmotionstudio.gef.editor/plugin.xml        |  59 ++++++-
 .../gef/editor/AppContextMenuProvider.java    |   4 +-
 .../gef/editor/AttributeConstants.java        |   3 +
 .../editor/attribute/BAttributeColumns.java   |  42 +++++
 .../attribute/BAttributeCoordinates.java      |  28 +++-
 .../gef/editor/attribute/BAttributeRows.java  |  42 +++++
 .../gef/editor/attribute/BAttributeSize.java  |  29 +++-
 .../gef/editor/command/AddCommand.java        |  55 +++++++
 .../editor/command/ReorderPartCommand.java    |  36 +++++
 .../editpolicy/AppEditLayoutPolicy.java       |   2 +-
 .../BMotionStudioFlowEditPolicy.java          | 113 +++++++++++++
 .../BMotionStudioResizableEditPolicy.java     |  83 ++++++++++
 .../editor/figure/AbstractTableFigure.java    |  29 ++++
 .../gef/editor/figure/TableCellFigure.java    |  74 +++++++++
 .../gef/editor/figure/TableColumnFigure.java  |  28 ++++
 .../gef/editor/figure/TableFigure.java        |  32 ++++
 .../internal/BControlPropertySource.java      |  33 ++--
 .../gef/editor/model/BControl.java            |  72 ++++-----
 .../gef/editor/model/BTable.java              |  64 ++++++++
 .../gef/editor/model/BTableCell.java          |  47 ++++++
 .../gef/editor/model/BTableColumn.java        |  47 ++++++
 .../gef/editor/observer/ColumnObserver.java   |  73 +++++++++
 .../observer/wizard/WizardColumnObserver.java | 125 +++++++++++++++
 .../gef/editor/part/AppAbstractEditPart.java  |  20 +--
 .../gef/editor/part/BTableCellPart.java       |  77 +++++++++
 .../gef/editor/part/BTableColumnPart.java     |  83 ++++++++++
 .../gef/editor/part/BTablePart.java           | 151 ++++++++++++++++++
 .../gef/editor/service/BTableCellService.java |  29 ++++
 .../editor/service/BTableColumnService.java   |  29 ++++
 .../gef/editor/service/BTableService.java     |  24 +++
 36 files changed, 1452 insertions(+), 81 deletions(-)
 create mode 100644 de.bmotionstudio.gef.editor/icons/eclipse16/image_obj.gif
 create mode 100644 de.bmotionstudio.gef.editor/icons/eclipse16/overview_obj.gif
 create mode 100644 de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps.gif
 create mode 100644 de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps2.gif
 create mode 100644 de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps3.gif
 create mode 100644 de.bmotionstudio.gef.editor/icons/icon_table.gif
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeColumns.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeRows.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/AddCommand.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/ReorderPartCommand.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioFlowEditPolicy.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioResizableEditPolicy.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractTableFigure.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableCellFigure.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableColumnFigure.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableFigure.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTable.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableCell.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableColumn.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ColumnObserver.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardColumnObserver.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableCellPart.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableColumnPart.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTablePart.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableCellService.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableColumnService.java
 create mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableService.java

diff --git a/de.bmotionstudio.gef.editor/icons/eclipse16/image_obj.gif b/de.bmotionstudio.gef.editor/icons/eclipse16/image_obj.gif
new file mode 100644
index 0000000000000000000000000000000000000000..830be0ea08df3f7f3de47ec1e3b92a4052e4c85a
GIT binary patch
literal 1051
zcmZ?wbhEHb6krfw_|Cv^ASn1?aLC5M;Kwz!SNkVkojiSUQpT?2oP&K+?_9m}|KI;d
z51#)1_5bIOzdyeJ4-5?c^XK2MUw`t7C;a;T|L3oNKYsqrESd85<DV<nA7qtI{P6i#
zTIr;W@+s+MlQTeQ;>jzoe*ONNUp+CWygMLoK}f;;(1N+?<r6b1CgoT4JbnA?`>+2&
zZ5IOz7lf89%Bk!LEL&B-{Pu(yiz6po4sO^UH{o<(&HBkZpKZVLZOPV?C3Rglo__uO
z<KKs`zXRJ3M@>2(HQ`KX$HCZ%r$U;x^=y5-@95cx$>)PR_C-%VlUr7Q^y<@>pMF1m
z_dT$6%eG@zOX}K-C$5aitC_xPM_GMaQ}?82@4tQj{V!(Hj%`QIUU>WW{F^`J4Xu~n
z{5<>a@40t>&%gO~;qC8?(&~cR=IV~VJ$GK7d-waon;+-j{y6*g$Klgw&tJd!>)-#1
zrj{4qe%5w$J^b~rp{u*DrRCrM{~!PUj!#WY$x5qlZLDgjnKoy}rk$Hw+UsV_>1%GQ
z?&_}W>aMP;OzrQhoY-GBbyD$?x#>&iWzC*eFl$P|^hrg_W~Z*0o4$Nb+Oj$6%jRS*
zn4YtIR_cn`Y0GD)ub7jue0Jv2SvgB)X5U;Dv2RIpbz$oNUthWlf@k!%{r~qjCoXu$
zmW`WRGHzVHa49SBL2vz^{kyi;RGbYBIS>?hyRu?JaM0wi&^;SA{09Su5eyW6vM@3*
ztY**wg#jo}FmU`}2<MdX*s#FCX@Y{T)RYr}DsGeHJcC+16qXt#oSAYlsO|Jjy|{fD
zGgUSSN-3L8_#@zS$fZ+EFT_MBgM)`dwOa3CLt?YrWJMn?P8*hIz9N3p?2aZB9&w+b
z)x^T~t4Z^6v;6`-hn+^uCxjfBe%C05o(x`LIoHHfvFLG=d}GxCg#*Q0SNSY+yDUyF
zZ0tW^5t%Z<P$6N83{Ub3m6wU`52oo9Y!F}w@VX*pmU!gD45bg9VyxVsL^uo_8l|lA
zWL^l&aN=(9<qVqXwb(0kuC<5@N6p8hUaV}|8a^EX3mrMMm07$jE-pOGDI#W6^5Db4
O!|l9mn}vBe7_0%cYO{X;

literal 0
HcmV?d00001

diff --git a/de.bmotionstudio.gef.editor/icons/eclipse16/overview_obj.gif b/de.bmotionstudio.gef.editor/icons/eclipse16/overview_obj.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0624021bc1ecd0a712580622c66eb03987039afc
GIT binary patch
literal 570
zcmZ?wbhEHb6krfwc*ekxQ8p>RvM;ZyS2w)hAZnsX>}2zVX*MY{9n$AGWXy5Np6{A7
z-y?sKXZ|AZ!lgb%OZ-Zf`<E^YEL))+)~g%QXAnKnGJURj;<SqT4$F*r_61AJ>pScU
zmb#R!@@d@a+qgAq^3kX%M-yhBO`LtUf8Ud}=U(o-`sU!xcYbrOhA+6DwER}y+Peko
z?lx?DF#q`TtDpXV`u+d)&;Rd!{r~v;|I45M-~Rgl<<I|zFW<cW_5b(3|6l+9|MBnt
z@BjZB+Zvl%8+v;y`+6#8OfFh5GiUjnj0H1tZ{EE5|Nno6p#v0uvM@3*xH0H}oD7N+
z2KMO<ZcWWCt!?dX!otj=tm5n(+&ugOLd~)o8k$-<x+;3AYU<OPx<pu5+1NR`c=-gE
zxH;=@*}6^Nxp}kp9&MAo`*t=t=_|XsDj8}Y*S2tJcGQ<UE^nk@ZmwwR*le#ac|*)V
zM(U}tL$j^Eu!)JVm6h2?E4yat*ImNaKYvLyGwBySd0;q!{a_;_8)L+Y4T{b#0?JZc
HEDY8FkcqU&

literal 0
HcmV?d00001

diff --git a/de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps.gif b/de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d11c996e570dfe06518631ba3f0f1893a21f88d1
GIT binary patch
literal 343
zcmZ?wbhEHb6krfwxXQrL*t=xKh671O{Rss<85L8yrmfy{<npnzx1w`8<MO++tEc7E
zOe=3+&^BdNQ~%PIiOXgz*}iJak=;iwA3S+2wQNFu!_4BAx%K_ankTL3nYnh-{7wCH
z)=youb<T>NYquZUcHsQZLl+L5ymsX5t;1(-R&*|??pfS0VOjI!mCch^v`<^zJ!{>P
z4F{HOI<#fqnG+Z97B<gnpSE(t?h{AO-#K>S&av~iHtadMe)ow93pN}%f9pROFrWg(
zpDc_F3|0&}AYqW77}!c2<`#J9NcFq9Bq=Nq5EJEITyl^ne{-M)L)J|j!E0QmE(|jL
zZi<^P7AVZU958kD?pHr{W$9TxC{U_5syC^2(yS1!tT1p^V-uRdHhBu0nzKrUP<N?{
lv%aCJp^)LyWrq6BTov+jEV)uSHf`Rr$z%JDojV;FtN|>LqV50y

literal 0
HcmV?d00001

diff --git a/de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps2.gif b/de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2460e6a3f70de1a8e594535101cd9e8f4f3eb158
GIT binary patch
literal 335
zcmZ?wbhEHb6krfwxN5*~`S#<>w;r$9d}zX)4GUN8UcL43%FTz)T)sDJ`HqFF_blIV
zVE^&Ub5`!UeEaF-1)DG3e0=)iovr&$?>=&2(b|1i?mS(zZvWctM;ENwbK&}fiE}q>
z+I@1*(Ti7ZJ)XK~^U@9b7q8uO<m~mnS?i}Q-gf2o<N2%i96odH(8(){*6o|QbjR^?
zH#h7&(K2!Q*~|BioVmup!0;ao7)Sw%KUo+V7z`M6K$<{)VqnX0m{H)NBh~LVJxKDD
zg^LDTrcp_toP@YasFAMOq~NI&e(VrwYjR!M8M12q4sE}F?p2I@2Sgbdr0SH*or;S}
zOXNaz*md-D`X}g!7qqqObA;+D=<4ato3AT7MZdM3In-NEd-a;t9_u%3+~~+)4FGl9
BmKXp4

literal 0
HcmV?d00001

diff --git a/de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps3.gif b/de.bmotionstudio.gef.editor/icons/eclipse16/prop_ps3.gif
new file mode 100644
index 0000000000000000000000000000000000000000..963bf79d8097c47c7e71b2dcfbdf665fe401c0f5
GIT binary patch
literal 336
zcmZ?wbhEHb6krfwxN6RD=JLH2n-5K0wE67idlTktn6-Sz#JL+frmS4L;lRwLJC>~9
zzi`#=O}kIdS-I=Vt;h3M@9CMbX6^Q)Yjzwta`yV6lUMp?tzW+3!2aWx7p>iQ`r@6f
z`%a&@aC_0ZeV1=NzH;a3hMgylpSyYK=HqL3pG{t{dD`M_tG6Crux8KY+m9Em+rM)2
zp@pmWT)6&V-;oQuk6c*1cF*B6*Y+H}*fx1Z=hW3l&RlDmxSWB3;XfEK-~ft0Sr{1@
z%o%h*@*qDku;m_@UErZ3)$bPdMxi-`M>%NG#{)d7^DcBvW!$SF9?@;QL^njQRW-D$
zMndX}LBi_pS3jx}?iJ3-YG`b9=BO~OY;#s)W?*jWcV?|%=qP1%W-=BwW-y*N-<Zjn
Zr9yhD8B40k>NRUudu-UaX_F&^H2`Eer{w?u

literal 0
HcmV?d00001

diff --git a/de.bmotionstudio.gef.editor/icons/icon_table.gif b/de.bmotionstudio.gef.editor/icons/icon_table.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d11c996e570dfe06518631ba3f0f1893a21f88d1
GIT binary patch
literal 343
zcmZ?wbhEHb6krfwxXQrL*t=xKh671O{Rss<85L8yrmfy{<npnzx1w`8<MO++tEc7E
zOe=3+&^BdNQ~%PIiOXgz*}iJak=;iwA3S+2wQNFu!_4BAx%K_ankTL3nYnh-{7wCH
z)=youb<T>NYquZUcHsQZLl+L5ymsX5t;1(-R&*|??pfS0VOjI!mCch^v`<^zJ!{>P
z4F{HOI<#fqnG+Z97B<gnpSE(t?h{AO-#K>S&av~iHtadMe)ow93pN}%f9pROFrWg(
zpDc_F3|0&}AYqW77}!c2<`#J9NcFq9Bq=Nq5EJEITyl^ne{-M)L)J|j!E0QmE(|jL
zZi<^P7AVZU958kD?pHr{W$9TxC{U_5syC^2(yS1!tT1p^V-uRdHhBu0nzKrUP<N?{
lv%aCJp^)LyWrq6BTov+jEV)uSHf`Rr$z%JDojV;FtN|>LqV50y

literal 0
HcmV?d00001

diff --git a/de.bmotionstudio.gef.editor/plugin.xml b/de.bmotionstudio.gef.editor/plugin.xml
index c1986900..5be99e29 100644
--- a/de.bmotionstudio.gef.editor/plugin.xml
+++ b/de.bmotionstudio.gef.editor/plugin.xml
@@ -166,7 +166,7 @@
       </group>
       <control
             groupid="de.bmotionstudio.gef.editor.group.main"
-            icon="icons/icon_image.gif"
+            icon="icons/eclipse16/image_obj.gif"
             id="de.bmotionstudio.gef.editor.image"
             name="Image"
             service="de.bmotionstudio.gef.editor.service.BImageService">
@@ -194,7 +194,7 @@
       </control>
       <control
             groupid="de.bmotionstudio.gef.editor.group.main"
-            icon="icons/icon_composite.gif"
+            icon="icons/eclipse16/overview_obj.gif"
             id="de.bmotionstudio.gef.editor.composite"
             name="Composite"
             service="de.bmotionstudio.gef.editor.service.BCompositeService">
@@ -234,6 +234,27 @@
             name="Connection"
             service="de.bmotionstudio.gef.editor.service.BConnectionService">
       </control>
+      <control
+            groupid="de.bmotionstudio.gef.editor.group.main"
+            icon="icons/eclipse16/prop_ps.gif"
+            id="de.bmotionstudio.gef.editor.table"
+            name="Table"
+            service="de.bmotionstudio.gef.editor.service.BTableService">
+      </control>
+      <control
+            groupid="de.bmotionstudio.gef.editor.group.main"
+            icon="icons/eclipse16/prop_ps2.gif"
+            id="de.bmotionstudio.gef.editor.tablecolumn"
+            name="Column"
+            service="de.bmotionstudio.gef.editor.service.BTableColumnService">
+      </control>
+      <control
+            groupid="de.bmotionstudio.gef.editor.group.main"
+            icon="icons/eclipse16/prop_ps3.gif"
+            id="de.bmotionstudio.gef.editor.tablecell"
+            name="Cell"
+            service="de.bmotionstudio.gef.editor.service.BTableCellService">
+      </control>
    </extension>
    <extension
          point="de.bmotionstudio.gef.editor.observer">
@@ -269,6 +290,10 @@
             class="de.bmotionstudio.gef.editor.observer.ExternalObserverScript"
             name="External Observer Script">
       </observer>
+      <observer
+            class="de.bmotionstudio.gef.editor.observer.ColumnObserver"
+            name="Column Observer">
+      </observer>
    </extension>
    <extension
          point="de.bmotionstudio.gef.editor.schedulerEvent">
@@ -349,6 +374,12 @@
             <control
                   id="de.bmotionstudio.gef.editor.connection">
             </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.tablecell">
+            </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.table">
+            </control>
          </observer>
          <observer
                id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
@@ -379,6 +410,9 @@
             <control
                   id="de.bmotionstudio.gef.editor.ellipse">
             </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.table">
+            </control>
          </observer>
          <observer
                id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay">
@@ -394,6 +428,9 @@
             <control
                   id="de.bmotionstudio.gef.editor.button">
             </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.tablecell">
+            </control>
          </observer>
          <observer
                id="de.bmotionstudio.gef.editor.observer.SetAttribute">
@@ -427,6 +464,12 @@
             <control
                   id="de.bmotionstudio.gef.editor.textfield">
             </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.tablecell">
+            </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.table">
+            </control>
          </observer>
          <observer
                id="de.bmotionstudio.gef.editor.observer.SwitchChildCoordinates">
@@ -469,6 +512,12 @@
             <control
                   id="de.bmotionstudio.gef.editor.textfield">
             </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.tablecell">
+            </control>
+            <control
+                  id="de.bmotionstudio.gef.editor.table">
+            </control>
          </observer>
          <observer
                id="de.bmotionstudio.gef.editor.observer.SwitchImage">
@@ -485,6 +534,12 @@
                   id="de.bmotionstudio.gef.editor.ellipse">
             </control>
          </observer>
+         <observer
+               id="de.bmotionstudio.gef.editor.observer.ColumnObserver">
+            <control
+                  id="de.bmotionstudio.gef.editor.tablecolumn">
+            </control>
+         </observer>
       </include>
    </extension>   
 </plugin>
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AppContextMenuProvider.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AppContextMenuProvider.java
index 68d5c225..221e61ab 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AppContextMenuProvider.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AppContextMenuProvider.java
@@ -174,7 +174,9 @@ public class AppContextMenuProvider extends ContextMenuProvider {
 					String langID = configurationElement
 							.getAttribute("language");
 
-					if (langID.equals(control.getVisualization().getLanguage())) {
+					if (langID != null
+							&& langID.equals(control.getVisualization()
+									.getLanguage())) {
 
 						for (IConfigurationElement cObserver : configurationElement
 								.getChildren("observer")) {
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java
index 30a8655e..56ddf9af 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java
@@ -16,6 +16,9 @@ public final class AttributeConstants {
 	public static final String ATTRIBUTE_ID = "de.bmotionstudio.gef.editor.attribute.BAttributeID";
 	public static final String ATTRIBUTE_VISIBLE = "de.bmotionstudio.gef.editor.attribute.BAttributeVisible";
 
+	public static final String ATTRIBUTE_COLUMNS = "de.bmotionstudio.gef.editor.attribute.BAttributeColumns";
+	public static final String ATTRIBUTE_ROWS = "de.bmotionstudio.gef.editor.attribute.BAttributeRows";
+
 	public static final String ATTRIBUTE_BACKGROUND_IMAGE = "de.bmotionstudio.gef.editor.attribute.BAttributeImage";
 	public static final String ATTRIBUTE_BACKGROUND_COLOR = "de.bmotionstudio.gef.editor.attribute.BAttributeBackgroundColor";
 	public static final String ATTRIBUTE_FOREGROUND_COLOR = "de.bmotionstudio.gef.editor.attribute.BAttributeForegroundColor";
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeColumns.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeColumns.java
new file mode 100644
index 00000000..12a636d1
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeColumns.java
@@ -0,0 +1,42 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+
+package de.bmotionstudio.gef.editor.attribute;
+
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.property.IntegerPropertyDescriptor;
+
+public class BAttributeColumns extends AbstractAttribute {
+
+	public BAttributeColumns(Object value) {
+		super(value);
+	}
+
+	public PropertyDescriptor preparePropertyDescriptor() {
+		IntegerPropertyDescriptor descriptor = new IntegerPropertyDescriptor(
+				getID(), getName());
+		return descriptor;
+	}
+
+	@Override
+	public String validateValue(Object value, BControl control) {
+		if (!(String.valueOf(value)).trim().matches("\\d*")) {
+			return "Value must be a number";
+		}
+		if ((String.valueOf(value)).trim().length() == 0) {
+			return "Value must not be empty string";
+		}
+		return null;
+	}
+
+	@Override
+	public String getName() {
+		return "Columns";
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeCoordinates.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeCoordinates.java
index e251e832..2aeb359d 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeCoordinates.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeCoordinates.java
@@ -27,9 +27,12 @@ public class BAttributeCoordinates extends AbstractAttribute {
 				Point point = (Point) element;
 				StringBuffer buf = new StringBuffer();
 				buf.append("[");
-				buf.append(point.x);
-				buf.append(",  ");
-				buf.append(point.y);
+				if (point.x >= 0)
+					buf.append(point.x);
+				if (point.y >= 0) {
+					buf.append(",  ");
+					buf.append(point.y);
+				}
 				buf.append("]");
 				return buf.toString();
 			}
@@ -39,11 +42,22 @@ public class BAttributeCoordinates extends AbstractAttribute {
 
 	@Override
 	public Object getEditableValue() {
-		int x = Integer.valueOf(getChildren()
-				.get(AttributeConstants.ATTRIBUTE_X).getValue().toString());
-		int y = Integer.valueOf(getChildren()
-				.get(AttributeConstants.ATTRIBUTE_Y).getValue().toString());
+
+		AbstractAttribute atrX = getChildren().get(
+				AttributeConstants.ATTRIBUTE_X);
+		AbstractAttribute atrY = getChildren().get(
+				AttributeConstants.ATTRIBUTE_Y);
+
+		int x = -1;
+		int y = -1;
+
+		if (atrX != null)
+			x = Integer.valueOf(atrX.getValue().toString());
+		if (atrY != null)
+			y = Integer.valueOf(atrY.getValue().toString());
+
 		return new Point(x, y);
+
 	}
 
 	@Override
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeRows.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeRows.java
new file mode 100644
index 00000000..b3df0f42
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeRows.java
@@ -0,0 +1,42 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+
+package de.bmotionstudio.gef.editor.attribute;
+
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.property.IntegerPropertyDescriptor;
+
+public class BAttributeRows extends AbstractAttribute {
+
+	public BAttributeRows(Object value) {
+		super(value);
+	}
+
+	public PropertyDescriptor preparePropertyDescriptor() {
+		IntegerPropertyDescriptor descriptor = new IntegerPropertyDescriptor(
+				getID(), getName());
+		return descriptor;
+	}
+
+	@Override
+	public String validateValue(Object value, BControl control) {
+		if (!(String.valueOf(value)).trim().matches("\\d*")) {
+			return "Value must be a number";
+		}
+		if ((String.valueOf(value)).trim().length() == 0) {
+			return "Value must not be empty string";
+		}
+		return null;
+	}
+
+	@Override
+	public String getName() {
+		return "Rows";
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeSize.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeSize.java
index 5024a0e3..1920190f 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeSize.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeSize.java
@@ -27,9 +27,12 @@ public class BAttributeSize extends AbstractAttribute {
 				Point point = (Point) element;
 				StringBuffer buf = new StringBuffer();
 				buf.append("[");
-				buf.append(point.x);
-				buf.append(",  ");
-				buf.append(point.y);
+				if (point.x >= 0)
+					buf.append(point.x);
+				if (point.y >= 0) {
+					buf.append(",  ");
+					buf.append(point.y);
+				}
 				buf.append("]");
 				return buf.toString();
 			}
@@ -39,12 +42,22 @@ public class BAttributeSize extends AbstractAttribute {
 
 	@Override
 	public Object getEditableValue() {
-		int width = Integer.valueOf(getChildren()
-				.get(AttributeConstants.ATTRIBUTE_WIDTH).getValue().toString());
-		int height = Integer
-				.valueOf(getChildren().get(AttributeConstants.ATTRIBUTE_HEIGHT)
-						.getValue().toString());
+
+		AbstractAttribute atrWidth = getChildren().get(
+				AttributeConstants.ATTRIBUTE_WIDTH);
+		AbstractAttribute atrHeight = getChildren().get(
+				AttributeConstants.ATTRIBUTE_HEIGHT);
+
+		int width = -1;
+		int height = -1;
+
+		if (atrWidth != null)
+			width = Integer.valueOf(atrWidth.getValue().toString());
+		if (atrHeight != null)
+			height = Integer.valueOf(atrHeight.getValue().toString());
+
 		return new Point(width, height);
+
 	}
 
 	@Override
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/AddCommand.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/AddCommand.java
new file mode 100644
index 00000000..8310dc43
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/AddCommand.java
@@ -0,0 +1,55 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+
+package de.bmotionstudio.gef.editor.command;
+
+import de.bmotionstudio.gef.editor.model.BControl;
+
+public class AddCommand extends org.eclipse.gef.commands.Command {
+
+	private BControl child;
+	private BControl parent;
+	private int index = -1;
+
+	public AddCommand() {
+		super("Add Control");
+	}
+
+	public void execute() {
+		if (index < 0)
+			parent.addChild(child);
+		else
+			parent.addChild(child, index);
+	}
+
+	public BControl getParent() {
+		return parent;
+	}
+
+	public void redo() {
+		if (index < 0)
+			parent.addChild(child);
+		else
+			parent.addChild(child, index);
+	}
+
+	public void setChild(BControl subpart) {
+		child = subpart;
+	}
+
+	public void setIndex(int i) {
+		index = i;
+	}
+
+	public void setParent(BControl newParent) {
+		parent = newParent;
+	}
+
+	public void undo() {
+		parent.removeChild(child);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/ReorderPartCommand.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/ReorderPartCommand.java
new file mode 100644
index 00000000..4303b61d
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/ReorderPartCommand.java
@@ -0,0 +1,36 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+package de.bmotionstudio.gef.editor.command;
+
+import org.eclipse.gef.commands.Command;
+
+import de.bmotionstudio.gef.editor.model.BControl;
+
+public class ReorderPartCommand extends Command {
+
+	private int oldIndex, newIndex;
+	private BControl child;
+	private BControl parent;
+
+	public ReorderPartCommand(BControl child, BControl parent, int newIndex) {
+		super("Reorder Control");
+		this.child = child;
+		this.parent = parent;
+		this.newIndex = newIndex;
+	}
+
+	public void execute() {
+		oldIndex = parent.getChildrenArray().indexOf(child);
+		parent.removeChild(child);
+		parent.addChild(child, newIndex);
+	}
+
+	public void undo() {
+		parent.removeChild(child);
+		parent.addChild(child, oldIndex);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/AppEditLayoutPolicy.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/AppEditLayoutPolicy.java
index b379e570..5fcc1fe2 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/AppEditLayoutPolicy.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/AppEditLayoutPolicy.java
@@ -23,8 +23,8 @@ import de.bmotionstudio.gef.editor.AttributeConstants;
 import de.bmotionstudio.gef.editor.attribute.BAttributeHeight;
 import de.bmotionstudio.gef.editor.attribute.BAttributeWidth;
 import de.bmotionstudio.gef.editor.command.BControlChangeLayoutCommand;
-import de.bmotionstudio.gef.editor.command.CreateCommand;
 import de.bmotionstudio.gef.editor.command.ChangeGuideCommand;
+import de.bmotionstudio.gef.editor.command.CreateCommand;
 import de.bmotionstudio.gef.editor.model.BControl;
 import de.bmotionstudio.gef.editor.model.BMotionGuide;
 import de.bmotionstudio.gef.editor.part.AppAbstractEditPart;
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioFlowEditPolicy.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioFlowEditPolicy.java
new file mode 100644
index 00000000..95681949
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioFlowEditPolicy.java
@@ -0,0 +1,113 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+package de.bmotionstudio.gef.editor.editpolicy;
+
+import org.eclipse.draw2d.FlowLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.FlowLayoutEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+
+import de.bmotionstudio.gef.editor.command.AddCommand;
+import de.bmotionstudio.gef.editor.command.ReorderPartCommand;
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.model.BTable;
+import de.bmotionstudio.gef.editor.model.BTableCell;
+import de.bmotionstudio.gef.editor.model.BTableColumn;
+
+public class BMotionStudioFlowEditPolicy extends FlowLayoutEditPolicy {
+
+	@Override
+	protected Command createAddCommand(EditPart child, EditPart after) {
+
+		BControl childModel = (BControl) child.getModel();
+		BControl parentModel = (BControl) getHost().getModel();
+		if ((childModel instanceof BTableColumn && parentModel instanceof BTable)
+				|| (childModel instanceof BTableCell
+						&& parentModel instanceof BTableColumn && childModel
+						.getParent().equals(parentModel))) {
+			AddCommand command = new AddCommand();
+			command.setChild(childModel);
+			command.setParent(parentModel);
+			int index = getHost().getChildren().indexOf(after);
+			command.setIndex(index);
+			return command;
+		}
+		return null;
+	}
+
+	/**
+	 * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#createChildEditPolicy(org.eclipse.gef.EditPart)
+	 */
+	protected EditPolicy createChildEditPolicy(EditPart child) {
+		BMotionStudioResizableEditPolicy policy = new BMotionStudioResizableEditPolicy();
+		policy.setResizeDirections(PositionConstants.EAST
+				| PositionConstants.WEST);
+		return policy;
+	}
+
+	@Override
+	protected Command createMoveChildCommand(EditPart child, EditPart after) {
+
+
+		BControl childModel = (BControl) child.getModel();
+		BControl parentModel = (BControl) getHost().getModel();
+
+		if ((childModel instanceof BTableColumn && parentModel instanceof BTable)
+				|| (childModel instanceof BTableCell && parentModel instanceof BTableColumn)) {
+			int oldIndex = getHost().getChildren().indexOf(child);
+			int newIndex = getHost().getChildren().indexOf(after);
+			if (newIndex > oldIndex)
+				newIndex--;
+			ReorderPartCommand command = new ReorderPartCommand(childModel,
+					parentModel, newIndex);
+			return command;
+		}
+
+		return null;
+
+	}
+
+	@Override
+	protected Command getCreateCommand(CreateRequest request) {
+		// CreateCommand command = new CreateCommand(
+		// (BControl) request.getNewObject(), (BControl) getHost()
+		// .getModel());
+		// EditPart after = getInsertionReference(request);
+		// command.setLayout(new Rectangle(0, 0, 100, 25));
+		// int index = getHost().getChildren().indexOf(after);
+		// command.setIndex(index);
+		// return command;
+		return null;
+	}
+
+	@Override
+	protected boolean isHorizontal() {
+		IFigure figure = getLayoutContainer();
+		if (figure.getLayoutManager() instanceof ToolbarLayout) {
+			return ((ToolbarLayout) figure.getLayoutManager()).isHorizontal();
+		} else if (figure.getLayoutManager() instanceof FlowLayout) {
+			return ((FlowLayout) figure.getLayoutManager()).isHorizontal();
+		}
+		return false;
+	}
+
+	@Override
+	public void showLayoutTargetFeedback(Request request) {
+		if (request instanceof CreateRequest) {
+			Object newObject = ((CreateRequest) request).getNewObject();
+			if (!(newObject instanceof BTableColumn || newObject instanceof BTableCell))
+				return;
+		}
+		super.showLayoutTargetFeedback(request);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioResizableEditPolicy.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioResizableEditPolicy.java
new file mode 100644
index 00000000..cbe96daa
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/editpolicy/BMotionStudioResizableEditPolicy.java
@@ -0,0 +1,83 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+package de.bmotionstudio.gef.editor.editpolicy;
+
+import java.util.Iterator;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editpolicies.ResizableEditPolicy;
+
+public class BMotionStudioResizableEditPolicy extends ResizableEditPolicy {
+
+	/**
+	 * Creates the figure used for feedback.
+	 * 
+	 * @return the new feedback figure
+	 */
+	protected IFigure createDragSourceFeedbackFigure() {
+		IFigure figure = createFigure((GraphicalEditPart) getHost(), null);
+		figure.setBounds(getInitialFeedbackBounds());
+		addFeedback(figure);
+		return figure;
+	}
+
+	protected IFigure createFigure(GraphicalEditPart part, IFigure parent) {
+		IFigure child = getCustomFeedbackFigure(part.getModel());
+
+		if (parent != null)
+			parent.add(child);
+
+		Rectangle childBounds = part.getFigure().getBounds().getCopy();
+
+		IFigure walker = part.getFigure().getParent();
+
+		while (walker != ((GraphicalEditPart) part.getParent()).getFigure()) {
+			walker.translateToParent(childBounds);
+			walker = walker.getParent();
+		}
+
+		child.setBounds(childBounds);
+
+		Iterator<?> i = part.getChildren().iterator();
+
+		while (i.hasNext())
+			createFigure((GraphicalEditPart) i.next(), child);
+
+		return child;
+	}
+
+	protected IFigure getCustomFeedbackFigure(Object modelPart) {
+		IFigure figure;
+		figure = new RectangleFigure();
+		((RectangleFigure) figure).setXOR(true);
+		((RectangleFigure) figure).setFill(true);
+		figure.setBackgroundColor(ColorConstants.blue);
+		figure.setForegroundColor(ColorConstants.white);
+		return figure;
+	}
+
+	/**
+	 * Returns the layer used for displaying feedback.
+	 * 
+	 * @return the feedback layer
+	 */
+	protected IFigure getFeedbackLayer() {
+		return getLayer(LayerConstants.SCALED_FEEDBACK_LAYER);
+	}
+
+	/**
+	 * @see org.eclipse.gef.editpolicies.NonResizableEditPolicy#getInitialFeedbackBounds()
+	 */
+	protected Rectangle getInitialFeedbackBounds() {
+		return getHostFigure().getBounds();
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractTableFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractTableFigure.java
new file mode 100644
index 00000000..2a3cad0b
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractTableFigure.java
@@ -0,0 +1,29 @@
+package de.bmotionstudio.gef.editor.figure;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+public class AbstractTableFigure extends AbstractBMotionFigure {
+
+	private Color foregroundColor;
+
+	@Override
+	public Color getForegroundColor() {
+		return foregroundColor;
+	}
+
+	public void setForegroundColor(RGB rgb) {
+		if (foregroundColor != null)
+			foregroundColor.dispose();
+		this.foregroundColor = new Color(Display.getDefault(), rgb);
+		repaint();
+	}
+
+	@Override
+	public void deactivateFigure() {
+		if (foregroundColor != null)
+			foregroundColor.dispose();
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableCellFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableCellFigure.java
new file mode 100644
index 00000000..09fa6fa8
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableCellFigure.java
@@ -0,0 +1,74 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+
+package de.bmotionstudio.gef.editor.figure;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+public class TableCellFigure extends AbstractTableFigure {
+
+	private String text;
+	private Color backgroundColor;
+	private Color textColor;
+
+	public TableCellFigure() {
+		setOpaque(true);
+	}
+
+	@Override
+	protected void paintBorder(Graphics g) {
+		Rectangle r = getClientArea();
+		g.setBackgroundColor(backgroundColor);
+		g.fillRectangle(r.x, r.y, r.x + r.width, r.y + r.height);
+		g.setForegroundColor(textColor);
+		g.drawText(text, r.x + 3, r.y + 3);
+		Color foregroundColor = getForegroundColor();
+		if (foregroundColor != null)
+			g.setForegroundColor(foregroundColor);
+		g.drawLine(r.x, r.y, r.x + r.width, r.y);
+	}
+
+	public String getText() {
+		return text;
+	}
+
+	public void setText(String text) {
+		this.text = text;
+		repaint();
+	}
+
+	public void setBackgroundColor(RGB rgb) {
+		if (backgroundColor != null)
+			backgroundColor.dispose();
+		backgroundColor = new Color(Display.getDefault(), rgb);
+		repaint();
+	}
+
+	public void setTextColor(RGB rgb) {
+		if (textColor != null)
+			textColor.dispose();
+		textColor = new Color(Display.getDefault(), rgb);
+		repaint();
+	}
+
+	@Override
+	public void deactivateFigure() {
+		if (backgroundColor != null)
+			backgroundColor.dispose();
+		if (textColor != null)
+			textColor.dispose();
+		super.deactivateFigure();
+	}
+
+	public void setFont(String string) {
+		// TODO Auto-generated method stub
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableColumnFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableColumnFigure.java
new file mode 100644
index 00000000..e036e5d6
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableColumnFigure.java
@@ -0,0 +1,28 @@
+package de.bmotionstudio.gef.editor.figure;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+
+public class TableColumnFigure extends AbstractTableFigure {
+
+	public TableColumnFigure() {
+		ToolbarLayout toolbarLayout = new ToolbarLayout();
+		setLayoutManager(toolbarLayout);
+		setOpaque(true);
+	}
+
+	@Override
+	protected void paintBorder(Graphics g) {
+		Rectangle r = getClientArea();
+		Color foregroundColor = getForegroundColor();
+		if (foregroundColor != null)
+			g.setForegroundColor(foregroundColor);
+		g.drawLine(r.x, r.y, r.x + r.width, r.y);
+		g.drawLine(r.x, r.y, r.x, r.y + r.height - 1);
+		g.drawLine(r.x, r.y + r.height - 1, r.x + r.width, r.y + r.height - 1);
+		super.paintBorder(g);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableFigure.java
new file mode 100644
index 00000000..fb322781
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/TableFigure.java
@@ -0,0 +1,32 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+
+package de.bmotionstudio.gef.editor.figure;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+public class TableFigure extends AbstractTableFigure {
+
+	public TableFigure() {
+		ToolbarLayout toolbarLayout = new ToolbarLayout();
+		toolbarLayout.setHorizontal(true);
+		toolbarLayout.setStretchMinorAxis(false);
+		setLayoutManager(toolbarLayout);
+		setOpaque(true);
+	}
+
+	@Override
+	protected void paintBorder(Graphics g) {
+		Rectangle r = getClientArea();
+		g.setForegroundColor(getForegroundColor());
+		g.drawLine(r.x + r.width - 1, r.y, r.x + r.width - 1, r.y + r.height
+				- 1);
+		super.paintBorder(g);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/internal/BControlPropertySource.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/internal/BControlPropertySource.java
index 6d27311b..0dffa83a 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/internal/BControlPropertySource.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/internal/BControlPropertySource.java
@@ -30,27 +30,32 @@ public class BControlPropertySource extends AbstractAttribute {
 
 		for (AbstractAttribute atr : control.getAttributes().values()) {
 
-			atr.setControl(control);
+			if (atr.show()) {
 
-			String group = atr.getGroup();
+				atr.setControl(control);
 
-			if (group != null) {
+				String group = atr.getGroup();
 
-				// If group is root node --> add to root
-				if (group.equals(ROOT)) {
-					addChild(atr);
-				} else {
-					AbstractAttribute groupAtr = control.getAttribute(group);
-					if (groupAtr != null) {
-						groupAtr.addChild(atr);
+				if (group != null) {
+
+					// If group is root node --> add to root
+					if (group.equals(ROOT)) {
+						addChild(atr);
 					} else {
-						miscAttribute.addChild(atr);
+						AbstractAttribute groupAtr = control
+								.getAttribute(group);
+						if (groupAtr != null) {
+							groupAtr.addChild(atr);
+						} else {
+							miscAttribute.addChild(atr);
+						}
 					}
+
+				} else {
+					// No group, add to misc attribute node
+					miscAttribute.addChild(atr);
 				}
 
-			} else {
-				// No group, add to misc attribute node
-				miscAttribute.addChild(atr);
 			}
 
 		}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java
index 5b69d569..0af0557d 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java
@@ -16,7 +16,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.UUID;
 
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.draw2d.geometry.Dimension;
@@ -29,7 +28,6 @@ import de.bmotionstudio.gef.editor.Animation;
 import de.bmotionstudio.gef.editor.AttributeConstants;
 import de.bmotionstudio.gef.editor.BMotionEditorPlugin;
 import de.bmotionstudio.gef.editor.BMotionStudioImage;
-import de.bmotionstudio.gef.editor.IBControlService;
 import de.bmotionstudio.gef.editor.attribute.AbstractAttribute;
 import de.bmotionstudio.gef.editor.attribute.BAttributeCoordinates;
 import de.bmotionstudio.gef.editor.attribute.BAttributeCustom;
@@ -369,6 +367,16 @@ public abstract class BControl implements IAdaptable, Cloneable {
 		getListeners().firePropertyChange(PROPERTY_ADD, index, child);
 	}
 
+	public void removeAllChildren() {
+		getChildrenArray().clear();
+		getListeners().firePropertyChange(PROPERTY_REMOVE, null, null);
+	}
+
+	public boolean removeChild(int index) {
+		BControl control = children.get(index);
+		return removeChild(control);
+	}
+
 	public boolean removeChild(BControl child) {
 		boolean b = children.remove(child);
 		if (b)
@@ -587,50 +595,38 @@ public abstract class BControl implements IAdaptable, Cloneable {
 
 		BControl clonedControl = (BControl) super.clone();
 
-		IConfigurationElement configElement = BMotionEditorPlugin
-				.getControlServices().get(getType());
-		if (configElement != null) {
-
-			try {
-
-				IBControlService service = (IBControlService) configElement
-						.createExecutableExtension("service");
-				clonedControl = service.createControl(visualization);
-
-				clonedControl.setParent(getParent());
-
-				String newID = clonedControl.getID();
-
-				Map<String, AbstractAttribute> newProperties = new HashMap<String, AbstractAttribute>();
-				for (Entry<String, AbstractAttribute> e : getAttributes()
-						.entrySet()) {
-					AbstractAttribute idAtr = e.getValue().clone();
-					newProperties.put(e.getKey(), idAtr);
-				}
+		clonedControl.setParent(getParent());
 
-				clonedControl.setAttributes(newProperties);
-				clonedControl.setAttributeValue(
-						AttributeConstants.ATTRIBUTE_ID, newID);
+		String newID = clonedControl.getID();
 
-				Iterator<BControl> it = getChildrenArray().iterator();
-				while (it.hasNext()) {
-					clonedControl.addChild(((BControl) it.next()).clone());
-				}
+		Map<String, AbstractAttribute> newProperties = new HashMap<String, AbstractAttribute>();
+		for (Entry<String, AbstractAttribute> e : getAttributes().entrySet()) {
+			AbstractAttribute idAtr = e.getValue().clone();
+			newProperties.put(e.getKey(), idAtr);
+		}
 
-				for (Observer observer : observers.values()) {
-					clonedControl.addObserver(observer.clone());
-				}
+		clonedControl.setAttributes(newProperties);
+		clonedControl.setAttributeValue(AttributeConstants.ATTRIBUTE_ID, newID);
 
-				for (Map.Entry<String, SchedulerEvent> e : events.entrySet()) {
-					clonedControl.addEvent(e.getKey(), e.getValue().clone());
-				}
+		clonedControl.setChildrenArray(new BControlList());
+		Iterator<BControl> it = getChildrenArray().iterator();
+		while (it.hasNext()) {
+			clonedControl.addChild(((BControl) it.next()).clone());
+		}
 
-			} catch (CoreException e) {
-				e.printStackTrace();
-			}
+		clonedControl.setObserverMap(new HashMap<String, Observer>());
+		for (Observer observer : observers.values()) {
+			clonedControl.addObserver(observer.clone());
+		}
 
+		clonedControl.setEventMap(new HashMap<String, SchedulerEvent>());
+		for (Map.Entry<String, SchedulerEvent> e : events.entrySet()) {
+			clonedControl.addEvent(e.getKey(), e.getValue().clone());
 		}
 
+		clonedControl.listeners = new PropertyChangeSupport(clonedControl);
+		clonedControl.observerListener = new ArrayList<IObserverListener>();
+
 		return clonedControl;
 
 	}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTable.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTable.java
new file mode 100644
index 00000000..dbb450c3
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTable.java
@@ -0,0 +1,64 @@
+package de.bmotionstudio.gef.editor.model;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.attribute.BAttributeColumns;
+import de.bmotionstudio.gef.editor.attribute.BAttributeForegroundColor;
+import de.bmotionstudio.gef.editor.attribute.BAttributeRows;
+import de.bmotionstudio.gef.editor.command.CreateCommand;
+
+public class BTable extends BControl {
+
+	public static transient String TYPE = "de.bmotionstudio.gef.editor.table";
+
+	public BTable(Visualization visualization) {
+
+		super(visualization);
+
+		int numberOfColumns = 2;
+		int numberOfRows = 2;
+
+		CreateCommand cmd;
+		for (int i = 0; i < numberOfColumns; i++) {
+			BTableColumn bTableColumn = new BTableColumn(visualization);
+			cmd = new CreateCommand(bTableColumn, this);
+			cmd.setLayout(new Rectangle(0, 0, 50, 25));
+			cmd.execute();
+			for (int z = 0; z < numberOfRows; z++) {
+				cmd = new CreateCommand(new BTableCell(getVisualization()),
+						bTableColumn);
+				cmd.setLayout(new Rectangle(0, 0, 50, 20));
+				cmd.execute();
+			}
+		}
+
+	}
+
+	@Override
+	public boolean canHaveChildren() {
+		return true;
+	}
+
+	@Override
+	protected void initAttributes() {
+		initAttribute(new BAttributeForegroundColor(
+				ColorConstants.black.getRGB()));
+		initAttribute(new BAttributeColumns(2));
+		initAttribute(new BAttributeRows(2));
+		getAttributes().get(AttributeConstants.ATTRIBUTE_SIZE).setShow(false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_COORDINATES).setShow(
+				false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_HEIGHT).setEditable(
+				false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_WIDTH).setEditable(
+				false);
+	}
+
+	@Override
+	public String getType() {
+		return TYPE;
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableCell.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableCell.java
new file mode 100644
index 00000000..587e2cdf
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableCell.java
@@ -0,0 +1,47 @@
+package de.bmotionstudio.gef.editor.model;
+
+import org.eclipse.draw2d.ColorConstants;
+
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.attribute.BAttributeBackgroundColor;
+import de.bmotionstudio.gef.editor.attribute.BAttributeForegroundColor;
+import de.bmotionstudio.gef.editor.attribute.BAttributeText;
+import de.bmotionstudio.gef.editor.attribute.BAttributeTextColor;
+
+public class BTableCell extends BControl {
+
+	public static transient String TYPE = "de.bmotionstudio.gef.editor.tablecell";
+
+	public BTableCell(Visualization visualization) {
+		super(visualization);
+	}
+
+	@Override
+	protected void initAttributes() {
+
+		initAttribute(new BAttributeBackgroundColor(
+				ColorConstants.white.getRGB()));
+		BAttributeForegroundColor bAttributeForegroundColor = new BAttributeForegroundColor(
+				ColorConstants.black.getRGB());
+		bAttributeForegroundColor.setShow(false);
+		initAttribute(bAttributeForegroundColor);
+		initAttribute(new BAttributeTextColor(ColorConstants.black.getRGB()));
+		initAttribute(new BAttributeText(""));
+		setAttributeValue(AttributeConstants.ATTRIBUTE_HEIGHT, 20);
+		setAttributeValue(AttributeConstants.ATTRIBUTE_WIDTH, 50);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_HEIGHT).setEditable(
+				false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_WIDTH).setEditable(
+				false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_SIZE).setShow(false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_COORDINATES).setShow(
+				false);
+
+	}
+
+	@Override
+	public String getType() {
+		return TYPE;
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableColumn.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableColumn.java
new file mode 100644
index 00000000..fc64b9ed
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BTableColumn.java
@@ -0,0 +1,47 @@
+package de.bmotionstudio.gef.editor.model;
+
+import org.eclipse.draw2d.ColorConstants;
+
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.attribute.BAttributeForegroundColor;
+
+public class BTableColumn extends BControl {
+
+	public static transient String TYPE = "de.bmotionstudio.gef.editor.tablecolumn";
+
+	public BTableColumn(Visualization visualization) {
+		super(visualization);
+	}
+
+	@Override
+	protected void initAttributes() {
+
+		// initAttribute(new BAttributeBackgroundColor(
+		// ColorConstants.white.getRGB()));
+		BAttributeForegroundColor bAttributeForegroundColor = new BAttributeForegroundColor(
+				ColorConstants.black.getRGB());
+		bAttributeForegroundColor.setShow(false);
+		initAttribute(bAttributeForegroundColor);
+		// initAttribute(new
+		// BAttributeTextColor(ColorConstants.black.getRGB()));
+		getAttributes().get(AttributeConstants.ATTRIBUTE_HEIGHT).setEditable(
+				false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_HEIGHT).setShow(false);
+		getAttributes().get(AttributeConstants.ATTRIBUTE_COORDINATES).setShow(
+				false);
+
+		// Background Color
+		// Font
+		// Foreground Color
+
+		// Width
+		// Height (not editable) --> determined by number of cells
+
+	}
+
+	@Override
+	public String getType() {
+		return TYPE;
+	}
+
+}
\ No newline at end of file
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ColumnObserver.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ColumnObserver.java
new file mode 100644
index 00000000..5b02178d
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ColumnObserver.java
@@ -0,0 +1,73 @@
+package de.bmotionstudio.gef.editor.observer;
+
+import de.bmotionstudio.gef.editor.Animation;
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.attribute.AbstractAttribute;
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.observer.wizard.WizardColumnObserver;
+import de.bmotionstudio.gef.editor.util.BMSUtil;
+
+public class ColumnObserver extends Observer {
+
+	private String expression;
+	private String predicate;
+
+	@Override
+	public void check(Animation animation, BControl control) {
+
+		// First evaluate predicate (predicate field)
+		String bolValue = "true";
+		if (predicate != null && predicate.length() > 0) {
+			bolValue = BMSUtil.parsePredicate(predicate, control, animation);
+		}
+
+		if (Boolean.valueOf(bolValue)) {
+
+			String fEval = BMSUtil.parseExpression(expression, control,
+					animation);
+			fEval = fEval.replace("}", "").replace("{", "");
+			String[] splitArray = fEval.split(",");
+
+			AbstractAttribute attributeRows = control.getParent().getAttribute(
+					AttributeConstants.ATTRIBUTE_ROWS);
+
+			Integer defaultRows = Integer.valueOf(attributeRows
+					.getInitValue().toString());
+
+			control.getParent().setAttributeValue(
+					AttributeConstants.ATTRIBUTE_ROWS,
+					defaultRows + splitArray.length, true, false);
+
+			for (int i = defaultRows; i < splitArray.length + defaultRows; i++) {
+				control.getChildrenArray()
+						.get(i)
+						.setAttributeValue(AttributeConstants.ATTRIBUTE_TEXT,
+								splitArray[i - defaultRows]);
+			}
+
+		}
+
+	}
+
+	public void setExpression(String expression) {
+		this.expression = expression;
+	}
+
+	public String getExpression() {
+		return expression;
+	}
+
+	public String getPredicate() {
+		return predicate;
+	}
+
+	public void setPredicate(String predicate) {
+		this.predicate = predicate;
+	}
+
+	@Override
+	public ObserverWizard getWizard(BControl control) {
+		return new WizardColumnObserver(control, this);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardColumnObserver.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardColumnObserver.java
new file mode 100644
index 00000000..04c3a5cd
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardColumnObserver.java
@@ -0,0 +1,125 @@
+/** 
+ * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, 
+ * Heinrich Heine Universitaet Duesseldorf
+ * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) 
+ * */
+
+package de.bmotionstudio.gef.editor.observer.wizard;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeansObservables;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.observer.ColumnObserver;
+import de.bmotionstudio.gef.editor.observer.Observer;
+import de.bmotionstudio.gef.editor.observer.ObserverWizard;
+
+public class WizardColumnObserver extends ObserverWizard {
+
+	private class ColumnObserverPage extends WizardPage {
+
+		private Text txtExpression;
+		private Text txtPredicate;
+
+		public Text getTxtExpression() {
+			return txtExpression;
+		}
+
+		protected ColumnObserverPage(final String pageName) {
+			super(pageName);
+		}
+
+		public void createControl(final Composite parent) {
+
+			final DataBindingContext dbc = new DataBindingContext();
+
+			Composite container = new Composite(parent, SWT.NONE);
+
+			container.setLayoutData(new GridData(GridData.FILL_BOTH));
+			container.setLayout(new GridLayout(2, false));
+
+			Label lb = new Label(container, SWT.NONE);
+			lb.setText("Predicate:");
+
+			txtPredicate = new Text(container, SWT.BORDER);
+			txtPredicate.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+			txtPredicate.setFont(new Font(Display.getDefault(), new FontData(
+					"Arial", 10, SWT.NONE)));
+
+			lb = new Label(container, SWT.NONE);
+			lb.setText("Expression:");
+			lb.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+
+			txtExpression = new Text(container, SWT.BORDER | SWT.MULTI
+					| SWT.WRAP);
+			txtExpression.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+			initBindings(dbc);
+
+			setControl(container);
+
+		}
+
+		private void initBindings(DataBindingContext dbc) {
+
+			dbc.bindValue(SWTObservables.observeText(txtPredicate, SWT.Modify),
+					BeansObservables.observeValue(
+							(ColumnObserver) getObserver(), "predicate"));
+
+			dbc.bindValue(
+					SWTObservables.observeText(txtExpression, SWT.Modify),
+					BeansObservables.observeValue(
+							(ColumnObserver) getObserver(), "expression"));
+
+		}
+
+	}
+
+	public WizardColumnObserver(BControl bcontrol,
+			Observer bobserver) {
+		super(bcontrol, bobserver);
+		addPage(new ColumnObserverPage("ColumnObserverPage"));
+	}
+
+	@Override
+	protected Boolean prepareToFinish() {
+
+		ColumnObserverPage page = (ColumnObserverPage) getPage("ColumnObserverPage");
+
+		String errorStr = "";
+
+		if (page.getTxtExpression().getText().length() == 0)
+			errorStr += "Please enter an expression.\n";
+
+		if (page.getErrorMessage() != null)
+			errorStr += "Please check the syntax/parser error.\n";
+
+		if (errorStr.length() > 0) {
+			MessageDialog.openError(Display.getDefault().getActiveShell(),
+					"An Error occured", errorStr);
+			return false;
+		}
+
+		return true;
+
+	}
+
+	@Override
+	public Point getSize() {
+		return new Point(600, 500);
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/AppAbstractEditPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/AppAbstractEditPart.java
index 91e73bff..91a5bc5a 100644
--- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/AppAbstractEditPart.java
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/AppAbstractEditPart.java
@@ -195,12 +195,12 @@ public abstract class AppAbstractEditPart extends AbstractGraphicalEditPart
 		} else if (Arrays.asList(layoutAttributes).contains(propName)) {
 			// Layout attribute
 			if (isRunning()) {
-				Display.getDefault().asyncExec(new Runnable() {
-					@Override
-					public void run() {
+				// Display.getDefault().asyncExec(new Runnable() {
+				// @Override
+				// public void run() {
 						refreshEditLayout(figure, model);
-					}
-				});
+				// }
+				// });
 			} else {
 				refreshEditLayout(figure, model);
 			}
@@ -208,12 +208,12 @@ public abstract class AppAbstractEditPart extends AbstractGraphicalEditPart
 
 			// Custom attribute
 			if (isRunning()) {
-				Display.getDefault().asyncExec(new Runnable() {
-					@Override
-					public void run() {
+				// Display.getDefault().asyncExec(new Runnable() {
+				// @Override
+				// public void run() {
 						refreshEditFigure(figure, model, evt);
-					}
-				});
+				// }
+				// });
 			} else {
 				refreshEditFigure(figure, model, evt);
 			}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableCellPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableCellPart.java
new file mode 100644
index 00000000..dba8ecf1
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableCellPart.java
@@ -0,0 +1,77 @@
+package de.bmotionstudio.gef.editor.part;
+
+import java.beans.PropertyChangeEvent;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.swt.graphics.RGB;
+
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.edit.TextCellEditorLocator;
+import de.bmotionstudio.gef.editor.edit.TextEditManager;
+import de.bmotionstudio.gef.editor.editpolicy.CustomDirectEditPolicy;
+import de.bmotionstudio.gef.editor.editpolicy.RenamePolicy;
+import de.bmotionstudio.gef.editor.figure.TableCellFigure;
+import de.bmotionstudio.gef.editor.model.BControl;
+
+public class BTableCellPart extends AppAbstractEditPart {
+
+	@Override
+	protected IFigure createEditFigure() {
+		return new TableCellFigure();
+	}
+
+	@Override
+	protected void prepareEditPolicies() {
+		installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
+				new CustomDirectEditPolicy());
+		installEditPolicy(EditPolicy.NODE_ROLE, new RenamePolicy());
+	}
+
+	@Override
+	protected void prepareRunPolicies() {
+	}
+
+	@Override
+	public void refreshEditFigure(IFigure figure, BControl model,
+			PropertyChangeEvent evt) {
+
+		Object value = evt.getNewValue();
+		String aID = evt.getPropertyName();
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT)) {
+			((TableCellFigure) figure).setText(value.toString());
+		}
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR)) {
+			((TableCellFigure) figure).setBackgroundColor((RGB) value);
+		}
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT_COLOR)) {
+			((TableCellFigure) figure).setTextColor((RGB) value);
+		}
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR)) {
+			((TableCellFigure) figure).setForegroundColor((RGB) value);
+		}
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_FONT))
+			((TableCellFigure) figure).setFont((value.toString()));
+
+	}
+
+	private void performDirectEdit() {
+		new TextEditManager(this, new TextCellEditorLocator(
+				(IFigure) getFigure())).show();
+	}
+
+	@Override
+	public void performRequest(Request request) {
+		super.performRequest(request);
+		if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
+			performDirectEdit();
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableColumnPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableColumnPart.java
new file mode 100644
index 00000000..49cfccce
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTableColumnPart.java
@@ -0,0 +1,83 @@
+package de.bmotionstudio.gef.editor.part;
+
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.swt.graphics.RGB;
+
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.editpolicy.BMotionNodeEditPolicy;
+import de.bmotionstudio.gef.editor.editpolicy.BMotionStudioFlowEditPolicy;
+import de.bmotionstudio.gef.editor.figure.TableColumnFigure;
+import de.bmotionstudio.gef.editor.model.BControl;
+
+public class BTableColumnPart extends AppAbstractEditPart {
+
+	@Override
+	protected IFigure createEditFigure() {
+		return new TableColumnFigure();
+	}
+
+	@Override
+	protected void prepareEditPolicies() {
+		installEditPolicy(EditPolicy.LAYOUT_ROLE,
+				new BMotionStudioFlowEditPolicy());
+		installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
+				new BMotionNodeEditPolicy());
+	}
+
+	@Override
+	protected void prepareRunPolicies() {
+	}
+
+	@Override
+	public void refreshEditFigure(IFigure figure, BControl model,
+			PropertyChangeEvent evt) {
+
+		Object value = evt.getNewValue();
+		String aID = evt.getPropertyName();
+
+		// if (aID.equals(AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR)) {
+		// for (BControl cell : model.getChildrenArray())
+		// cell.setAttributeValue(
+		// AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR, value);
+		// }
+		//
+		if (aID.equals(AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR)) {
+			((TableColumnFigure) figure).setForegroundColor((RGB) value);
+			for (BControl cell : model.getChildrenArray())
+				cell.setAttributeValue(
+						AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR, value);
+		}
+		//
+		// if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT_COLOR)) {
+		// for (BControl cell : model.getChildrenArray())
+		// cell.setAttributeValue(AttributeConstants.ATTRIBUTE_TEXT_COLOR,
+		// value);
+		// }
+		//
+		// if (aID.equals(AttributeConstants.ATTRIBUTE_FONT)) {
+		// for (BControl cell : model.getChildrenArray())
+		// cell.setAttributeValue(AttributeConstants.ATTRIBUTE_FONT, value);
+		// }
+
+	}
+
+	@Override
+	protected void refreshEditLayout(IFigure figure, BControl control) {
+		if (getParent() instanceof AppAbstractEditPart) {
+			AppAbstractEditPart tablePart = (AppAbstractEditPart) getParent();
+			tablePart.refreshEditLayout(tablePart.getFigure(),
+					control.getParent());
+		}
+		super.refreshEditLayout(figure, control);
+	}
+
+	@Override
+	public List<BControl> getModelChildren() {
+		return ((BControl) getModel()).getChildrenArray();
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTablePart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTablePart.java
new file mode 100644
index 00000000..78d6bc0d
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BTablePart.java
@@ -0,0 +1,151 @@
+package de.bmotionstudio.gef.editor.part;
+
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.swt.graphics.RGB;
+
+import de.bmotionstudio.gef.editor.AttributeConstants;
+import de.bmotionstudio.gef.editor.command.CreateCommand;
+import de.bmotionstudio.gef.editor.editpolicy.AppDeletePolicy;
+import de.bmotionstudio.gef.editor.editpolicy.BMotionNodeEditPolicy;
+import de.bmotionstudio.gef.editor.editpolicy.BMotionStudioFlowEditPolicy;
+import de.bmotionstudio.gef.editor.figure.TableFigure;
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.model.BTableCell;
+import de.bmotionstudio.gef.editor.model.BTableColumn;
+
+public class BTablePart extends AppAbstractEditPart {
+
+	@Override
+	protected IFigure createEditFigure() {
+		return new TableFigure();
+	}
+
+	@Override
+	protected void prepareEditPolicies() {
+		installEditPolicy(EditPolicy.LAYOUT_ROLE,
+				new BMotionStudioFlowEditPolicy());
+		installEditPolicy(EditPolicy.COMPONENT_ROLE, new AppDeletePolicy());
+		installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
+				new BMotionNodeEditPolicy());
+	}
+
+	@Override
+	protected void prepareRunPolicies() {
+	}
+
+	@Override
+	protected void refreshEditLayout(IFigure figure, BControl control) {
+
+		int width = 0;
+
+		int rows = Integer.valueOf(control.getAttributeValue(
+				AttributeConstants.ATTRIBUTE_ROWS).toString());
+
+		for (BControl column : control.getChildrenArray()) {
+			width = width + column.getLayout().width;
+		}
+
+		// Set the correct size of the table
+		figure.getParent().setConstraint(
+				figure,
+				new Rectangle(control.getLocation().x, control.getLocation().y,
+						width + 1, (rows * 20) + 1));
+
+	}
+
+	@Override
+	public void refreshEditFigure(IFigure figure, BControl model,
+			PropertyChangeEvent evt) {
+
+		Object value = evt.getNewValue();
+		Object oldValue = evt.getOldValue();
+		String aID = evt.getPropertyName();
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR)) {
+			((TableFigure) figure).setForegroundColor((RGB) value);
+			for (BControl child : model.getChildrenArray())
+				child.setAttributeValue(
+						AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR, value);
+		}
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_COLUMNS)) {
+
+			if (oldValue == null || value.equals(oldValue))
+				return;
+
+			// Create columns
+			Integer numberOfColumns = Integer.valueOf(value.toString());
+			Integer numberOfCurrentColumns = Integer.valueOf(oldValue
+					.toString());
+
+			if (numberOfColumns < numberOfCurrentColumns) {
+				for (int i = numberOfCurrentColumns - 1; i >= numberOfColumns; i--) {
+					model.removeChild(i);
+				}
+			}
+
+			for (int i = numberOfCurrentColumns; i < numberOfColumns; i++) {
+				BTableColumn bTableColumn = new BTableColumn(
+						model.getVisualization());
+				CreateCommand cmd = new CreateCommand(bTableColumn, model);
+				cmd.setLayout(new Rectangle(0, 0, 50, 25));
+				cmd.execute();
+				Integer numberOfRows = Integer.valueOf(model.getAttributeValue(
+						AttributeConstants.ATTRIBUTE_ROWS).toString());
+				refreshRows(bTableColumn, numberOfRows);
+			}
+
+			refreshEditLayout(figure, model);
+
+		}
+
+		if (aID.equals(AttributeConstants.ATTRIBUTE_ROWS)) {
+
+			if (oldValue == null || value.equals(oldValue))
+				return;
+
+			// Create rows
+			
+			Integer numberOfRows = Integer.valueOf(value.toString());
+
+			List<BControl> columnChildren = model.getChildrenArray();
+			for (BControl column : columnChildren) {
+				refreshRows(column, numberOfRows);
+			}
+			
+			refreshEditLayout(figure, model);
+
+		}
+
+	}
+
+	private void refreshRows(BControl column, int numberOfRows) {
+
+		Integer numberOfCurrentRows = column.getChildrenArray().size();
+
+		if (numberOfRows < numberOfCurrentRows) {
+			for (int i = numberOfCurrentRows - 1; i >= numberOfRows; i--) {
+				column.removeChild(i);
+			}
+		}
+
+		for (int i = numberOfCurrentRows; i < numberOfRows; i++) {
+			CreateCommand cmd = new CreateCommand(new BTableCell(
+					column.getVisualization()), column);
+			cmd.setLayout(new Rectangle(0, 0, 50, 20));
+			cmd.execute();
+		}
+
+	}
+
+	@Override
+	public List<BControl> getModelChildren() {
+		return ((BControl) getModel()).getChildrenArray();
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableCellService.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableCellService.java
new file mode 100644
index 00000000..36bd5c52
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableCellService.java
@@ -0,0 +1,29 @@
+package de.bmotionstudio.gef.editor.service;
+
+import de.bmotionstudio.gef.editor.AbstractBControlService;
+import de.bmotionstudio.gef.editor.IBControlService;
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.model.BTableCell;
+import de.bmotionstudio.gef.editor.model.Visualization;
+import de.bmotionstudio.gef.editor.part.AppAbstractEditPart;
+import de.bmotionstudio.gef.editor.part.BTableCellPart;
+
+public class BTableCellService extends AbstractBControlService implements
+		IBControlService {
+
+	@Override
+	public BControl createControl(Visualization visualization) {
+		return new BTableCell(visualization);
+	}
+
+	@Override
+	public AppAbstractEditPart createEditPart() {
+		return new BTableCellPart();
+	}
+
+	@Override
+	public boolean showInPalette() {
+		return false;
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableColumnService.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableColumnService.java
new file mode 100644
index 00000000..ea26c632
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableColumnService.java
@@ -0,0 +1,29 @@
+package de.bmotionstudio.gef.editor.service;
+
+import de.bmotionstudio.gef.editor.AbstractBControlService;
+import de.bmotionstudio.gef.editor.IBControlService;
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.model.BTableColumn;
+import de.bmotionstudio.gef.editor.model.Visualization;
+import de.bmotionstudio.gef.editor.part.AppAbstractEditPart;
+import de.bmotionstudio.gef.editor.part.BTableColumnPart;
+
+public class BTableColumnService extends AbstractBControlService implements
+		IBControlService {
+
+	@Override
+	public BControl createControl(Visualization visualization) {
+		return new BTableColumn(visualization);
+	}
+
+	@Override
+	public AppAbstractEditPart createEditPart() {
+		return new BTableColumnPart();
+	}
+
+	@Override
+	public boolean showInPalette() {
+		return false;
+	}
+
+}
diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableService.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableService.java
new file mode 100644
index 00000000..da6182eb
--- /dev/null
+++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/service/BTableService.java
@@ -0,0 +1,24 @@
+package de.bmotionstudio.gef.editor.service;
+
+import de.bmotionstudio.gef.editor.AbstractBControlService;
+import de.bmotionstudio.gef.editor.IBControlService;
+import de.bmotionstudio.gef.editor.model.BControl;
+import de.bmotionstudio.gef.editor.model.BTable;
+import de.bmotionstudio.gef.editor.model.Visualization;
+import de.bmotionstudio.gef.editor.part.AppAbstractEditPart;
+import de.bmotionstudio.gef.editor.part.BTablePart;
+
+public class BTableService extends AbstractBControlService implements
+		IBControlService {
+
+	@Override
+	public BControl createControl(Visualization visualization) {
+		return new BTable(visualization);
+	}
+
+	@Override
+	public AppAbstractEditPart createEditPart() {
+		return new BTablePart();
+	}
+
+}
-- 
GitLab