Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.sdk.ui/src/org/eclipse/papyrus')
-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.java38
-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.java102
-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.java96
-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.java154
-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.java46
-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.properties206
-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.java124
-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.java124
-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.java190
-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.java218
-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.java164
-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.java34
-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.java54
13 files changed, 775 insertions, 775 deletions
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
index f15bad56de4..ed25f074e78 100644
--- 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
@@ -1,20 +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);
-
+/**
+ * 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
index 6d287c235ad..b342baa01ae 100644
--- 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
@@ -1,51 +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;
- }
-
-}
+/**
+ * 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
index 7b8da79edd3..e7d2e372566 100644
--- 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
@@ -1,48 +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() {
- }
-}
+/**
+ * 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
index ba11b0736ba..3e4cad36412 100644
--- 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
@@ -1,77 +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;
- }
-
-}
+/**
+ * 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
index ed8611d3a68..325834a87ab 100644
--- 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
@@ -1,23 +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);
- }
-
-}
+/**
+ * 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
index 8a5cb9243d9..1adeef4c297 100644
--- 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
@@ -1,104 +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
+########################################################################
+# 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
index b12809294f4..996b3ece175 100644
--- 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
@@ -1,62 +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();
- }
-
-}
+/**
+ * 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
index edc1b55ad2f..ff6dd3f90fe 100644
--- 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
@@ -1,62 +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();
- }
-
-}
+/**
+ * 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
index 7623077660d..ec0bedef9e9 100644
--- 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
@@ -1,95 +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.ocl.ParserException;
-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.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);
- }
-
-}
+/**
+ * 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.ocl.ParserException;
+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.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
index ce75c9d2627..a30fb85a310 100644
--- 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
@@ -1,109 +1,109 @@
-/**
- * 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);
- }
-}
+/**
+ * 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
index b3917d1e5a4..5a1dc960965 100644
--- 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
@@ -1,82 +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() {
-
- return SynchonizedOclQueryWidget.this.getSynchronizedObject()
- .getError();
- }
- });
- }
-
-}
+/**
+ * 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() {
+
+ 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
index 1b66d465469..877db768189 100644
--- 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
@@ -1,18 +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);
-
+/**
+ * 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
index 91889c55026..fae3af95658 100644
--- 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
@@ -1,28 +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);
-
+/**
+ * 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