[574038] Change to Pivot, CG defaults
diff --git a/plugins/org.eclipse.ocl.common.ui/src/org/eclipse/ocl/common/ui/internal/preferences/CommonProjectPreferencePage.java b/plugins/org.eclipse.ocl.common.ui/src/org/eclipse/ocl/common/ui/internal/preferences/CommonProjectPreferencePage.java
index 3b9f3ac..4fdfb46 100644
--- a/plugins/org.eclipse.ocl.common.ui/src/org/eclipse/ocl/common/ui/internal/preferences/CommonProjectPreferencePage.java
+++ b/plugins/org.eclipse.ocl.common.ui/src/org/eclipse/ocl/common/ui/internal/preferences/CommonProjectPreferencePage.java
@@ -108,8 +108,8 @@
"The (legacy) Classic functionality uses an LPG-based parser and an extended Ecore metamodel.\n" +
"This preference takes effect when the 'virtual' " + OCLConstants.OCL_DELEGATE_URI + " is used.\n" +
OCLConstants.OCL_DELEGATE_URI_LPG + " delegates to the Classic LPG-based engine.\n" +
- OCLConstants.OCL_DELEGATE_URI_SLASH + "Pivot delegates to the Unified Xtext-based engine.\n" +
- OCLConstants.OCL_DELEGATE_URI_SLASH + "Debug delegates to the Unified Xtext-based debugger."));
+ OCLConstants.OCL_DELEGATE_URI_PIVOT + " delegates to the Unified Xtext-based engine.\n" +
+ OCLConstants.OCL_DELEGATE_URI_DEBUG + " delegates to the Unified Xtext-based debugger."));
fields.add(new MyComboFieldEditor(CommonOptions.CODE_GENERATION_MODE,
CommonUIMessages.CodeGenerationMode, CODE_GENERATION_MODES, fieldEditorParent,
"When EMF's generate model facility is used to generate Java code for an Ecore model, OCL embedded\n" +
diff --git a/plugins/org.eclipse.ocl.common/.settings/.api_filters b/plugins/org.eclipse.ocl.common/.settings/.api_filters
new file mode 100644
index 0000000..7c4a7a0
--- /dev/null
+++ b/plugins/org.eclipse.ocl.common/.settings/.api_filters
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.ocl.common" version="2">
+ <resource path="src/org/eclipse/ocl/common/OCLConstants.java" type="org.eclipse.ocl.common.OCLConstants">
+ <filter id="403767336">
+ <message_arguments>
+ <message_argument value="org.eclipse.ocl.common.OCLConstants"/>
+ <message_argument value="OCL_DELEGATE_URI_DEBUG"/>
+ </message_arguments>
+ </filter>
+ <filter id="403767336">
+ <message_arguments>
+ <message_argument value="org.eclipse.ocl.common.OCLConstants"/>
+ <message_argument value="OCL_DELEGATE_URI_PIVOT"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/org.eclipse.ocl.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.ocl.common/META-INF/MANIFEST.MF
index 4bbfc44..80283cf 100644
--- a/plugins/org.eclipse.ocl.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.ocl.common/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ocl.common;singleton:=true
Bundle-Localization: plugin
-Bundle-Version: 1.8.800.qualifier
+Bundle-Version: 1.16.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.ocl.common,
org.eclipse.ocl.common.delegate,
diff --git a/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLCommon.java b/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLCommon.java
index 34b1600..9a1784e 100644
--- a/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLCommon.java
+++ b/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLCommon.java
@@ -33,7 +33,7 @@
* A DefaultDefaultDelegationMode.run() scans the validationDelegates extension points for
* to determine whether Pivot functionality is available and so returns the relevant delegate
* URI for use as the default.degate.mode..
- *
+ *
* This code is factored into a separate static class to ensure that classes that are not
* available standalone are not loaded before EMFPlugin.IS_ECLIPSE_RUNNING is checked.
*
@@ -60,7 +60,7 @@
/**
* A PreferenceListenerInstaller installs itself as a IPreferenceChangeListener on an option
* so that PreferenceableOption2.fireChanged is invoked for any change.
- *
+ *
* This code is factored into a separate static class to ensure that classes that are not
* available standalone are not loaded before EMFPlugin.IS_ECLIPSE_RUNNING is checked.
*/
@@ -85,7 +85,7 @@
}
public static final String PLUGIN_ID = "org.eclipse.ocl.common"; //$NON-NLS-1$
-
+
/**
* Return the default value of the "default.delegation.mode" preference, returning the LPG value for now.
* .
@@ -112,7 +112,7 @@
return (String) pivotClass.getField("OCL_DELEGATE_URI_PIVOT").get(null); //$NON-NLS-1$
} catch (Exception e) { /* Can't find it - no need to report as error * / }
} */
- return OCLConstants.OCL_DELEGATE_URI_LPG;
+ return OCLConstants.OCL_DELEGATE_URI_PIVOT;
}
/**
@@ -146,16 +146,16 @@
EAnnotation eAnnotation = getDelegateAnnotation(eModelElement);
return eAnnotation == null ? null : (String)eAnnotation.getDetails().get(key);
}
-
+
/**
- * Return the preference value for
+ * Return the preference value for
* @param option
* @param contexts
*/
public static <T> T getPreference(PreferenceableOption<T> option, IScopeContext[] contexts) {
if (EMFPlugin.IS_ECLIPSE_RUNNING) {
IPreferencesService preferencesService = Platform.getPreferencesService();
- if (preferencesService != null) {
+ if (preferencesService != null) {
String qualifier = option.getPluginId();
String key = option.getKey();
T defaultValue = option.getDefaultValue();
@@ -165,7 +165,7 @@
}
return option.getDefaultValue(); // Standalone or Eclipse not running
}
-
+
/**
* Install an IPreferenceChangeListener so that option.fireChanged() is notified of any change in the Eclipse preference.
* @since 1.1
diff --git a/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLConstants.java b/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLConstants.java
index 7720508..89a590f 100644
--- a/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLConstants.java
+++ b/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/OCLConstants.java
@@ -53,12 +53,21 @@
* keys.
* <p>
* Note also that validation must be enabled by specifying an EClassifier Ecore annotation with a space separated list
- * of invariant <tt><i>constraintName</i></tt>s as the value of the <tt>constraints</tt> details key.
+ * of invariant <tt><i>constraintName</i></tt>s as the value of the <tt>constraints</tt> details key.
* <p>
* See <tt>/org.eclipse.ocl.ecore.tests/model/Company.ecore</tt> or <tt>http://wiki.eclipse.org/MDT/OCLinEcore</tt> for an example.
*/
public static final String OCL_DELEGATE_URI = org.eclipse.emf.ecore.EcorePackage.eNS_URI + "/OCL"; //$NON-NLS-1$
public static final String OCL_DELEGATE_URI_SLASH = OCL_DELEGATE_URI + "/"; //$NON-NLS-1$
+ /**
+ * @since 1.16
+ */
+ public static final String OCL_DELEGATE_URI_DEBUG = OCL_DELEGATE_URI_SLASH + "Debug"; //$NON-NLS-1$
public static final String OCL_DELEGATE_URI_LPG = OCL_DELEGATE_URI_SLASH + "LPG"; //$NON-NLS-1$
+
+ /**
+ * @since 1.16
+ */
+ public static final String OCL_DELEGATE_URI_PIVOT = OCL_DELEGATE_URI_SLASH + "Pivot"; //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/internal/options/CommonOptions.java b/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/internal/options/CommonOptions.java
index b71aa52..a75fc23 100644
--- a/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/internal/options/CommonOptions.java
+++ b/plugins/org.eclipse.ocl.common/src/org/eclipse/ocl/common/internal/options/CommonOptions.java
@@ -17,9 +17,15 @@
public class CommonOptions {
+ /**
+ * CODE_GENERATION_MODE select whether GenModel geneates direct Java code or delegates to the OCL interpreter at run-time.
+ */
public static final EnumerationPreference<CodeGenerationMode> CODE_GENERATION_MODE = new EnumerationPreference<CodeGenerationMode>(
- OCLConstants.PLUGIN_ID, "code.generation.mode", CodeGenerationMode.DELEGATED, CodeGenerationMode.class); //$NON-NLS-1$
+ OCLConstants.PLUGIN_ID, "code.generation.mode", CodeGenerationMode.GENERATED, CodeGenerationMode.class); //$NON-NLS-1$
+ /**
+ * DEFAULT_DELEGATION_MODE selects which OCL execution engine is used when the edit-time save has used the virtual delegate.
+ */
public static final VirtualDelegateMapping DEFAULT_DELEGATION_MODE = new VirtualDelegateMapping(
OCLConstants.PLUGIN_ID, "default.delegation.mode", OCLCommon.getDefaultDefaultDelegationMode()); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/utilities/PivotConstants.java b/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/utilities/PivotConstants.java
index 4eae1d7..7734f3b 100644
--- a/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/utilities/PivotConstants.java
+++ b/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/utilities/PivotConstants.java
@@ -184,7 +184,7 @@
/**
* The delegate URI for Ecore annotations using the Pivot evaluator.
*/
- static final @NonNull String OCL_DELEGATE_URI_PIVOT = OCLConstants.OCL_DELEGATE_URI_SLASH + "Pivot"; //$NON-NLS-1$
+ static final @NonNull String OCL_DELEGATE_URI_PIVOT = OCLConstants.OCL_DELEGATE_URI_PIVOT;
- static final @NonNull String OCL_DELEGATE_URI_DEBUG = OCLConstants.OCL_DELEGATE_URI_SLASH + "Debug"; //$NON-NLS-1$
+ static final @NonNull String OCL_DELEGATE_URI_DEBUG = OCLConstants.OCL_DELEGATE_URI_DEBUG;
}
diff --git a/plugins/org.eclipse.ocl.xtext.oclinecore.ui/src/org/eclipse/ocl/xtext/oclinecore/ui/preferences/OCLinEcoreProjectPreferencePage.java b/plugins/org.eclipse.ocl.xtext.oclinecore.ui/src/org/eclipse/ocl/xtext/oclinecore/ui/preferences/OCLinEcoreProjectPreferencePage.java
index 04a783a..2764f20 100644
--- a/plugins/org.eclipse.ocl.xtext.oclinecore.ui/src/org/eclipse/ocl/xtext/oclinecore/ui/preferences/OCLinEcoreProjectPreferencePage.java
+++ b/plugins/org.eclipse.ocl.xtext.oclinecore.ui/src/org/eclipse/ocl/xtext/oclinecore/ui/preferences/OCLinEcoreProjectPreferencePage.java
@@ -55,8 +55,8 @@
"OCL embedded within an Ecore model can be executed using the Unified or Classic OCL functionality.\n" +
"This preference determines what form of execution is specified when the OCLinEcore saves to an Ecore file.\n" +
OCLConstants.OCL_DELEGATE_URI_LPG + " specifies use of the Classic LPG-based engine.\n" +
- OCLConstants.OCL_DELEGATE_URI_SLASH + "Pivot specifies use of the Unified Xtext-based engine.\n" +
- OCLConstants.OCL_DELEGATE_URI_SLASH + "Debug specifies use of the Unified Xtext-based debugger.\n" +
+ OCLConstants.OCL_DELEGATE_URI_PIVOT + " specifies use of the Unified Xtext-based engine.\n" +
+ OCLConstants.OCL_DELEGATE_URI_DEBUG + " specifies use of the Unified Xtext-based debugger.\n" +
"The virtual " + OCLConstants.OCL_DELEGATE_URI + " defers the decision until execution at which point\n" +
"the \"" + CommonUIMessages.DefaultDelegationMode + "\" preferennce selects the engine."));
}
diff --git a/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/DelegatesTest.java b/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/DelegatesTest.java
index 871e66c..a005369 100644
--- a/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/DelegatesTest.java
+++ b/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/DelegatesTest.java
@@ -890,11 +890,11 @@
});
}
- public void test_defaultIsLPG() throws Throwable {
+ public void test_defaultIsPivot() throws Throwable {
doTestRunnable(new TestRunnable() {
@Override
public void runWithThrowable() {
- assertEquals(OCLConstants.OCL_DELEGATE_URI_LPG, CommonOptions.DEFAULT_DELEGATION_MODE.getPreferredValue());
+ assertEquals(OCLConstants.OCL_DELEGATE_URI_PIVOT, CommonOptions.DEFAULT_DELEGATION_MODE.getPreferredValue());
}
});
}