mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
New class hierarchy for the binary and Archive:
IBinary IBinaryModule IBinaryFunction IBinaryVariable IBinaryElement
This commit is contained in:
parent
65e2949db7
commit
5229f48934
2 changed files with 22 additions and 5 deletions
|
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
import org.eclipse.cdt.core.model.IArchiveContainer;
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
|
@ -157,7 +158,9 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
} else {
|
||||
return true;
|
||||
}
|
||||
} else if (element instanceof ICContainer) {
|
||||
}
|
||||
|
||||
if (element instanceof ICContainer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -173,13 +176,23 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
* Method declared on ITreeContentProvider.
|
||||
*/
|
||||
public Object getParent(Object element) {
|
||||
//if (!exists(element))
|
||||
// return null;
|
||||
if (!exists(element)) {
|
||||
return null;
|
||||
}
|
||||
return internalGetParent(element);
|
||||
}
|
||||
|
||||
public Object internalGetParent(Object element) {
|
||||
if (element instanceof ICElement) {
|
||||
return ((ICElement)element).getParent();
|
||||
}
|
||||
if (element instanceof IResource) {
|
||||
return ((IResource)element).getParent();
|
||||
IResource parent= ((IResource)element).getParent();
|
||||
ICElement cParent= CoreModel.getDefault().create(parent);
|
||||
if (cParent != null && cParent.exists()) {
|
||||
return cParent;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,12 @@ package org.eclipse.cdt.internal.ui;
|
|||
*/
|
||||
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.core.model.IBinaryModule;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IDeclaration;
|
||||
import org.eclipse.cdt.core.model.IMember;
|
||||
import org.eclipse.cdt.core.model.IMethodDeclaration;
|
||||
import org.eclipse.cdt.core.model.IDeclaration;
|
||||
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||
import org.eclipse.cdt.ui.CElementImageDescriptor;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
@ -158,6 +159,9 @@ public class CElementImageProvider {
|
|||
int type = celement.getElementType();
|
||||
switch (type) {
|
||||
case ICElement.C_VCONTAINER:
|
||||
if (celement instanceof IBinaryModule) {
|
||||
return CPluginImages.DESC_OBJS_BINARY;
|
||||
}
|
||||
return CPluginImages.DESC_OBJS_CONTAINER;
|
||||
|
||||
case ICElement.C_BINARY: {
|
||||
|
|
Loading…
Add table
Reference in a new issue