Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Suzzi2015-09-21 18:42:50 +0000
committerPatrik Suzzi2015-09-21 18:42:50 +0000
commit020ff70cbb3243558e52b9e99da266b07398fbd8 (patch)
treed37ae060f1ee36d9ca50bbea1051ebd37455b57e
parentcbb50493f451304dd9eafc84e65a0d26513a77dd (diff)
downloadeclipse.platform.ui.tools-020ff70cbb3243558e52b9e99da266b07398fbd8.tar.gz
eclipse.platform.ui.tools-020ff70cbb3243558e52b9e99da266b07398fbd8.tar.xz
eclipse.platform.ui.tools-020ff70cbb3243558e52b9e99da266b07398fbd8.zip
Bug 474841 - Fragment editor suggests incorrect name for inner classI20150922-0800
Find contribution class now suggests correct class when using inner classes. Fixed whitespaces. Change-Id: Idb9d84c5e15e164e1fe999abad81c3907bbf3e8d Signed-off-by: Patrik Suzzi <psuzzi@gmail.com>
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java
index 9c42f01d..b944454b 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java
@@ -106,9 +106,12 @@ public class PDEClassContributionProvider implements IClassContributionProvider
final TypeNameRequestor req = new TypeNameRequestor() {
@Override
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName,
- char[][] enclosingTypeNames, String path) {
+ char[][] enclosingTypeNames, String path) {
+ // 474841 compute name considering inner classes
+ final boolean isEnclosed = enclosingTypeNames != null && enclosingTypeNames.length > 0;
+ final String ePrefix = isEnclosed ? new String(enclosingTypeNames[0]) + "$" : ""; //$NON-NLS-1$//$NON-NLS-2$
// Accept search results from the JDT SearchEngine
- final String cName = new String(simpleTypeName);
+ final String cName = ePrefix + new String(simpleTypeName);
final String pName = new String(packageName);
// String label = cName + " - " + pName; //$NON-NLS-1$
final String content = pName.length() == 0 ? cName : pName + "." + cName; //$NON-NLS-1$

Back to the top