Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java')
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java
index 56ed15c1956..5b7fbdadde1 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java
@@ -1,21 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.sysml.facets.portandflows.query.value.getter;
+import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection;
import org.eclipse.papyrus.sysml.portandflows.FlowPort;
import org.eclipse.papyrus.sysml.util.ElementUtil;
import org.eclipse.uml2.uml.Port;
/** Query to qet the attribute "Direction" of the FlowPort */
-public class GetFlowPortDirectionQuery implements IJavaModelQuery<Port, FlowDirection> {
+public class GetFlowPortDirectionQuery implements IJavaModelQuery<Port, Enumerator> {
- public FlowDirection evaluate(final Port context, final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
+ public Enumerator evaluate(final Port context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
FlowPort flowPort = ElementUtil.getStereotypeApplication(context, FlowPort.class);
if(flowPort != null) {
- return flowPort.getDirection();
+ if(flowPort.isIsAtomic()) {
+ return flowPort.getDirection();
+ } else {
+ return NAFlowPortDirection.get(0);
+ }
}
return null;
}

Back to the top