mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
New icons
This commit is contained in:
parent
e25c54c01d
commit
1df94abba2
4 changed files with 24 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-03-18 Alain Magloire
|
||||
New icons
|
||||
* icons/full/obj16/cfolder_obj.gif
|
||||
* src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
|
||||
* src/org/eclipse/cdt/internal/ui/CElementImageProvider.java
|
||||
|
||||
2004-03-18 Alain Magloire
|
||||
Change in the hierarchy of the core Model:
|
||||
ICModel
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 166 B |
|
@ -280,7 +280,9 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
}
|
||||
try {
|
||||
ILibraryReference[] refs = cproject.getLibraryReferences();
|
||||
objects = concatenate(objects, refs);
|
||||
if (refs != null && refs.length > 0) {
|
||||
objects = concatenate(objects, refs);
|
||||
}
|
||||
} catch (CModelException e) {
|
||||
}
|
||||
return objects;
|
||||
|
@ -293,7 +295,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
objects = container.getNonCResources();
|
||||
} catch (CModelException e) {
|
||||
}
|
||||
if (objects == null) {
|
||||
if (objects == null || objects.length == 0) {
|
||||
return children;
|
||||
}
|
||||
return concatenate(children, objects);
|
||||
|
|
|
@ -14,11 +14,13 @@ import org.eclipse.cdt.core.model.IDeclaration;
|
|||
import org.eclipse.cdt.core.model.IField;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.core.model.IMethodDeclaration;
|
||||
import org.eclipse.cdt.core.model.ISourceRoot;
|
||||
import org.eclipse.cdt.core.model.ITemplate;
|
||||
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
|
||||
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||
import org.eclipse.cdt.ui.CElementImageDescriptor;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
|
@ -99,6 +101,15 @@ public class CElementImageProvider {
|
|||
ImageDescriptor descriptor= null;
|
||||
if (element instanceof ICElement) {
|
||||
descriptor= getCImageDescriptor((ICElement) element, flags);
|
||||
} else if (element instanceof IFile) {
|
||||
// Check for Non Translation Unit.
|
||||
IFile file = (IFile)element;
|
||||
CoreModel model = CoreModel.getDefault();
|
||||
if (model.isTranslationUnit(file)) {
|
||||
descriptor = CPluginImages.DESC_OBJS_TUNIT_RESOURCE;
|
||||
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
|
||||
descriptor = new CElementImageDescriptor(descriptor, 0, size);
|
||||
}
|
||||
}
|
||||
if (descriptor == null && element instanceof IAdaptable) {
|
||||
descriptor= getWorkbenchImageDescriptor((IAdaptable) element, flags);
|
||||
|
@ -278,6 +289,9 @@ public class CElementImageProvider {
|
|||
return CPluginImages.DESC_OBJS_TUNIT;
|
||||
|
||||
case ICElement.C_CCONTAINER:
|
||||
if (celement instanceof ISourceRoot) {
|
||||
return CPluginImages.DESC_OBJS_SOURCE_ROOT;
|
||||
}
|
||||
return DESC_OBJ_FOLDER;
|
||||
|
||||
case ICElement.C_PROJECT:
|
||||
|
|
Loading…
Add table
Reference in a new issue