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
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.ICModel;
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.ISourceRoot;
import org.eclipse.cdt.core.model.IStructure;
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.ui.CUIPlugin;
import org.eclipse.cdt.ui.PreferenceConstants;
@ -216,18 +213,21 @@ public class TypesView extends CBrowsingPart {
return null;
}
if (element instanceof ICElement && !(element instanceof ITranslationUnit)) {
ICElement parent = (ICElement)element;
while (parent != null) {
if ((parent instanceof IStructure
|| parent instanceof IEnumeration
|| parent instanceof ITypeDef)) {
ITypeInfo info = AllTypesCache.getTypeForElement(parent, true, true, null);
return info;
}
parent = parent.getParent();
}
return null;
if (element instanceof ICElement) {
ICElement celem = (ICElement) element;
if (celem instanceof ITranslationUnit) {
return null;
} else if (celem.getElementType() == ICElement.C_NAMESPACE) {
return null;
} else {
while (celem != null) {
ICElement parent = TypeUtil.getDeclaringType(celem);
if (parent == null || parent instanceof INamespace) {
return AllTypesCache.getTypeForElement(celem, true, true, null);
}
celem = parent;
}
}
}
if (element instanceof ITypeInfo) {