1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

2004-09-15 Chris Wiebe

fixed selection
	* browser/org/eclipse/cdt/internal/ui/browser/cbrowsing/TypesView.java
This commit is contained in:
Chris Wiebe 2004-09-16 01:31:32 +00:00
parent d081086a26
commit 4cbd23a3df
2 changed files with 21 additions and 16 deletions

View file

@ -1,3 +1,8 @@
2004-09-15 Chris Wiebe
fixed selection
* browser/org/eclipse/cdt/internal/ui/browser/cbrowsing/TypesView.java
2004-09-15 Chris Wiebe 2004-09-15 Chris Wiebe
fixed element navigation problems fixed element navigation problems

View file

@ -16,12 +16,9 @@ import org.eclipse.cdt.core.browser.TypeUtil;
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICModel; import org.eclipse.cdt.core.model.ICModel;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.IEnumeration;
import org.eclipse.cdt.core.model.INamespace; import org.eclipse.cdt.core.model.INamespace;
import org.eclipse.cdt.core.model.ISourceRoot; import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.model.ITypeDef;
import org.eclipse.cdt.internal.ui.ICHelpContextIds; import org.eclipse.cdt.internal.ui.ICHelpContextIds;
import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.PreferenceConstants; import org.eclipse.cdt.ui.PreferenceConstants;
@ -216,20 +213,23 @@ public class TypesView extends CBrowsingPart {
return null; return null;
} }
if (element instanceof ICElement && !(element instanceof ITranslationUnit)) { if (element instanceof ICElement) {
ICElement parent = (ICElement)element; ICElement celem = (ICElement) element;
while (parent != null) { if (celem instanceof ITranslationUnit) {
if ((parent instanceof IStructure return null;
|| parent instanceof IEnumeration } else if (celem.getElementType() == ICElement.C_NAMESPACE) {
|| parent instanceof ITypeDef)) { return null;
ITypeInfo info = AllTypesCache.getTypeForElement(parent, true, true, null); } else {
return info; while (celem != null) {
} ICElement parent = TypeUtil.getDeclaringType(celem);
parent = parent.getParent(); if (parent == null || parent instanceof INamespace) {
} return AllTypesCache.getTypeForElement(celem, true, true, null);
return null; }
celem = parent;
}
}
} }
if (element instanceof ITypeInfo) { if (element instanceof ITypeInfo) {
ITypeInfo info = (ITypeInfo) element; ITypeInfo info = (ITypeInfo) element;
if (info.getCElementType() != ICElement.C_NAMESPACE) { if (info.getCElementType() != ICElement.C_NAMESPACE) {