From 02d747d5112cfef53c2758e1ee11dacdf32b4bdf Mon Sep 17 00:00:00 2001
From: Florian Hoelzl <hoelzl@fortiss.org>
Date: Mon, 8 May 2017 09:35:09 +0000
Subject: [PATCH] Bugfix of data state variable initial value with structure
 type. refs 2953

---
 ...tStyledTextActionHandlerDatabindingEditingSupport.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport.java
index 47a51d890..8e05893ed 100644
--- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport.java
+++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport.java
@@ -31,6 +31,7 @@ import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.ColumnViewer;
 import org.eclipse.jface.viewers.ViewerCell;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
 import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
 import org.fortiss.tooling.kernel.ui.util.DataBindingUtils;
 
@@ -71,7 +72,7 @@ public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDa
 	@Override
 	protected Binding[] createBinding(CellEditor cellEditor, ViewerCell cell, CellEditor editor,
 			DataBindingContext context) {
-		return performCellTextBinding(dbc, cellEditor.getControl(),
+		return performCellTextBinding(dbc, getText(cellEditor),
 				getModelObservableValue(cell.getElement()), getModelToTextConverter(),
 				getTextToModelConverter(), getTextValidator(cell.getElement()));
 	}
@@ -102,4 +103,9 @@ public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDa
 	protected IValidator getTextValidator(Object object) {
 		return null;
 	}
+
+	/** Returns the {@link Control} to be used for data binding. Sub-classes may override. */
+	protected Control getText(CellEditor cellEditor) {
+		return cellEditor.getControl();
+	}
 }
-- 
GitLab