summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThibault Le Ouay2014-02-19 05:32:23 (EST)
committerCamille Letavernier2014-02-19 06:57:00 (EST)
commit493f50a6d1abbc1f06b591918c4e209ba04f56cb (patch)
tree7d216466cb9cb0cb65850ebe54643190075b060d
parent7c15c86695d85d4a105e4d3295c98f027bdd4442 (diff)
downloadorg.eclipse.papyrus-493f50a6d1abbc1f06b591918c4e209ba04f56cb.zip
org.eclipse.papyrus-493f50a6d1abbc1f06b591918c4e209ba04f56cb.tar.gz
org.eclipse.papyrus-493f50a6d1abbc1f06b591918c4e209ba04f56cb.tar.bz2
428518: [Properties View] Property view model should manage type
Double/Real https://bugs.eclipse.org/bugs/show_bug.cgi?id=428518 Signed-off-by: Thibault Le Ouay <t.leouay@sherpa-eng.com>
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto3
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java70
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsFactoryImpl.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/Type.java27
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentFactoryImpl.java3
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentPackageImpl.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentAdapterFactory.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentSwitch.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/impl/UiFactoryImpl.java3
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiAdapterFactory.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiSwitch.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationManager.java75
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiDouble.java63
16 files changed, 213 insertions, 40 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto
index 2d57165..021c0bf 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto
@@ -170,7 +170,8 @@ query UML::Type::getType() : PropertyEnvironment::Type {
case (self.name = "String") type := PropertyEnvironment::Type::String;
case (self.name = "Integer") type := PropertyEnvironment::Type::Integer;
case (self.name = "Boolean") type := PropertyEnvironment::Type::Boolean;
- case (self.name = "Real") type := PropertyEnvironment::Type::String;
+ case (self.name = "Real") type := PropertyEnvironment::Type::Double;
+ case (self.name = "Double") type := PropertyEnvironment::Type::Double;
};
case (self.oclIsTypeOf(DataType)) type := PropertyEnvironment::Type::Reference;
};
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java
new file mode 100644
index 0000000..477a464
--- /dev/null
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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:
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.widgets.editors;
+
+
+import org.eclipse.papyrus.infra.widgets.selectors.RealSelector;
+import org.eclipse.swt.widgets.Composite;
+
+
+public class MultipleDoubleEditor extends MultipleStringEditor {
+
+ /**
+ * Constructs an Editor for multiple double values
+ * The widget is a List, with controls to move values up/down, add values
+ * and remove values.
+ *
+ * @param parent
+ * The Composite in which this editor is created
+ * @param style
+ * The List's style
+ */
+ public MultipleDoubleEditor(Composite parent, int style) {
+ super(parent, style, new RealSelector());
+ }
+
+ /**
+ * Constructs an Editor for multiple double values
+ * The widget is a List, with controls to move values up/down, add values
+ * and remove values.
+ *
+ * @param parent
+ * The Composite in which this editor is created
+ * @param style
+ * The List's style
+ * @param label
+ * The editor's label
+ */
+ public MultipleDoubleEditor(Composite parent, int style, String label) {
+ super(parent, style, new RealSelector(), label);
+ }
+
+ /**
+ * Constructs an Editor for multiple double values
+ * The widget is a List, with controls to move values up/down, add values
+ * and remove values.
+ *
+ * @param parent
+ * The Composite in which this editor is created
+ * @param style
+ * The List's style
+ * @param ordered
+ * Indicates if the values should be ordered. If true, the up/down controls will be activated
+ * @param unique
+ * Indicates if the values should be unique.
+ * @param label
+ * The editor's label
+ */
+ public MultipleDoubleEditor(Composite parent, int style, boolean ordered, boolean unique, String label) {
+ super(parent, style, new RealSelector(), ordered, unique, label);
+ }
+
+}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore
index cc31fe0..017ab06 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore
@@ -47,6 +47,7 @@
<eLiterals name="Integer" value="2"/>
<eLiterals name="Reference" value="3" literal="Reference"/>
<eLiterals name="Enumeration" value="4"/>
+ <eLiterals name="Double" value="5" literal="Double"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="StandardWidgetType" eSuperTypes="#//environment/WidgetType"/>
<eClassifiers xsi:type="ecore:EClass" name="Namespace">
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsFactoryImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsFactoryImpl.java
index 4fd9a1a..319e7d9 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsFactoryImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsFactoryImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.papyrus.views.properties.contexts.*;
import org.eclipse.papyrus.views.properties.contexts.Context;
import org.eclipse.papyrus.views.properties.contexts.ContextsFactory;
import org.eclipse.papyrus.views.properties.contexts.ContextsPackage;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java
index 8258dc8..7232147 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java
@@ -12,6 +12,7 @@ import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.constraints.DisplayUnit;
+import org.eclipse.papyrus.views.properties.contexts.*;
import org.eclipse.papyrus.views.properties.contexts.Context;
import org.eclipse.papyrus.views.properties.contexts.ContextsPackage;
import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java
index fb7634e..36f6758 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java
@@ -11,6 +11,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.papyrus.infra.constraints.DisplayUnit;
+import org.eclipse.papyrus.views.properties.contexts.*;
import org.eclipse.papyrus.views.properties.contexts.Context;
import org.eclipse.papyrus.views.properties.contexts.ContextsPackage;
import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/Type.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/Type.java
index f791619..872732b 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/Type.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/Type.java
@@ -70,7 +70,15 @@ public enum Type implements Enumerator {
* @generated
* @ordered
*/
- ENUMERATION(4, "Enumeration", "Enumeration");
+ ENUMERATION(4, "Enumeration", "Enumeration"), /**
+ * The '<em><b>Double</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #DOUBLE_VALUE
+ * @generated
+ * @ordered
+ */
+ DOUBLE(5, "Double", "Double");
/**
* The '<em><b>String</b></em>' literal value.
@@ -148,6 +156,21 @@ public enum Type implements Enumerator {
public static final int ENUMERATION_VALUE = 4;
/**
+ * The '<em><b>Double</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Double</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #DOUBLE
+ * @model name="Double"
+ * @generated
+ * @ordered
+ */
+ public static final int DOUBLE_VALUE = 5;
+
+ /**
* An array of all the '<em><b>Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -160,6 +183,7 @@ public enum Type implements Enumerator {
INTEGER,
REFERENCE,
ENUMERATION,
+ DOUBLE,
};
/**
@@ -215,6 +239,7 @@ public enum Type implements Enumerator {
case INTEGER_VALUE: return INTEGER;
case REFERENCE_VALUE: return REFERENCE;
case ENUMERATION_VALUE: return ENUMERATION;
+ case DOUBLE_VALUE: return DOUBLE;
}
return null;
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentFactoryImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentFactoryImpl.java
index 535975c..d8f43af 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentFactoryImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentFactoryImpl.java
@@ -12,6 +12,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.papyrus.views.properties.environment.*;
import org.eclipse.papyrus.views.properties.environment.CompositeWidgetType;
import org.eclipse.papyrus.views.properties.environment.Environment;
import org.eclipse.papyrus.views.properties.environment.EnvironmentFactory;
@@ -40,7 +41,7 @@ public class EnvironmentFactoryImpl extends EFactoryImpl implements EnvironmentF
*/
public static EnvironmentFactory init() {
try {
- EnvironmentFactory theEnvironmentFactory = (EnvironmentFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/environment/0.9");
+ EnvironmentFactory theEnvironmentFactory = (EnvironmentFactory)EPackage.Registry.INSTANCE.getEFactory(EnvironmentPackage.eNS_URI);
if (theEnvironmentFactory != null) {
return theEnvironmentFactory;
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentPackageImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentPackageImpl.java
index 7f2f1f7..609a9c0 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentPackageImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/impl/EnvironmentPackageImpl.java
@@ -604,6 +604,7 @@ public class EnvironmentPackageImpl extends EPackageImpl implements EnvironmentP
addEEnumLiteral(typeEEnum, Type.INTEGER);
addEEnumLiteral(typeEEnum, Type.REFERENCE);
addEEnumLiteral(typeEEnum, Type.ENUMERATION);
+ addEEnumLiteral(typeEEnum, Type.DOUBLE);
// Create resource
createResource(eNS_URI);
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentAdapterFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentAdapterFactory.java
index d3de17b..f32f035 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentAdapterFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentAdapterFactory.java
@@ -11,6 +11,7 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.constraints.environment.ConstraintEnvironment;
+import org.eclipse.papyrus.views.properties.environment.*;
import org.eclipse.papyrus.views.properties.environment.CompositeWidgetType;
import org.eclipse.papyrus.views.properties.environment.Environment;
import org.eclipse.papyrus.views.properties.environment.EnvironmentPackage;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentSwitch.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentSwitch.java
index 8236e6b..5bd3790 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentSwitch.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/environment/util/EnvironmentSwitch.java
@@ -10,6 +10,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.papyrus.infra.constraints.environment.ConstraintEnvironment;
+import org.eclipse.papyrus.views.properties.environment.*;
import org.eclipse.papyrus.views.properties.environment.CompositeWidgetType;
import org.eclipse.papyrus.views.properties.environment.Environment;
import org.eclipse.papyrus.views.properties.environment.EnvironmentPackage;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/impl/UiFactoryImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/impl/UiFactoryImpl.java
index fdaed50..0ed3d52 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/impl/UiFactoryImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/impl/UiFactoryImpl.java
@@ -11,6 +11,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.papyrus.views.properties.ui.*;
import org.eclipse.papyrus.views.properties.ui.CompositeWidget;
import org.eclipse.papyrus.views.properties.ui.Element;
import org.eclipse.papyrus.views.properties.ui.Layout;
@@ -37,7 +38,7 @@ public class UiFactoryImpl extends EFactoryImpl implements UiFactory {
*/
public static UiFactory init() {
try {
- UiFactory theUiFactory = (UiFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/ui/0.9");
+ UiFactory theUiFactory = (UiFactory)EPackage.Registry.INSTANCE.getEFactory(UiPackage.eNS_URI);
if (theUiFactory != null) {
return theUiFactory;
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiAdapterFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiAdapterFactory.java
index f4a53f4..2426173 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiAdapterFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiAdapterFactory.java
@@ -10,6 +10,7 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.views.properties.ui.*;
import org.eclipse.papyrus.views.properties.ui.CompositeWidget;
import org.eclipse.papyrus.views.properties.ui.Element;
import org.eclipse.papyrus.views.properties.ui.Layout;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiSwitch.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiSwitch.java
index 6a91e96..d7bb044 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiSwitch.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/ui/util/UiSwitch.java
@@ -9,6 +9,7 @@ package org.eclipse.papyrus.views.properties.ui.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
+import org.eclipse.papyrus.views.properties.ui.*;
import org.eclipse.papyrus.views.properties.ui.CompositeWidget;
import org.eclipse.papyrus.views.properties.ui.Element;
import org.eclipse.papyrus.views.properties.ui.Layout;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationManager.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationManager.java
index 154f368..d24eff3 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationManager.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationManager.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010, 2013 CEA LIST.
- *
+ *
* 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
@@ -74,14 +74,14 @@ import org.eclipse.swt.widgets.Display;
/**
* Central class of the Property View framework. It lists the available environments and contexts,
* and is responsible for Enabling or Disabling contexts programmatically.
- *
+ *
* All {@link Context}s should have unique names.
- *
+ *
* @see ContextExtensionPoint
* @see EnvironmentExtensionPoint
* @see Preferences
* @see ConfigurationManager#instance
- *
+ *
* @author Camille Letavernier
*/
public class ConfigurationManager {
@@ -314,7 +314,7 @@ public class ConfigurationManager {
/**
* Refresh the given Context. This method should be called when a model is edited
* at runtime, to re-load it from persistent storage.
- *
+ *
* @param context
* A Context model to re-load
*/
@@ -356,11 +356,11 @@ public class ConfigurationManager {
/**
* Tests if a Context is enabled.
- *
+ *
* @param context
* @return
* true if the given context is enabled.
- *
+ *
* @see Preferences
*/
public boolean isApplied(Context context) {
@@ -420,7 +420,7 @@ public class ConfigurationManager {
* Retrieves the ContextDescriptor associated to the specified context.
* If a matching descriptor cannot be found, a new Descriptor is created
* in the preferences.
- *
+ *
* @param context
* @return
*/
@@ -446,7 +446,7 @@ public class ConfigurationManager {
/**
* Adds a context via its URI. The URI should represent a valid Context model.
* The model is loaded in the ConfigurationManager's resourceSet.
- *
+ *
* @param uri
* The context's URI
* @throws IOException
@@ -468,7 +468,7 @@ public class ConfigurationManager {
/**
* Adds a context via its URI. The URI should represent a valid Context model.
* The model is loaded in the ConfigurationManager's resourceSet.
- *
+ *
* @param uri
* The context's URI
* @throws IOException
@@ -484,12 +484,12 @@ public class ConfigurationManager {
* However, you can still call this method when creating a Context at runtime, programmatically
* (Wizards, ...)
* All {@link Context} should have unique names
- *
+ *
* @param context
* The new context to register
* @param apply
* Whether the context should be enabled or not
- *
+ *
* @see ConfigurationManager#addContext(URI)
*/
public void addContext(Context context, boolean apply) {
@@ -500,7 +500,7 @@ public class ConfigurationManager {
* Recalculates the cached preference descriptor prototype of the specified {@code context}.
* This ensures that if the {@code context} becomes unavailable, we will still know locally
* in this workspace what its prototype is.
- *
+ *
* @param context
* a context
*/
@@ -525,12 +525,12 @@ public class ConfigurationManager {
* However, you can still call this method when creating a Context at runtime, programmatically
* (Wizards, ...)
* All {@link Context} should have unique names
- *
+ *
* @param context
* The new context to register
* @param apply
* Whether the context should be enabled or not
- *
+ *
* @see ConfigurationManager#addContext(URI)
*/
public void addContext(Context context, boolean apply, boolean isCustomizable) {
@@ -572,7 +572,7 @@ public class ConfigurationManager {
/**
* Disable a Context.
- *
+ *
* @param context
* The Context to disable
* @param update
@@ -612,7 +612,7 @@ public class ConfigurationManager {
/**
* Enables a Context
- *
+ *
* @param context
* The Context to enable
* @param update
@@ -620,7 +620,7 @@ public class ConfigurationManager {
* modification
* If false, you should call manually {@link #update()} to refresh
* the constraint engine
- *
+ *
* @see #disableContext(Context, boolean)
*/
public void enableContext(Context context, boolean update) {
@@ -651,7 +651,7 @@ public class ConfigurationManager {
* Tests if a Context is a plugin context. plugin contexts
* are registered through {@link ContextExtensionPoint} and are
* read-only.
- *
+ *
* @param context
* @return
* True if the context comes from a plugin, and is thus read-only
@@ -665,7 +665,7 @@ public class ConfigurationManager {
/**
* Queries whether the specified {@code context} is a proxy for a missing context. That is a
* context that is expected to exist but is (temporarily) unavailable.
- *
+ *
* @param context
* a context
* @return whether it represents a missing context
@@ -676,7 +676,7 @@ public class ConfigurationManager {
/**
* Loads a Context from the given URI. The model is loaded in the {@link ConfigurationManager}'s resourceSet
- *
+ *
* @param uri
* The URI from which the Context is loaded
* @return
@@ -694,7 +694,7 @@ public class ConfigurationManager {
/**
* Adds a new Environment from the given URI.
- *
+ *
* @param uri
* The URI from which the Environment is retrieved.
* @throws IOException
@@ -716,7 +716,7 @@ public class ConfigurationManager {
/**
* Returns the context from the given context name
- *
+ *
* @param contextName
* The name of the context to retrieve
* @return
@@ -746,9 +746,9 @@ public class ConfigurationManager {
/**
* Returns all the known contexts, even if they are not applied
* To get only applied contexts, see {@link #getEnabledContexts()}
- *
+ *
* @return All known contexts
- *
+ *
* @see PropertiesRoot#getContexts()
*/
public Collection<Context> getContexts() {
@@ -757,9 +757,9 @@ public class ConfigurationManager {
/**
* Returns all the known customizable contexts.
- *
+ *
* @return All known contexts
- *
+ *
* @see PropertiesRoot#getContexts()
* @see {@link #getEnabledContexts()}
*/
@@ -776,7 +776,7 @@ public class ConfigurationManager {
/**
* Obtains proxies (not the EMF kind) for all contexts that the system knows about
* but are currently unavailable.
- *
+ *
* @return the current collection of missing contexts
*/
public Collection<Context> getMissingContexts() {
@@ -860,8 +860,11 @@ public class ConfigurationManager {
case STRING:
propertyEditorName = multiple ? "MultiString" : "StringEditor"; //$NON-NLS-1$ //$NON-NLS-2$
break;
+ case DOUBLE:
+ propertyEditorName = multiple ? "MultiDouble" : "DoubleEditor"; //$NON-NLS-1$ //$NON-NLS-2$
}
+
if(propertyEditorName == null) {
return null;
}
@@ -871,7 +874,7 @@ public class ConfigurationManager {
/**
* Returns the default XWT namespaces
- *
+ *
* @return the default XWT namespaces
*/
public Set<Namespace> getBaseNamespaces() {
@@ -912,7 +915,7 @@ public class ConfigurationManager {
* Disable, then unregisters a Context. The Context won't be available anymore in the framework
* (not even in the Preferences page). This method <strong>won't</strong> delete the context's files
* on the file system.
- *
+ *
* @param context
* The context to delete
*/
@@ -924,7 +927,7 @@ public class ConfigurationManager {
* Disable, then unregisters a Context. The Context won't be available anymore in the framework
* (not even in the Preferences page). This method <strong>won't</strong> delete the context's files
* on the file system.
- *
+ *
* @param context
* The context to delete
* @param updateEngine
@@ -980,7 +983,7 @@ public class ConfigurationManager {
/**
* Retrieves the Property object associated to the propertyPath in the given context
- *
+ *
* @param propertyPath
* @param context
* @return
@@ -1027,7 +1030,7 @@ public class ConfigurationManager {
* Checks the conflicts between all applied configurations
* A Conflict may occur when two sections have the same ID : they can't
* be displayed at the same time
- *
+ *
* @return
* The list of conflicts
*/
@@ -1066,7 +1069,7 @@ public class ConfigurationManager {
/**
* Returns the ResourceSet associated to the ConfigurationManager,
* ie. the ResourceSet containing all Environments and Contexts
- *
+ *
* @return
*/
public ResourceSet getResourceSet() {
@@ -1085,8 +1088,8 @@ public class ConfigurationManager {
return customizableContexts.get(propertyViewConfiguration);
}
- //Default value for isCustomizable is true. However, if the context is
- //not stored in customizableContexts, then it's an error. We should
+ //Default value for isCustomizable is true. However, if the context is
+ //not stored in customizableContexts, then it's an error. We should
//disable customization tools for this one...
return false;
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiDouble.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiDouble.java
new file mode 100644
index 0000000..47b0e17
--- /dev/null
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiDouble.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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:
+ *****************************************************************************/
+package org.eclipse.papyrus.views.properties.widgets;
+
+
+
+import org.eclipse.papyrus.infra.widgets.editors.ICommitListener;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleDoubleEditor;
+import org.eclipse.swt.widgets.Composite;
+
+public class MultiDouble extends AbstractPropertyEditor {
+
+ /**
+ * The MultipleDoubleEditor widget
+ */
+ protected MultipleDoubleEditor editor;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * The composite in which the widget will be displayed
+ * @param style
+ * The style for the widget
+ */
+ public MultiDouble(Composite parent, int style) {
+ editor = createMultipleDoubleEditor(parent, style);
+ super.setEditor(editor);
+ }
+
+ /**
+ * Creates the multiple double editor.
+ *
+ * @param parent
+ * The composite in which the widget will be displayed
+ * @param style
+ * The style for the widget
+ * @return the multiple double editor.
+ */
+ protected MultipleDoubleEditor createMultipleDoubleEditor(Composite parent, int style) {
+ return new MultipleDoubleEditor(parent, style);
+ }
+
+ @Override
+ protected void doBinding() {
+ editor.setOrdered(input.isOrdered(propertyPath));
+ editor.setUnique(input.isUnique(propertyPath));
+
+ if(getInputObservableList() instanceof ICommitListener) {
+ editor.addCommitListener((ICommitListener)getInputObservableList());
+ }
+
+ super.doBinding();
+ }
+}