Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-11-04 10:07:51 +0000
committerAnsgar Radermacher2013-11-04 10:07:51 +0000
commita9c34177780cc04c143d552804955d90f5f27564 (patch)
treed45a65ab65882e6f9b6dc14372382b2a23ffe6f8
parent5585992f6f89aa9d09263ee13840100c9b965d37 (diff)
downloadorg.eclipse.papyrus-a9c34177780cc04c143d552804955d90f5f27564.tar.gz
org.eclipse.papyrus-a9c34177780cc04c143d552804955d90f5f27564.tar.xz
org.eclipse.papyrus-a9c34177780cc04c143d552804955d90f5f27564.zip
- Fix text selection for classes nested in namespaces. Bug 399864 - [CDT/StateMachine] Papyrus shall enable to see code on transitions
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java
index d98da785558..654c54d454d 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation
+ *
+ *******************************************************************************/
+
package org.eclipse.papyrus.texteditor.cdt.sync;
import org.eclipse.cdt.core.model.ICElement;
@@ -5,6 +17,7 @@ import org.eclipse.cdt.core.model.IFunctionDeclaration;
import org.eclipse.cdt.core.model.IParent;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.Operation;
public class ObtainICElement {
@@ -18,13 +31,13 @@ public class ObtainICElement {
try {
for(ICElement child : parent.getChildren()) {
if(child instanceof IParent) {
- getICElement((IParent)child, element);
+ return getICElement((IParent)child, element);
}
if(child instanceof IFunctionDeclaration) {
// IFunctionDeclaration function = (IFunctionDeclaration) child;
if (element instanceof Operation) {
- if (child.getElementName().endsWith("::" + element.getName())) {
+ if (child.getElementName().endsWith(Namespace.SEPARATOR + element.getName())) {
return child;
}
}

Back to the top