Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-07 14:45:31 +0000
committerptessier2014-03-07 14:45:31 +0000
commit3bfbd192382bf6b109f828e2b3de3944d11628a9 (patch)
tree75a17f67e778037ea162169cc119a8a1f0dc5619 /plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui
parent5c79080b182bdbf3e0fe8969dd68b9a7092b16aa (diff)
downloadorg.eclipse.papyrus-3bfbd192382bf6b109f828e2b3de3944d11628a9.tar.gz
org.eclipse.papyrus-3bfbd192382bf6b109f828e2b3de3944d11628a9.tar.xz
org.eclipse.papyrus-3bfbd192382bf6b109f828e2b3de3944d11628a9.zip
Bug 386118 - [EMF Facet] Papyrus should progressively support EMF Facet
0.2 rename directories
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.checkstyle8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.pmd7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/META-INF/MANIFEST.MF23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/OSGI-INF/l10n/bundle.properties13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/build.properties20
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/plugin.xml23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/dialog/IOclDialogFactory.java20
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Activator.java51
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Messages.java48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/dialog/OclDialogFactory.java77
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/exception/OclQueryRuntimeException.java23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/messages.properties104
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryContextWidget.java62
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryReturnTypeWidget.java62
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/oclexpression/OclExpressionWidgetSimple.java95
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/OclQueryWidget.java107
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/SynchonizedOclQueryWidget.java82
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/IOclQueryWidget.java18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/oclexpression/IOCLExpressionWidget.java28
24 files changed, 959 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.checkstyle b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.checkstyle
new file mode 100644
index 00000000000..2664c7abd61
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.checkstyle
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="EmfFacet" location="/org.eclipse.papyrus.emf.facet.archi.tech.rules/checkstyle/EmfFacet.checkstyle" type="project" description=""/>
+ <fileset name="all" enabled="true" check-config-name="EmfFacet" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ <file-match-pattern match-pattern="Messages.java" include-pattern="false"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.pmd b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.pmd
new file mode 100644
index 00000000000..e8d3e27588f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.pmd
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd>
+ <useProjectRuleSet>true</useProjectRuleSet>
+ <ruleSetFile>../org.eclipse.papyrus.emf.facet.archi.tech.rules/pmd/ruleset.xml</ruleSetFile>
+ <includeDerivedFiles>false</includeDerivedFiles>
+ <violationsAsErrors>true</violationsAsErrors>
+</pmd>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.project b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.project
new file mode 100644
index 00000000000..580b1b197df
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.core.resources.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..4824b802631
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..060c5ee3d2e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..11eb46b56a4
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.emf.facet.util.ui;bundle-version="0.3.0",
+ org.eclipse.papyrus.emf.facet.efacet.sdk.ui;bundle-version="0.3.0",
+ org.eclipse.emf.ecore;bundle-version="2.6.0",
+ org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="0.3.0",
+ org.eclipse.papyrus.emf.facet.query.ocl.metamodel;bundle-version="0.3.0",
+ org.eclipse.emf.edit;bundle-version="2.6.0",
+ org.eclipse.papyrus.emf.facet.query.ocl.core;bundle-version="0.3.0",
+ org.eclipse.ocl.ecore;bundle-version="3.0.0",
+ org.eclipse.papyrus.emf.facet.efacet.core;bundle-version="0.3.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.dialog,
+ org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget,
+ org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget.oclexpression
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..7f61301e5ee
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2012 Mia-Software.
+#
+# 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:
+# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+###############################################################################
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = EMF Facet OCL Query SDK UI (Incubation) \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/about.html
new file mode 100644
index 00000000000..aacf0cfd3b9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>August 17, 2012</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) 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 <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/build.properties
new file mode 100644
index 00000000000..341fc62b2b9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2012 Mia-Software.
+#
+# 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:
+# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ plugin.xml,\
+ about.html
+javacDefaultEncoding.. = UTF-8
+src.includes = about.html
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/plugin.xml
new file mode 100644
index 00000000000..753e8a41f19
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/plugin.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2012 Mia-Software.
+
+ 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:
+ Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+-->
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.queryFactoryDialogRegistration">
+ <queryDialogFactory
+ dialogFactory="org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.dialog.OclDialogFactory"
+ managedQueryTypeName="OCL Query">
+ </queryDialogFactory>
+ </extension>
+
+</plugin>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/dialog/IOclDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/dialog/IOclDialogFactory.java
new file mode 100644
index 00000000000..cc1bac601c7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/dialog/IOclDialogFactory.java
@@ -0,0 +1,20 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.dialog;
+
+import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.dialog.query.IQueryDialogFactory;
+
+public interface IOclDialogFactory extends IQueryDialogFactory {
+
+ void setExpression(final String expression);
+
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Activator.java
new file mode 100644
index 00000000000..333502ad9b4
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Activator.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2012 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:
+ * Gregoire Dupe (Mia-Software) - Bug 372626 - Aggregates
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+// Copied from org.eclipse.papyrus.emf.facet.aggregate.metamodel.notgenerated
+@SuppressWarnings("PMD.UseSingleton")
+// @SuppressWarnings("PMD.UseSingleton") We cannot conforms to this rule because
+// this class is an Eclipse plug-in activator which will be instantiated by the
+// Eclipse framework.
+public class Activator extends Plugin {
+
+ private static Activator plugin;
+
+ @Override
+ @SuppressWarnings("PMD.SignatureDeclareThrowsException")
+ // @SuppressWarnings("PMD.SignatureDeclareThrowsException") We have to use
+ // this signature because this is an override of an Eclipse framework's
+ // method.
+ public void start(final BundleContext bundleContext) throws Exception {
+ super.start(bundleContext);
+ Activator.plugin = this;
+ }
+
+ @Override
+ @SuppressWarnings("PMD.SignatureDeclareThrowsException")
+ // @SuppressWarnings("PMD.SignatureDeclareThrowsException") We have to use
+ // this signature because this is an override of an Eclipse framework's
+ // method.
+ public void stop(final BundleContext bundleContext) throws Exception {
+ // NOPMD: PMD say "Assigning an Object to null is a code smell."
+ // No choice to right it in another way : this is an Eclipse pattern.
+ Activator.plugin = null; // NOPMD by gdupe on 30/03/12 10:19
+ super.stop(bundleContext);
+ }
+
+ public static Plugin getDefault() {
+ return Activator.plugin;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Messages.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Messages.java
new file mode 100644
index 00000000000..68cd5a4df3a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/Messages.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.messages"; //$NON-NLS-1$
+
+ public static String Query_Context;
+ public static String Return_type;
+ public static String Type_returned;
+
+ public static String OclDialogFactory_OclExpression;
+
+ public static String OclExpression_Error;
+ public static String OclQueryDialogFactory_Dialog_Desc;
+ public static String OclQueryDialogFactory_Dialog_Title;
+ public static String Expression;
+ public static String Expression_return_type_not_valid;
+ public static String Expression_not_valid;
+
+ // OCL expression
+ public static String Create_Ocl_expression;
+ public static String Create_the;
+ public static String OclExpression_Error_type;
+
+ // OCL
+ public static String console_badContextForQuery;
+ public static String console_badContextForConstraint;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/dialog/OclDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/dialog/OclDialogFactory.java
new file mode 100644
index 00000000000..3c84dbc8340
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/dialog/OclDialogFactory.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.dialog;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
+import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query.AbstractQueryDialogFactory;
+import org.eclipse.papyrus.emf.facet.query.ocl.metamodel.oclquery.OclQuery;
+import org.eclipse.papyrus.emf.facet.query.ocl.metamodel.oclquery.OclQueryFactory;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.Messages;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.query.OclQueryWidget;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.query.SynchonizedOclQueryWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Concrete implementation of {@link AbstractQueryDialogFactory} for the
+ * creation of OCLExpression.
+ *
+ * @see AbstractQueryDialogFactory
+ */
+public class OclDialogFactory implements IQueryDialogFactoryStrategy {
+
+ private final PropertyElement2<String> oclExpressionProp;
+
+ public OclDialogFactory() {
+ this.oclExpressionProp = new PropertyElement2<String>(false,
+ Messages.OclDialogFactory_OclExpression);
+ }
+
+ public IAbstractWidget createWidget(
+ final Composite parent, final IQueryContext queryContext) {
+ // An OCL query by definition can't have side effects.
+ return new SynchonizedOclQueryWidget(new OclQueryWidget(parent,
+ this.oclExpressionProp, queryContext), parent.getDisplay());
+ }
+
+ public String getDialogMessage() {
+ return Messages.OclQueryDialogFactory_Dialog_Desc;
+ }
+
+ public String getDialogTitle() {
+ return Messages.OclQueryDialogFactory_Dialog_Title;
+ }
+
+ public String getConclusionText() {
+ return this.oclExpressionProp.getValue2();
+ }
+
+ public OclQuery createQuery(final boolean canBeCached,
+ final boolean sideEffects, final IQueryContext queryContext) {
+ OclQuery query = null;
+ final String oclExpression = (String) this.oclExpressionProp.getValue();
+ final EClassifier context = queryContext.getExtendedEClass();
+ if ((oclExpression != null) && (context != null)) {
+ query = OclQueryFactory.eINSTANCE.createOclQuery();
+ query.setCanBeCached(true);
+ query.setCanHaveSideEffects(false);
+ query.setOclExpression(oclExpression);
+ query.setContext(context);
+ }
+ return query;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/exception/OclQueryRuntimeException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/exception/OclQueryRuntimeException.java
new file mode 100644
index 00000000000..39d6967b0e1
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/exception/OclQueryRuntimeException.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.exception;
+
+public class OclQueryRuntimeException extends RuntimeException {
+
+ private static final long serialVersionUID = -3675130124806299967L;
+
+ public OclQueryRuntimeException(final String message) {
+ super(message);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/messages.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/messages.properties
new file mode 100644
index 00000000000..8a5cb9243d9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/messages.properties
@@ -0,0 +1,104 @@
+########################################################################
+# Copyright (c) 2012 Mia-Software.
+#
+# 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:
+# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+# Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+########################################################################
+OclDialogFactory_OclExpression=OCL expression
+OclQueryDialogFactory_Dialog_Desc=Create a new OCL query
+OclQueryDialogFactory_Dialog_Title=New OCL query
+OclExpression_Error=You must create a valid OCL expression
+Expression=Expression :
+Edition_Group=Edition
+Previous=Previous
+Next=Next
+Expression_return_type_not_valid=The type returned by the expression is not valid
+Expression_not_valid=The OCL expression is not valid
+Return_type=Expected type :
+Type_returned=Type returned :
+Select_choice=You must select an element
+Select_option= = Select an option =
+
+Create_next_step=Add an new element at the expression
+
+New_wizard=New Element
+
+Can_finish=OR you can rather finish the expression
+
+#### Wizard Pages
+Choice_step_name=Select an option
+Choice_step_message=Select an option for the current expression.
+String_step_name=String comparison
+String_step_message=Compare the string to an other one.
+Operation_step_name=Create the operation expression
+Operation_step_message=Create the operation expression for the selected operation
+
+#### OCL Expression
+Create_Ocl_expression=Create an OCL Expression
+Create_the=Create the parameter
+OclExpression_Error_type=The type returned by the expression is not correct, expected :
+
+#### Booleans
+Add_a_boolean_expression=Add a boolean expression
+
+Or_tree_item=OR
+Or_menu_item=Or
+
+And_tree_item=AND
+And_menu_item=And
+
+Not_tree_item=NOT
+Not_menu_item=Not
+
+#### Comparator
+Add_a_comparator=Add a comparator
+
+Equal==
+Different=<>
+Gretter=>
+Gretter_equal=>=
+Lower=<
+Lower_equal=<=
+
+#### Constant
+Add_constant=Add a constant
+Create_new_constant=Create a new constant
+
+String=String
+Integer=Integer
+Real=Real
+Real_error=You must enter a real number (like 42.1337)
+Real_can_be_null=The real can't be null
+Boolean=Boolean
+
+#### Dynamic Menu Attributes
+Attributes_of=Attributes of
+
+#### OCL
+
+console_badContextForQuery = Must select a model element on which to evaluate the query.
+console_badContextForConstraint = Must select a classifier, operation, or attribute on which to parse the constraint.
+
+
+#### Let
+Create_Let_expression=Create a let Expression
+Variable_Name=Name :
+Variable_Type=Type :
+Variable_Select_Type: Select a type
+Variable_Expression=Expression :
+
+Variable_Name_Error=You must set a name for the variable
+Variable_Type_Error=You must set a type for the variable
+
+#### Variables
+Variable=Variables
+
+Query_Context=Context :
+Delete_Item=Delete item
+Parameters_for : Parameters for \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryContextWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryContextWidget.java
new file mode 100644
index 00000000000..89606dfb085
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryContextWidget.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.Messages;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractPrintElementWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Widget for the display of the expected type. Display a simple text field, not
+ * editable with the type expected in it.
+ */
+public class PrintQueryContextWidget extends
+ AbstractPrintElementWidget<EClassifier> {
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this widget.
+ * @param propertyElement
+ * the {@link PropertyElement} that this widget will edit.
+ */
+ public PrintQueryContextWidget(final Composite parent,
+ final PropertyElement2<EClassifier> propertyElement) {
+ super(parent, propertyElement);
+ }
+
+ @Override
+ protected String getLabel() {
+ return Messages.Query_Context;
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing.
+ }
+
+ @Override
+ protected String getErrorMessage() {
+ return null;
+ }
+
+ @Override
+ protected String getTextFieldInitialText() {
+ return this.getPropertyElement().getValue2().getName();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryReturnTypeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryReturnTypeWidget.java
new file mode 100644
index 00000000000..b78b0aadfaf
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/PrintQueryReturnTypeWidget.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.Messages;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractPrintElementWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Widget for the display of the expected type. Display a simple text field, not
+ * editable with the type expected in it.
+ */
+public class PrintQueryReturnTypeWidget extends
+ AbstractPrintElementWidget<EClassifier> {
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this widget.
+ * @param propertyElement
+ * the {@link PropertyElement} that this widget will edit.
+ */
+ public PrintQueryReturnTypeWidget(final Composite parent,
+ final PropertyElement2<EClassifier> propertyElement) {
+ super(parent, propertyElement);
+ }
+
+ @Override
+ protected String getLabel() {
+ return Messages.Return_type;
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing.
+ }
+
+ @Override
+ protected String getErrorMessage() {
+ return null;
+ }
+
+ @Override
+ protected String getTextFieldInitialText() {
+ return this.getPropertyElement().getValue2().getName();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/oclexpression/OclExpressionWidgetSimple.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/oclexpression/OclExpressionWidgetSimple.java
new file mode 100644
index 00000000000..7afe5e0d520
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/oclexpression/OclExpressionWidgetSimple.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.oclexpression;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.papyrus.emf.facet.query.ocl.core.util.OclQueryUtil;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.Messages;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget.oclexpression.IOCLExpressionWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.ocl.ParserException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Simple widget for the edition of a complexe OCl expression.
+ */
+public class OclExpressionWidgetSimple extends AbstractWidget implements
+ IOCLExpressionWidget {
+
+ private static final String UNREC_VAR = "Unrecognized variable"; //$NON-NLS-1$
+ private static final int TEXT_HEIGHT = 100;
+ private final EClassifier context;
+ private final String expression;
+ private Text text;
+ private final PropertyElement oclExpressionProp;
+
+ public OclExpressionWidgetSimple(final Composite parent,
+ final EClassifier context, final String expression,
+ final PropertyElement oclExpressionProp) {
+ super(parent);
+ this.context = context;
+ this.expression = expression;
+ this.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ this.oclExpressionProp = oclExpressionProp;
+ }
+
+ @Override
+ protected void addSubWidgets() {
+ this.text = new Text(this, SWT.MULTI | SWT.V_SCROLL);
+ final GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.heightHint = TEXT_HEIGHT;
+ this.text.setLayoutData(gridData);
+
+ if (this.expression != null) {
+ this.text.setText(this.expression);
+ }
+ }
+
+ @Override
+ public String getError() {
+ String result = null;
+
+ final String textExpression = this.text.getText().trim();
+ if ("".equals(textExpression)) { //$NON-NLS-1$
+ result = Messages.OclExpression_Error;
+ } else {
+ try {
+ OclQueryUtil.createOCLExpression(this.context, textExpression);
+ this.oclExpressionProp.setValue(textExpression);
+ } catch (final ParserException exception) {
+ if (exception.getMessage().contains(UNREC_VAR)) {
+ this.oclExpressionProp.setValue(textExpression);
+ } else {
+ result = Messages.OclExpression_Error
+ + " :\n - " + exception.getMessage(); //$NON-NLS-1$
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing to do.
+ }
+
+ public void setExpression(final String expression) {
+ this.text.setText(expression);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/OclQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/OclQueryWidget.java
new file mode 100644
index 00000000000..de95018922c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/OclQueryWidget.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.query;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.papyrus.emf.facet.query.ocl.metamodel.oclquery.OclQuery;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.PrintQueryContextWidget;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.PrintQueryReturnTypeWidget;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.oclexpression.OclExpressionWidgetSimple;
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget.IOclQueryWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.query.AbstractQueryWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * It is the main widget of the main dialog. This widget add the expected return
+ * type and display the tree.
+ */
+public class OclQueryWidget extends AbstractQueryWidget<ETypedElement> implements IOclQueryWidget {
+
+ private final PropertyElement oclExpressionProp;
+ private OclExpressionWidgetSimple oclExprWidget;
+ private final IQueryContext queryContext;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this widget.
+ * @param properties
+ * the properties for this widget.
+ * @param context
+ * the context of the OCL expression.
+ * @param returnType
+ * the type that the OCL expression must return.
+ * @param initialQuery
+ * the initial {@link OclQuery} if there is one (can be null).
+ * @param facet
+ */
+ public OclQueryWidget(final Composite parent,
+ final PropertyElement oclExpressionProp,
+ final IQueryContext queryContext) {
+ super(parent);
+ this.queryContext = queryContext;
+ this.oclExpressionProp = oclExpressionProp;
+ }
+
+ @Override
+ protected void addSubWidgets() {
+ final EClassifier extendedEClass = this.queryContext
+ .getExtendedEClass();
+ addSubWidget(new PrintQueryContextWidget(this,
+ new PropertyElement2<EClassifier>(false, extendedEClass)));
+ final EClassifier returnType = this.queryContext.getReturnType();
+ addSubWidget(new PrintQueryReturnTypeWidget(this,
+ new PropertyElement2<EClassifier>(false, returnType)));
+ String expression;
+ final Query initialQuery = this.queryContext.getQuery();
+ if (initialQuery instanceof OclQuery) {
+ final OclQuery oclQuery = (OclQuery) initialQuery;
+ expression = oclQuery.getOclExpression();
+ } else {
+ expression = (String) this.oclExpressionProp.getValue();
+ }
+ this.oclExprWidget = new OclExpressionWidgetSimple(this,
+ extendedEClass, expression, this.oclExpressionProp);
+ addSubWidget(this.oclExprWidget);
+ }
+
+ @Override
+ public Command getCommand() {
+ // This widget doesn't create any command.
+ return null;
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing to do.
+ }
+
+ @Override
+ public void onDialogValidation() {
+ // Nothing
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.query.IOclQueryWidget#setExpression(java.lang.String)
+ */
+ public void setExpression(final String expression) {
+ this.oclExprWidget.setExpression(expression);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/SynchonizedOclQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/SynchonizedOclQueryWidget.java
new file mode 100644
index 00000000000..0e5a6fdeeb9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/internal/widget/query/SynchonizedOclQueryWidget.java
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.internal.widget.query;
+
+import org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget.IOclQueryWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
+import org.eclipse.swt.widgets.Display;
+
+public class SynchonizedOclQueryWidget extends
+ SynchronizedObject<OclQueryWidget> implements IOclQueryWidget,
+ IAbstractWidget {
+
+ public SynchonizedOclQueryWidget(final OclQueryWidget widget,
+ final Display display) {
+ super(widget, display);
+ }
+
+ public void setExpression(final String expression) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchonizedOclQueryWidget.this.getSynchronizedObject()
+ .setExpression(expression);
+ }
+ });
+ }
+
+ public void addListener(final AbstractWidget abstractWidget) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchonizedOclQueryWidget.this.getSynchronizedObject()
+ .addListener(abstractWidget);
+ }
+ });
+ }
+
+ public void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchonizedOclQueryWidget.this.getSynchronizedObject()
+ .notifyChanged();
+ }
+ });
+ }
+
+ public void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchonizedOclQueryWidget.this.getSynchronizedObject()
+ .createWidgetContent();
+ }
+ });
+ }
+
+ public String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
+ @Override
+ public String safeRun() {
+ // TODO Auto-generated method stub
+ return SynchonizedOclQueryWidget.this.getSynchronizedObject()
+ .getError();
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/IOclQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/IOclQueryWidget.java
new file mode 100644
index 00000000000..ff2d5696139
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/IOclQueryWidget.java
@@ -0,0 +1,18 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget;
+
+public interface IOclQueryWidget {
+
+ void setExpression(final String expression);
+
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/oclexpression/IOCLExpressionWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/oclexpression/IOCLExpressionWidget.java
new file mode 100644
index 00000000000..d9ee22f4934
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus/emf/facet/query/ocl/sdk/ui/widget/oclexpression/IOCLExpressionWidget.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui.widget.oclexpression;
+
+import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
+
+/**
+ * @see OCLExpressionWidget
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IOCLExpressionWidget extends IAbstractWidget {
+
+ /**
+ * @param expression
+ */
+ void setExpression(String expression);
+
+} \ No newline at end of file

Back to the top