";
+ public UndefinedRuleElements getUndefinedRuleAccess() {
+ return pUndefinedRule;
+ }
+
+ public ParserRule getUndefinedRuleRule() {
+ return getUndefinedRuleAccess().getRule();
+ }
+
+ //VisibilityKind:
+ // public="+" | private="-" | protected="#" | package="~";
+ public VisibilityKindElements getVisibilityKindAccess() {
+ return pVisibilityKind;
+ }
+
+ public ParserRule getVisibilityKindRule() {
+ return getVisibilityKindAccess().getRule();
+ }
+
+ //terminal ID:
+ // "^"? ("a".."z" | "A".."Z" | "_") ("a".."z" | "A".."Z" | "_" | "0".."9")*;
+ public TerminalRule getIDRule() {
+ return gaTerminals.getIDRule();
+ }
+
+ //terminal INT returns ecore::EInt:
+ // "0".."9"+;
+ public TerminalRule getINTRule() {
+ return gaTerminals.getINTRule();
+ }
+
+ //terminal STRING:
+ // "\"" ("\\" . / * 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' * / | !("\\" | "\""))* "\"" | "\'" ("\\" .
+ // / * 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' * / | !("\\" | "\'"))* "\'";
+ public TerminalRule getSTRINGRule() {
+ return gaTerminals.getSTRINGRule();
+ }
+
+ //terminal ML_COMMENT:
+ // "/ *"->"* /";
+ public TerminalRule getML_COMMENTRule() {
+ return gaTerminals.getML_COMMENTRule();
+ }
+
+ //terminal SL_COMMENT:
+ // "//" !("\n" | "\r")* ("\r"? "\n")?;
+ public TerminalRule getSL_COMMENTRule() {
+ return gaTerminals.getSL_COMMENTRule();
+ }
+
+ //terminal WS:
+ // (" " | "\t" | "\r" | "\n")+;
+ public TerminalRule getWSRule() {
+ return gaTerminals.getWSRule();
+ }
+
+ //terminal ANY_OTHER:
+ // .;
+ public TerminalRule getANY_OTHERRule() {
+ return gaTerminals.getANY_OTHERRule();
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/AbstractRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/AbstractRule.java
new file mode 100644
index 00000000000..403ac75b5d0
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/AbstractRule.java
@@ -0,0 +1,161 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.uml2.uml.InstanceSpecification;
+
+/**
+ *
+ * A representation of the model object 'Abstract Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getVisibility Visibility }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getName Name }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getValue Value }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getInstanceSpecification Instance Specification }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getUndefined Undefined }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getAbstractRule()
+ * @model
+ * @generated
+ */
+public interface AbstractRule extends EObject
+{
+ /**
+ * Returns the value of the 'Visibility ' containment reference.
+ *
+ *
+ * If the meaning of the 'Visibility ' containment reference isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Visibility ' containment reference.
+ * @see #setVisibility(VisibilityKind)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getAbstractRule_Visibility()
+ * @model containment="true"
+ * @generated
+ */
+ VisibilityKind getVisibility();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getVisibility Visibility }' containment reference.
+ *
+ *
+ * @param value the new value of the 'Visibility ' containment reference.
+ * @see #getVisibility()
+ * @generated
+ */
+ void setVisibility(VisibilityKind value);
+
+ /**
+ * Returns the value of the 'Name ' attribute.
+ *
+ *
+ * If the meaning of the 'Name ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Name ' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getAbstractRule_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getName Name }' attribute.
+ *
+ *
+ * @param value the new value of the 'Name ' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the 'Value ' containment reference.
+ *
+ *
+ * If the meaning of the 'Value ' containment reference isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' containment reference.
+ * @see #setValue(EObject)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getAbstractRule_Value()
+ * @model containment="true"
+ * @generated
+ */
+ EObject getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getValue Value }' containment reference.
+ *
+ *
+ * @param value the new value of the 'Value ' containment reference.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(EObject value);
+
+ /**
+ * Returns the value of the 'Instance Specification ' reference.
+ *
+ *
+ * If the meaning of the 'Instance Specification ' reference isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Instance Specification ' reference.
+ * @see #setInstanceSpecification(InstanceSpecification)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getAbstractRule_InstanceSpecification()
+ * @model
+ * @generated
+ */
+ InstanceSpecification getInstanceSpecification();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getInstanceSpecification Instance Specification }' reference.
+ *
+ *
+ * @param value the new value of the 'Instance Specification ' reference.
+ * @see #getInstanceSpecification()
+ * @generated
+ */
+ void setInstanceSpecification(InstanceSpecification value);
+
+ /**
+ * Returns the value of the 'Undefined ' containment reference.
+ *
+ *
+ * If the meaning of the 'Undefined ' containment reference isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Undefined ' containment reference.
+ * @see #setUndefined(UndefinedRule)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getAbstractRule_Undefined()
+ * @model containment="true"
+ * @generated
+ */
+ UndefinedRule getUndefined();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getUndefined Undefined }' containment reference.
+ *
+ *
+ * @param value the new value of the 'Undefined ' containment reference.
+ * @see #getUndefined()
+ * @generated
+ */
+ void setUndefined(UndefinedRule value);
+
+} // AbstractRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralBooleanRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralBooleanRule.java
new file mode 100644
index 00000000000..66fcd3c80f0
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralBooleanRule.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Literal Boolean Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule#getValue Value }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralBooleanRule()
+ * @model
+ * @generated
+ */
+public interface LiteralBooleanRule extends EObject
+{
+ /**
+ * Returns the value of the 'Value ' attribute.
+ *
+ *
+ * If the meaning of the 'Value ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralBooleanRule_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule#getValue Value }' attribute.
+ *
+ *
+ * @param value the new value of the 'Value ' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // LiteralBooleanRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralIntegerOrUnlimitedNaturalRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralIntegerOrUnlimitedNaturalRule.java
new file mode 100644
index 00000000000..e1f72ad6125
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralIntegerOrUnlimitedNaturalRule.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Literal Integer Or Unlimited Natural Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule#getValue Value }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralIntegerOrUnlimitedNaturalRule()
+ * @model
+ * @generated
+ */
+public interface LiteralIntegerOrUnlimitedNaturalRule extends EObject
+{
+ /**
+ * Returns the value of the 'Value ' attribute.
+ *
+ *
+ * If the meaning of the 'Value ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' attribute.
+ * @see #setValue(int)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralIntegerOrUnlimitedNaturalRule_Value()
+ * @model
+ * @generated
+ */
+ int getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule#getValue Value }' attribute.
+ *
+ *
+ * @param value the new value of the 'Value ' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(int value);
+
+} // LiteralIntegerOrUnlimitedNaturalRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralNullRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralNullRule.java
new file mode 100644
index 00000000000..e5f218aa995
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralNullRule.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Literal Null Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule#getValue Value }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralNullRule()
+ * @model
+ * @generated
+ */
+public interface LiteralNullRule extends EObject
+{
+ /**
+ * Returns the value of the 'Value ' attribute.
+ *
+ *
+ * If the meaning of the 'Value ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralNullRule_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule#getValue Value }' attribute.
+ *
+ *
+ * @param value the new value of the 'Value ' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // LiteralNullRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralRealRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralRealRule.java
new file mode 100644
index 00000000000..384964125f6
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralRealRule.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Literal Real Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule#getValue Value }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralRealRule()
+ * @model
+ * @generated
+ */
+public interface LiteralRealRule extends EObject
+{
+ /**
+ * Returns the value of the 'Value ' attribute.
+ *
+ *
+ * If the meaning of the 'Value ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' attribute.
+ * @see #setValue(double)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralRealRule_Value()
+ * @model
+ * @generated
+ */
+ double getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule#getValue Value }' attribute.
+ *
+ *
+ * @param value the new value of the 'Value ' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(double value);
+
+} // LiteralRealRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralStringRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralStringRule.java
new file mode 100644
index 00000000000..a7fbf63e614
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/LiteralStringRule.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Literal String Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule#getValue Value }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralStringRule()
+ * @model
+ * @generated
+ */
+public interface LiteralStringRule extends EObject
+{
+ /**
+ * Returns the value of the 'Value ' attribute.
+ *
+ *
+ * If the meaning of the 'Value ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getLiteralStringRule_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule#getValue Value }' attribute.
+ *
+ *
+ * @param value the new value of the 'Value ' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // LiteralStringRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UmlValueSpecificationFactory.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UmlValueSpecificationFactory.java
new file mode 100644
index 00000000000..f11f23b78d1
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UmlValueSpecificationFactory.java
@@ -0,0 +1,106 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ *
+ * The Factory for the model.
+ * It provides a create method for each non-abstract class of the model.
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage
+ * @generated
+ */
+public interface UmlValueSpecificationFactory extends EFactory
+{
+ /**
+ * The singleton instance of the factory.
+ *
+ *
+ * @generated
+ */
+ UmlValueSpecificationFactory eINSTANCE = org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationFactoryImpl.init();
+
+ /**
+ * Returns a new object of class 'Abstract Rule '.
+ *
+ *
+ * @return a new object of class 'Abstract Rule '.
+ * @generated
+ */
+ AbstractRule createAbstractRule();
+
+ /**
+ * Returns a new object of class 'Literal Boolean Rule '.
+ *
+ *
+ * @return a new object of class 'Literal Boolean Rule '.
+ * @generated
+ */
+ LiteralBooleanRule createLiteralBooleanRule();
+
+ /**
+ * Returns a new object of class 'Literal Integer Or Unlimited Natural Rule '.
+ *
+ *
+ * @return a new object of class 'Literal Integer Or Unlimited Natural Rule '.
+ * @generated
+ */
+ LiteralIntegerOrUnlimitedNaturalRule createLiteralIntegerOrUnlimitedNaturalRule();
+
+ /**
+ * Returns a new object of class 'Literal Real Rule '.
+ *
+ *
+ * @return a new object of class 'Literal Real Rule '.
+ * @generated
+ */
+ LiteralRealRule createLiteralRealRule();
+
+ /**
+ * Returns a new object of class 'Literal Null Rule '.
+ *
+ *
+ * @return a new object of class 'Literal Null Rule '.
+ * @generated
+ */
+ LiteralNullRule createLiteralNullRule();
+
+ /**
+ * Returns a new object of class 'Literal String Rule '.
+ *
+ *
+ * @return a new object of class 'Literal String Rule '.
+ * @generated
+ */
+ LiteralStringRule createLiteralStringRule();
+
+ /**
+ * Returns a new object of class 'Undefined Rule '.
+ *
+ *
+ * @return a new object of class 'Undefined Rule '.
+ * @generated
+ */
+ UndefinedRule createUndefinedRule();
+
+ /**
+ * Returns a new object of class 'Visibility Kind '.
+ *
+ *
+ * @return a new object of class 'Visibility Kind '.
+ * @generated
+ */
+ VisibilityKind createVisibilityKind();
+
+ /**
+ * Returns the package supported by this factory.
+ *
+ *
+ * @return the package supported by this factory.
+ * @generated
+ */
+ UmlValueSpecificationPackage getUmlValueSpecificationPackage();
+
+} //UmlValueSpecificationFactory
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UmlValueSpecificationPackage.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UmlValueSpecificationPackage.java
new file mode 100644
index 00000000000..a18dccee499
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UmlValueSpecificationPackage.java
@@ -0,0 +1,817 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ *
+ * The Package for the model.
+ * It contains accessors for the meta objects to represent
+ *
+ * each class,
+ * each feature of each class,
+ * each enum,
+ * and each data type
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface UmlValueSpecificationPackage extends EPackage
+{
+ /**
+ * The package name.
+ *
+ *
+ * @generated
+ */
+ String eNAME = "umlValueSpecification";
+
+ /**
+ * The package namespace URI.
+ *
+ *
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecification";
+
+ /**
+ * The package namespace name.
+ *
+ *
+ * @generated
+ */
+ String eNS_PREFIX = "umlValueSpecification";
+
+ /**
+ * The singleton instance of the package.
+ *
+ *
+ * @generated
+ */
+ UmlValueSpecificationPackage eINSTANCE = org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl Abstract Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getAbstractRule()
+ * @generated
+ */
+ int ABSTRACT_RULE = 0;
+
+ /**
+ * The feature id for the 'Visibility ' containment reference.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_RULE__VISIBILITY = 0;
+
+ /**
+ * The feature id for the 'Name ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_RULE__NAME = 1;
+
+ /**
+ * The feature id for the 'Value ' containment reference.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_RULE__VALUE = 2;
+
+ /**
+ * The feature id for the 'Instance Specification ' reference.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_RULE__INSTANCE_SPECIFICATION = 3;
+
+ /**
+ * The feature id for the 'Undefined ' containment reference.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_RULE__UNDEFINED = 4;
+
+ /**
+ * The number of structural features of the 'Abstract Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_RULE_FEATURE_COUNT = 5;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralBooleanRuleImpl Literal Boolean Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralBooleanRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralBooleanRule()
+ * @generated
+ */
+ int LITERAL_BOOLEAN_RULE = 1;
+
+ /**
+ * The feature id for the 'Value ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_BOOLEAN_RULE__VALUE = 0;
+
+ /**
+ * The number of structural features of the 'Literal Boolean Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_BOOLEAN_RULE_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralIntegerOrUnlimitedNaturalRuleImpl Literal Integer Or Unlimited Natural Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralIntegerOrUnlimitedNaturalRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralIntegerOrUnlimitedNaturalRule()
+ * @generated
+ */
+ int LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE = 2;
+
+ /**
+ * The feature id for the 'Value ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE = 0;
+
+ /**
+ * The number of structural features of the 'Literal Integer Or Unlimited Natural Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralRealRuleImpl Literal Real Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralRealRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralRealRule()
+ * @generated
+ */
+ int LITERAL_REAL_RULE = 3;
+
+ /**
+ * The feature id for the 'Value ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_REAL_RULE__VALUE = 0;
+
+ /**
+ * The number of structural features of the 'Literal Real Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_REAL_RULE_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralNullRuleImpl Literal Null Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralNullRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralNullRule()
+ * @generated
+ */
+ int LITERAL_NULL_RULE = 4;
+
+ /**
+ * The feature id for the 'Value ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_NULL_RULE__VALUE = 0;
+
+ /**
+ * The number of structural features of the 'Literal Null Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_NULL_RULE_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralStringRuleImpl Literal String Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralStringRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralStringRule()
+ * @generated
+ */
+ int LITERAL_STRING_RULE = 5;
+
+ /**
+ * The feature id for the 'Value ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_STRING_RULE__VALUE = 0;
+
+ /**
+ * The number of structural features of the 'Literal String Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LITERAL_STRING_RULE_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UndefinedRuleImpl Undefined Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UndefinedRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getUndefinedRule()
+ * @generated
+ */
+ int UNDEFINED_RULE = 6;
+
+ /**
+ * The feature id for the 'Value ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int UNDEFINED_RULE__VALUE = 0;
+
+ /**
+ * The number of structural features of the 'Undefined Rule ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int UNDEFINED_RULE_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl Visibility Kind }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getVisibilityKind()
+ * @generated
+ */
+ int VISIBILITY_KIND = 7;
+
+ /**
+ * The feature id for the 'Public ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int VISIBILITY_KIND__PUBLIC = 0;
+
+ /**
+ * The feature id for the 'Private ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int VISIBILITY_KIND__PRIVATE = 1;
+
+ /**
+ * The feature id for the 'Protected ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int VISIBILITY_KIND__PROTECTED = 2;
+
+ /**
+ * The feature id for the 'Package ' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int VISIBILITY_KIND__PACKAGE = 3;
+
+ /**
+ * The number of structural features of the 'Visibility Kind ' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int VISIBILITY_KIND_FEATURE_COUNT = 4;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule Abstract Rule }'.
+ *
+ *
+ * @return the meta object for class 'Abstract Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule
+ * @generated
+ */
+ EClass getAbstractRule();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getVisibility Visibility }'.
+ *
+ *
+ * @return the meta object for the containment reference 'Visibility '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getVisibility()
+ * @see #getAbstractRule()
+ * @generated
+ */
+ EReference getAbstractRule_Visibility();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getName Name }'.
+ *
+ *
+ * @return the meta object for the attribute 'Name '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getName()
+ * @see #getAbstractRule()
+ * @generated
+ */
+ EAttribute getAbstractRule_Name();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the containment reference 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getValue()
+ * @see #getAbstractRule()
+ * @generated
+ */
+ EReference getAbstractRule_Value();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getInstanceSpecification Instance Specification }'.
+ *
+ *
+ * @return the meta object for the reference 'Instance Specification '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getInstanceSpecification()
+ * @see #getAbstractRule()
+ * @generated
+ */
+ EReference getAbstractRule_InstanceSpecification();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getUndefined Undefined }'.
+ *
+ *
+ * @return the meta object for the containment reference 'Undefined '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule#getUndefined()
+ * @see #getAbstractRule()
+ * @generated
+ */
+ EReference getAbstractRule_Undefined();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule Literal Boolean Rule }'.
+ *
+ *
+ * @return the meta object for class 'Literal Boolean Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule
+ * @generated
+ */
+ EClass getLiteralBooleanRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the attribute 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule#getValue()
+ * @see #getLiteralBooleanRule()
+ * @generated
+ */
+ EAttribute getLiteralBooleanRule_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule Literal Integer Or Unlimited Natural Rule }'.
+ *
+ *
+ * @return the meta object for class 'Literal Integer Or Unlimited Natural Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule
+ * @generated
+ */
+ EClass getLiteralIntegerOrUnlimitedNaturalRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the attribute 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule#getValue()
+ * @see #getLiteralIntegerOrUnlimitedNaturalRule()
+ * @generated
+ */
+ EAttribute getLiteralIntegerOrUnlimitedNaturalRule_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule Literal Real Rule }'.
+ *
+ *
+ * @return the meta object for class 'Literal Real Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule
+ * @generated
+ */
+ EClass getLiteralRealRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the attribute 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule#getValue()
+ * @see #getLiteralRealRule()
+ * @generated
+ */
+ EAttribute getLiteralRealRule_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule Literal Null Rule }'.
+ *
+ *
+ * @return the meta object for class 'Literal Null Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule
+ * @generated
+ */
+ EClass getLiteralNullRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the attribute 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule#getValue()
+ * @see #getLiteralNullRule()
+ * @generated
+ */
+ EAttribute getLiteralNullRule_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule Literal String Rule }'.
+ *
+ *
+ * @return the meta object for class 'Literal String Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule
+ * @generated
+ */
+ EClass getLiteralStringRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the attribute 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule#getValue()
+ * @see #getLiteralStringRule()
+ * @generated
+ */
+ EAttribute getLiteralStringRule_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule Undefined Rule }'.
+ *
+ *
+ * @return the meta object for class 'Undefined Rule '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule
+ * @generated
+ */
+ EClass getUndefinedRule();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule#getValue Value }'.
+ *
+ *
+ * @return the meta object for the attribute 'Value '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule#getValue()
+ * @see #getUndefinedRule()
+ * @generated
+ */
+ EAttribute getUndefinedRule_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind Visibility Kind }'.
+ *
+ *
+ * @return the meta object for class 'Visibility Kind '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind
+ * @generated
+ */
+ EClass getVisibilityKind();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPublic Public }'.
+ *
+ *
+ * @return the meta object for the attribute 'Public '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPublic()
+ * @see #getVisibilityKind()
+ * @generated
+ */
+ EAttribute getVisibilityKind_Public();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPrivate Private }'.
+ *
+ *
+ * @return the meta object for the attribute 'Private '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPrivate()
+ * @see #getVisibilityKind()
+ * @generated
+ */
+ EAttribute getVisibilityKind_Private();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getProtected Protected }'.
+ *
+ *
+ * @return the meta object for the attribute 'Protected '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getProtected()
+ * @see #getVisibilityKind()
+ * @generated
+ */
+ EAttribute getVisibilityKind_Protected();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPackage Package }'.
+ *
+ *
+ * @return the meta object for the attribute 'Package '.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPackage()
+ * @see #getVisibilityKind()
+ * @generated
+ */
+ EAttribute getVisibilityKind_Package();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ *
+ *
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ UmlValueSpecificationFactory getUmlValueSpecificationFactory();
+
+ /**
+ *
+ * Defines literals for the meta objects that represent
+ *
+ * each class,
+ * each feature of each class,
+ * each enum,
+ * and each data type
+ *
+ *
+ * @generated
+ */
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl Abstract Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getAbstractRule()
+ * @generated
+ */
+ EClass ABSTRACT_RULE = eINSTANCE.getAbstractRule();
+
+ /**
+ * The meta object literal for the 'Visibility ' containment reference feature.
+ *
+ *
+ * @generated
+ */
+ EReference ABSTRACT_RULE__VISIBILITY = eINSTANCE.getAbstractRule_Visibility();
+
+ /**
+ * The meta object literal for the 'Name ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute ABSTRACT_RULE__NAME = eINSTANCE.getAbstractRule_Name();
+
+ /**
+ * The meta object literal for the 'Value ' containment reference feature.
+ *
+ *
+ * @generated
+ */
+ EReference ABSTRACT_RULE__VALUE = eINSTANCE.getAbstractRule_Value();
+
+ /**
+ * The meta object literal for the 'Instance Specification ' reference feature.
+ *
+ *
+ * @generated
+ */
+ EReference ABSTRACT_RULE__INSTANCE_SPECIFICATION = eINSTANCE.getAbstractRule_InstanceSpecification();
+
+ /**
+ * The meta object literal for the 'Undefined ' containment reference feature.
+ *
+ *
+ * @generated
+ */
+ EReference ABSTRACT_RULE__UNDEFINED = eINSTANCE.getAbstractRule_Undefined();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralBooleanRuleImpl Literal Boolean Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralBooleanRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralBooleanRule()
+ * @generated
+ */
+ EClass LITERAL_BOOLEAN_RULE = eINSTANCE.getLiteralBooleanRule();
+
+ /**
+ * The meta object literal for the 'Value ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute LITERAL_BOOLEAN_RULE__VALUE = eINSTANCE.getLiteralBooleanRule_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralIntegerOrUnlimitedNaturalRuleImpl Literal Integer Or Unlimited Natural Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralIntegerOrUnlimitedNaturalRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralIntegerOrUnlimitedNaturalRule()
+ * @generated
+ */
+ EClass LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE = eINSTANCE.getLiteralIntegerOrUnlimitedNaturalRule();
+
+ /**
+ * The meta object literal for the 'Value ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE = eINSTANCE.getLiteralIntegerOrUnlimitedNaturalRule_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralRealRuleImpl Literal Real Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralRealRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralRealRule()
+ * @generated
+ */
+ EClass LITERAL_REAL_RULE = eINSTANCE.getLiteralRealRule();
+
+ /**
+ * The meta object literal for the 'Value ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute LITERAL_REAL_RULE__VALUE = eINSTANCE.getLiteralRealRule_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralNullRuleImpl Literal Null Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralNullRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralNullRule()
+ * @generated
+ */
+ EClass LITERAL_NULL_RULE = eINSTANCE.getLiteralNullRule();
+
+ /**
+ * The meta object literal for the 'Value ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute LITERAL_NULL_RULE__VALUE = eINSTANCE.getLiteralNullRule_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralStringRuleImpl Literal String Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralStringRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getLiteralStringRule()
+ * @generated
+ */
+ EClass LITERAL_STRING_RULE = eINSTANCE.getLiteralStringRule();
+
+ /**
+ * The meta object literal for the 'Value ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute LITERAL_STRING_RULE__VALUE = eINSTANCE.getLiteralStringRule_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UndefinedRuleImpl Undefined Rule }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UndefinedRuleImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getUndefinedRule()
+ * @generated
+ */
+ EClass UNDEFINED_RULE = eINSTANCE.getUndefinedRule();
+
+ /**
+ * The meta object literal for the 'Value ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute UNDEFINED_RULE__VALUE = eINSTANCE.getUndefinedRule_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl Visibility Kind }' class.
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UmlValueSpecificationPackageImpl#getVisibilityKind()
+ * @generated
+ */
+ EClass VISIBILITY_KIND = eINSTANCE.getVisibilityKind();
+
+ /**
+ * The meta object literal for the 'Public ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute VISIBILITY_KIND__PUBLIC = eINSTANCE.getVisibilityKind_Public();
+
+ /**
+ * The meta object literal for the 'Private ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute VISIBILITY_KIND__PRIVATE = eINSTANCE.getVisibilityKind_Private();
+
+ /**
+ * The meta object literal for the 'Protected ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute VISIBILITY_KIND__PROTECTED = eINSTANCE.getVisibilityKind_Protected();
+
+ /**
+ * The meta object literal for the 'Package ' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute VISIBILITY_KIND__PACKAGE = eINSTANCE.getVisibilityKind_Package();
+
+ }
+
+} //UmlValueSpecificationPackage
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UndefinedRule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UndefinedRule.java
new file mode 100644
index 00000000000..0613b310f32
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/UndefinedRule.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Undefined Rule '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule#getValue Value }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getUndefinedRule()
+ * @model
+ * @generated
+ */
+public interface UndefinedRule extends EObject
+{
+ /**
+ * Returns the value of the 'Value ' attribute.
+ *
+ *
+ * If the meaning of the 'Value ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Value ' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getUndefinedRule_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule#getValue Value }' attribute.
+ *
+ *
+ * @param value the new value of the 'Value ' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // UndefinedRule
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/VisibilityKind.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/VisibilityKind.java
new file mode 100644
index 00000000000..ec20f54f93e
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/VisibilityKind.java
@@ -0,0 +1,132 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Visibility Kind '.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPublic Public }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPrivate Private }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getProtected Protected }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPackage Package }
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getVisibilityKind()
+ * @model
+ * @generated
+ */
+public interface VisibilityKind extends EObject
+{
+ /**
+ * Returns the value of the 'Public ' attribute.
+ *
+ *
+ * If the meaning of the 'Public ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Public ' attribute.
+ * @see #setPublic(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getVisibilityKind_Public()
+ * @model
+ * @generated
+ */
+ String getPublic();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPublic Public }' attribute.
+ *
+ *
+ * @param value the new value of the 'Public ' attribute.
+ * @see #getPublic()
+ * @generated
+ */
+ void setPublic(String value);
+
+ /**
+ * Returns the value of the 'Private ' attribute.
+ *
+ *
+ * If the meaning of the 'Private ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Private ' attribute.
+ * @see #setPrivate(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getVisibilityKind_Private()
+ * @model
+ * @generated
+ */
+ String getPrivate();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPrivate Private }' attribute.
+ *
+ *
+ * @param value the new value of the 'Private ' attribute.
+ * @see #getPrivate()
+ * @generated
+ */
+ void setPrivate(String value);
+
+ /**
+ * Returns the value of the 'Protected ' attribute.
+ *
+ *
+ * If the meaning of the 'Protected ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Protected ' attribute.
+ * @see #setProtected(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getVisibilityKind_Protected()
+ * @model
+ * @generated
+ */
+ String getProtected();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getProtected Protected }' attribute.
+ *
+ *
+ * @param value the new value of the 'Protected ' attribute.
+ * @see #getProtected()
+ * @generated
+ */
+ void setProtected(String value);
+
+ /**
+ * Returns the value of the 'Package ' attribute.
+ *
+ *
+ * If the meaning of the 'Package ' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Package ' attribute.
+ * @see #setPackage(String)
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#getVisibilityKind_Package()
+ * @model
+ * @generated
+ */
+ String getPackage();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind#getPackage Package }' attribute.
+ *
+ *
+ * @param value the new value of the 'Package ' attribute.
+ * @see #getPackage()
+ * @generated
+ */
+ void setPackage(String value);
+
+} // VisibilityKind
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/AbstractRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/AbstractRuleImpl.java
new file mode 100644
index 00000000000..43612a21841
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/AbstractRuleImpl.java
@@ -0,0 +1,476 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind;
+
+import org.eclipse.uml2.uml.InstanceSpecification;
+
+/**
+ *
+ * An implementation of the model object 'Abstract Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl#getVisibility Visibility }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl#getName Name }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl#getValue Value }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl#getInstanceSpecification Instance Specification }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.AbstractRuleImpl#getUndefined Undefined }
+ *
+ *
+ *
+ * @generated
+ */
+public class AbstractRuleImpl extends MinimalEObjectImpl.Container implements AbstractRule
+{
+ /**
+ * The cached value of the '{@link #getVisibility() Visibility }' containment reference.
+ *
+ *
+ * @see #getVisibility()
+ * @generated
+ * @ordered
+ */
+ protected VisibilityKind visibility;
+
+ /**
+ * The default value of the '{@link #getName() Name }' attribute.
+ *
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() Name }' attribute.
+ *
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' containment reference.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected EObject value;
+
+ /**
+ * The cached value of the '{@link #getInstanceSpecification() Instance Specification }' reference.
+ *
+ *
+ * @see #getInstanceSpecification()
+ * @generated
+ * @ordered
+ */
+ protected InstanceSpecification instanceSpecification;
+
+ /**
+ * The cached value of the '{@link #getUndefined() Undefined }' containment reference.
+ *
+ *
+ * @see #getUndefined()
+ * @generated
+ * @ordered
+ */
+ protected UndefinedRule undefined;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected AbstractRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.ABSTRACT_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public VisibilityKind getVisibility()
+ {
+ return visibility;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetVisibility(VisibilityKind newVisibility, NotificationChain msgs)
+ {
+ VisibilityKind oldVisibility = visibility;
+ visibility = newVisibility;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY, oldVisibility, newVisibility);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setVisibility(VisibilityKind newVisibility)
+ {
+ if (newVisibility != visibility)
+ {
+ NotificationChain msgs = null;
+ if (visibility != null)
+ msgs = ((InternalEObject)visibility).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY, null, msgs);
+ if (newVisibility != null)
+ msgs = ((InternalEObject)newVisibility).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY, null, msgs);
+ msgs = basicSetVisibility(newVisibility, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY, newVisibility, newVisibility));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__NAME, oldName, name));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EObject getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetValue(EObject newValue, NotificationChain msgs)
+ {
+ EObject oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE, oldValue, newValue);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(EObject newValue)
+ {
+ if (newValue != value)
+ {
+ NotificationChain msgs = null;
+ if (value != null)
+ msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE, null, msgs);
+ if (newValue != null)
+ msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE, null, msgs);
+ msgs = basicSetValue(newValue, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE, newValue, newValue));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public InstanceSpecification getInstanceSpecification()
+ {
+ if (instanceSpecification != null && instanceSpecification.eIsProxy())
+ {
+ InternalEObject oldInstanceSpecification = (InternalEObject)instanceSpecification;
+ instanceSpecification = (InstanceSpecification)eResolveProxy(oldInstanceSpecification);
+ if (instanceSpecification != oldInstanceSpecification)
+ {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, UmlValueSpecificationPackage.ABSTRACT_RULE__INSTANCE_SPECIFICATION, oldInstanceSpecification, instanceSpecification));
+ }
+ }
+ return instanceSpecification;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public InstanceSpecification basicGetInstanceSpecification()
+ {
+ return instanceSpecification;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setInstanceSpecification(InstanceSpecification newInstanceSpecification)
+ {
+ InstanceSpecification oldInstanceSpecification = instanceSpecification;
+ instanceSpecification = newInstanceSpecification;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__INSTANCE_SPECIFICATION, oldInstanceSpecification, instanceSpecification));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public UndefinedRule getUndefined()
+ {
+ return undefined;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetUndefined(UndefinedRule newUndefined, NotificationChain msgs)
+ {
+ UndefinedRule oldUndefined = undefined;
+ undefined = newUndefined;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED, oldUndefined, newUndefined);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setUndefined(UndefinedRule newUndefined)
+ {
+ if (newUndefined != undefined)
+ {
+ NotificationChain msgs = null;
+ if (undefined != null)
+ msgs = ((InternalEObject)undefined).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED, null, msgs);
+ if (newUndefined != null)
+ msgs = ((InternalEObject)newUndefined).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED, null, msgs);
+ msgs = basicSetUndefined(newUndefined, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED, newUndefined, newUndefined));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY:
+ return basicSetVisibility(null, msgs);
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE:
+ return basicSetValue(null, msgs);
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED:
+ return basicSetUndefined(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY:
+ return getVisibility();
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__NAME:
+ return getName();
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE:
+ return getValue();
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__INSTANCE_SPECIFICATION:
+ if (resolve) return getInstanceSpecification();
+ return basicGetInstanceSpecification();
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED:
+ return getUndefined();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY:
+ setVisibility((VisibilityKind)newValue);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__NAME:
+ setName((String)newValue);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE:
+ setValue((EObject)newValue);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__INSTANCE_SPECIFICATION:
+ setInstanceSpecification((InstanceSpecification)newValue);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED:
+ setUndefined((UndefinedRule)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY:
+ setVisibility((VisibilityKind)null);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE:
+ setValue((EObject)null);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__INSTANCE_SPECIFICATION:
+ setInstanceSpecification((InstanceSpecification)null);
+ return;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED:
+ setUndefined((UndefinedRule)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VISIBILITY:
+ return visibility != null;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__VALUE:
+ return value != null;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__INSTANCE_SPECIFICATION:
+ return instanceSpecification != null;
+ case UmlValueSpecificationPackage.ABSTRACT_RULE__UNDEFINED:
+ return undefined != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //AbstractRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralBooleanRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralBooleanRuleImpl.java
new file mode 100644
index 00000000000..c7a100020a0
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralBooleanRuleImpl.java
@@ -0,0 +1,177 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+
+/**
+ *
+ * An implementation of the model object 'Literal Boolean Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralBooleanRuleImpl#getValue Value }
+ *
+ *
+ *
+ * @generated
+ */
+public class LiteralBooleanRuleImpl extends MinimalEObjectImpl.Container implements LiteralBooleanRule
+{
+ /**
+ * The default value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected LiteralBooleanRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.LITERAL_BOOLEAN_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(String newValue)
+ {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LiteralBooleanRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralIntegerOrUnlimitedNaturalRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralIntegerOrUnlimitedNaturalRuleImpl.java
new file mode 100644
index 00000000000..f53af4abbac
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralIntegerOrUnlimitedNaturalRuleImpl.java
@@ -0,0 +1,177 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+
+/**
+ *
+ * An implementation of the model object 'Literal Integer Or Unlimited Natural Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralIntegerOrUnlimitedNaturalRuleImpl#getValue Value }
+ *
+ *
+ *
+ * @generated
+ */
+public class LiteralIntegerOrUnlimitedNaturalRuleImpl extends MinimalEObjectImpl.Container implements LiteralIntegerOrUnlimitedNaturalRule
+{
+ /**
+ * The default value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final int VALUE_EDEFAULT = 0;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected int value = VALUE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected LiteralIntegerOrUnlimitedNaturalRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(int newValue)
+ {
+ int oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE:
+ setValue((Integer)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE:
+ return value != VALUE_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LiteralIntegerOrUnlimitedNaturalRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralNullRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralNullRuleImpl.java
new file mode 100644
index 00000000000..b44dd319895
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralNullRuleImpl.java
@@ -0,0 +1,177 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+
+/**
+ *
+ * An implementation of the model object 'Literal Null Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralNullRuleImpl#getValue Value }
+ *
+ *
+ *
+ * @generated
+ */
+public class LiteralNullRuleImpl extends MinimalEObjectImpl.Container implements LiteralNullRule
+{
+ /**
+ * The default value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected LiteralNullRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.LITERAL_NULL_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(String newValue)
+ {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.LITERAL_NULL_RULE__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_NULL_RULE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_NULL_RULE__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_NULL_RULE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_NULL_RULE__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LiteralNullRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralRealRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralRealRuleImpl.java
new file mode 100644
index 00000000000..a7300220e15
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralRealRuleImpl.java
@@ -0,0 +1,177 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+
+/**
+ *
+ * An implementation of the model object 'Literal Real Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralRealRuleImpl#getValue Value }
+ *
+ *
+ *
+ * @generated
+ */
+public class LiteralRealRuleImpl extends MinimalEObjectImpl.Container implements LiteralRealRule
+{
+ /**
+ * The default value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final double VALUE_EDEFAULT = 0.0;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected double value = VALUE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected LiteralRealRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.LITERAL_REAL_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public double getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(double newValue)
+ {
+ double oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.LITERAL_REAL_RULE__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_REAL_RULE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_REAL_RULE__VALUE:
+ setValue((Double)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_REAL_RULE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_REAL_RULE__VALUE:
+ return value != VALUE_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LiteralRealRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralStringRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralStringRuleImpl.java
new file mode 100644
index 00000000000..862ba6e6d1a
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/LiteralStringRuleImpl.java
@@ -0,0 +1,177 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+
+/**
+ *
+ * An implementation of the model object 'Literal String Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.LiteralStringRuleImpl#getValue Value }
+ *
+ *
+ *
+ * @generated
+ */
+public class LiteralStringRuleImpl extends MinimalEObjectImpl.Container implements LiteralStringRule
+{
+ /**
+ * The default value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected LiteralStringRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.LITERAL_STRING_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(String newValue)
+ {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.LITERAL_STRING_RULE__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_STRING_RULE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_STRING_RULE__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_STRING_RULE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.LITERAL_STRING_RULE__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LiteralStringRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UmlValueSpecificationFactoryImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UmlValueSpecificationFactoryImpl.java
new file mode 100644
index 00000000000..0a04c9c4e32
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UmlValueSpecificationFactoryImpl.java
@@ -0,0 +1,190 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.ecore.EClass;
+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.uml.textedit.valuespecification.xtext.umlValueSpecification.*;
+
+/**
+ *
+ * An implementation of the model Factory .
+ *
+ * @generated
+ */
+public class UmlValueSpecificationFactoryImpl extends EFactoryImpl implements UmlValueSpecificationFactory
+{
+ /**
+ * Creates the default factory implementation.
+ *
+ *
+ * @generated
+ */
+ public static UmlValueSpecificationFactory init()
+ {
+ try
+ {
+ UmlValueSpecificationFactory theUmlValueSpecificationFactory = (UmlValueSpecificationFactory)EPackage.Registry.INSTANCE.getEFactory(UmlValueSpecificationPackage.eNS_URI);
+ if (theUmlValueSpecificationFactory != null)
+ {
+ return theUmlValueSpecificationFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new UmlValueSpecificationFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ *
+ *
+ * @generated
+ */
+ public UmlValueSpecificationFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE: return createAbstractRule();
+ case UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE: return createLiteralBooleanRule();
+ case UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE: return createLiteralIntegerOrUnlimitedNaturalRule();
+ case UmlValueSpecificationPackage.LITERAL_REAL_RULE: return createLiteralRealRule();
+ case UmlValueSpecificationPackage.LITERAL_NULL_RULE: return createLiteralNullRule();
+ case UmlValueSpecificationPackage.LITERAL_STRING_RULE: return createLiteralStringRule();
+ case UmlValueSpecificationPackage.UNDEFINED_RULE: return createUndefinedRule();
+ case UmlValueSpecificationPackage.VISIBILITY_KIND: return createVisibilityKind();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public AbstractRule createAbstractRule()
+ {
+ AbstractRuleImpl abstractRule = new AbstractRuleImpl();
+ return abstractRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public LiteralBooleanRule createLiteralBooleanRule()
+ {
+ LiteralBooleanRuleImpl literalBooleanRule = new LiteralBooleanRuleImpl();
+ return literalBooleanRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public LiteralIntegerOrUnlimitedNaturalRule createLiteralIntegerOrUnlimitedNaturalRule()
+ {
+ LiteralIntegerOrUnlimitedNaturalRuleImpl literalIntegerOrUnlimitedNaturalRule = new LiteralIntegerOrUnlimitedNaturalRuleImpl();
+ return literalIntegerOrUnlimitedNaturalRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public LiteralRealRule createLiteralRealRule()
+ {
+ LiteralRealRuleImpl literalRealRule = new LiteralRealRuleImpl();
+ return literalRealRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public LiteralNullRule createLiteralNullRule()
+ {
+ LiteralNullRuleImpl literalNullRule = new LiteralNullRuleImpl();
+ return literalNullRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public LiteralStringRule createLiteralStringRule()
+ {
+ LiteralStringRuleImpl literalStringRule = new LiteralStringRuleImpl();
+ return literalStringRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public UndefinedRule createUndefinedRule()
+ {
+ UndefinedRuleImpl undefinedRule = new UndefinedRuleImpl();
+ return undefinedRule;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public VisibilityKind createVisibilityKind()
+ {
+ VisibilityKindImpl visibilityKind = new VisibilityKindImpl();
+ return visibilityKind;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public UmlValueSpecificationPackage getUmlValueSpecificationPackage()
+ {
+ return (UmlValueSpecificationPackage)getEPackage();
+ }
+
+ /**
+ *
+ *
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static UmlValueSpecificationPackage getPackage()
+ {
+ return UmlValueSpecificationPackage.eINSTANCE;
+ }
+
+} //UmlValueSpecificationFactoryImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UmlValueSpecificationPackageImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UmlValueSpecificationPackageImpl.java
new file mode 100644
index 00000000000..9a37bb5ee0a
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UmlValueSpecificationPackageImpl.java
@@ -0,0 +1,518 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationFactory;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind;
+
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * An implementation of the model Package .
+ *
+ * @generated
+ */
+public class UmlValueSpecificationPackageImpl extends EPackageImpl implements UmlValueSpecificationPackage
+{
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass abstractRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass literalBooleanRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass literalIntegerOrUnlimitedNaturalRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass literalRealRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass literalNullRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass literalStringRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass undefinedRuleEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass visibilityKindEClass = null;
+
+ /**
+ * Creates an instance of the model Package , registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ *
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private UmlValueSpecificationPackageImpl()
+ {
+ super(eNS_URI, UmlValueSpecificationFactory.eINSTANCE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the Package for this model, and for any others upon which it depends.
+ *
+ *
This method is used to initialize {@link UmlValueSpecificationPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ *
+ *
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static UmlValueSpecificationPackage init()
+ {
+ if (isInited) return (UmlValueSpecificationPackage)EPackage.Registry.INSTANCE.getEPackage(UmlValueSpecificationPackage.eNS_URI);
+
+ // Obtain or create and register package
+ UmlValueSpecificationPackageImpl theUmlValueSpecificationPackage = (UmlValueSpecificationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof UmlValueSpecificationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new UmlValueSpecificationPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ UMLPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theUmlValueSpecificationPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theUmlValueSpecificationPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theUmlValueSpecificationPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(UmlValueSpecificationPackage.eNS_URI, theUmlValueSpecificationPackage);
+ return theUmlValueSpecificationPackage;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getAbstractRule()
+ {
+ return abstractRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAbstractRule_Visibility()
+ {
+ return (EReference)abstractRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getAbstractRule_Name()
+ {
+ return (EAttribute)abstractRuleEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAbstractRule_Value()
+ {
+ return (EReference)abstractRuleEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAbstractRule_InstanceSpecification()
+ {
+ return (EReference)abstractRuleEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAbstractRule_Undefined()
+ {
+ return (EReference)abstractRuleEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getLiteralBooleanRule()
+ {
+ return literalBooleanRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getLiteralBooleanRule_Value()
+ {
+ return (EAttribute)literalBooleanRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getLiteralIntegerOrUnlimitedNaturalRule()
+ {
+ return literalIntegerOrUnlimitedNaturalRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getLiteralIntegerOrUnlimitedNaturalRule_Value()
+ {
+ return (EAttribute)literalIntegerOrUnlimitedNaturalRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getLiteralRealRule()
+ {
+ return literalRealRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getLiteralRealRule_Value()
+ {
+ return (EAttribute)literalRealRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getLiteralNullRule()
+ {
+ return literalNullRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getLiteralNullRule_Value()
+ {
+ return (EAttribute)literalNullRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getLiteralStringRule()
+ {
+ return literalStringRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getLiteralStringRule_Value()
+ {
+ return (EAttribute)literalStringRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getUndefinedRule()
+ {
+ return undefinedRuleEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getUndefinedRule_Value()
+ {
+ return (EAttribute)undefinedRuleEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getVisibilityKind()
+ {
+ return visibilityKindEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getVisibilityKind_Public()
+ {
+ return (EAttribute)visibilityKindEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getVisibilityKind_Private()
+ {
+ return (EAttribute)visibilityKindEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getVisibilityKind_Protected()
+ {
+ return (EAttribute)visibilityKindEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getVisibilityKind_Package()
+ {
+ return (EAttribute)visibilityKindEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public UmlValueSpecificationFactory getUmlValueSpecificationFactory()
+ {
+ return (UmlValueSpecificationFactory)getEFactoryInstance();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ abstractRuleEClass = createEClass(ABSTRACT_RULE);
+ createEReference(abstractRuleEClass, ABSTRACT_RULE__VISIBILITY);
+ createEAttribute(abstractRuleEClass, ABSTRACT_RULE__NAME);
+ createEReference(abstractRuleEClass, ABSTRACT_RULE__VALUE);
+ createEReference(abstractRuleEClass, ABSTRACT_RULE__INSTANCE_SPECIFICATION);
+ createEReference(abstractRuleEClass, ABSTRACT_RULE__UNDEFINED);
+
+ literalBooleanRuleEClass = createEClass(LITERAL_BOOLEAN_RULE);
+ createEAttribute(literalBooleanRuleEClass, LITERAL_BOOLEAN_RULE__VALUE);
+
+ literalIntegerOrUnlimitedNaturalRuleEClass = createEClass(LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE);
+ createEAttribute(literalIntegerOrUnlimitedNaturalRuleEClass, LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE__VALUE);
+
+ literalRealRuleEClass = createEClass(LITERAL_REAL_RULE);
+ createEAttribute(literalRealRuleEClass, LITERAL_REAL_RULE__VALUE);
+
+ literalNullRuleEClass = createEClass(LITERAL_NULL_RULE);
+ createEAttribute(literalNullRuleEClass, LITERAL_NULL_RULE__VALUE);
+
+ literalStringRuleEClass = createEClass(LITERAL_STRING_RULE);
+ createEAttribute(literalStringRuleEClass, LITERAL_STRING_RULE__VALUE);
+
+ undefinedRuleEClass = createEClass(UNDEFINED_RULE);
+ createEAttribute(undefinedRuleEClass, UNDEFINED_RULE__VALUE);
+
+ visibilityKindEClass = createEClass(VISIBILITY_KIND);
+ createEAttribute(visibilityKindEClass, VISIBILITY_KIND__PUBLIC);
+ createEAttribute(visibilityKindEClass, VISIBILITY_KIND__PRIVATE);
+ createEAttribute(visibilityKindEClass, VISIBILITY_KIND__PROTECTED);
+ createEAttribute(visibilityKindEClass, VISIBILITY_KIND__PACKAGE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+ UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(abstractRuleEClass, AbstractRule.class, "AbstractRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getAbstractRule_Visibility(), this.getVisibilityKind(), null, "visibility", null, 0, 1, AbstractRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getAbstractRule_Name(), theEcorePackage.getEString(), "name", null, 0, 1, AbstractRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getAbstractRule_Value(), theEcorePackage.getEObject(), null, "value", null, 0, 1, AbstractRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getAbstractRule_InstanceSpecification(), theUMLPackage.getInstanceSpecification(), null, "instanceSpecification", null, 0, 1, AbstractRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getAbstractRule_Undefined(), this.getUndefinedRule(), null, "undefined", null, 0, 1, AbstractRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(literalBooleanRuleEClass, LiteralBooleanRule.class, "LiteralBooleanRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLiteralBooleanRule_Value(), theEcorePackage.getEString(), "value", null, 0, 1, LiteralBooleanRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(literalIntegerOrUnlimitedNaturalRuleEClass, LiteralIntegerOrUnlimitedNaturalRule.class, "LiteralIntegerOrUnlimitedNaturalRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLiteralIntegerOrUnlimitedNaturalRule_Value(), theEcorePackage.getEInt(), "value", null, 0, 1, LiteralIntegerOrUnlimitedNaturalRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(literalRealRuleEClass, LiteralRealRule.class, "LiteralRealRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLiteralRealRule_Value(), theEcorePackage.getEDouble(), "value", null, 0, 1, LiteralRealRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(literalNullRuleEClass, LiteralNullRule.class, "LiteralNullRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLiteralNullRule_Value(), theEcorePackage.getEString(), "value", null, 0, 1, LiteralNullRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(literalStringRuleEClass, LiteralStringRule.class, "LiteralStringRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLiteralStringRule_Value(), theEcorePackage.getEString(), "value", null, 0, 1, LiteralStringRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(undefinedRuleEClass, UndefinedRule.class, "UndefinedRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getUndefinedRule_Value(), theEcorePackage.getEString(), "value", null, 0, 1, UndefinedRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(visibilityKindEClass, VisibilityKind.class, "VisibilityKind", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getVisibilityKind_Public(), theEcorePackage.getEString(), "public", null, 0, 1, VisibilityKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getVisibilityKind_Private(), theEcorePackage.getEString(), "private", null, 0, 1, VisibilityKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getVisibilityKind_Protected(), theEcorePackage.getEString(), "protected", null, 0, 1, VisibilityKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getVisibilityKind_Package(), theEcorePackage.getEString(), "package", null, 0, 1, VisibilityKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //UmlValueSpecificationPackageImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UndefinedRuleImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UndefinedRuleImpl.java
new file mode 100644
index 00000000000..79070f838a1
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/UndefinedRuleImpl.java
@@ -0,0 +1,177 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule;
+
+/**
+ *
+ * An implementation of the model object 'Undefined Rule '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.UndefinedRuleImpl#getValue Value }
+ *
+ *
+ *
+ * @generated
+ */
+public class UndefinedRuleImpl extends MinimalEObjectImpl.Container implements UndefinedRule
+{
+ /**
+ * The default value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() Value }' attribute.
+ *
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected UndefinedRuleImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.UNDEFINED_RULE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setValue(String newValue)
+ {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.UNDEFINED_RULE__VALUE, oldValue, value));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.UNDEFINED_RULE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.UNDEFINED_RULE__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.UNDEFINED_RULE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.UNDEFINED_RULE__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //UndefinedRuleImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/VisibilityKindImpl.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/VisibilityKindImpl.java
new file mode 100644
index 00000000000..9408dd0e8f7
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/impl/VisibilityKindImpl.java
@@ -0,0 +1,345 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind;
+
+/**
+ *
+ * An implementation of the model object 'Visibility Kind '.
+ *
+ *
+ * The following features are implemented:
+ *
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl#getPublic Public }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl#getPrivate Private }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl#getProtected Protected }
+ * {@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.impl.VisibilityKindImpl#getPackage Package }
+ *
+ *
+ *
+ * @generated
+ */
+public class VisibilityKindImpl extends MinimalEObjectImpl.Container implements VisibilityKind
+{
+ /**
+ * The default value of the '{@link #getPublic() Public }' attribute.
+ *
+ *
+ * @see #getPublic()
+ * @generated
+ * @ordered
+ */
+ protected static final String PUBLIC_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPublic() Public }' attribute.
+ *
+ *
+ * @see #getPublic()
+ * @generated
+ * @ordered
+ */
+ protected String public_ = PUBLIC_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPrivate() Private }' attribute.
+ *
+ *
+ * @see #getPrivate()
+ * @generated
+ * @ordered
+ */
+ protected static final String PRIVATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPrivate() Private }' attribute.
+ *
+ *
+ * @see #getPrivate()
+ * @generated
+ * @ordered
+ */
+ protected String private_ = PRIVATE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getProtected() Protected }' attribute.
+ *
+ *
+ * @see #getProtected()
+ * @generated
+ * @ordered
+ */
+ protected static final String PROTECTED_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getProtected() Protected }' attribute.
+ *
+ *
+ * @see #getProtected()
+ * @generated
+ * @ordered
+ */
+ protected String protected_ = PROTECTED_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPackage() Package }' attribute.
+ *
+ *
+ * @see #getPackage()
+ * @generated
+ * @ordered
+ */
+ protected static final String PACKAGE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPackage() Package }' attribute.
+ *
+ *
+ * @see #getPackage()
+ * @generated
+ * @ordered
+ */
+ protected String package_ = PACKAGE_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected VisibilityKindImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return UmlValueSpecificationPackage.Literals.VISIBILITY_KIND;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getPublic()
+ {
+ return public_;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setPublic(String newPublic)
+ {
+ String oldPublic = public_;
+ public_ = newPublic;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.VISIBILITY_KIND__PUBLIC, oldPublic, public_));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getPrivate()
+ {
+ return private_;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setPrivate(String newPrivate)
+ {
+ String oldPrivate = private_;
+ private_ = newPrivate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.VISIBILITY_KIND__PRIVATE, oldPrivate, private_));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getProtected()
+ {
+ return protected_;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setProtected(String newProtected)
+ {
+ String oldProtected = protected_;
+ protected_ = newProtected;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.VISIBILITY_KIND__PROTECTED, oldProtected, protected_));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getPackage()
+ {
+ return package_;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setPackage(String newPackage)
+ {
+ String oldPackage = package_;
+ package_ = newPackage;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UmlValueSpecificationPackage.VISIBILITY_KIND__PACKAGE, oldPackage, package_));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PUBLIC:
+ return getPublic();
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PRIVATE:
+ return getPrivate();
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PROTECTED:
+ return getProtected();
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PACKAGE:
+ return getPackage();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PUBLIC:
+ setPublic((String)newValue);
+ return;
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PRIVATE:
+ setPrivate((String)newValue);
+ return;
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PROTECTED:
+ setProtected((String)newValue);
+ return;
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PACKAGE:
+ setPackage((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PUBLIC:
+ setPublic(PUBLIC_EDEFAULT);
+ return;
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PRIVATE:
+ setPrivate(PRIVATE_EDEFAULT);
+ return;
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PROTECTED:
+ setProtected(PROTECTED_EDEFAULT);
+ return;
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PACKAGE:
+ setPackage(PACKAGE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PUBLIC:
+ return PUBLIC_EDEFAULT == null ? public_ != null : !PUBLIC_EDEFAULT.equals(public_);
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PRIVATE:
+ return PRIVATE_EDEFAULT == null ? private_ != null : !PRIVATE_EDEFAULT.equals(private_);
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PROTECTED:
+ return PROTECTED_EDEFAULT == null ? protected_ != null : !PROTECTED_EDEFAULT.equals(protected_);
+ case UmlValueSpecificationPackage.VISIBILITY_KIND__PACKAGE:
+ return PACKAGE_EDEFAULT == null ? package_ != null : !PACKAGE_EDEFAULT.equals(package_);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (public: ");
+ result.append(public_);
+ result.append(", private: ");
+ result.append(private_);
+ result.append(", protected: ");
+ result.append(protected_);
+ result.append(", package: ");
+ result.append(package_);
+ result.append(')');
+ return result.toString();
+ }
+
+} //VisibilityKindImpl
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/util/UmlValueSpecificationAdapterFactory.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/util/UmlValueSpecificationAdapterFactory.java
new file mode 100644
index 00000000000..a8a1c689cbe
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/util/UmlValueSpecificationAdapterFactory.java
@@ -0,0 +1,272 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.util;
+
+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.uml.textedit.valuespecification.xtext.umlValueSpecification.*;
+
+/**
+ *
+ * The Adapter Factory for the model.
+ * It provides an adapter createXXX
method for each class of the model.
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage
+ * @generated
+ */
+public class UmlValueSpecificationAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ *
+ *
+ * @generated
+ */
+ protected static UmlValueSpecificationPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ *
+ *
+ * @generated
+ */
+ public UmlValueSpecificationAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = UmlValueSpecificationPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ *
+ * This implementation returns true
if the object is either the model's package or is an instance object of the model.
+ *
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object)
+ {
+ if (object == modelPackage)
+ {
+ return true;
+ }
+ if (object instanceof EObject)
+ {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the createXXX
methods.
+ *
+ *
+ * @generated
+ */
+ protected UmlValueSpecificationSwitch modelSwitch =
+ new UmlValueSpecificationSwitch()
+ {
+ @Override
+ public Adapter caseAbstractRule(AbstractRule object)
+ {
+ return createAbstractRuleAdapter();
+ }
+ @Override
+ public Adapter caseLiteralBooleanRule(LiteralBooleanRule object)
+ {
+ return createLiteralBooleanRuleAdapter();
+ }
+ @Override
+ public Adapter caseLiteralIntegerOrUnlimitedNaturalRule(LiteralIntegerOrUnlimitedNaturalRule object)
+ {
+ return createLiteralIntegerOrUnlimitedNaturalRuleAdapter();
+ }
+ @Override
+ public Adapter caseLiteralRealRule(LiteralRealRule object)
+ {
+ return createLiteralRealRuleAdapter();
+ }
+ @Override
+ public Adapter caseLiteralNullRule(LiteralNullRule object)
+ {
+ return createLiteralNullRuleAdapter();
+ }
+ @Override
+ public Adapter caseLiteralStringRule(LiteralStringRule object)
+ {
+ return createLiteralStringRuleAdapter();
+ }
+ @Override
+ public Adapter caseUndefinedRule(UndefinedRule object)
+ {
+ return createUndefinedRuleAdapter();
+ }
+ @Override
+ public Adapter caseVisibilityKind(VisibilityKind object)
+ {
+ return createVisibilityKindAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object)
+ {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the target
.
+ *
+ *
+ * @param target the object to adapt.
+ * @return the adapter for the target
.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule Abstract Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule
+ * @generated
+ */
+ public Adapter createAbstractRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule Literal Boolean Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralBooleanRule
+ * @generated
+ */
+ public Adapter createLiteralBooleanRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule Literal Integer Or Unlimited Natural Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralIntegerOrUnlimitedNaturalRule
+ * @generated
+ */
+ public Adapter createLiteralIntegerOrUnlimitedNaturalRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule Literal Real Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralRealRule
+ * @generated
+ */
+ public Adapter createLiteralRealRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule Literal Null Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralNullRule
+ * @generated
+ */
+ public Adapter createLiteralNullRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule Literal String Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.LiteralStringRule
+ * @generated
+ */
+ public Adapter createLiteralStringRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule Undefined Rule }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UndefinedRule
+ * @generated
+ */
+ public Adapter createUndefinedRuleAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind Visibility Kind }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.VisibilityKind
+ * @generated
+ */
+ public Adapter createVisibilityKindAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ *
+ * This default implementation returns null.
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} //UmlValueSpecificationAdapterFactory
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/util/UmlValueSpecificationSwitch.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/util/UmlValueSpecificationSwitch.java
new file mode 100644
index 00000000000..61807d4b4d6
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/umlValueSpecification/util/UmlValueSpecificationSwitch.java
@@ -0,0 +1,280 @@
+/**
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.*;
+
+/**
+ *
+ * The Switch for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the caseXXX
method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ *
+ * @see org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage
+ * @generated
+ */
+public class UmlValueSpecificationSwitch extends Switch
+{
+ /**
+ * The cached model package
+ *
+ *
+ * @generated
+ */
+ protected static UmlValueSpecificationPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ *
+ *
+ * @generated
+ */
+ public UmlValueSpecificationSwitch()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = UmlValueSpecificationPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ *
+ *
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage)
+ {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls caseXXX
for each class of the model until one returns a non null result; it yields that result.
+ *
+ *
+ * @return the first non-null result returned by a caseXXX
call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case UmlValueSpecificationPackage.ABSTRACT_RULE:
+ {
+ AbstractRule abstractRule = (AbstractRule)theEObject;
+ T result = caseAbstractRule(abstractRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.LITERAL_BOOLEAN_RULE:
+ {
+ LiteralBooleanRule literalBooleanRule = (LiteralBooleanRule)theEObject;
+ T result = caseLiteralBooleanRule(literalBooleanRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.LITERAL_INTEGER_OR_UNLIMITED_NATURAL_RULE:
+ {
+ LiteralIntegerOrUnlimitedNaturalRule literalIntegerOrUnlimitedNaturalRule = (LiteralIntegerOrUnlimitedNaturalRule)theEObject;
+ T result = caseLiteralIntegerOrUnlimitedNaturalRule(literalIntegerOrUnlimitedNaturalRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.LITERAL_REAL_RULE:
+ {
+ LiteralRealRule literalRealRule = (LiteralRealRule)theEObject;
+ T result = caseLiteralRealRule(literalRealRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.LITERAL_NULL_RULE:
+ {
+ LiteralNullRule literalNullRule = (LiteralNullRule)theEObject;
+ T result = caseLiteralNullRule(literalNullRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.LITERAL_STRING_RULE:
+ {
+ LiteralStringRule literalStringRule = (LiteralStringRule)theEObject;
+ T result = caseLiteralStringRule(literalStringRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.UNDEFINED_RULE:
+ {
+ UndefinedRule undefinedRule = (UndefinedRule)theEObject;
+ T result = caseUndefinedRule(undefinedRule);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case UmlValueSpecificationPackage.VISIBILITY_KIND:
+ {
+ VisibilityKind visibilityKind = (VisibilityKind)theEObject;
+ T result = caseVisibilityKind(visibilityKind);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Abstract Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Abstract Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAbstractRule(AbstractRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Literal Boolean Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Literal Boolean Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLiteralBooleanRule(LiteralBooleanRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Literal Integer Or Unlimited Natural Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Literal Integer Or Unlimited Natural Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLiteralIntegerOrUnlimitedNaturalRule(LiteralIntegerOrUnlimitedNaturalRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Literal Real Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Literal Real Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLiteralRealRule(LiteralRealRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Literal Null Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Literal Null Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLiteralNullRule(LiteralNullRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Literal String Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Literal String Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLiteralStringRule(LiteralStringRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Undefined Rule '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Undefined Rule '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseUndefinedRule(UndefinedRule object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Visibility Kind '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Visibility Kind '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseVisibilityKind(VisibilityKind object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'EObject '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'EObject '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} //UmlValueSpecificationSwitch
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/validation/AbstractUmlValueSpecificationJavaValidator.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/validation/AbstractUmlValueSpecificationJavaValidator.java
new file mode 100644
index 00000000000..e2e96314dfb
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/validation/AbstractUmlValueSpecificationJavaValidator.java
@@ -0,0 +1,22 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.validation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.validation.ComposedChecks;
+
+@ComposedChecks(validators= {org.eclipse.xtext.validation.ImportUriValidator.class, org.eclipse.xtext.validation.NamesAreUniqueValidator.class})
+public class AbstractUmlValueSpecificationJavaValidator extends org.eclipse.xtext.validation.AbstractDeclarativeValidator {
+
+ @Override
+ protected List getEPackages() {
+ List result = new ArrayList();
+ result.add(org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.UmlValueSpecificationPackage.eINSTANCE);
+ return result;
+ }
+
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/GenerateUmlValueSpecification.mwe2 b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/GenerateUmlValueSpecification.mwe2
new file mode 100644
index 00000000000..bbf75c50563
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/GenerateUmlValueSpecification.mwe2
@@ -0,0 +1,187 @@
+module org.eclipse.papyrus.uml.textedit.valuespecification.xtext.GenerateUmlValueSpecification
+
+import org.eclipse.emf.mwe.utils.*
+import org.eclipse.xtext.generator.*
+import org.eclipse.xtext.ui.generator.*
+
+var grammarURI = "classpath:/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecification.xtext"
+var file.extensions = "umlvaluespecification"
+var projectName = "org.eclipse.papyrus.uml.textedit.valuespecification.xtext"
+var runtimeProject = "../${projectName}"
+
+
+
+Workflow {
+ bean = StandaloneSetup {
+ scanClassPath = true
+ platformUri = "${runtimeProject}/.."
+
+ //load EMF ECORE
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore"
+ to = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore"
+ }
+
+ uriMap = { from = "platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
+ to = "platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
+ }
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel"
+ to = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
+ }
+ registerGeneratedEPackage = "org.eclipse.emf.ecore.EcorePackage"
+ registerGeneratedEPackage = "org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage"
+ registerGenModelFile = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
+ registerGenModelFile = "platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
+
+ //load UML
+
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.uml2.types/model/Types.genmodel"
+ to = "platform:/resource/org.eclipse.uml2.types/model/Types.genmodel"
+ }
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.uml2.uml/model/UML.genmodel"
+ to = "platform:/resource/org.eclipse.uml2.uml/model/UML.genmodel"
+ }
+
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.uml2.codegen.ecore/model/GenModel.genmodel"
+ to = "platform:/resource/org.eclipse.uml2.codegen.ecore/model/GenModel.genmodel"
+ }
+
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.uml2.codegen.ecore/model/GenModel.ecore"
+ to = "platform:/resource/org.eclipse.uml2.codegen.ecore/model/GenModel.ecore"
+ }
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore"
+ to = "platform:/resource/org.eclipse.uml2.uml/model/UML.ecore"
+ }
+
+ uriMap = {
+ from = "platform:/plugin/org.eclipse.uml2.types/model/Types.ecore"
+ to = "platform:/resource/org.eclipse.uml2.types/model/Types.ecore"
+ }
+ registerGeneratedEPackage = "org.eclipse.uml2.types.TypesPackage"
+ registerGeneratedEPackage = "org.eclipse.uml2.uml.UMLPackage"
+ registerGeneratedEPackage = "org.eclipse.uml2.codegen.ecore.genmodel.GenModelPackage"
+
+ registerGenModelFile = "platform:/resource/org.eclipse.uml2.types/model/Types.genmodel"
+ registerGenModelFile = "platform:/resource/org.eclipse.uml2.uml/model/UML.genmodel"
+ registerGenModelFile = "platform:/resource/org.eclipse.uml2.codegen.ecore/model/GenModel.genmodel"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}/src-gen"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}.ui/src-gen"
+ }
+
+ component = Generator {
+ pathRtProject = runtimeProject
+ pathUiProject = "${runtimeProject}.ui"
+ projectNameRt = projectName
+ projectNameUi = "${projectName}.ui"
+
+ language = {
+ uri = grammarURI
+ fileExtensions = file.extensions
+
+ // generates Java API for the generated EPackages
+ fragment = ecore.EcoreGeneratorFragment {}
+ // Java API to access grammar elements (required by several other fragments)
+ fragment = grammarAccess.GrammarAccessFragment {}
+
+
+ // the serialization component
+ //fragment = parseTreeConstructor.ParseTreeConstructorFragment {}
+
+ // Serializer 2.0
+ fragment = serializer.SerializerFragment {
+ generateStub = false
+ }
+
+
+ // a custom ResourceFactory for use with EMF
+ fragment = resourceFactory.ResourceFactoryFragment {
+ fileExtensions = file.extensions
+ }
+
+ // the following fragment tries to use the Antlr Generator fragment which can be installed via update manager from http://download.itemis.com/updates/
+ //fragment = AntlrDelegatingFragment {}
+ // The antlr parser generator fragment.
+ fragment = parser.antlr.XtextAntlrGeneratorFragment {
+ // options = {
+ // backtrack = true
+ // }
+ }
+
+ /*
+ If you don't want to use the Antlr fragment for some reason, remove the antlr fragment and uncomment the packrat parser fragment below.
+ fragment = parser.PackratParserFragment {}
+ */
+
+ // check-based API for validation
+ /*
+ fragment = validation.CheckFragment {}
+ */
+
+ // java-based API for validation
+ fragment = validation.JavaValidatorFragment {
+ composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
+ composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
+ inheritImplementation=false
+ }
+
+ // scoping and exporting API
+
+ //fragment = scoping.ImportURIScopingFragment {}
+ //fragment = exporting.SimpleNamesFragment {}
+
+
+ // scoping and exporting API
+ //It is very important to add it if not you will
+ //have a mistake during the execution about qualifiedName.
+ fragment = scoping.ImportNamespacesScopingFragment {}
+ fragment = exporting.QualifiedNamesFragment {}
+ fragment = builder.BuilderIntegrationFragment {}
+
+ // generator API
+ fragment = generator.GeneratorFragment {
+ generateMwe = false
+ generateJavaMain = false
+ }
+
+ // formatter API
+ fragment = formatting.FormatterFragment {}
+
+ // labeling API
+ fragment = labeling.LabelProviderFragment {}
+
+ // outline API
+ fragment = outline.OutlineTreeProviderFragment {}
+ fragment = outline.QuickOutlineFragment {}
+
+ // quickfix API
+ fragment = quickfix.QuickfixProviderFragment {}
+
+ // java-based API for content assistance
+ fragment = contentAssist.JavaBasedContentAssistFragment {}
+
+ // generates a more lightweight Antlr parser and lexer tailored for content assist
+ fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}
+
+ // project wizard (optional)
+ /*
+ fragment = projectWizard.SimpleProjectWizardFragment {
+ generatorProjectName = "${projectName}.generator"
+ modelFileExtension = file.extensions
+ }
+ */
+
+ }
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecification.xtext b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecification.xtext
new file mode 100644
index 00000000000..5d6ef4846a0
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecification.xtext
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+grammar org.eclipse.papyrus.uml.textedit.valuespecification.xtext.UmlValueSpecification with org.eclipse.xtext.common.Terminals
+
+import "http://www.eclipse.org/uml2/5.0.0/UML" as uml
+import "http://www.eclipse.org/emf/2002/Ecore" as ecore
+
+
+generate umlValueSpecification "http://www.eclipse.org/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecification"
+
+AbstractRule:
+ ((visibility = VisibilityKind)?
+ (name=ID '=')?
+ (value=(LiteralBooleanRule |
+ LiteralIntegerOrUnlimitedNaturalRule |
+ LiteralRealRule |
+ LiteralNullRule |
+ LiteralStringRule) |
+ instanceSpecification=[uml::InstanceSpecification]) |
+ undefined=UndefinedRule)
+;
+
+LiteralBooleanRule:
+ value=('true'|'false')
+;
+
+LiteralIntegerOrUnlimitedNaturalRule:
+ value=INT
+;
+
+LiteralRealRule:
+ value=DOUBLE
+;
+
+terminal DOUBLE returns ecore::EDouble: ('0'..'9')+"."('0'..'9')+;
+
+LiteralNullRule:
+ value='null'
+;
+
+
+LiteralStringRule:
+ value=STRING
+;
+
+UndefinedRule:
+ value=''
+;
+
+VisibilityKind:
+ public = '+'
+ | private = '-'
+ | protected = '#'
+ | package = '~' ;
\ No newline at end of file
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecificationRuntimeModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecificationRuntimeModule.java
new file mode 100644
index 00000000000..638f988964e
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecificationRuntimeModule.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext;
+
+/**
+ * Use this class to register components to be used at runtime / without the Equinox extension registry.
+ */
+public class UmlValueSpecificationRuntimeModule extends org.eclipse.papyrus.uml.textedit.valuespecification.xtext.AbstractUmlValueSpecificationRuntimeModule {
+
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecificationStandaloneSetup.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecificationStandaloneSetup.java
new file mode 100644
index 00000000000..8082045f992
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/UmlValueSpecificationStandaloneSetup.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext;
+
+
+/**
+ * Initialization support for running Xtext languages
+ * without equinox extension registry
+ */
+public class UmlValueSpecificationStandaloneSetup extends UmlValueSpecificationStandaloneSetupGenerated {
+
+ public static void doSetup() {
+ new UmlValueSpecificationStandaloneSetup().createInjectorAndDoEMFRegistration();
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/formatting/UmlValueSpecificationFormatter.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/formatting/UmlValueSpecificationFormatter.java
new file mode 100644
index 00000000000..5751cc28634
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/formatting/UmlValueSpecificationFormatter.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.formatting;
+
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.services.UmlValueSpecificationGrammarAccess;
+import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter;
+import org.eclipse.xtext.formatting.impl.FormattingConfig;
+
+import com.google.inject.Inject;
+
+/**
+ * This class contains custom formatting description.
+ *
+ * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#formatting
+ * on how and when to use it
+ *
+ * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
+ */
+public class UmlValueSpecificationFormatter extends AbstractDeclarativeFormatter {
+
+ @Inject
+ private UmlValueSpecificationGrammarAccess grammarAccess;
+
+ @Override
+ protected void configureFormatting(final FormattingConfig c) {
+ org.eclipse.papyrus.uml.textedit.valuespecification.xtext.services.UmlValueSpecificationGrammarAccess f = (org.eclipse.papyrus.uml.textedit.valuespecification.xtext.services.UmlValueSpecificationGrammarAccess) getGrammarAccess();
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/Main.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/Main.java
new file mode 100644
index 00000000000..98a29c34d87
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/Main.java
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.generator;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.xtext.generator.IGenerator;
+import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
+import org.eclipse.xtext.util.CancelIndicator;
+import org.eclipse.xtext.validation.CheckMode;
+import org.eclipse.xtext.validation.IResourceValidator;
+import org.eclipse.xtext.validation.Issue;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Provider;
+
+/**
+ * The main class of the xtext grammar.
+ */
+public class Main {
+
+ /**
+ * The main method.
+ *
+ * @param args
+ * The arguments.
+ */
+ public static void main(final String[] args) {
+ if (args.length == 0) {
+ System.err.println("Aborting: no path to EMF resource provided!");
+ return;
+ }
+ Injector injector = new org.eclipse.papyrus.uml.textedit.valuespecification.xtext.UmlValueSpecificationStandaloneSetupGenerated().createInjectorAndDoEMFRegistration();
+ Main main = injector.getInstance(Main.class);
+ main.runGenerator(args[0]);
+ }
+
+ @Inject
+ private Provider resourceSetProvider;
+
+ @Inject
+ private IResourceValidator validator;
+
+ @Inject
+ private IGenerator generator;
+
+ @Inject
+ private JavaIoFileSystemAccess fileAccess;
+
+ /**
+ * This allow to run the generator.
+ *
+ * @param string
+ * The URI as string.
+ */
+ protected void runGenerator(final String string) {
+ // load the resource
+ ResourceSet set = resourceSetProvider.get();
+ Resource resource = set.getResource(URI.createURI(string), true);
+
+ // validate the resource
+ List list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl);
+ if (!list.isEmpty()) {
+ for (Issue issue : list) {
+ System.err.println(issue);
+ }
+ return;
+ }
+
+ // configure and start the generator
+ fileAccess.setOutputPath("src-gen/");
+ generator.doGenerate(resource, fileAccess);
+
+ System.out.println("Code generation finished.");
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/UmlValueSpecificationGenerator.xtend b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/UmlValueSpecificationGenerator.xtend
new file mode 100644
index 00000000000..9c3c2ca937a
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/UmlValueSpecificationGenerator.xtend
@@ -0,0 +1,24 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.generator
+
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.xtext.generator.IGenerator
+import org.eclipse.xtext.generator.IFileSystemAccess
+
+/**
+ * Generates code from your model files on save.
+ *
+ * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration
+ */
+class UmlValueSpecificationGenerator implements IGenerator {
+
+ override void doGenerate(Resource resource, IFileSystemAccess fsa) {
+// fsa.generateFile('greetings.txt', 'People to greet: ' +
+// resource.allContents
+// .filter(typeof(Greeting))
+// .map[name]
+// .join(', '))
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/UmlValueSpecificationGeneratorMWE.mwe2 b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/UmlValueSpecificationGeneratorMWE.mwe2
new file mode 100644
index 00000000000..7d75325709b
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/UmlValueSpecificationGeneratorMWE.mwe2
@@ -0,0 +1,31 @@
+module org.eclipse.papyrus.uml.textedit.valuespecification.xtext.generator.UmlValueSpecificationGeneratorMWE
+
+import org.eclipse.emf.mwe.utils.*
+
+var targetDir
+var modelPath
+
+Workflow {
+
+ component = org.eclipse.xtext.mwe.Reader {
+ // lookup all resources on the classpath
+ // useJavaClassPath = true
+
+ // or define search scope explicitly
+ path = modelPath
+
+ // this class will be generated by the xtext generator
+ register = org.eclipse.papyrus.uml.textedit.valuespecification.xtext.UmlValueSpecificationStandaloneSetup {}
+ loadResource = {
+ slot = "model"
+ }
+ }
+
+ component = org.eclipse.xtext.generator.GeneratorComponent {
+ register = org.eclipse.papyrus.uml.textedit.valuespecification.xtext.UmlValueSpecificationStandaloneSetup {}
+ slot = 'model'
+ outlet = {
+ path = targetDir
+ }
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/scoping/UmlValueSpecificationScopeProvider.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/scoping/UmlValueSpecificationScopeProvider.java
new file mode 100644
index 00000000000..9a543f60870
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/scoping/UmlValueSpecificationScopeProvider.java
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.scoping;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.umlValueSpecification.AbstractRule;
+import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementUtil;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.xtext.resource.IEObjectDescription;
+import org.eclipse.xtext.scoping.IScope;
+import org.eclipse.xtext.scoping.Scopes;
+import org.eclipse.xtext.scoping.impl.SimpleScope;
+
+
+/**
+ * This class contains custom scoping description.
+ *
+ * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping on
+ * how and when to use it
+ *
+ */
+public class UmlValueSpecificationScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider {
+
+ /**
+ * This allow to define the scope for the instance specification of the abstract rule.
+ *
+ * @param ctx
+ * The abstract rule context.
+ * @param ref
+ * The reference.
+ * @return The scope representing the instance specification in the model.
+ */
+ public IScope scope_AbstractRule_instanceSpecification(final AbstractRule ctx, final EReference ref) {
+ EObject contextElement = ContextElementUtil.getContextElement(ctx.eResource());
+
+ Collection instanceSpecification = EMFHelper.allInstances(contextElement.eResource(), InstanceSpecification.class);
+
+ final Iterable visibleClassifiers = Scopes.scopedElementsFor(instanceSpecification);
+ return new SimpleScope(visibleClassifiers);
+ }
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/validation/UmlValueSpecificationJavaValidator.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/validation/UmlValueSpecificationJavaValidator.java
new file mode 100644
index 00000000000..ab350324b21
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/validation/UmlValueSpecificationJavaValidator.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.validation;
+
+
+/**
+ * Custom validation rules.
+ *
+ * see http://www.eclipse.org/Xtext/documentation.html#validation
+ */
+public class UmlValueSpecificationJavaValidator extends org.eclipse.papyrus.uml.textedit.valuespecification.xtext.validation.AbstractUmlValueSpecificationJavaValidator {
+
+ /**
+ * Constructor.
+ */
+ public UmlValueSpecificationJavaValidator() {
+ super();
+ }
+
+}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/xtend-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/.gitignore b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/xtend-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/.gitignore
new file mode 100644
index 00000000000..0a1ab0b0cb8
--- /dev/null
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext/xtend-gen/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/generator/.gitignore
@@ -0,0 +1 @@
+/UmlValueSpecificationGenerator.java
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF
index 77f15bdfb2f..d38633bd1e6 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF
@@ -1,25 +1,25 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.uml.tools.utils
-Require-Bundle: org.eclipse.uml2.uml,
- org.eclipse.jface;bundle-version="3.4.1",
- org.eclipse.emf.transaction;bundle-version="1.2.1",
- org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
- org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.1.0",
- org.eclipse.ui.workbench;bundle-version="3.105.0",
- org.eclipse.papyrus.infra.tools;bundle-version="1.1.0",
- com.google.guava;bundle-version="11.0.0"
-Bundle-Vendor: %pluginProvider
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-Name: %pluginName
-Bundle-Activator: org.eclipse.papyrus.uml.tools.utils.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.uml.tools.utils;singleton:=tr
- ue
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.uml.tools.utils
+Require-Bundle: org.eclipse.uml2.uml,
+ org.eclipse.jface;bundle-version="3.4.1",
+ org.eclipse.emf.transaction;bundle-version="1.2.1",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
+ org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.1.0",
+ org.eclipse.ui.workbench;bundle-version="3.105.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.1.0",
+ com.google.guava;bundle-version="11.0.0"
+Bundle-Vendor: %pluginProvider
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.1.0.qualifier
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.uml.tools.utils.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.uml.tools.utils;singleton:=tr
+ ue
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/NameResolutionHelper.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/NameResolutionHelper.java
index eb74eebbe5c..d42c44d4ce9 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/NameResolutionHelper.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/NameResolutionHelper.java
@@ -16,42 +16,124 @@
package org.eclipse.papyrus.uml.tools.utils;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper;
+import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.resource.UMLResource;
+/**
+ *
+ * This class allows to find named element from this name or its (partially) qualified name
+ *
+ */
+public class NameResolutionHelper implements INameResolutionHelper {
-public class NameResolutionHelper {
-
+ /**
+ * the scope used to look for the elements
+ */
protected Namespace scope;
+ /**
+ * the filter
+ */
protected EClass filter;
+ /**
+ * This map links the name and the named element
+ */
protected Map> allNames;
+ /**
+ * the empty string
+ */
+ private static final String EMPTY_STRING = ""; //$NON-NLS-N1
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param element
+ * an element of the model
+ * @param filter
+ * the filter
+ */
+ public NameResolutionHelper(Element element, EClass filter) {
+ Namespace space = null;
+ if (element instanceof Namespace) {
+ space = (Namespace) element;
+
+ } else if (element instanceof NamedElement) {
+ space = ((NamedElement) element).getNamespace();
+ } else {
+ space = element.getNearestPackage();
+ }
+ init(space, filter);
+ }
+
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param element
+ * an element of the model
+ * @param filter
+ * the filter
+ */
public NameResolutionHelper(Namespace scope, EClass filter) {
+ init(scope, filter);
+ }
+
+ /**
+ *
+ * @param scope
+ * @param filter
+ */
+ protected void init(Namespace scope, EClass filter) {
+ Assert.isNotNull(scope);
+ if (filter == null) {
+ filter = UMLPackage.eINSTANCE.getNamedElement();
+ }
this.scope = scope;
this.filter = filter;
}
+ /**
+ *
+ * @param name
+ * a name
+ * @return
+ * all named element matching this name
+ *
+ * @deprecated you should use {@link #getElementsByName(String)}
+ */
+ @Deprecated
public List getNamedElements(String name) {
- if (this.allNames == null) {
- this.allNames = new HashMap>();
- this.computeAllNames();
+ List returnedValues = new ArrayList();
+ List obj = getElementsByName(name);
+ for (Object current : obj) {
+ if (current instanceof NamedElement) {
+ returnedValues.add((NamedElement) current);
+ }
}
- List namedElements = this.allNames.get(name);
- return namedElements != null ? namedElements : new ArrayList();
+ return returnedValues;
}
/**
@@ -60,14 +142,14 @@ public class NameResolutionHelper {
protected void computeAllNames() {
// compute names directly available in the scope
- computeNames("", scope, true);
+ computeNames(EMPTY_STRING, scope, true);
// compute names related to enclosing namepaces of scope
Namespace enclosingNamespace = scope.getNamespace();
- String prefix = "";
+ String prefix = EMPTY_STRING;
while (enclosingNamespace != null) {
// prefix += enclosingNamespace.getName() + NamedElementUtil.QUALIFIED_NAME_SEPARATOR;
- prefix = "";
+ prefix = EMPTY_STRING;
computeNames(prefix, enclosingNamespace, false);
enclosingNamespace = enclosingNamespace.getNamespace();
}
@@ -77,16 +159,8 @@ public class NameResolutionHelper {
if (model == null) {
model = scope;
}
- if (filter != null) {
- if (filter.isSuperTypeOf(model.eClass())) {
- List l = this.allNames.get(model.getName());
- if (l == null) { // i.e. no names have already been resolved in enclosed namespaces
- l = new ArrayList();
- l.add(model);
- this.allNames.put(model.getName(), l);
- }
- }
- } else {
+
+ if (filter.isSuperTypeOf(model.eClass())) {
List l = this.allNames.get(model.getName());
if (l == null) { // i.e. no names have already been resolved in enclosed namespaces
l = new ArrayList();
@@ -94,7 +168,9 @@ public class NameResolutionHelper {
this.allNames.put(model.getName(), l);
}
}
- computeNames(model.getName() + NamedElementUtil.QUALIFIED_NAME_SEPARATOR, model, false);
+ StringBuilder builder = new StringBuilder(model.getName());
+ builder.append(NamedElementUtil.QUALIFIED_NAME_SEPARATOR);
+ computeNames(builder.toString(), model, false);
// Build names corresponding to other available UML resources in the workspace
List resources = new ArrayList(scope.eResource().getResourceSet().getResources());// we duplicate the resource to avoid concurrent modification
@@ -109,16 +185,8 @@ public class NameResolutionHelper {
}
}
if (root != null) {
- if (filter != null) {
- if (filter.isSuperTypeOf(root.eClass())) {
- List l = this.allNames.get(root.getName());
- if (l == null) { // i.e. no names have already been resolved in enclosed namespaces
- l = new ArrayList();
- l.add(root);
- this.allNames.put(root.getName(), l);
- }
- }
- } else {
+
+ if (filter.isSuperTypeOf(root.eClass())) {
List l = this.allNames.get(root.getName());
if (l == null) { // i.e. no names have already been resolved in enclosed namespaces
l = new ArrayList();
@@ -126,7 +194,9 @@ public class NameResolutionHelper {
this.allNames.put(root.getName(), l);
}
}
- computeNames(root.getName() + NamedElementUtil.QUALIFIED_NAME_SEPARATOR, root, false);
+ StringBuilder builder2 = new StringBuilder(root.getName());
+ builder2.append(NamedElementUtil.QUALIFIED_NAME_SEPARATOR);
+ computeNames(builder2.toString(), root, false);
}
}
}
@@ -161,16 +231,96 @@ public class NameResolutionHelper {
// iterates other names given to the current member in the context of this scope
for (String memberName : memberNames) {
// Checks if the name must be considered or not
- if (!preExistingKeys.contains(prefix + memberName)) {
- List l = this.getNamedElements(prefix + memberName);
- l.add(member);
- this.allNames.put(prefix + memberName, l);
+ if (!preExistingKeys.contains(prefix + memberName) || !this.allNames.get(prefix + memberName).contains(member)) {
+ // the second part of the previous if is to be able to found model::Class1 in this kind of model with scope==Property and filter : UML::Class
+ // model
+ // Class1
+ // Property1
+ // Class1
+ // Class2
+
+
+ if (filter.isSuperTypeOf(member.eClass())) {
+ List l = this.getNamedElements(prefix + memberName);
+ l.add(member);
+ this.allNames.put(prefix + memberName, l);
+ }
}
if (member instanceof Namespace && !alreadyComputedNamespace.contains(member)) { // avoid loop on imported packages
// Recursive call on the current member
- computeNames(prefix + memberName + NamedElementUtil.QUALIFIED_NAME_SEPARATOR, (Namespace) member, false, alreadyComputedNamespace);
+ StringBuilder newPrefix = new StringBuilder(prefix);
+ newPrefix.append(memberName);
+ newPrefix.append(NamedElementUtil.QUALIFIED_NAME_SEPARATOR);
+ computeNames(newPrefix.toString(), (Namespace) member, false, alreadyComputedNamespace);
}
}
}
}
+
+ /**
+ * @param namedElement
+ * @return
+ * the shortest qualified to use for the element
+ */
+ public List getShortestQualifiedNames(NamedElement namedElement) {
+ return NameResolutionUtils.getShortestQualifiedNames(namedElement, this.scope);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper#getMatchingElements(java.lang.String)
+ *
+ * @param aString
+ * @return
+ */
+ public List getMatchingElements(String aString) {
+ if (this.allNames == null) {
+ this.allNames = new HashMap>();
+ this.computeAllNames();
+ }
+
+ Collection elements = new HashSet();
+
+ for (Entry> current : this.allNames.entrySet()) {
+ if (aString == null || aString.isEmpty() || current.getKey().startsWith(aString)) {
+ elements.addAll(current.getValue());
+ }
+ }
+ // to avoid to found the same element several time
+ return new ArrayList(elements);
+ }
+
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper#getElementsByName(java.lang.String)
+ *
+ * @param aString
+ * @return
+ */
+ public List getElementsByName(String aString) {
+ if (this.allNames == null) {
+ this.allNames = new HashMap>();
+ this.computeAllNames();
+ }
+ List namedElements = this.allNames.get(aString);
+ List returnedValues = null;
+ if (namedElements != null && namedElements.size() > 0) {
+
+ returnedValues = new ArrayList(namedElements);
+ }
+ return returnedValues != null ? returnedValues : Collections.emptyList();
+ }
+
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper#getShortestQualifiedNames(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ public List getShortestQualifiedNames(Object element) {
+ if (element instanceof NamedElement) {
+ return getShortestQualifiedNames((NamedElement) element);
+ }
+ return null;
+ }
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/ReferenceContentAssistProcessor.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/ReferenceContentAssistProcessor.java
new file mode 100644
index 00000000000..11b9b4e016a
--- /dev/null
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/ReferenceContentAssistProcessor.java
@@ -0,0 +1,250 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.tools.util;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ContextInformationValidator;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.papyrus.infra.widgets.util.DoNothingCompletionProposal;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
+
+/**
+ * @author VL222926
+ *
+ */
+public class ReferenceContentAssistProcessor implements IContentAssistProcessor {
+ /**
+ * the maximum of elements to display in the completion
+ */
+ private int MAX_ELEMENTS_TO_DISPLAY = 15;
+
+ /**
+ * add this string to the suggestions when there are more than {@link #MAX_ELEMENTS_TO_DISPLAY}
+ */
+ public static final String MORE_ELEMENTS = IPapyrusConverter.MORE_ELEMENTS; //$NON-NLS-1$
+
+
+ private String lastError = null;
+
+ private IContextInformationValidator contextInfoValidator;
+
+ private IPapyrusConverter parser;
+
+ private boolean isMany;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parser
+ */
+ public ReferenceContentAssistProcessor(IPapyrusConverter parser, boolean isMany) {
+ this.parser = parser;
+ this.isMany = isMany;
+ contextInfoValidator = new ContextInformationValidator(this);
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
+ *
+ * @param textViewer
+ * @param documentOffset
+ * @return
+ */
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentOffset) {
+ IDocument document = textViewer.getDocument();
+ int currOffset = documentOffset - 1;
+ String currentStr = textViewer.getTextWidget().getText();
+ Map, String> parse = this.parser.getSubStringsWithTheirPositions(currentStr);
+
+ String stringToComplete = null;
+ for (Entry, String> current : parse.entrySet()) {
+ int start = current.getKey().get(0);
+ int end = current.getKey().get(1);
+ if (currOffset >= start && currOffset < end) {
+ stringToComplete = current.getValue();
+ break;
+ }
+ }
+ if (stringToComplete == null) {
+ stringToComplete = IPapyrusConverter.EMPTY_STRING;
+ }
+
+ try {
+
+ String currWord = IPapyrusConverter.EMPTY_STRING;
+ char currChar;
+ while (currOffset > 0 && !Character.isWhitespace(currChar = document.getChar(currOffset))) {
+ currWord = currChar + currWord;
+ currOffset--;
+ }
+
+ currWord = textViewer.getTextWidget().getText();
+ List suggestions = suggest(stringToComplete);
+ ICompletionProposal[] proposals = null;
+ if (suggestions.size() > 0) {
+ proposals = buildProposals(suggestions, stringToComplete, documentOffset - stringToComplete.length());
+ // proposals = buildProposals(suggestions, currWord, 0);
+ lastError = null;
+ } else {
+ lastError = "There is no suggestion for you."; //$NON-NLS-1$
+ }
+ return proposals;
+ } catch (BadLocationException e) {
+ org.eclipse.papyrus.infra.widgets.Activator.log.error(e);
+ lastError = e.getMessage();
+ return null;
+ }
+ }
+
+ /**
+ *
+ * @param word
+ * the string typed by the user
+ * @return
+ * the available suggestion for this string and fill {@link #map}
+ */
+ public List suggest(String word) {
+ List suggestions = new LinkedList();
+ if (word == null || word.length() == 0) {
+ suggestions.addAll(buildSuggest(word));
+ } else {
+ List val = this.parser.splitFullStringToSubElementString(word);
+ if (val.size() == 1) {
+ suggestions.addAll(buildSuggest(val.get(0)));
+ } else {
+ // we assume than we provide always for the last string
+ String subWord = val.get(val.size() - 1);
+ suggestions.addAll(buildSuggest(subWord));
+ }
+ // if(isMany){
+ // suggestions.add(IPapyrusConverter.STRING_SEPARATOR);
+ // }
+ }
+ return suggestions;
+ }
+
+ /**
+ *
+ * @param word
+ * a word
+ * @return
+ * the list of suggestions for the string word, + null
suggestion + {@link #MORE_ELEMENTS} if required
+ */
+ protected List buildSuggest(String word) {
+ List suggestions = new LinkedList();
+ boolean isEmpty = word == null || word.length() == 0;
+ if (!isEmpty) {
+ boolean escapedName = word.startsWith(IPapyrusConverter.STRING_DELIMITER);
+ if (escapedName) {
+ word = word.substring(1);
+ }
+
+ List> elements = parser.getMatchingElements(word);// OK
+ for (int i = 0; i < elements.size() && i < MAX_ELEMENTS_TO_DISPLAY; i++) {
+ Object current = elements.get(i);
+ String name = parser.canonicalToDisplayValue(current, 0);
+ if (escapedName && !name.contains(IPapyrusConverter.STRING_SEPARATOR)) {
+ continue;
+ }
+ suggestions.add(name);
+ }
+ if (elements.size() > MAX_ELEMENTS_TO_DISPLAY) {
+ suggestions.add(0, MORE_ELEMENTS);
+ }
+ } else {
+ suggestions.add(0, MORE_ELEMENTS);
+ }
+ suggestions.add(0, IPapyrusConverter.NULL_VALUE);
+ return suggestions;
+ }
+
+ /**
+ *
+ * @param suggestions
+ * the list of suggestions
+ * @param replacedWord
+ * the word to replace
+ * @param offset
+ * the offset
+ * @return
+ * an array with the completion proposal
+ */
+ private ICompletionProposal[] buildProposals(List suggestions, String replacedWord, int offset) {
+ ICompletionProposal[] proposals = new ICompletionProposal[suggestions.size()];
+ int index = 0;
+ for (Iterator i = suggestions.iterator(); i.hasNext();) {
+ String currSuggestion = (String) i.next();
+ if (MORE_ELEMENTS.equals(currSuggestion)) {
+ // we do nothing
+ proposals[index] = new DoNothingCompletionProposal(IPapyrusConverter.EMPTY_STRING, 0, replacedWord.length() + offset, currSuggestion.length(), null, currSuggestion, null, null);
+ } else if (IPapyrusConverter.NULL_VALUE.equals(currSuggestion)) {
+ // we will replace the full string
+ proposals[index] = new CompletionProposal(currSuggestion, 0, replacedWord.length() + offset, currSuggestion.length());
+ } else if (IPapyrusConverter.STRING_SEPARATOR.equals(currSuggestion)) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(replacedWord);
+ builder.append(currSuggestion);
+ proposals[index] = new CompletionProposal(builder.toString(), offset, replacedWord.length(), builder.length(), null, currSuggestion, null, null);
+ }
+ else {
+ String replacementString = parser.displayToEditValue(currSuggestion);
+ proposals[index] = new CompletionProposal(replacementString, offset, replacedWord.length(), replacementString.length(), null, currSuggestion, null, null);
+ }
+ index++;
+ }
+ return proposals;
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer textViewer, int documentOffset) {
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+ *
+ * @return
+ */
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ // we always wait for the user to explicitly trigger completion
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ // we have no context information
+ return null;
+ }
+
+ public String getErrorMessage() {
+ return lastError;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return contextInfoValidator;
+ }
+}
\ No newline at end of file
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLReferenceConverter.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLReferenceConverter.java
new file mode 100644
index 00000000000..e6b72d9f457
--- /dev/null
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLReferenceConverter.java
@@ -0,0 +1,457 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.tools.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.infra.widgets.Activator;
+import org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * @author Vincent Lorenzo
+ *
+ */
+public class UMLReferenceConverter implements IPapyrusConverter {
+
+ /**
+ * the helper used to find UML NamedElement using their name
+ */
+ protected INameResolutionHelper sharedResolutionHelper;
+
+ /**
+ * boolean indicating if the edited property is many or not
+ */
+ protected final boolean isMany;
+
+ public static final String ERROR_MESSAGE_NO_ELEMENT_FOUND = "No element have been found to match your string";//$NON-NLS-1$;
+
+ public static final String ERROR_MESSAGE_SOME_ELEMENTS_NOT_FOUND = "Some elements have not been found to match your string";//$NON-NLS-1$;
+
+ /**
+ * Constructor.
+ *
+ * @param helper
+ * the name resolution helper to use
+ * @param isMultiValued
+ * true
if the edited property is multi valued
+ */
+ public UMLReferenceConverter(INameResolutionHelper nameResolutionHelper, boolean isMultiValued) {
+ this.sharedResolutionHelper = nameResolutionHelper;
+ this.isMany = isMultiValued;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#getCompletionProcessor(org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param element
+ * @return
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return new ReferenceContentAssistProcessor(this, isMany);
+ }
+
+
+/**
+ * This method takes a string as parameter. This string can contains the name (qualified name) of several elements, separated by {@link IPapyrusConverter#STRING_SEPARATOR}. if the name of an element contains {@link IPapyrusParser#STRING_SEPARATOR, the name will be delimited by IPapyrusParser#STRING_DELIMITER
+ *
+ * This method return a map with the name of the subelement as keys. The values are the start and the end position of the key in the string parameter.
+ * @param listOfValueAsString
+ * the full String write in the StyledText
+ * @return
+ * a map with the name of the elements as key and the start and the end index of the name in the typed text
+ */
+ public final Map, String> getSubStringsWithTheirPositions(String listOfValueAsString) {
+ final Pattern pattern = Pattern.compile(FIND_PART_NAME_REGEX);
+ final Matcher matcher = pattern.matcher(listOfValueAsString);
+ final TreeMap, String> path = new TreeMap, String>(new TwoIntegerListTupleComparator());
+ while (matcher.find()) {
+ String current = matcher.group();
+ List indexes = new ArrayList();
+ int start = matcher.start();
+ int end = matcher.end();
+ if (current.startsWith(STRING_DELIMITER) && current.endsWith(STRING_DELIMITER)) {
+ current = current.substring(1, current.length() - 1);
+ } else {
+ if (start - 1 >= 0) {
+ // we chack than the user does not have type something starting with the delimiter, without typing a comma after it
+ String substring = listOfValueAsString.substring(start - 1, start);
+ if (STRING_DELIMITER.equals(substring)) {
+ if (!current.contains(STRING_SEPARATOR)) {
+ start = start - 1;
+ current = listOfValueAsString.substring(start, end);
+ }
+ }
+ }
+ }
+ indexes.add(start);
+ indexes.add(end);
+ path.put(indexes, current);
+ }
+ return path;
+ }
+
+ /**
+ *
+ * @param multiValuedString
+ * @return
+ * the list of named element represented by this string
+ */
+ private List getNamedElementFromString(String multiValuedString) {
+ List elements = new ArrayList();
+ Collection names = splitFullStringToSubElementString(multiValuedString);
+ for (String string2 : names) {
+ List> values = sharedResolutionHelper.getElementsByName(string2);
+ if (values.size() > 0) {
+ Assert.isTrue(values.size() == 1);
+ elements.add((NamedElement) values.get(0));
+ }
+ }
+ return elements;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#splitFullStringToSubElementString(java.lang.String)
+ *
+ * @param multiValueAsString
+ * @return
+ */
+ public List splitFullStringToSubElementString(String multiValueAsString) {
+ TreeMap, String> res = (TreeMap, String>) getSubStringsWithTheirPositions(multiValueAsString);
+ List values = new ArrayList(res.values());
+ return values;
+ // final Pattern pattern = Pattern.compile(FIND_PART_NAME_REGEX);
+ // final Matcher matcher = pattern.matcher(multiValueAsString);
+ // final List subString = new ArrayList();
+ // while (matcher.find()) {
+ // String current = matcher.group();
+ // if (current.startsWith(STRING_DELIMITER) && current.endsWith(STRING_DELIMITER)) {
+ // current = current.substring(1, current.length() - 1);
+ // }
+ // subString.add(current);
+ // }
+ // return subString;
+ }
+
+
+ /**
+ *
+ * @param namedElement
+ * @return
+ * the name of the named element, starting and ending with {@link #STRING_DELIMITER} if its name contains {@link #STRING_DELIMITER}
+ */
+ protected String getElementNameWithDelimiterIfRequired(NamedElement namedElement) {
+ StringBuffer builder = new StringBuffer();
+ List names = sharedResolutionHelper.getShortestQualifiedNames(namedElement);
+ String name = names.get(0);
+ if (name.contains(STRING_SEPARATOR)) {
+ builder.append(STRING_DELIMITER);
+ builder.append(name);
+ builder.append(STRING_DELIMITER);
+ } else {
+ builder.append(name);
+ }
+ return builder.toString();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#getEditStringFromPrintString(java.lang.String)
+ *
+ * @param printString
+ * @return
+ */
+ public String getEditStringFromPrintString(String printString) {
+ if (printString.contains(STRING_SEPARATOR)) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(STRING_DELIMITER);
+ builder.append(printString);
+ builder.append(STRING_DELIMITER);
+ return builder.toString();
+ }
+ return printString;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#getUsedNameResolutionHelper()
+ *
+ * @return
+ */
+ public INameResolutionHelper getUsedNameResolutionHelper() {
+ return this.sharedResolutionHelper;
+ }
+
+ /**
+ *
+ * @param aString
+ * a string
+ * @return
+ * all elements whose the name starts with this string, or all found element if the string is null
or empty
+ */
+ public List> getMatchingElements(final String aString) {
+ String lookedForString = null;
+ if (aString.startsWith(STRING_DELIMITER) && aString.endsWith(STRING_DELIMITER)) {
+ lookedForString = aString.substring(1, aString.length() - 2);
+ } else {
+ lookedForString = aString;
+ }
+ return this.sharedResolutionHelper.getMatchingElements(lookedForString);
+ }
+
+ /**
+ *
+ * @param aString
+ * a string
+ * @return
+ * all elements which have the wanted string as (qualified) name
+ */
+ public List> getElementsByName(final String aString) {
+ return this.sharedResolutionHelper.getElementsByName(aString);
+ }
+
+
+ /**
+ * @param namedElement
+ * @return
+ * the shortest qualified to use for the element
+ */
+ public List getShortestQualifiedNames(Object element) {
+ return this.sharedResolutionHelper.getShortestQualifiedNames(element);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#canonicalToDisplayValue(java.lang.Object, int)
+ *
+ * @param object
+ * @return
+ */
+ public String canonicalToDisplayValue(Object object, int flag) {
+ if (object == null || EMPTY_STRING.equals(object)) {
+ return EMPTY_STRING;
+ }
+
+ if (object instanceof Collection>) {
+ // if (canonicalValue instanceof Collection>) {
+ if (((Collection>) object).isEmpty()) {
+ return EMPTY_STRING;
+ }
+
+ StringBuilder builder = new StringBuilder();
+ Collection> coll = (Collection>) object;
+ Iterator> iter = coll.iterator();
+ while (iter.hasNext()) {
+ Object tmp = iter.next();
+ Assert.isTrue(tmp instanceof NamedElement);
+ List names = getShortestQualifiedNames(tmp);
+ if (names.size() > 0) {
+ builder.append(names.get(0));
+ }
+ if (iter.hasNext()) {
+ builder.append(STRING_SEPARATOR);
+ }
+ }
+ return builder.toString();
+ } else if (object instanceof EObject) {
+ EObject eobject = (EObject) object;
+ Assert.isTrue(eobject instanceof NamedElement);
+ List names = getShortestQualifiedNames(eobject);
+ if (names.size() > 0) {
+ return names.get(0);
+ }
+
+ }
+ return EMPTY_STRING;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#displayToCanonicalValue(java.lang.String)
+ *
+ * @param string
+ * @return
+ */
+ public Object displayToCanonicalValue(String string, int flag) {
+ if (EMPTY_STRING.equals(string) || NULL_VALUE.equals(string)) {
+ return null;
+ }
+ Assert.isTrue(string instanceof String);
+ List elements = getNamedElementFromString((String) string);
+ if (elements.size() == 0) {
+ return null;
+ }
+ if (!isMany && elements.size() >= 1) {
+ return elements.get(0);
+ }
+ return elements;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#canonicalToEditValue(java.lang.Object)
+ *
+ * @param object
+ * @return
+ */
+ public String canonicalToEditValue(Object object, int flag) {
+ if (object == null || EMPTY_STRING.equals(object)) {
+ return EMPTY_STRING;
+ }
+
+ if (object instanceof Collection>) {
+ // if (canonicalValue instanceof Collection>) {
+ if (((Collection>) object).isEmpty()) {
+ return EMPTY_STRING;
+ }
+
+ StringBuilder builder = new StringBuilder();
+ Collection> coll = (Collection>) object;
+ Iterator> iter = coll.iterator();
+ while (iter.hasNext()) {
+ Object tmp = iter.next();
+ Assert.isTrue(tmp instanceof NamedElement);
+ builder.append(getElementNameWithDelimiterIfRequired((NamedElement) tmp));
+ if (iter.hasNext()) {
+ builder.append(STRING_SEPARATOR);
+ }
+ }
+ return builder.toString();
+ } else if (object instanceof EObject) {
+ EObject eobject = (EObject) object;
+ Assert.isTrue(eobject instanceof NamedElement);
+ return getElementNameWithDelimiterIfRequired((NamedElement) eobject);
+ }
+ return EMPTY_STRING;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#editToCanonicalValue(java.lang.Object)
+ *
+ * @param object
+ * @return
+ */
+ public Object editToCanonicalValue(String editValue, int flag) {
+ if (EMPTY_STRING.equals(editValue) || NULL_VALUE.equals(editValue)) {
+ return null;
+ }
+ Assert.isTrue(editValue instanceof String);
+ List elements = getNamedElementFromString((String) editValue);
+ if (elements.size() == 0) {
+ return null;
+ }
+ if (!isMany && elements.size() >= 1) {
+ return elements.get(0);
+ }
+ return elements;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#editToDisplayValue(java.lang.String)
+ *
+ * @param singleString
+ * @return
+ */
+ public String editToDisplayValue(String singleString) {
+ if (singleString.startsWith(STRING_DELIMITER) && singleString.endsWith(STRING_DELIMITER)) {
+ return singleString.substring(1, singleString.length() - 1);
+ }
+ return singleString;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#displayToEditValue(java.lang.String)
+ *
+ * @param singleString
+ * @return
+ */
+ public String displayToEditValue(String singleString) {
+ if (singleString.contains(STRING_SEPARATOR)) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(STRING_DELIMITER);
+ builder.append(singleString);
+ builder.append(STRING_DELIMITER);
+ return builder.toString();
+ }
+ return singleString;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter#isValidEditString(java.lang.String)
+ *
+ * @param aString
+ * @return
+ */
+ public IStatus isValidEditString(String aString) {
+ if (aString == null || EMPTY_STRING.equals(aString) || NULL_VALUE.equals(aString)) {
+ return org.eclipse.core.runtime.Status.OK_STATUS;
+ }
+ Object result = editToCanonicalValue(aString, 0);
+ List split = splitFullStringToSubElementString(aString);
+ if (result == null || (result instanceof Collection> && ((Collection>) result).isEmpty())) {
+ return new org.eclipse.core.runtime.Status(IStatus.ERROR, Activator.PLUGIN_ID, ERROR_MESSAGE_NO_ELEMENT_FOUND);
+ }
+ if (result instanceof Collection> && (((Collection>) result).size() < split.size())) {
+ return new org.eclipse.core.runtime.Status(IStatus.ERROR, Activator.PLUGIN_ID, ERROR_MESSAGE_SOME_ELEMENTS_NOT_FOUND);
+ }
+ return org.eclipse.core.runtime.Status.OK_STATUS;
+ }
+
+
+ /**
+ *
+ * @author VL222926
+ * This class allows to sort the map containing the start and end index of the substrings. We need it to be able to provide completion for the correct sub string
+ */
+ private static final class TwoIntegerListTupleComparator implements Comparator> {
+
+
+ /**
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ *
+ * @param o1
+ * @param o2
+ * @return
+ */
+ public int compare(List o1, List o2) {
+ Assert.isTrue(o1.size() == 2);
+ Assert.isTrue(o2.size() == 2);
+ if (o1.equals(o2)) {
+ return 0;
+ }
+ if (o1.get(0) > o2.get(0)) {
+ Assert.isTrue(o1.get(1) > o2.get(1));
+ return 1;
+ }
+ if (o1.get(0) < o2.get(0)) {
+ Assert.isTrue(o1.get(1) < o2.get(1));
+ return -1;
+ }
+ throw new UnsupportedOperationException("should no be possible"); //$NON-NLS-1$
+
+ }
+
+ }
+}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/model/Environment.xmi b/plugins/views/properties/org.eclipse.papyrus.views.properties/model/Environment.xmi
index 6bf05b56904..f5ac3e19391 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/model/Environment.xmi
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/model/Environment.xmi
@@ -1,56 +1,230 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java
index 41f554ce516..60d12d69043 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java
@@ -30,6 +30,8 @@ import org.eclipse.papyrus.infra.tools.databinding.ReferenceCountedObservable;
import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.infra.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
import org.eclipse.papyrus.views.properties.creation.PropertyEditorFactory;
/**
@@ -208,5 +210,26 @@ public abstract class AbstractModelElement implements ModelElement, IDataSourceL
return observableDisposeListener;
}
+
+
+ /**
+ * @see org.eclipse.papyrus.views.properties.modelelement.ModelElement#getNameResolutionHelper(java.lang.String)
+ *
+ * @param propertyPath
+ * @return
+ */
+ public INameResolutionHelper getNameResolutionHelper(String propertyPath) {
+ return null;
+ }
+ /**
+ *
+ * @see org.eclipse.papyrus.views.properties.modelelement.ModelElement#getPapyrusConverter(java.lang.String)
+ *
+ * @param propertyPath
+ * @return
+ */
+ public IPapyrusConverter getPapyrusConverter(String propertyPath) {
+ return null;
+ }
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java
index 1178da2e99c..9983cc43f2e 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java
@@ -33,6 +33,8 @@ import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.infra.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.EncapsulatedContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
import org.eclipse.papyrus.views.properties.Activator;
import org.eclipse.papyrus.views.properties.contexts.View;
import org.eclipse.swt.graphics.Image;
@@ -526,4 +528,32 @@ public class DataSource implements IChangeListener {
}
return element.getValidator(getLocalPropertyPath(propertyPath));
}
+
+ /**
+ * return the NameResolutionHelper to use for completion
+ *
+ * @param propertyPath
+ * @return
+ */
+ public INameResolutionHelper getNameResolutionHelper(String propertyPath) {
+ ModelElement element = getModelElement(propertyPath);
+ if (element == null) {
+ return null;
+ }
+ return element.getNameResolutionHelper(getLocalPropertyPath(propertyPath));
+ }
+
+ /**
+ * return the Papyrus Converter to convert the object to edit or display string and to find the object from a string
+ *
+ * @param propertyPath
+ * @return
+ */
+ public IPapyrusConverter getPapyrusConverter(String propertyPath){
+ ModelElement element = getModelElement(propertyPath);
+ if (element == null) {
+ return null;
+ }
+ return element.getPapyrusConverter(getLocalPropertyPath(propertyPath));
+ }
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/ModelElement.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/ModelElement.java
index 3e59d8b33b1..31fd95aa484 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/ModelElement.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/ModelElement.java
@@ -18,6 +18,8 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.infra.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
/**
* An interface representing Model Elements. A ModelElement is associated to a
@@ -167,4 +169,20 @@ public interface ModelElement {
* @return
*/
public IValidator getValidator(String propertyPath);
+
+ /**
+ * return the INameResolutionHelper to use for completion
+ *
+ * @param propertyPath
+ * @return
+ */
+ public INameResolutionHelper getNameResolutionHelper(String propertyPath);
+
+ /**
+ * return the Papyrus Converter to convert the object to edit or display string and to find the object from a string
+ *
+ * @param localPropertyPath
+ * @return
+ */
+ public IPapyrusConverter getPapyrusConverter(String localPropertyPath);
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/CompletionStyledTextMultiReference.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/CompletionStyledTextMultiReference.java
new file mode 100644
index 00000000000..551bff86f56
--- /dev/null
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/CompletionStyledTextMultiReference.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.views.properties.widgets;
+
+import org.eclipse.papyrus.infra.widgets.editors.CompletionStyledTextMultipleReferenceEditor;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleReferenceEditor;
+import org.eclipse.papyrus.infra.widgets.util.ISetPapyrusConverter;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * A PropertyEditor for editing multiple references in a List
+ *
+ * @see org.eclipse.papyrus.widgets.editors.BooleanCheckbox
+ *
+ * @author Camille Letavernier
+ */
+public class CompletionStyledTextMultiReference extends MultiReference {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * @param style
+ */
+ public CompletionStyledTextMultiReference(Composite parent, int style) {
+ super(parent, style);
+ }
+
+
+ /**
+ * @see org.eclipse.papyrus.views.properties.widgets.MultiReference#createMultipleReferenceEditor(org.eclipse.swt.widgets.Composite, int)
+ *
+ * @param parent
+ * @param style
+ * @return
+ */
+ @Override
+ protected MultipleReferenceEditor createMultipleReferenceEditor(Composite parent, int style) {
+ return new CompletionStyledTextMultipleReferenceEditor(parent, style);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.views.properties.widgets.MultiReference#doBinding()
+ *
+ */
+ @Override
+ protected void doBinding() {
+ if (editor instanceof ISetPapyrusConverter) {
+ ((ISetPapyrusConverter) editor).setPapyrusConverter(input.getPapyrusConverter(propertyPath));
+ }
+ super.doBinding();
+ }
+
+
+}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/CompletionStyledTextReferenceDialog.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/CompletionStyledTextReferenceDialog.java
new file mode 100644
index 00000000000..df68b066231
--- /dev/null
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/CompletionStyledTextReferenceDialog.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.views.properties.widgets;
+
+import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author VL222926
+ *
+ */
+public class CompletionStyledTextReferenceDialog extends AbstractPropertyEditor {
+
+ /**
+ * The ReferenceDialog widget
+ */
+ protected org.eclipse.papyrus.infra.widgets.editors.CompletionStyledTextReferenceDialog editor;
+
+ /**
+ * The ValueFactory used to create or edit Objects directly from
+ * this editor
+ */
+ protected ReferenceValueFactory factory;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * The composite in which the widget will be displayed
+ * @param style
+ * The style for the widget
+ */
+ public CompletionStyledTextReferenceDialog(Composite parent, int style) {
+ editor = createReferenceDialog(parent, style);
+ setEditor(editor);
+ }
+
+ /**
+ * Creates the reference dialog.
+ *
+ * @param parent
+ * The composite in which the widget will be displayed
+ * @param style
+ * The style for the widget
+ * @return the reference dialog.
+ */
+ protected org.eclipse.papyrus.infra.widgets.editors.CompletionStyledTextReferenceDialog createReferenceDialog(Composite parent, int style) {
+ return new org.eclipse.papyrus.infra.widgets.editors.CompletionStyledTextReferenceDialog(parent, style);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.properties.widgets.AbstractPropertyEditor#doBinding()
+ *
+ */
+ @Override
+ protected void doBinding() {
+
+ IStaticContentProvider provider = input.getContentProvider(propertyPath);
+ editor.setLabelProvider(input.getLabelProvider(propertyPath));
+ editor.setContentProvider(provider);
+ editor.setDirectCreation(input.getDirectCreation(propertyPath));
+ editor.setMandatory(input.isMandatory(propertyPath));
+ if (factory == null) { // Use the default factory from the DataSource
+ editor.setValueFactory(input.getValueFactory(propertyPath));
+ } else { // Use the factory explicitly specified
+ editor.setValueFactory(factory);
+ }
+ IPapyrusConverter parser = input.getPapyrusConverter(propertyPath);
+ if (parser != null) {
+ editor.setPapyrusConverter(parser);
+
+ }
+ super.doBinding();
+ }
+
+ /**
+ * Sets the ValueFactory used to create or edit Objects directly from
+ * this editor
+ *
+ * @param factory
+ */
+ public void setFactory(ReferenceValueFactory factory) {
+ this.factory = factory;
+ editor.setValueFactory(factory);
+ }
+
+ /**
+ * @return The ValueFactory used to create or edit Objects directly from
+ * this editor
+ */
+ public ReferenceValueFactory getFactory() {
+ return factory;
+ }
+
+}
diff --git a/releng/top-pom-main.xml b/releng/top-pom-main.xml
old mode 100644
new mode 100755
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
index 4b84d3eac1c..fcef0e8e800 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
@@ -72,7 +72,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.tests.diagramassistants;bundle-version="1.1.0",
org.eclipse.papyrus.uml.profile.drafter;bundle-version="1.1.0",
org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="1.1.0",
- org.eclipse.papyrus.uml.alf.tests;bundle-version="1.1.0"
+ org.eclipse.papyrus.uml.alf.tests;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.textedit.valuespecification.tests;bundle-version="1.1.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.1.0.qualifier
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
index 0b87269313c..081f249c66b 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
@@ -137,6 +137,7 @@ public class AllTests {
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.port.tests.suites.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.property.tests.suites.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.parameter.tests.suites.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites.AllTests.class));
// Alf
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.alf.tests.AllTests.class));
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/.project b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/.project
index 37c08359712..fd080f51221 100644
--- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/.project
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/.project
@@ -1,28 +1,29 @@
-
-
- org.eclipse.papyrus.infra.nattable.model.tests
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
+
+
+ org.eclipse.papyrus.infra.nattable.model.tests
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.classpath b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.project b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.project
new file mode 100644
index 00000000000..d9465185ecd
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.papyrus.uml.textedit.valuespecification.tests
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..94d61f00da6
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=/**\n * @return the ${bare_field_name}\n */ /**\n * @param ${param} the ${bare_field_name} to set\n */ /**\n * Constructor.\n *\n * ${tags}\n */ /*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n /**\n * @author ${user}\n *\n * ${tags}\n */ /**\n * \n */ /**\n * ${tags}\n */ /**\n * ${see_to_overridden}\n *\n * ${tags}\n */ /**\n * ${see_to_target}\n *\n * ${tags}\n */ ${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration} \n \n \n \n // ${todo} Auto-generated catch block\n${exception_var}.printStackTrace(); // ${todo} Auto-generated method stub\n${body_statement} ${body_statement}\n// ${todo} Auto-generated constructor stub return ${field}; ${field} \= ${param};
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..ece647e48c2
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.uml.textedit.valuespecification.tests
+Bundle-Version: 1.0.2.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.textedit.valuespecification.tests.Activator
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.uml2.uml;bundle-version="5.0.0",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="1.0.2",
+ org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="1.0.2",
+ org.eclipse.papyrus.junit.framework;bundle-version="1.0.2",
+ org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui;bundle-version="1.0.2",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.2",
+ org.eclipse.gmf.runtime.common.ui.services,
+ org.eclipse.gmf.runtime.emf.core,
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.2",
+ org.eclipse.papyrus.infra.extendedtypes.emf;bundle-version="1.0.2"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites
+Bundle-Description: %pluginDescription
+Bundle-Localization: plugin
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/ValueSpecficationGrammarTests.launch b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/ValueSpecficationGrammarTests.launch
new file mode 100644
index 00000000000..76785fd9244
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/ValueSpecficationGrammarTests.launch
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/about.html b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/about.html
new file mode 100644
index 00000000000..ee7cad035a4
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+About This Content
+
+September 30, 2009
+License
+
+The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at http://www.eclipse.org/legal/epl-v10.html .
+For purposes of the EPL, "Program" will mean the Content.
+
+If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org .
+
+
+
\ No newline at end of file
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/build.properties b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/build.properties
new file mode 100644
index 00000000000..74d76124156
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ model/,\
+ about.html
+src.includes = about.html
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.di b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.notation b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.notation
new file mode 100644
index 00000000000..0386b098d04
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.notation
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.uml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.uml
new file mode 100644
index 00000000000..fd270c654f8
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/model/xtextValueSpecificationModel.uml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/plugin.properties b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/plugin.properties
new file mode 100644
index 00000000000..befcd918a84
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/plugin.properties
@@ -0,0 +1,13 @@
+#################################################################################
+# Copyright (c) 2015 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:
+# Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - initial API and implementation
+##################################################################################
+pluginName=XText ValueSpecification Editor Tests
+providerName=Eclipse Modeling Project
+pluginDescription=This plugin define the xtext editor for the cell of NatTable
\ No newline at end of file
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml
new file mode 100644
index 00000000000..962a5e2acaa
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+
+ org.eclipse.papyrus
+ org.eclipse.papyrus
+ 1.0.2-SNAPSHOT
+ ../../../../../../releng/top-pom-main-tests.xml
+
+ org.eclipse.papyrus
+ org.eclipse.papyrus.uml.textedit.valuespecification.tests
+ 1.0.2-SNAPSHOT
+ eclipse-test-plugin
+
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/AbstractGrammarTest.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/AbstractGrammarTest.java
new file mode 100644
index 00000000000..a8586f2f1d9
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/AbstractGrammarTest.java
@@ -0,0 +1,102 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.uml.textedit.valuespecification.tests.rules.NoTransactionRule;
+import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
+import org.eclipse.uml2.uml.NamedElement;
+import org.junit.Before;
+import org.junit.Rule;
+
+/**
+ * This define the abstract grammar test used to declare an xtext grammar tester.
+ *
+ * @param
+ * The EObject
+ */
+public abstract class AbstractGrammarTest extends AbstractPapyrusTest {
+
+ /**
+ * The xtext direct editor configuration used.
+ */
+ protected DefaultXtextDirectEditorConfiguration editor;
+
+ /**
+ * The xtext editor tester.
+ */
+ protected XTextEditorTester tester;
+
+ /**
+ * The rule used.
+ */
+ @Rule
+ public NoTransactionRule noTransaction = new NoTransactionRule();
+
+ /**
+ * This allow to initialize the editor.
+ */
+ @Before
+ public void initEditor() {
+ editor = getEditor();
+ tester = new XTextEditorTester(editor);
+ }
+
+ /**
+ * This allow to find an element in the model.
+ *
+ * @param type
+ * The type of element to search.
+ * @param name
+ * The name of element to search.
+ * @return The element find in the model of null
.
+ */
+ public E findElement(final Class type, final String name) {
+ for (E element : EMFHelper.allInstances(getModelResource(), type)) {
+ if (element.getName().equals(name)) {
+ return element;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the resource set.
+ *
+ * @return The resource set.
+ */
+ protected ResourceSet getResourceSet() {
+ return noTransaction.getResourceSet();
+ }
+
+ /**
+ * Get the model resource.
+ *
+ * @return The model resource.
+ */
+ protected Resource getModelResource() {
+ return noTransaction.getModelResource();
+ }
+
+ /**
+ * This allow to define the xtext direct editor configuration used to parse.
+ *
+ * @return The xtext direct editor configuration used.
+ */
+ public abstract DefaultXtextDirectEditorConfiguration getEditor();
+
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/Activator.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/Activator.java
new file mode 100644
index 00000000000..ed10d86e44a
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/Activator.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator implements BundleActivator {
+
+ /**
+ * The bundle context.
+ */
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/XTextEditorTester.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/XTextEditorTester.java
new file mode 100644
index 00000000000..b685bd6132e
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/XTextEditorTester.java
@@ -0,0 +1,79 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
+
+/**
+ * The generic xtext editor tester.
+ *
+ * @param
+ * The EObject to parse.
+ */
+public class XTextEditorTester {
+
+ /**
+ * The xtext direct editor configuration used.
+ */
+ protected DefaultXtextDirectEditorConfiguration editor;
+
+ /**
+ * Constructor.
+ *
+ * @param editor
+ * The xtext direct editor configuration used.
+ */
+ public XTextEditorTester(final DefaultXtextDirectEditorConfiguration editor) {
+ this.editor = editor;
+ }
+
+ /**
+ * This allow to parse text for the parent element.
+ *
+ * @param parentElement
+ * The parent element.
+ * @param initialElement
+ * The initial element or the structural feature.
+ * @param textToParse
+ * The text to parse.
+ * @return The initial element modified depending of the text parser.
+ * @throws Exception
+ * All the exception for the parser.
+ */
+ public T parseText(final EObject parentElement, final T initialElement, final String textToParse) throws Exception {
+ IParser parser = editor.createParser(parentElement);
+ ICommand parseCommand = parser.getParseCommand(new EObjectAdapter(initialElement), textToParse, 0);
+ if (null != parseCommand) {
+ parseCommand.execute(new NullProgressMonitor(), null);
+ }
+
+ return initialElement;
+ }
+
+ /**
+ * Get the initial text corresponding to the element.
+ *
+ * @param element
+ * The element to parse to string.
+ * @return The text representing the element.
+ */
+ public String getInitialText(final Object element) {
+ return editor.getTextToEdit(element);
+ }
+
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/rules/NoTransactionFixture.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/rules/NoTransactionFixture.java
new file mode 100644
index 00000000000..75befa937da
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/rules/NoTransactionFixture.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests.rules;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+/**
+ * This rule provides a ResourceSet with a TransactionalEditingDomain
+ *
+ * All test methods are executed within a Transaction (Which means test method
+ * do not need to care about transactions)
+ *
+ * This fixture is meant to be used through {@link NoTransactionRule}
+ *
+ * @see {@link NoTransactionRule}
+ */
+public class NoTransactionFixture implements TestRule {
+
+ /**
+ * The model set fixture.
+ */
+ private final ModelSetFixture modelSet;
+
+ /**
+ * Constructor.
+ *
+ * @param modelSet
+ * The model set fixture.
+ */
+ public NoTransactionFixture(final ModelSetFixture modelSet) {
+ this.modelSet = modelSet;
+ }
+
+ /**
+ * @see org.junit.rules.TestRule#apply(org.junit.runners.model.Statement, org.junit.runner.Description)
+ *
+ * @param base
+ * The base statement.
+ * @param description
+ * The description.
+ * @return The modified statement.
+ */
+ public Statement apply(final Statement base, final Description description) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+
+ final AtomicReference throwable = new AtomicReference();
+ modelSet.getEditingDomain().getCommandStack().execute(new AbstractCommand() {
+
+ public void execute() {
+ try {
+ base.evaluate();
+ } catch (Throwable t) {
+ throwable.set(t);
+ }
+ }
+
+ public void redo() {
+ // Nothing
+ }
+
+ /**
+ * @see org.eclipse.emf.common.command.AbstractCommand#prepare()
+ *
+ * @return
+ */
+ @Override
+ protected boolean prepare() {
+ return true;
+ }
+
+ });
+
+ if (null != throwable.get()) {
+ throw throwable.get();
+ }
+ }
+ };
+ }
+
+ /**
+ * Get the resource set.
+ *
+ * @return The resource set.
+ */
+ public ResourceSet getResourceSet() {
+ return modelSet.getResourceSet();
+ }
+
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/rules/NoTransactionRule.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/rules/NoTransactionRule.java
new file mode 100644
index 00000000000..1035fc7b97a
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/rules/NoTransactionRule.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests.rules;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture;
+import org.junit.rules.RuleChain;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+/**
+ * This rule provides a ResourceSet with a TransactionalEditingDomain
+ *
+ * All test methods are executed within a Transaction (Which means test method
+ * do not need to care about transactions)
+ *
+ * Usage:
+ *
+ *
+ * @Rule
+ * public NoTransactionRule noTransaction = new NoTransactionRule();
+ *
+ */
+public class NoTransactionRule implements TestRule {
+
+ /**
+ * The model set fixture.
+ */
+ private final ModelSetFixture modelSet = new ModelSetFixture();
+
+ /**
+ * The no transition fixture created from the model set fixture.
+ */
+ private final NoTransactionFixture noTransaction = new NoTransactionFixture(modelSet);
+
+ /**
+ * Get the {@link RuleChain}.
+ *
+ * @return The {@link RuleChain}.
+ */
+ public RuleChain getRuleChain() {
+ return RuleChain.outerRule(modelSet).around(noTransaction);
+ }
+
+ /**
+ * @see org.junit.rules.TestRule#apply(org.junit.runners.model.Statement, org.junit.runner.Description)
+ *
+ * @param base
+ * The base statement.
+ * @param description
+ * The description.
+ * @return The modified statement.
+ */
+ public Statement apply(final Statement base, final Description description) {
+ return getRuleChain().apply(base, description);
+ }
+
+ /**
+ * Get the resource set.
+ *
+ * @return The resource set
+ */
+ public ResourceSet getResourceSet() {
+ return modelSet.getResourceSet();
+ }
+
+ /**
+ * Get the model resource.
+ *
+ * @return The model resource.
+ */
+ public Resource getModelResource() {
+ return modelSet.getModelResource();
+ }
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/AllTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/AllTests.java
new file mode 100644
index 00000000000..1c4b7595518
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/AllTests.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+ ValueSpecificationGrammarTests.class
+})
+public class AllTests {
+ // JUnit 4 Test Suite
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java
new file mode 100644
index 00000000000..b59796cc98f
--- /dev/null
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java
@@ -0,0 +1,273 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites;
+
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.textedit.valuespecification.tests.AbstractGrammarTest;
+import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui.contribution.ValueSpecificationXtextDirectEditorConfiguration;
+import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.LiteralBoolean;
+import org.eclipse.uml2.uml.LiteralInteger;
+import org.eclipse.uml2.uml.LiteralReal;
+import org.eclipse.uml2.uml.LiteralString;
+import org.eclipse.uml2.uml.LiteralUnlimitedNatural;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+import org.eclipse.uml2.uml.VisibilityKind;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@PluginResource("/model/xtextValueSpecificationModel.uml")
+public class ValueSpecificationGrammarTests extends AbstractGrammarTest {
+
+ /**
+ * The instance specification (QName = model::InstanceSpecification1).
+ */
+ protected InstanceSpecification instanceSpecification;
+
+ /**
+ * The enumeration literal (QName = model::Package1::EnumerationLiteral1).
+ */
+ protected EnumerationLiteral enumerationLiteral;
+
+ /**
+ * The root model.
+ */
+ protected Model rootModel;
+
+ /**
+ * The tested property.
+ */
+ protected Property testedProperty;
+
+ /**
+ * The boolean type (already created in the model).
+ */
+ private Type booleanType;
+
+ /**
+ * The integer type (already created in the model).
+ */
+ private Type integerType;
+
+ /**
+ * The real type (already created in the model).
+ */
+ private Type realType;
+
+ @Before
+ public void loadTestModel() {
+ instanceSpecification = findElement(InstanceSpecification.class, "InstanceSpecification1");
+ enumerationLiteral = findElement(EnumerationLiteral.class, "EnumerationLiteral1");
+ rootModel = findElement(Model.class, "model");
+ booleanType = findElement(Property.class, "PropertyBooleanType").getType();
+ integerType = findElement(Property.class, "PropertyIntegerType").getType();
+ realType = findElement(Property.class, "PropertyRealType").getType();
+
+ Class createdClass = (Class) rootModel.createPackagedElement("Class1", UMLPackage.eINSTANCE.getClass_());
+ testedProperty = (Property) createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
+ }
+
+ @Test
+ public void testParser() throws Exception {
+
+ // **************************************//
+ // Check the text parser object creation //
+ // **************************************//
+
+ // Check undefined
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "");
+ Assert.assertNull(testedProperty.getDefaultValue());
+
+ // ***************************************************//
+ // Check the basic parser with all the possible types //
+ // ***************************************************//
+
+ // Check instance value and instance specification
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "~instanceValue=InstanceSpecification1");
+ Assert.assertEquals(VisibilityKind.PACKAGE_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("instanceValue", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getInstanceValue(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(instanceSpecification, ((InstanceValue) testedProperty.getDefaultValue()).getInstance());
+
+ // Check literal boolean parse
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "-boolean=true");
+ Assert.assertEquals(VisibilityKind.PRIVATE_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("boolean", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralBoolean(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(true, ((LiteralBoolean) testedProperty.getDefaultValue()).isValue());
+
+ // Check literal unlimited natural
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+unlimitedNatural=12");
+ Assert.assertEquals(VisibilityKind.PUBLIC_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("unlimitedNatural", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(12, ((LiteralUnlimitedNatural) testedProperty.getDefaultValue()).getValue());
+
+ // Check literal integer
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "#integer=34");
+ Assert.assertEquals(VisibilityKind.PROTECTED_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(34, ((LiteralUnlimitedNatural) testedProperty.getDefaultValue()).getValue());
+
+ // Check literal real
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "123.45");
+ Assert.assertEquals(VisibilityKind.PROTECTED_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralReal(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(123.45, ((LiteralReal) testedProperty.getDefaultValue()).getValue(), 0);
+
+ // Check literal null
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+null");
+ Assert.assertEquals(VisibilityKind.PUBLIC_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralNull(), testedProperty.getDefaultValue().eClass());
+
+ // Check literal string
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "-name=\"abcdef\"");
+ Assert.assertEquals(VisibilityKind.PRIVATE_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("name", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralString(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals("abcdef", ((LiteralString) testedProperty.getDefaultValue()).getValue());
+
+ // Check opaque expression
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+#id=\"test\"");
+ Assert.assertEquals(VisibilityKind.PRIVATE_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("+#id=\"test\"", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getOpaqueExpression(), testedProperty.getDefaultValue().eClass());
+
+ // ************************************************************************************//
+ // Check when the type of parent is not compatible with the value specification needed //
+ // ************************************************************************************//
+
+ // Check the boolean text parser with real type on property -> Opaque Expression will be created
+ testedProperty.setType(realType);
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "-boolean=true");
+ Assert.assertEquals("-boolean=true", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getOpaqueExpression(), testedProperty.getDefaultValue().eClass());
+
+ // Check the unlimited natural text parser with real type on property -> Literal real will be created
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+unlimitedNatural=12");
+ Assert.assertEquals(VisibilityKind.PUBLIC_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("unlimitedNatural", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralReal(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(12, ((LiteralReal) testedProperty.getDefaultValue()).getValue(), 0);
+
+ // Check the unlimited natural text parser with integer type on property -> Literal integer will be created
+ testedProperty.setType(integerType);
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "-integer=34");
+ Assert.assertEquals(VisibilityKind.PRIVATE_LITERAL, testedProperty.getDefaultValue().getVisibility());
+ Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralInteger(), testedProperty.getDefaultValue().eClass());
+ Assert.assertEquals(34, ((LiteralInteger) testedProperty.getDefaultValue()).getValue(), 0);
+
+ // Check the integer text parser with boolean type on property -> Opaque Expression will be created
+ testedProperty.setType(booleanType);
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+integer=56");
+ Assert.assertEquals("+integer=56", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getOpaqueExpression(), testedProperty.getDefaultValue().eClass());
+
+ // ******************************//
+ // Check the multi valued option //
+ // ******************************//
+ testedProperty.setType(null);
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "integer=34");
+ testedProperty.setUpper(2);
+ // Check the boolean xtext parser with multi valuation -> Opaque Expression will be created
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "-boolean=true");
+ Assert.assertEquals("-boolean=true", testedProperty.getDefaultValue().getName());
+ Assert.assertEquals(UMLPackage.eINSTANCE.getOpaqueExpression(), testedProperty.getDefaultValue().eClass());
+
+ // ****************************//
+ // Check the empty text parser //
+ // ****************************//
+
+ // Check the integer text parser with boolean type on property -> Opaque Expression will be created
+ tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "");
+ Assert.assertNull(testedProperty.getDefaultValue());
+
+ }
+
+ @Test
+ public void testInitialText() {
+ ValueSpecification testedValueSpecification = (ValueSpecification) testedProperty.createDefaultValue("valueSpec", null, UMLPackage.eINSTANCE.getLiteralBoolean());
+ Assert.assertEquals("valueSpec=false", tester.getInitialText(testedValueSpecification));
+
+ ((LiteralBoolean) testedValueSpecification).setValue(true);
+ Assert.assertEquals("valueSpec=true", tester.getInitialText(testedValueSpecification));
+
+ testedValueSpecification.setName("boolean");
+ Assert.assertEquals("boolean=true", tester.getInitialText(testedValueSpecification));
+
+ testedValueSpecification.eUnset(UMLPackage.Literals.NAMED_ELEMENT__NAME);
+ Assert.assertEquals("true", tester.getInitialText(testedValueSpecification));
+ }
+
+ @Test
+ public void testDefaultValues() throws Exception {
+
+ // Check the instance specification
+ ValueSpecification testedValueSpecification = testedProperty.createDefaultValue("literalInstanceValue", null, UMLPackage.eINSTANCE.getInstanceValue());
+ ((InstanceValue) testedValueSpecification).setInstance(enumerationLiteral);
+ Assert.assertEquals("literalInstanceValue=EnumerationLiteral1", tester.getInitialText(testedValueSpecification));
+
+ // Check the literal boolean
+ testedValueSpecification = testedProperty.createDefaultValue("literalBoolean", null, UMLPackage.eINSTANCE.getLiteralBoolean());
+ ((LiteralBoolean) testedValueSpecification).setValue(true);
+ Assert.assertEquals("literalBoolean=true", tester.getInitialText(testedValueSpecification));
+
+ // Check the literal unlimited natural
+ testedValueSpecification = testedProperty.createDefaultValue("literalUnlimitedNatural", null, UMLPackage.eINSTANCE.getLiteralUnlimitedNatural());
+ ((LiteralUnlimitedNatural) testedValueSpecification).setValue(12);
+ Assert.assertEquals("literalUnlimitedNatural=12", tester.getInitialText(testedValueSpecification));
+
+ // Check the literal integer
+ testedValueSpecification = testedProperty.createDefaultValue("literalInteger", null, UMLPackage.eINSTANCE.getLiteralInteger());
+ ((LiteralInteger) testedValueSpecification).setValue(-34);
+ Assert.assertEquals("literalInteger=-34", tester.getInitialText(testedValueSpecification));
+
+ // Check the literal real
+ testedValueSpecification = testedProperty.createDefaultValue("literalReal", null, UMLPackage.eINSTANCE.getLiteralReal());
+ ((LiteralReal) testedValueSpecification).setValue(123.45);
+ Assert.assertEquals("literalReal=123.45", tester.getInitialText(testedValueSpecification));
+
+ // Check the literal null
+ testedValueSpecification = testedProperty.createDefaultValue("literalNull", null, UMLPackage.eINSTANCE.getLiteralNull());
+ Assert.assertEquals("literalNull=null", tester.getInitialText(testedValueSpecification));
+
+ // Check the literal string
+ testedValueSpecification = testedProperty.createDefaultValue("literalString", null, UMLPackage.eINSTANCE.getLiteralString());
+ ((LiteralString) testedValueSpecification).setValue("abcdef");
+ Assert.assertEquals("literalString=\"abcdef\"", tester.getInitialText(testedValueSpecification));
+
+ // Check the opaque expression
+ testedValueSpecification = testedProperty.createDefaultValue("opaqueExpression=Nothing", null, UMLPackage.eINSTANCE.getOpaqueExpression());
+ Assert.assertEquals("opaqueExpression=Nothing", tester.getInitialText(testedValueSpecification));
+ }
+
+ @Override
+ public DefaultXtextDirectEditorConfiguration getEditor() {
+ return new ValueSpecificationXtextDirectEditorConfiguration();
+ }
+}
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.di b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.notation b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.notation
new file mode 100644
index 00000000000..9987ddfa898
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.notation
@@ -0,0 +1,347 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.uml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.uml
new file mode 100644
index 00000000000..0f99d8fc929
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterCompletionTest.uml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.di b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.notation b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.notation
new file mode 100644
index 00000000000..fcea6e80947
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.notation
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.uml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.uml
new file mode 100644
index 00000000000..a834d786385
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/uml/UMLReferenceConverterTest.uml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java
index 3e1d24dc50a..8b3bfb06d5a 100644
--- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java
@@ -21,7 +21,7 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ ContentProviderTest.class, UMLStereotypePropertyContentProviderTest.class, DependencyManagementTest.class,
- NamedElementValidatorTest.class, StereotypeElementListenerTest.class, ProfileApplicationListenerTest.class
+ NamedElementValidatorTest.class, StereotypeElementListenerTest.class, ProfileApplicationListenerTest.class, UMLReferenceConverterTest.class, UMLReferenceConverterCompletionTest.class
})
public class AllTests {
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/UMLReferenceConverterCompletionTest.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/UMLReferenceConverterCompletionTest.java
new file mode 100644
index 00000000000..6497f17552e
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/UMLReferenceConverterCompletionTest.java
@@ -0,0 +1,362 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.tools.tests.tests;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
+import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.tools.util.ReferenceContentAssistProcessor;
+import org.eclipse.papyrus.uml.tools.util.UMLReferenceConverter;
+import org.eclipse.papyrus.uml.tools.utils.NameResolutionHelper;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * @author VL222926
+ *
+ * This class the suggestion of the content assist
+ *
+ */
+@PluginResource("/resources/uml/UMLReferenceConverterCompletionTest.di")
+public class UMLReferenceConverterCompletionTest {
+
+ @Rule
+ public final ModelSetFixture fixture = new ModelSetFixture();
+
+ private Package root;
+
+ private Class class1;
+
+ private Property property;
+
+
+
+ private static String PROPERTY1_NAME_TO_DISPLAY = "Attribute1"; //$NON-NLS-1$
+
+ private static final String PACKAGE1_NAME_TO_DISPLAY = "Package1"; //$NON-NLS-1$
+
+ public static final String CLASS1_SHORTEST_QN_TO_DISPLAY = "model::Class1"; //$NON-NLS-1$
+
+ public static final String CLASS1_QUALIFIED_NAME_TO_DISPLAY = "model::Class1"; //$NON-NLS-1$
+
+ public static final String NESTED_CLASS1_NAME_TO_DISPLAY = "Class1"; //$NON-NLS-1$
+
+ public static final String CLASS4_NAME_TO_DISPLAY = "Class4"; //$NON-NLS-1$
+
+ public static final String CLASS2_NAME_TO_DISPLAY = "Clas,s2"; //$NON-NLS-1$
+
+ public static final String CLASS3_NAME_TO_DISPLAY = "Cla,,ss3"; //$NON-NLS-1$
+
+ private static final String CLASS_PARTIAL_NAME_WITHOUT_QUOTE_WITH_COMMA = "Clas,"; //$NON-NLS-1$
+
+ private static final String CLASS_PARTIAL_NAME_WITHOUT_QUOTE_WITHOUT_COMMA = "Clas"; //$NON-NLS-1$
+
+ private static final String CLASS_PARTIAL_NAME_WITH_QUOTE_WITH_COMMA = "'Clas,"; //$NON-NLS-1$
+
+
+ public static final String CLASS5_NAME_TO_DISPLAY = "Class5"; //$NON-NLS-1$
+ public static final String CLASS6_NAME_TO_DISPLAY = "Class6"; //$NON-NLS-1$
+
+ public static final String CLASS1_NAME_TO_DISPLAY = "Class1"; //$NON-NLS-1$
+
+ public static final String CONSTRAINT1_NAME_TO_DISPLAY = "Constraint1"; //$NON-NLS-1$
+ public static final String CONSTRAINT2_NAME_TO_DISPLAY = "Constraint2"; //$NON-NLS-1$
+ public static final String CONSTRAINT3_NAME_TO_DISPLAY = "Constraint3"; //$NON-NLS-1$
+ public static final String CONSTRAINT4_NAME_TO_DISPLAY = "Constraint4"; //$NON-NLS-1$
+ public static final String CONSTRAINT5_NAME_TO_DISPLAY = "Constraint5"; //$NON-NLS-1$
+ public static final String CONSTRAINT6_NAME_TO_DISPLAY = "Constraint6"; //$NON-NLS-1$
+
+ @Before
+ public void initField() {
+ root = fixture.getModel();
+ class1 = (Class) root.getMember(CLASS1_NAME_TO_DISPLAY);
+ property = (Property) class1.getMember(PROPERTY1_NAME_TO_DISPLAY);
+ }
+
+ @Test
+ public void testCompletionToFindClass_1() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter converter = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) converter.getCompletionProcessor(null);
+ List values = completionproposal.suggest(IPapyrusConverter.EMPTY_STRING);
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ }
+
+ public void testCompletionToFindClass_2() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter converter = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) converter.getCompletionProcessor(null);
+ List values = completionproposal.suggest("Cl"); //$NON-NLS-1$
+ Assert.assertEquals(8, values.size());
+ Assert.assertTrue(!values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ }
+
+
+ @Test
+ public void testCompletionToFindClass_3() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ List values = completionproposal.suggest("C"); //$NON-NLS-1$
+ Assert.assertEquals(8, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(!values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(CLASS1_SHORTEST_QN_TO_DISPLAY));
+ Assert.assertTrue(values.contains(NESTED_CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS2_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS3_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS4_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS5_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS6_NAME_TO_DISPLAY));
+ }
+
+ @Test
+ public void testCompletionToFindClass_4() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ List values = completionproposal.suggest(NESTED_CLASS1_NAME_TO_DISPLAY);
+ Assert.assertEquals(3, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(!values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(CLASS1_SHORTEST_QN_TO_DISPLAY));
+ Assert.assertTrue(values.contains(NESTED_CLASS1_NAME_TO_DISPLAY));
+ }
+
+ @Test
+ public void testCompletionToFindClass_5() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ List values = completionproposal.suggest("Clas,"); //$NON-NLS-1$
+ // the comma is ignored
+ Assert.assertEquals(7, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(!values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(CLASS1_SHORTEST_QN_TO_DISPLAY));
+ Assert.assertTrue(values.contains(NESTED_CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS2_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS4_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS5_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS6_NAME_TO_DISPLAY));
+ }
+
+ @Test
+ public void testCompletionToFindClass_6() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ List values = completionproposal.suggest("'Clas,"); //$NON-NLS-1$
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(values.contains(CLASS2_NAME_TO_DISPLAY));
+ }
+
+ @Test
+ public void testCompletionToFindClass_7() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ List values = completionproposal.suggest("'Clas"); //$NON-NLS-1$
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(values.contains(CLASS2_NAME_TO_DISPLAY));
+ }
+
+
+ @Test
+ public void testCompletionToFindClass_8() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, true);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ StringBuilder multiValueString = new StringBuilder();
+ multiValueString.append(CLASS1_NAME_TO_DISPLAY);
+ multiValueString.append(IPapyrusConverter.STRING_SEPARATOR);
+ multiValueString.append(CLASS4_NAME_TO_DISPLAY);
+ multiValueString.append(IPapyrusConverter.STRING_SEPARATOR);
+ multiValueString.append("Cl"); //$NON-NLS-1$
+ List values = completionproposal.suggest(multiValueString.toString());
+ Assert.assertEquals(8, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(!values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(CLASS1_SHORTEST_QN_TO_DISPLAY));
+ Assert.assertTrue(values.contains(NESTED_CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS2_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS3_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS4_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS5_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CLASS6_NAME_TO_DISPLAY));
+ }
+
+ @Test
+ public void testCompletionToFindConstraint_1() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getConstraint());
+ UMLReferenceConverter converter = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) converter.getCompletionProcessor(null);
+ // we don't provide values when the string is empty
+ List values = completionproposal.suggest(IPapyrusConverter.EMPTY_STRING);
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ }
+
+ @Test
+ public void testCompletionToFindConstraint_2() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getConstraint());
+ UMLReferenceConverter converter = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) converter.getCompletionProcessor(null);
+ List values = completionproposal.suggest("Cons"); //$NON-NLS-1$
+ Assert.assertEquals(7, values.size());
+ Assert.assertTrue(!values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ Assert.assertTrue(values.contains(CONSTRAINT1_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CONSTRAINT2_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CONSTRAINT3_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CONSTRAINT4_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CONSTRAINT5_NAME_TO_DISPLAY));
+ Assert.assertTrue(values.contains(CONSTRAINT6_NAME_TO_DISPLAY));
+ }
+
+
+ @Test
+ public void testCompletionToFindPackage_1() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getPackage());
+ UMLReferenceConverter converter = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) converter.getCompletionProcessor(null);
+ List values = completionproposal.suggest(IPapyrusConverter.EMPTY_STRING);
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ }
+
+ @Test
+ public void testCompletionToFindPackage_2() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getPackage());
+ UMLReferenceConverter converter = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) converter.getCompletionProcessor(null);
+ List values = completionproposal.suggest("Pack"); //$NON-NLS-1$
+ Assert.assertEquals(17, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ values.remove(IPapyrusConverter.MORE_ELEMENTS);
+ values.remove(IPapyrusConverter.NULL_VALUE);
+ Assert.assertEquals(15, new HashSet(values).size());
+ }
+
+
+ @Test
+ public void testCompletionSingleValueConverterEmptyString() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter singleValueParser = new UMLReferenceConverter(helper, false);
+ ReferenceContentAssistProcessor proposal = (ReferenceContentAssistProcessor) singleValueParser.getCompletionProcessor(null);
+ List values = proposal.suggest(IPapyrusConverter.EMPTY_STRING);
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ }
+
+ @Test
+ public void testCompletionMultiValueConverterEmptyString() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, true);
+ ReferenceContentAssistProcessor completionproposal = (ReferenceContentAssistProcessor) multiValueParser.getCompletionProcessor(null);
+ List values = completionproposal.suggest(IPapyrusConverter.EMPTY_STRING);
+ Assert.assertEquals(2, values.size());
+ Assert.assertTrue(values.contains(IPapyrusConverter.MORE_ELEMENTS));
+ Assert.assertTrue(values.contains(IPapyrusConverter.NULL_VALUE));
+ }
+
+ @Test
+ public void testSplitString_1() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, true);
+ StringBuilder builder = new StringBuilder();
+ builder.append(CLASS1_NAME_TO_DISPLAY);
+ builder.append(IPapyrusConverter.STRING_SEPARATOR);
+ builder.append(CLASS_PARTIAL_NAME_WITHOUT_QUOTE_WITH_COMMA);
+ Map, String> mapRes = multiValueParser.getSubStringsWithTheirPositions(builder.toString());
+ Assert.assertEquals(2, mapRes.size());
+ Assert.assertTrue(mapRes.values().contains(CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(mapRes.values().contains(CLASS_PARTIAL_NAME_WITHOUT_QUOTE_WITHOUT_COMMA));
+ for (Entry, String> current : mapRes.entrySet()) {
+ if (current.getValue().equals(CLASS1_NAME_TO_DISPLAY)) {
+ int start = current.getKey().get(0);
+ int end = current.getKey().get(1);
+ Assert.assertEquals(0, start);
+ Assert.assertEquals(6, end);
+ } else if (current.getValue().equals(CLASS_PARTIAL_NAME_WITHOUT_QUOTE_WITHOUT_COMMA)) {
+ int start = current.getKey().get(0);
+ int end = current.getKey().get(1);
+ Assert.assertEquals(7, start);
+ Assert.assertEquals(11, end);
+ } else {
+ Assert.assertTrue(false);
+ }
+
+ }
+ List res = multiValueParser.splitFullStringToSubElementString(builder.toString());
+ Assert.assertEquals(2, res.size());
+ Assert.assertTrue(res.get(0).equals(CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(res.get(1).equals(CLASS_PARTIAL_NAME_WITHOUT_QUOTE_WITHOUT_COMMA));
+ }
+
+ @Test
+ public void testSplitString_2() {
+ NameResolutionHelper helper = new NameResolutionHelper(property, UMLPackage.eINSTANCE.getClass_());
+ UMLReferenceConverter multiValueParser = new UMLReferenceConverter(helper, true);
+ StringBuilder builder = new StringBuilder();
+ builder.append(CLASS1_NAME_TO_DISPLAY);
+ builder.append(IPapyrusConverter.STRING_SEPARATOR);
+ builder.append(CLASS_PARTIAL_NAME_WITH_QUOTE_WITH_COMMA);
+ Map, String> mapRes = multiValueParser.getSubStringsWithTheirPositions(builder.toString());
+ Assert.assertEquals(2, mapRes.size());
+ Assert.assertTrue(mapRes.values().contains(CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(mapRes.values().contains(CLASS_PARTIAL_NAME_WITH_QUOTE_WITH_COMMA));
+ for (Entry, String> current : mapRes.entrySet()) {
+ if (current.getValue().equals(CLASS1_NAME_TO_DISPLAY)) {
+ int start = current.getKey().get(0);
+ int end = current.getKey().get(1);
+ Assert.assertEquals(0, start);
+ Assert.assertEquals(6, end);
+ } else if (current.getValue().equals(CLASS_PARTIAL_NAME_WITH_QUOTE_WITH_COMMA)) {
+ int start = current.getKey().get(0);
+ int end = current.getKey().get(1);
+ Assert.assertEquals(7, start);
+ Assert.assertEquals(13, end);
+ } else {
+ Assert.assertTrue(false);
+ }
+
+ }
+ List res = multiValueParser.splitFullStringToSubElementString(builder.toString());
+ Assert.assertEquals(2, res.size());
+ Assert.assertTrue(res.get(0).equals(CLASS1_NAME_TO_DISPLAY));
+ Assert.assertTrue(res.get(1).equals(CLASS_PARTIAL_NAME_WITH_QUOTE_WITH_COMMA));
+ }
+
+}
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/UMLReferenceConverterTest.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/UMLReferenceConverterTest.java
new file mode 100644
index 00000000000..eb6252b0e8d
--- /dev/null
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/UMLReferenceConverterTest.java
@@ -0,0 +1,173 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.tools.tests.tests;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.widgets.util.INameResolutionHelper;
+import org.eclipse.papyrus.infra.widgets.util.IPapyrusConverter;
+import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.tools.util.UMLReferenceConverter;
+import org.eclipse.papyrus.uml.tools.utils.NameResolutionHelper;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * @author VL222926
+ * This class tests the UMLReferenceConverter
+ */
+@PluginResource("/resources/uml/UMLReferenceConverterTest.di")
+public class UMLReferenceConverterTest {
+
+ @Rule
+ public final ModelSetFixture fixture = new ModelSetFixture();
+
+ private INameResolutionHelper helper;
+
+ private UMLReferenceConverter singleValueParser;
+
+ private UMLReferenceConverter multiValueParser;
+
+ public static final String MODEL_TO_DISPLAY = "model";
+
+ public static final String MODEL_TO_EDIT = "model";
+
+ public static final String CLASS1_NAME_TO_DISPLAY = "Class1";
+
+ public static final String CLASS1_NAME_TO_EDIT = "Class1";
+
+
+ public static final String CLASS2_NAME_TO_DISPLAY = "Clas,s2";
+
+ public static final String CLASS2_NAME_TO_EDIT = "'Clas,s2'";
+
+ public static final String CLASS3_NAME_TO_DISPLAY = "Cla,,ss3";
+
+ public static final String CLASS4_NAME_TO_DISPLAY = "Class4";
+
+ public static final String CLASS3_NAME_TO_EDIT = "'Cla,,ss3'";
+
+ public static final String CLASSE2_CLASS3_TO_DISPLAY = CLASS2_NAME_TO_DISPLAY + "," + CLASS3_NAME_TO_DISPLAY;
+
+ public static final String CLASSE2_CLASS3_TO_EDIT = CLASS2_NAME_TO_EDIT + "," + CLASS3_NAME_TO_EDIT;
+
+ private Class class2 = null;
+
+ private Class class3 = null;
+
+ private Class class1 = null;
+
+ private Class class4 = null;
+
+ private Package root = null;
+
+
+ @Before
+ public void initField() {
+ helper = new NameResolutionHelper(fixture.getModel(), UMLPackage.eINSTANCE.getClass_());
+ singleValueParser = new UMLReferenceConverter(helper, false);
+ multiValueParser = new UMLReferenceConverter(helper, true);
+ root = fixture.getModel();
+ class2 = (Class) root.getMember(CLASS1_NAME_TO_DISPLAY);
+ class2 = (Class) root.getMember(CLASS2_NAME_TO_DISPLAY);
+ class3 = (Class) root.getMember(CLASS3_NAME_TO_DISPLAY);
+ }
+
+ private void testConverter(final String strToParse, final String strToEdit, final String strToDisplay, final Object objectToString, Object objectToFound, boolean isMany) {
+ IPapyrusConverter converter = null;
+ if(isMany){
+ converter = multiValueParser;
+ }else{
+ converter = singleValueParser;
+ }
+ // test parsed value
+ Object parsedValue = converter.editToCanonicalValue(strToParse, 0);
+ Assert.assertEquals(objectToFound, parsedValue);
+
+ // test the string to edit
+ String str = converter.canonicalToEditValue(objectToString, 0);
+ Assert.assertEquals(strToEdit, str);
+
+
+ // test the string to display
+ str = converter.canonicalToDisplayValue(objectToString, 0);
+ Assert.assertEquals(str, strToDisplay);
+ }
+
+
+ @Test
+ public void testClass2() {
+ testConverter(CLASS2_NAME_TO_EDIT, CLASS2_NAME_TO_EDIT, CLASS2_NAME_TO_DISPLAY, class2, class2, false);
+ }
+
+ @Test
+ public void testClass3() {
+ testConverter(CLASS3_NAME_TO_EDIT, CLASS3_NAME_TO_EDIT, CLASS3_NAME_TO_DISPLAY, class3, class3, false);
+ }
+
+ @Test
+ public void testList() {
+ List list = new ArrayList();
+ list.add(class2);
+ list.add(class3);
+ testConverter(CLASSE2_CLASS3_TO_EDIT, CLASSE2_CLASS3_TO_EDIT, CLASSE2_CLASS3_TO_DISPLAY, list, list, true);
+ }
+
+
+ @Test
+ public void testMatchingElementstSingleValue1() {
+ List> elements = singleValueParser.getMatchingElements(CLASS2_NAME_TO_DISPLAY);
+ Assert.assertEquals(1, elements.size());
+ }
+
+
+ @Test
+ public void testMatchingElementstSingleValue2() {
+ List> elements = singleValueParser.getMatchingElements(CLASS2_NAME_TO_EDIT);
+ Assert.assertEquals(1, elements.size());
+ }
+
+ @Test
+ public void testEmptyString() {
+ testConverter(IPapyrusConverter.EMPTY_STRING, IPapyrusConverter.EMPTY_STRING, IPapyrusConverter.EMPTY_STRING, null, null, false);
+ }
+
+ @Test
+ public void testNull() {
+ testConverter(IPapyrusConverter.NULL_VALUE, IPapyrusConverter.EMPTY_STRING, IPapyrusConverter.EMPTY_STRING, null, null, false);
+ }
+
+
+ @Test
+ public void testEditToDisplaySingleString_1() {
+ String res = singleValueParser.editToDisplayValue(CLASS2_NAME_TO_EDIT);
+ Assert.assertEquals(CLASS2_NAME_TO_DISPLAY, res);
+ }
+
+ @Test
+ public void testDisplayToEditString_1() {
+ String res = singleValueParser.displayToEditValue(CLASS2_NAME_TO_DISPLAY);
+ Assert.assertEquals(CLASS2_NAME_TO_EDIT, res);
+ }
+
+
+
+}
--
cgit v1.2.3