Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/eobjectbooleanexpressions/custom/CustomNotExpression.java')
-rwxr-xr-xplugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/eobjectbooleanexpressions/custom/CustomNotExpression.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/eobjectbooleanexpressions/custom/CustomNotExpression.java b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/eobjectbooleanexpressions/custom/CustomNotExpression.java
new file mode 100755
index 00000000000..17c43132d72
--- /dev/null
+++ b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/eobjectbooleanexpressions/custom/CustomNotExpression.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2017 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.infra.emf.expressions.eobjectbooleanexpressions.custom;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.emf.expressions.booleanexpressionspackage.impl.NotExpressionImpl;
+
+
+public class CustomNotExpression extends NotExpressionImpl{
+
+ @Override
+ public Boolean evaluate(EObject context) {
+ //1. we evaluate the own expression first
+ if(null!=ownedExpression) {
+ return !ownedExpression.evaluate(context);
+ }
+
+ //2. we evaluate the referenced expression
+ if(null!=referencedExpression) {
+ return !referencedExpression.evaluate(context);
+ }
+
+ //3. we return the default value
+ return Boolean.FALSE;
+ }
+} \ No newline at end of file

Back to the top