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:
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
|
2004-09-15 Chris Wiebe
|
||||||
|
|
||||||
fixed element navigation problems
|
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.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,18 +213,21 @@ 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
|
|
||||||
|| parent instanceof IEnumeration
|
|
||||||
|| parent instanceof ITypeDef)) {
|
|
||||||
ITypeInfo info = AllTypesCache.getTypeForElement(parent, true, true, null);
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
parent = parent.getParent();
|
|
||||||
}
|
|
||||||
return null;
|
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) {
|
if (element instanceof ITypeInfo) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue