[480891] Re-introduce the "..." button for all but interpreted expressions

Commit ca0caa99753116848bd0deb387dd15982c6d9999 was too heavy-handed,
and removed the "..." button for *all* VSM fields which had one, not
just the problematic ones which concern interpreted expressions.

Make the AbstractTextWithButtonPropertySection a little smarter and
show the button or not depending on the type of the attribute. Among
others, this re-introduces the button for icon paths.

Bug: 480891
Change-Id: I3eaea1de4838aa4a9472a89e76718f1630da8f70
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractTextWithButtonPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractTextWithButtonPropertySection.java
index 8c1e080d..61ce87c 100644
--- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractTextWithButtonPropertySection.java
+++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractTextWithButtonPropertySection.java
@@ -32,6 +32,7 @@
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IWorkbenchPart;
@@ -60,6 +61,9 @@
     /** The main listener */
     protected TextChangeListener listener;
 
+    /** The button control for the section. */
+    protected Button button;
+
     private boolean handleModifications;
 
     /**
@@ -72,16 +76,31 @@
         else
             super.createControls(parent, tabbedPropertySheetPage);
 
+        boolean hasButton = getFeature().getEType() != DescriptionPackage.Literals.INTERPRETED_EXPRESSION;
+
         composite = getWidgetFactory().createFlatFormComposite(parent);
         FormData data;
 
         text = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
         data = new FormData();
         data.left = new FormAttachment(0, LABEL_WIDTH);
-        data.right = new FormAttachment(100, 0);
+        if (hasButton) {
+            data.right = new FormAttachment(95, 0);
+        } else {
+            data.right = new FormAttachment(100, 0);
+        }
         data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
         text.setLayoutData(data);
 
+        if (hasButton) {
+            button = getWidgetFactory().createButton(composite, "...", SWT.PUSH);
+            data = new FormData();
+            data.left = new FormAttachment(95, 0);
+            data.right = new FormAttachment(100, 0);
+            data.top = new FormAttachment(text, 0, SWT.CENTER);
+            button.setLayoutData(data);
+        }
+
         nameLabel = getWidgetFactory().createCLabel(composite, getLabelText());
         data = new FormData();
         data.left = new FormAttachment(0, 0);
@@ -89,6 +108,10 @@
         data.top = new FormAttachment(text, 0, SWT.CENTER);
         nameLabel.setLayoutData(data);
 
+        if (hasButton) {
+            button.addSelectionListener(createButtonListener());
+        }
+
         listener = new TextWithContentAssistChangeHelper() {
             public void textChanged(Text control) {
                 handleTextModified();