mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
2004-09-15 Chris Wiebe
fixed selection * browser/org/eclipse/cdt/internal/ui/browser/cbrowsing/TypesView.java
This commit is contained in:
parent
d081086a26
commit
4cbd23a3df
2 changed files with 21 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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,20 +213,23 @@ 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) {
|
||||
ITypeInfo info = (ITypeInfo) element;
|
||||
if (info.getCElementType() != ICElement.C_NAMESPACE) {
|
||||
|
|
Loading…
Add table
Reference in a new issue