Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2018-06-25 04:23:31 -0400
committerNicolas FAUVERGUE2018-09-18 03:27:43 -0400
commit32460d846e6e4f70c9d4a31933fb9a20aa1da3c4 (patch)
treeaa2566f50c31e7d48f01264cf051f3785a1144d4
parent9ca049b95b1e92c8f42238971eccdb46235b8518 (diff)
downloadorg.eclipse.papyrus-32460d846e6e4f70c9d4a31933fb9a20aa1da3c4.tar.gz
org.eclipse.papyrus-32460d846e6e4f70c9d4a31933fb9a20aa1da3c4.tar.xz
org.eclipse.papyrus-32460d846e6e4f70c9d4a31933fb9a20aa1da3c4.zip
Bug 475369: List of string has always null string item
Remove the auto commit on focus lost listener for the Multi primitive types window edition. Change-Id: Ibfaaeb9bf6c2d6335916e85f2c6fce5b87ded2cc Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumCombo.java17
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceCombo.java27
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StringCombo.java20
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/StandardSelector.java5
4 files changed, 63 insertions, 6 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumCombo.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumCombo.java
index 806a35dfce1..1e2a553140b 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumCombo.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumCombo.java
@@ -10,6 +10,7 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 475369
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
@@ -52,4 +53,20 @@ public class EnumCombo extends ReferenceCombo {
super(parent, style, label);
}
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * The parent composite.
+ * @param style
+ * The style used.
+ * @param label
+ * The initial label.
+ * @param commitOnFocusLost
+ * Determinate if the focus lost ill commit the value or not.
+ * @since 3.3
+ */
+ public EnumCombo(final Composite parent, final int style, final String label, final boolean commitOnFocusLost) {
+ super(parent, style, label, commitOnFocusLost);
+ }
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceCombo.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceCombo.java
index 922842a5a3f..15104ef767c 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceCombo.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceCombo.java
@@ -12,6 +12,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Add binding implementation
* Christian W. Damus (CEA) - bug 435420
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 475369
*
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
@@ -74,7 +75,7 @@ public class ReferenceCombo extends AbstractValueEditor { // implements Selectio
* Constructor.
*
* @param parent
- * The Composite in which this editor is diplayed
+ * The Composite in which this editor is displayed
* @param style
* The style for this editor's combo
*/
@@ -87,13 +88,31 @@ public class ReferenceCombo extends AbstractValueEditor { // implements Selectio
* Constructor.
*
* @param parent
- * The Composite in which this editor is diplayed
+ * The Composite in which this editor is displayed
* @param style
* The style for this editor's combo
* @param label
* The label for this editor
*/
public ReferenceCombo(Composite parent, int style, String label) {
+ this(parent, style, label, true);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * The Composite in which this editor is displayed.
+ * @param style
+ * The style for this editor's combo.
+ * @param label
+ * The label for this editor.
+ * @param commitOnFocusLost
+ * Determinate if the focus lost ill commit the value or not.
+ * @since 3.3
+ */
+ public ReferenceCombo(Composite parent, int style, String label, boolean commitOnFocusLost) {
super(parent, label);
combo = factory.createCCombo(this, style | SWT.BORDER);
@@ -110,7 +129,9 @@ public class ReferenceCombo extends AbstractValueEditor { // implements Selectio
((GridLayout) getLayout()).numColumns++;
- setCommitOnFocusLost(combo);
+ if (commitOnFocusLost) {
+ setCommitOnFocusLost(combo);
+ }
controlDecoration = new ControlDecoration(combo, SWT.TOP | SWT.LEFT);
GridData gridData = getDefaultLayoutData();
combo.setLayoutData(gridData);
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StringCombo.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StringCombo.java
index 1878fd13846..131e0a17c54 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StringCombo.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StringCombo.java
@@ -12,7 +12,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Add binding implementation
* Christian W. Damus (CEA) - bug 436072
- * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net- Bug 446865
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net- Bug 446865, 475369
*
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
@@ -69,6 +69,24 @@ public class StringCombo extends ReferenceCombo {
}
/**
+ * Constructor.
+ *
+ * @param parent
+ * The parent composite.
+ * @param style
+ * The style used.
+ * @param label
+ * The initial label.
+ * @param commitOnFocusLost
+ * Determinate if the focus lost ill commit the value or not.
+ * @since 3.3
+ */
+ public StringCombo(final Composite parent, final int style, final String label, final boolean commitOnFocusLost) {
+ super(parent, style, label, commitOnFocusLost);
+ combo.setEditable(true);
+ }
+
+ /**
* {@inheritDoc}
*
* @see org.eclipse.papyrus.infra.widgets.editors.ReferenceCombo#getEditableType()
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/StandardSelector.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/StandardSelector.java
index db832e85a7f..57b85572a49 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/StandardSelector.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/StandardSelector.java
@@ -10,6 +10,7 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 475369
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.selectors;
@@ -97,8 +98,8 @@ public class StandardSelector implements IElementSelector {
@Override
public void createControls(Composite parent) {
try {
- Constructor<? extends AbstractValueEditor> construct = editorClass.getDeclaredConstructor(Composite.class, Integer.TYPE);
- editor = construct.newInstance(parent, SWT.BORDER);
+ Constructor<? extends AbstractValueEditor> construct = editorClass.getDeclaredConstructor(Composite.class, Integer.TYPE, String.class, Boolean.TYPE);
+ editor = construct.newInstance(parent, SWT.BORDER, null, false);
editor.addCommitListener(new ICommitListener() {
@Override

Back to the top