mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Add ILibraryReference awareness
This commit is contained in:
parent
44f52feeff
commit
19805635c6
4 changed files with 21 additions and 7 deletions
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.model.ICContainer;
|
|||
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.ILibraryReference;
|
||||
import org.eclipse.cdt.core.model.IParent;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
|
@ -211,6 +212,11 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
if (bins.hasChildren()) {
|
||||
objects = concatenate(objects, new Object[] {bins});
|
||||
}
|
||||
try {
|
||||
ILibraryReference[] refs = cproject.getLibraryReferences();
|
||||
objects = concatenate(objects, refs);
|
||||
} catch (CModelException e) {
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ 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.ILibraryReference;
|
||||
import org.eclipse.cdt.core.model.IMember;
|
||||
import org.eclipse.cdt.core.model.IMethodDeclaration;
|
||||
import org.eclipse.cdt.core.model.IField;
|
||||
|
@ -162,6 +163,8 @@ public class CElementImageProvider {
|
|||
case ICElement.C_VCONTAINER:
|
||||
if (celement instanceof IBinaryModule) {
|
||||
return CPluginImages.DESC_OBJS_BINARY;
|
||||
} else if (celement instanceof ILibraryReference) {
|
||||
return CPluginImages.DESC_OBJS_LIBRARY;
|
||||
}
|
||||
return CPluginImages.DESC_OBJS_CONTAINER;
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ public class CPluginImages {
|
|||
public static final String IMG_OBJS_CEXEC_DEBUG= NAME_PREFIX + "exec_dbg_obj.gif";
|
||||
public static final String IMG_OBJS_CORE= NAME_PREFIX + "core_obj.gif";
|
||||
public static final String IMG_OBJS_CONTAINER= NAME_PREFIX + "container_obj.gif";
|
||||
public static final String IMG_OBJS_LIBRARY= NAME_PREFIX + "lib_obj.gif";
|
||||
|
||||
// Breakpoint images
|
||||
public static final String IMG_OBJS_BREAKPOINT = NAME_PREFIX + "breakpoint.gif";
|
||||
|
@ -99,6 +100,7 @@ public class CPluginImages {
|
|||
public static final ImageDescriptor DESC_OBJS_CEXEC_DEBUG= createManaged(T_OBJ, IMG_OBJS_CEXEC_DEBUG);
|
||||
public static final ImageDescriptor DESC_OBJS_CORE= createManaged(T_OBJ, IMG_OBJS_CORE);
|
||||
public static final ImageDescriptor DESC_OBJS_CONTAINER= createManaged(T_OBJ, IMG_OBJS_CONTAINER);
|
||||
public static final ImageDescriptor DESC_OBJS_LIBRARY= createManaged(T_OBJ, IMG_OBJS_LIBRARY);
|
||||
|
||||
// Breakpoint image descriptors
|
||||
public static final ImageDescriptor DESC_OBJS_BREAKPOINT = createManaged( T_OBJ, IMG_OBJS_BREAKPOINT );
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.model.ICProject;
|
|||
import org.eclipse.cdt.core.model.IFunction;
|
||||
import org.eclipse.cdt.core.model.IFunctionDeclaration;
|
||||
import org.eclipse.cdt.core.model.IInclude;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.core.model.IMacro;
|
||||
import org.eclipse.cdt.core.model.IMethod;
|
||||
import org.eclipse.cdt.core.model.IMethodDeclaration;
|
||||
|
@ -109,19 +110,21 @@ public class CViewSorter extends ViewerSorter {
|
|||
return 134;
|
||||
}
|
||||
return 140;
|
||||
} else if (element instanceof IArchive) {
|
||||
return 150;
|
||||
} else if (element instanceof IBinary) {
|
||||
return 160;
|
||||
} else if (element instanceof ILibraryReference) {
|
||||
return 170;
|
||||
} else if (element instanceof ICElement) {
|
||||
String name = ((ICElement)element).getElementName();
|
||||
if (name.startsWith("__")) {
|
||||
return 142;
|
||||
return 172;
|
||||
}
|
||||
if (name.charAt(0) == '_') {
|
||||
return 144;
|
||||
return 174;
|
||||
}
|
||||
return 150;
|
||||
} else if (element instanceof IArchive) {
|
||||
return 160;
|
||||
} else if (element instanceof IBinary) {
|
||||
return 170;
|
||||
return 180;
|
||||
}
|
||||
return 200;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue