Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2003-04-02 23:29:59 -0500
committerAlain Magloire2003-04-02 23:29:59 -0500
commit19805635c6bc6becde2a11c75aa071a8d60adf20 (patch)
treecb97dbbbbe8564172f0d328661b2d7958ce751f1
parent44f52feeffe41c474c3b1871a01fe7c977820ee7 (diff)
downloadorg.eclipse.cdt-19805635c6bc6becde2a11c75aa071a8d60adf20.tar.gz
org.eclipse.cdt-19805635c6bc6becde2a11c75aa071a8d60adf20.tar.xz
org.eclipse.cdt-19805635c6bc6becde2a11c75aa071a8d60adf20.zip
Add ILibraryReference awareness
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java17
4 files changed, 21 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
index 5900c41757..546de62148 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
@@ -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;
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java
index 3e651f71f3..d7be94f2b0 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java
@@ -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;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
index e175013e5d..72628e9487 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
@@ -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 );
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java
index d0f19b3878..46c05bf5ba 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java
@@ -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;
}

Back to the top