diff options
author | Markus Keller | 2016-02-03 22:11:31 +0000 |
---|---|---|
committer | Markus Keller | 2016-02-03 22:11:31 +0000 |
commit | 85382492434b7b0d976c90f9780276ab29c99ec7 (patch) | |
tree | d9880a82c6ef2aaab4abead0b5cb6b6620164fe9 | |
parent | 46b949b5781153fe59bc9c4afe93cbd897933f1b (diff) | |
download | eclipse.jdt.ui-85382492434b7b0d976c90f9780276ab29c99ec7.tar.gz eclipse.jdt.ui-85382492434b7b0d976c90f9780276ab29c99ec7.tar.xz eclipse.jdt.ui-85382492434b7b0d976c90f9780276ab29c99ec7.zip |
Bug 487174: [navigation] Quick Outline colors nested binary type as inherited member
-rw-r--r-- | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java index 4a155955a9..29b525a83d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -53,6 +53,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.keys.KeySequence; import org.eclipse.ui.keys.SWTKeySupport; +import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; @@ -152,12 +153,19 @@ public class JavaOutlineInformationControl extends AbstractInformationControl { if (fOutlineContentProvider.isShowingInheritedMembers()) { if (element instanceof IJavaElement) { IJavaElement je= (IJavaElement)element; - if (fInput.getElementType() == IJavaElement.CLASS_FILE) - je= je.getAncestor(IJavaElement.CLASS_FILE); - else + if (fInput.getElementType() == IJavaElement.COMPILATION_UNIT) { je= je.getAncestor(IJavaElement.COMPILATION_UNIT); - if (fInput.equals(je)) { - return null; + if (fInput.equals(je)) { + return null; + } + } else { + do { + je= je.getAncestor(IJavaElement.CLASS_FILE); + if (fInput.equals(je) || je == null) { + return null; + } + je= ((IClassFile) je).getType().getDeclaringType(); + } while (je != null); } } return JFaceResources.getColorRegistry().get(ColoredViewersManager.INHERITED_COLOR_NAME); |