[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Namespace support, extern icon, JUnit test case.
|
Hi,
This patch adds:
- the support for namespaces in the NewModelBuilder.
- an icon for extern variables.
- a JUnit test case for core model elements, including namespaces.
The enum_obj_gif should overwrite the existing file.
Thanks,
Hoda
Index: model/org/eclipse/cdt/core/model/INamespace.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java,v
retrieving revision 1.1
diff -u -r1.1 INamespace.java
--- model/org/eclipse/cdt/core/model/INamespace.java 26 Jun 2002 20:37:15 -0000 1.1
+++ model/org/eclipse/cdt/core/model/INamespace.java 2 Apr 2003 20:27:46 -0000
@@ -7,7 +7,7 @@
/**
* Represents a package declaration in a C translation unit.
*/
-public interface INamespace extends ICElement, ISourceManipulation, ISourceReference {
+public interface INamespace extends ICElement, IParent, ISourceManipulation, ISourceReference {
/**
* Returns the name of the package the statement refers to.
* This is a handle-only method.
Index: model/org/eclipse/cdt/core/model/IStructure.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IStructure.java,v
retrieving revision 1.3
diff -u -r1.3 IStructure.java
--- model/org/eclipse/cdt/core/model/IStructure.java 28 Mar 2003 21:05:20 -0000 1.3
+++ model/org/eclipse/cdt/core/model/IStructure.java 2 Apr 2003 20:27:46 -0000
@@ -8,7 +8,7 @@
/**
* Represent struct(ure), class or union.
*/
-public interface IStructure extends IInheritance, IParent, IDeclaration {
+public interface IStructure extends IInheritance, IParent, IVariableDeclaration {
//public String instantiatesTemplate();
public IField getField(String name);
Index: parser/org/eclipse/cdt/internal/core/model/ICElementWrapper.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/ICElementWrapper.java,v
retrieving revision 1.3
diff -u -r1.3 ICElementWrapper.java
--- parser/org/eclipse/cdt/internal/core/model/ICElementWrapper.java 1 Apr 2003 18:52:37 -0000 1.3
+++ parser/org/eclipse/cdt/internal/core/model/ICElementWrapper.java 2 Apr 2003 20:27:47 -0000
@@ -1,5 +1,6 @@
package org.eclipse.cdt.internal.core.model;
+import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IParent;
/**
@@ -12,6 +13,7 @@
*/
public interface ICElementWrapper {
- public IParent getElement();
- public void setElement (IParent item);
+ public ICElement getElement();
+ public void setElement (ICElement item);
+ public IParent getParent();
}
Index: parser/org/eclipse/cdt/internal/core/model/NamespaceWrapper.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/model/NamespaceWrapper.java
diff -N parser/org/eclipse/cdt/internal/core/model/NamespaceWrapper.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/model/NamespaceWrapper.java 2 Apr 2003 20:27:47 -0000
@@ -0,0 +1,67 @@
+package org.eclipse.cdt.internal.core.model;
+
+import org.eclipse.cdt.core.model.IParent;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.internal.core.parser.util.Name;
+
+/**********************************************************************
+ * Created on Apr 1, 2003
+ *
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * Rational Software - Initial API and implementation
+***********************************************************************/
+public class NamespaceWrapper implements ICElementWrapper{
+ private Name name;
+ private final IParent parent;
+ private ICElement element;
+
+ public NamespaceWrapper( IParent incoming)
+ {
+ this.parent= incoming;
+ }
+
+ /**
+ * Returns the name.
+ * @return Name
+ */
+ public Name getName() {
+ return name;
+ }
+
+ /**
+ * Returns the parent.
+ * @return IParent
+ */
+ public IParent getParent() {
+ return parent;
+ }
+
+ /**
+ * Sets the name.
+ * @param name The name to set
+ */
+ public void setName(Name name) {
+ this.name = name;
+ }
+
+ /**
+ * @see org.eclipse.cdt.internal.core.model.ICElementWrapper#getElement()
+ */
+ public ICElement getElement() {
+ return element;
+ }
+
+ /**
+ * @see org.eclipse.cdt.internal.core.model.ICElementWrapper#setElement(org.eclipse.cdt.core.model.IParent)
+ */
+ public void setElement(ICElement item) {
+ element = item;
+ }
+
+}
Index: parser/org/eclipse/cdt/internal/core/model/NewModelBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/NewModelBuilder.java,v
retrieving revision 1.15
diff -u -r1.15 NewModelBuilder.java
--- parser/org/eclipse/cdt/internal/core/model/NewModelBuilder.java 1 Apr 2003 18:52:37 -0000 1.15
+++ parser/org/eclipse/cdt/internal/core/model/NewModelBuilder.java 2 Apr 2003 20:27:47 -0000
@@ -15,6 +15,7 @@
import java.util.List;
import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.internal.core.parser.IParserCallback;
import org.eclipse.cdt.internal.core.parser.Token;
import org.eclipse.cdt.internal.core.parser.util.AccessSpecifier;
@@ -135,14 +136,15 @@
org.eclipse.cdt.internal.core.newparser.IParserCallback#beginSimpleDeclaration(Token)
*/
public Object simpleDeclarationBegin(Object container) {
- ICElementWrapper wrapper = (ICElementWrapper)container;
- Object parent = wrapper.getElement();
+ ICElementWrapper wrapper = (ICElementWrapper)container;
+ // Assuming that the parent is the container's element
+ IParent parent = (IParent)wrapper.getElement();
SimpleDeclarationWrapper result = new SimpleDeclarationWrapper();
+ result.setParent( parent );
+ // A special case to transfere the visibility
if( wrapper instanceof SimpleDeclarationWrapper ){
- result.setParent( wrapper.getElement() );
result.setCurrentVisibility(((SimpleDeclarationWrapper)wrapper).getCurrentVisibility());
- } else if ( wrapper instanceof TranslationUnitWrapper )
- result.setParent( (TranslationUnit)wrapper.getElement());
+ }
return result;
}
@@ -354,11 +356,13 @@
elem.setElementName( elementName );
if( wrapper.getName() != null )
{
+ elem.setTypeName( wrapper.getClassKind().getImage() );
elem.setIdPos(wrapper.getName().getStartOffset(), elementName.length());
elem.setPos(wrapper.getName().getStartOffset(), elementName.length());
}
else
{
+ elem.setTypeName( wrapper.getClassKind().getImage() );
elem.setIdPos(wrapper.getClassKind().getOffset(), wrapper.getClassKind().getLength());
elem.setPos(wrapper.getClassKind().getOffset(), wrapper.getClassKind().getLength());
}
@@ -548,21 +552,37 @@
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationBegin(java.lang.Object)
*/
public Object namespaceDefinitionBegin(Object container) {
- // until Namespaces are made part of the code model, just return the container object
- return container;
+
+ ICElementWrapper c = (ICElementWrapper)container;
+ NamespaceWrapper wrapper = new NamespaceWrapper((IParent)c.getElement());
+ return wrapper;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationId(java.lang.Object)
*/
public void namespaceDefinitionId(Object namespace) {
- // until namespaceDefinitionBegin is updated to do more than return its container, do nothing
+ // set wrapper name to current name
+ NamespaceWrapper wrapper = (NamespaceWrapper)namespace;
+ wrapper.setName( currName );
+
+ // create the new element
+ String namespaceName = wrapper.getName().toString();
+ Parent realParent = (Parent)wrapper.getParent();
+ Namespace newNameSpace = new Namespace( (ICElement)realParent, namespaceName );
+ wrapper.setElement(newNameSpace);
+ realParent.addChild( newNameSpace );
+
+ // set the positions
+ newNameSpace.setIdPos(wrapper.getName().getStartOffset(), namespaceName.length());
+ newNameSpace.setPos(wrapper.getName().getStartOffset(), namespaceName.length());
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationAbort(java.lang.Object)
*/
public void namespaceDefinitionAbort(Object namespace) {
+ namespace = null;
}
/* (non-Javadoc)
@@ -684,6 +704,7 @@
Parent realParent = (Parent)wrapper.getParent();
String enumName = ( wrapper.getName() == null ) ? "" : wrapper.getName().toString();
Enumeration enumeration = new Enumeration( (ICElement)realParent, enumName );
+ enumeration.setTypeName( "enum" );
realParent.addChild( enumeration );
// create the list
@@ -691,20 +712,25 @@
while( i.hasNext())
{
EnumeratorWrapper subwrapper = (EnumeratorWrapper)i.next();
- Enumerator enumerator = new Enumerator( enumeration, subwrapper.getName().toString() );
+ Enumerator enumerator = new Enumerator( enumeration, subwrapper.getName().toString() );
+ String enumeratorName = subwrapper.getName().toString();
+
+ enumerator.setIdPos(subwrapper.getName().getStartOffset(), enumeratorName.length());
+ enumerator.setPos(subwrapper.getName().getStartOffset(), enumeratorName.length());
+
enumeration.addChild( enumerator );
}
// do the offsets
if( wrapper.getName() != null )
{
- elem.setIdPos(wrapper.getName().getStartOffset(), enumName.length());
- elem.setPos(wrapper.getName().getStartOffset(), enumName.length());
+ enumeration.setIdPos(wrapper.getName().getStartOffset(), enumName.length());
+ enumeration.setPos(wrapper.getName().getStartOffset(), enumName.length());
}
else
{
- elem.setIdPos(wrapper.getClassKind().getOffset(), wrapper.getClassKind().getLength());
- elem.setPos(wrapper.getClassKind().getOffset(), wrapper.getClassKind().getLength());
+ enumeration.setIdPos(wrapper.getClassKind().getOffset(), wrapper.getClassKind().getLength());
+ enumeration.setPos(wrapper.getClassKind().getOffset(), wrapper.getClassKind().getLength());
}
}
Index: parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java,v
retrieving revision 1.14
diff -u -r1.14 SimpleDeclarationWrapper.java
--- parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java 1 Apr 2003 18:52:37 -0000 1.14
+++ parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java 2 Apr 2003 20:27:47 -0000
@@ -3,7 +3,9 @@
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.cdt.core.model.INamespace;
import org.eclipse.cdt.core.model.IParent;
+import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.internal.core.parser.Token;
@@ -21,7 +23,7 @@
*/
public class SimpleDeclarationWrapper extends DeclSpecifier implements DeclSpecifier.Container, ICElementWrapper {
- private IParent element = null;
+ private ICElement element = null;
private IParent parent = null;
private Name name = null;
@@ -29,7 +31,7 @@
public SimpleDeclarationWrapper( IParent item )
{
- this.element = item;
+ this.parent = item;
}
public SimpleDeclarationWrapper()
@@ -40,7 +42,7 @@
* Returns the item.
* @return CElement
*/
- public IParent getElement() {
+ public ICElement getElement() {
return element;
}
@@ -48,8 +50,8 @@
* Sets the item.
* @param item The item to set
*/
- public void setElement (IParent item) {
- this.element = (IParent)item;
+ public void setElement (ICElement item) {
+ this.element = item;
}
/**
@@ -94,7 +96,8 @@
{
declaration = createField( parentElement, declaratorName );
}
- else if( parentElement instanceof ITranslationUnit )
+ else if(( parentElement instanceof ITranslationUnit )
+ || ( parentElement instanceof INamespace ))
{
if(isExtern())
{
@@ -116,10 +119,18 @@
// this is a function or a method
if( parentElement instanceof IStructure )
{
- declaration = createMethodDeclaration( parentElement, declaratorName, parameters );
+ if (isFunctionDefinition())
+ {
+ declaration = createMethod( parentElement, declaratorName, parameters );
+ }
+ else
+ {
+ declaration = createMethodDeclaration( parentElement, declaratorName, parameters );
+ }
}
- else if( parentElement instanceof ITranslationUnit )
+ else if(( parentElement instanceof ITranslationUnit )
+ || ( parentElement instanceof INamespace ))
{
if (isFunctionDefinition())
{
Index: parser/org/eclipse/cdt/internal/core/model/TranslationUnitWrapper.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/TranslationUnitWrapper.java,v
retrieving revision 1.3
diff -u -r1.3 TranslationUnitWrapper.java
--- parser/org/eclipse/cdt/internal/core/model/TranslationUnitWrapper.java 1 Apr 2003 18:52:37 -0000 1.3
+++ parser/org/eclipse/cdt/internal/core/model/TranslationUnitWrapper.java 2 Apr 2003 20:27:47 -0000
@@ -1,5 +1,6 @@
package org.eclipse.cdt.internal.core.model;
+import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IParent;
/**
@@ -17,18 +18,25 @@
/**
* @see org.eclipse.cdt.internal.core.model.IWrapper#getElement()
*/
- public IParent getElement() {
+ public ICElement getElement() {
return unit;
}
/**
* @see org.eclipse.cdt.internal.core.model.IWrapper#setElement(java.lang.Object)
*/
- public void setElement(IParent item) {
+ public void setElement(ICElement item) {
unit = (TranslationUnit)item;
}
public TranslationUnitWrapper( )
{
+ }
+
+ /**
+ * @see org.eclipse.cdt.internal.core.model.ICElementWrapper#getParent()
+ */
+ public IParent getParent() {
+ return null;
}
}
Index: model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java
diff -N model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java 2 Apr 2003 20:30:14 -0000
@@ -0,0 +1,113 @@
+package org.eclipse.cdt.core.model.tests;
+
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * Rational Software - Initial API and implementation
+***********************************************************************/
+import java.io.FileInputStream;
+import java.util.ArrayList;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.IField;
+import org.eclipse.cdt.core.model.IMember;
+import org.eclipse.cdt.core.model.IMethod;
+import org.eclipse.cdt.core.model.INamespace;
+import org.eclipse.cdt.core.model.IStructure;
+import org.eclipse.cdt.internal.core.model.TranslationUnit;
+import org.eclipse.cdt.testplugin.CProjectHelper;
+import org.eclipse.cdt.testplugin.TestPluginLauncher;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+public class CModelElementsTests extends TestCase {
+ private ICProject fCProject;
+ private IFile headerFile;
+ private NullProgressMonitor monitor;
+
+ public static void main(String[] args) {
+ TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), WorkingCopyTests.class, args);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite();
+ suite.addTest(new CModelElementsTests("testCModelElements"));
+ return suite;
+ }
+
+ public CModelElementsTests(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ monitor = new NullProgressMonitor();
+ String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.ui.tests").find(new Path("/")).getFile();
+
+ fCProject= CProjectHelper.createCProject("TestProject1", "bin");
+ headerFile = fCProject.getProject().getFile("CModelElementsTest.h");
+ if (!headerFile.exists()) {
+ try{
+ FileInputStream fileIn = new FileInputStream(pluginRoot+ "model/org/eclipse/cdt/core/model/tests/resources/cfiles/CModelElementsTestStart.h");
+ headerFile.create(fileIn,false, monitor);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ CCorePlugin.getDefault().setUseNewParser(true);
+
+ }
+
+ protected void tearDown() throws Exception {
+ CProjectHelper.delete(fCProject);
+ }
+
+ public void testCModelElements(){
+ TranslationUnit tu = new TranslationUnit(fCProject, headerFile);
+ // parse the translation unit to get the elements tree
+ tu.parse();
+
+ // tu ---> namespace MyPackage
+ ArrayList tuPackages = tu.getChildrenOfType(ICElement.C_NAMESPACE);
+ INamespace namespace = (INamespace) tuPackages.get(0);
+ assertEquals(namespace.getElementName(), new String("MyPackage"));
+
+ // MyPackage ---> class Hello
+ ArrayList nsClassChildren = namespace.getChildrenOfType(ICElement.C_CLASS);
+ IStructure classHello = (IStructure) nsClassChildren.get(0);
+ assertEquals(classHello.getElementName(), new String("Hello"));
+
+ // Hello --> int x
+ ArrayList helloFieldChildren = classHello.getChildrenOfType(ICElement.C_FIELD);
+ IField intX = (IField) helloFieldChildren.get(0);
+ assertEquals(intX.getElementName(), new String("x"));
+ int visibility = intX.getVisibility();
+ if (visibility != IMember.V_PROTECTED)
+ fail("visibility should be protected!");
+
+
+ // Hello ---> void setX(int X)
+ ArrayList helloMethodChildren = classHello.getChildrenOfType(ICElement.C_METHOD);
+ IMethod setX = (IMethod) helloMethodChildren.get(0);
+ assertEquals(setX.getElementName(), new String("setX"));
+ int setXNumOfParam = setX.getNumberOfParameters();
+ if(setXNumOfParam != 1)
+ fail("setX should have one parameter!");
+ String[] setXParamTypes = setX.getParameterTypes();
+ String firstParamType = setXParamTypes[0];
+ assertEquals(firstParamType, new String("int"));
+ }
+
+}
Index: model/org/eclipse/cdt/core/model/tests/resources/cfiles/CModelElementsTestStart.h
===================================================================
RCS file: model/org/eclipse/cdt/core/model/tests/resources/cfiles/CModelElementsTestStart.h
diff -N model/org/eclipse/cdt/core/model/tests/resources/cfiles/CModelElementsTestStart.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/tests/resources/cfiles/CModelElementsTestStart.h 2 Apr 2003 20:30:15 -0000
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+namespace MyPackage{
+ class Hello{
+ protected:
+ int x;
+ void setX(int X){
+ x = X;
+ };
+ };
+};
\ No newline at end of file
Index: icons/full/obj16/enum_obj.gif
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif,v
retrieving revision 1.1
diff -u -r1.1 enum_obj.gif
Binary files /tmp/cvs4T0mfd and enum_obj.gif differ
Index: icons/full/obj16/var_declaration_obj.gif
===================================================================
RCS file: icons/full/obj16/var_declaration_obj.gif
diff -N icons/full/obj16/var_declaration_obj.gif
Binary files /dev/null and var_declaration_obj.gif differ
Index: src/org/eclipse/cdt/internal/ui/CElementImageProvider.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java,v
retrieving revision 1.10
diff -u -r1.10 CElementImageProvider.java
--- src/org/eclipse/cdt/internal/ui/CElementImageProvider.java 1 Apr 2003 18:41:54 -0000 1.10
+++ src/org/eclipse/cdt/internal/ui/CElementImageProvider.java 2 Apr 2003 20:29:08 -0000
@@ -248,6 +248,9 @@
case ICElement.C_FUNCTION:
return CPluginImages.DESC_OBJS_FUNCTION;
+ case ICElement.C_VARIABLE_DECLARATION:
+ return CPluginImages.DESC_OBJS_VAR_DECLARARION;
+
case ICElement.C_FUNCTION_DECLARATION:
return CPluginImages.DESC_OBJS_DECLARARION;
@@ -256,59 +259,13 @@
case ICElement.C_MACRO:
return CPluginImages.DESC_OBJS_MACRO;
- }
- return null;
- }
-
- public ImageDescriptor getCElementImageDescriptor(int type) {
- switch (type) {
- case ICElement.C_VCONTAINER:
- return CPluginImages.DESC_OBJS_CONTAINER;
-
- case ICElement.C_UNIT:
- return CPluginImages.DESC_OBJS_TUNIT;
-
- case ICElement.C_STRUCT:
- return CPluginImages.DESC_OBJS_STRUCT;
-
- case ICElement.C_CLASS:
- return CPluginImages.DESC_OBJS_CLASS;
-
- case ICElement.C_UNION:
- return CPluginImages.DESC_OBJS_UNION;
-
- case ICElement.C_TYPEDEF:
- return CPluginImages.DESC_OBJS_TYPEDEF;
-
- case ICElement.C_ENUMERATION:
- return CPluginImages.DESC_OBJS_ENUMERATION;
-
- case ICElement.C_ENUMERATOR:
- return CPluginImages.DESC_OBJS_ENUMERATOR;
-
- case ICElement.C_FIELD:
- return CPluginImages.DESC_OBJS_PUBLIC_FIELD;
-
- case ICElement.C_VARIABLE:
- return CPluginImages.DESC_OBJS_FIELD;
-
- case ICElement.C_METHOD: // assumed public
- return CPluginImages.DESC_OBJS_PUBLIC_METHOD;
- case ICElement.C_FUNCTION:
- case ICElement.C_FUNCTION_DECLARATION:
- return CPluginImages.DESC_OBJS_FUNCTION;
-
- case ICElement.C_INCLUDE:
- return CPluginImages.DESC_OBJS_INCLUDE;
-
- case ICElement.C_MACRO:
- return CPluginImages.DESC_OBJS_MACRO;
+ case ICElement.C_NAMESPACE:
+ return CPluginImages.DESC_OBJS_CONTAINER;
+
}
- System.out.println("Unknown base object ype " + type);
- return CPluginImages.DESC_OBJS_MACRO;
- //return null;
- }
+ return null;
+ }
// ---- Methods to compute the adornments flags ---------------------------------
Index: src/org/eclipse/cdt/internal/ui/CPluginImages.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java,v
retrieving revision 1.7
diff -u -r1.7 CPluginImages.java
--- src/org/eclipse/cdt/internal/ui/CPluginImages.java 1 Apr 2003 18:41:54 -0000 1.7
+++ src/org/eclipse/cdt/internal/ui/CPluginImages.java 2 Apr 2003 20:29:08 -0000
@@ -58,6 +58,7 @@
public static final String IMG_OBJS_PROTECTED_FIELD= NAME_PREFIX + "field_protected_obj.gif";
public static final String IMG_OBJS_PRIVATE_FIELD= NAME_PREFIX + "field_private_obj.gif";
public static final String IMG_OBJS_DECLARATION= NAME_PREFIX + "cdeclaration_obj.gif";
+ public static final String IMG_OBJS_VAR_DECLARATION= NAME_PREFIX + "var_declaration_obj.gif";
public static final String IMG_OBJS_INCLUDE= NAME_PREFIX + "include_obj.gif";
public static final String IMG_OBJS_MACRO= NAME_PREFIX + "define_obj.gif";
public static final String IMG_OBJS_TUNIT= NAME_PREFIX + "c_file_obj.gif";
@@ -89,6 +90,7 @@
public static final ImageDescriptor DESC_OBJS_PROTECTED_FIELD= createManaged(T_OBJ, IMG_OBJS_PROTECTED_FIELD);
public static final ImageDescriptor DESC_OBJS_PRIVATE_FIELD= createManaged(T_OBJ, IMG_OBJS_PRIVATE_FIELD);
public static final ImageDescriptor DESC_OBJS_DECLARARION= createManaged(T_OBJ, IMG_OBJS_DECLARATION);
+ public static final ImageDescriptor DESC_OBJS_VAR_DECLARARION= createManaged(T_OBJ, IMG_OBJS_VAR_DECLARATION);
public static final ImageDescriptor DESC_OBJS_INCLUDE= createManaged(T_OBJ, IMG_OBJS_INCLUDE);
public static final ImageDescriptor DESC_OBJS_MACRO= createManaged(T_OBJ, IMG_OBJS_MACRO);
public static final ImageDescriptor DESC_OBJS_TUNIT= createManaged(T_OBJ, IMG_OBJS_TUNIT);
Index: src/org/eclipse/cdt/ui/CElementLabelProvider.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java,v
retrieving revision 1.8
diff -u -r1.8 CElementLabelProvider.java
--- src/org/eclipse/cdt/ui/CElementLabelProvider.java 1 Apr 2003 19:11:44 -0000 1.8
+++ src/org/eclipse/cdt/ui/CElementLabelProvider.java 2 Apr 2003 20:29:08 -0000
@@ -76,6 +76,7 @@
name = fDecl.getSignature();
break;
case ICElement.C_STRUCT:
+ case ICElement.C_UNION:
case ICElement.C_ENUMERATION:
if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){
name = celem.getElementName();
Attachment:
var_declaration_obj.gif
Description: GIF image
Attachment:
enum_obj.gif
Description: GIF image