Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] cdt.core core model changes

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.75
diff -u -r1.75 ChangeLog
--- ChangeLog	20 Mar 2003 16:44:15 -0000	1.75
+++ ChangeLog	27 Mar 2003 16:00:10 -0000
@@ -1,3 +1,102 @@
+2003-03-27 Alain Magloire
+
+	Some changes in the Core Model to make it closer to JDT, the hierarchy is now:
+	ICModel
+		ICProject
+			ICContainer
+				ITranslationUnit
+				IArchive
+				IBinary
+
+	All the C Resources above implements IParent, ICElement and IOpenable.
+	The rationale is that in the old hierarchy, we were putting things in the model
+	that the did not belong to the a C/C++ Model, for example a "README" file
+	was map to CFile or CResource bloating the LRU cache, those resources did
+	not contribute any info to the model and would make the indexer job more
+	complex.  A new method been added getNonCResources() to retrieve those elements.
+	Note CResource, CFolder, CFile are removed.
+	Also refactors:
+	- ICOpenable to IOpenable
+	- ICRoot to ICModel
+	- ICRootInfo to ICModelInfo
+	- Move internal/core/model/IBuffer* classes to core/model/IBuffer*
+
+	index/org/eclipse/cdt/internal/core/index/IndexManager.java
+	model/org/eclipse/cdt/core/model/BufferChangedEvent.java
+	model/org/eclipse/cdt/core/model/CoreModel.java
+	model/org/eclipse/cdt/core/model/IArchive.java
+	model/org/eclipse/cdt/core/model/IArchiveContainer.java
+	model/org/eclipse/cdt/core/model/IBinary.java
+	model/org/eclipse/cdt/core/model/IBinaryContainer.java
+	odel/org/eclipse/cdt/core/model/IBinaryContainer.java
+	model/org/eclipse/cdt/core/model/IBuffer.java
+	model/org/eclipse/cdt/core/model/IBufferChangedListener.java
+	model/org/eclipse/cdt/core/model/ICContainer.java
+	model/org/eclipse/cdt/core/model/ICElement.java
+	model/org/eclipse/cdt/core/model/ICFile.java
+	model/org/eclipse/cdt/core/model/ICFolder.java
+	model/org/eclipse/cdt/core/model/ICModel.java
+	model/org/eclipse/cdt/core/model/ICOpenable.java
+	model/org/eclipse/cdt/core/model/ICProject.java
+	model/org/eclipse/cdt/core/model/ICResource.java
+	model/org/eclipse/cdt/core/model/ICRoot.java
+	model/org/eclipse/cdt/core/model/IOpenable.java
+	model/org/eclipse/cdt/core/model/ITranslationUnit.java
+	model/org/eclipse/cdt/internal/core/model/Archive.java
+	model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java
+	model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java
+	model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java
+	model/org/eclipse/cdt/internal/core/model/Binary.java
+	model/org/eclipse/cdt/internal/core/model/BinaryContainer.java
+	model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java
+	model/org/eclipse/cdt/internal/core/model/BinaryInfo.java
+	model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
+	model/org/eclipse/cdt/internal/core/model/Buffer.java
+	model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java
+	model/org/eclipse/cdt/internal/core/model/BufferManager.java
+	model/org/eclipse/cdt/internal/core/model/CContainer.java
+	model/org/eclipse/cdt/internal/core/model/CContainerInfo.java
+	model/org/eclipse/cdt/internal/core/model/CElement.java
+	model/org/eclipse/cdt/internal/core/model/CElementDelta.java
+	model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java
+	model/org/eclipse/cdt/internal/core/model/CElementInfo.java
+	model/org/eclipse/cdt/internal/core/model/CFile.java
+	model/org/eclipse/cdt/internal/core/model/CFileInfo.java
+	model/org/eclipse/cdt/internal/core/model/CFolder.java
+	model/org/eclipse/cdt/internal/core/model/CFolderInfo.java
+	model/org/eclipse/cdt/internal/core/model/CModel.java
+	model/org/eclipse/cdt/internal/core/model/CModelCache.java
+	model/org/eclipse/cdt/internal/core/model/CModelInfo.java
+	model/org/eclipse/cdt/internal/core/model/CModelManager.java
+	model/org/eclipse/cdt/internal/core/model/CModelOperation.java
+	model/org/eclipse/cdt/internal/core/model/CProject.java
+	model/org/eclipse/cdt/internal/core/model/CProjectInfo.java
+	model/org/eclipse/cdt/internal/core/model/CResource.java
+	model/org/eclipse/cdt/internal/core/model/CResourceInfo.java
+	model/org/eclipse/cdt/internal/core/model/CRoot.java
+	model/org/eclipse/cdt/internal/core/model/CRootInfo.java
+	model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java
+	model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java
+	model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java
+	model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java
+	model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java
+	model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
+	model/org/eclipse/cdt/internal/core/model/ElementCache.java
+	model/org/eclipse/cdt/internal/core/model/FieldInfo.java
+	model/org/eclipse/cdt/internal/core/model/FunctionInfo.java
+	model/org/eclipse/cdt/internal/core/model/IBuffer.java
+	model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java
+	model/org/eclipse/cdt/internal/core/model/IBufferFactory.java
+	model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java
+	model/org/eclipse/cdt/internal/core/model/Openable.java
+	model/org/eclipse/cdt/internal/core/model/OpenableInfo.java
+	model/org/eclipse/cdt/internal/core/model/Parent.java
+	model/org/eclipse/cdt/internal/core/model/SourceManipulation.java
+	model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java
+	model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
+	model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java
+
+
 2003-03-20 Alain Magloire
 
 	Patch from Amer Hoda
Index: index/org/eclipse/cdt/internal/core/index/IndexManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IndexManager.java,v
retrieving revision 1.6
diff -u -r1.6 IndexManager.java
--- index/org/eclipse/cdt/internal/core/index/IndexManager.java	29 Jan 2003 15:02:43 -0000	1.6
+++ index/org/eclipse/cdt/internal/core/index/IndexManager.java	27 Mar 2003 16:00:11 -0000
@@ -19,7 +19,6 @@
 import org.eclipse.cdt.core.model.ElementChangedEvent;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICElementDelta;
-import org.eclipse.cdt.core.model.ICResource;
 import org.eclipse.cdt.core.model.IElementChangedListener;
 import org.eclipse.cdt.core.model.ITranslationUnit;
 import org.eclipse.core.resources.IContainer;
@@ -269,7 +268,7 @@
 
 		if (kind == ICElementDelta.REMOVED) {
 			try {
-				IResource resource = ((ICResource)element).getResource();
+				IResource resource = element.getResource();
 				removeResource(resource);
 			} catch (CModelException e) {
 			}
@@ -285,7 +284,7 @@
 
 		if (element instanceof ITranslationUnit) {
 			if (kind == ICElementDelta.CHANGED) {
-				IResource resource = ((ICResource)element).getResource();
+				IResource resource = element.getResource();
 				addResource(resource);
 				return;
 			}
Index: model/org/eclipse/cdt/core/model/BufferChangedEvent.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/BufferChangedEvent.java
diff -N model/org/eclipse/cdt/core/model/BufferChangedEvent.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/BufferChangedEvent.java	27 Mar 2003 16:00:12 -0000
@@ -0,0 +1,112 @@
+package org.eclipse.cdt.core.model;
+/**********************************************************************
+ * 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.util.EventObject;
+
+
+/**
+ * A   buffer changed event describes how a buffer has changed. These events are
+ * used in <code>IBufferChangedListener</code> notifications.
+ * <p>
+ * For text insertions, <code>getOffset</code> is the offset
+ * of the first inserted character, <code>getText</code> is the
+ * inserted text, and <code>getLength</code> is 0.
+ * </p>
+ * <p>
+ * For text removals, <code>getOffset</code> is the offset
+ * of the first removed character, <code>getText</code> is <code>null</code>,
+ * and <code>getLength</code> is the length of the text that was removed.
+ * </p>
+ * <p>
+ * For replacements (including <code>IBuffer.setContents</code>), 
+ * <code>getOffset</code> is the offset
+ * of the first replaced character, <code>getText</code> is the replacement
+ * text, and <code>getLength</code> is the length of the original text
+ * that was replaced.
+ * </p>
+ * <p>
+ * When a buffer is closed, <code>getOffset</code> is 0, <code>getLength</code>
+ * is 0, and <code>getText</code> is <code>null</code>.
+ * </p>
+ * <p>
+ * This class is not intended to be instantiated or subclassed by clients.
+ * Instances of this class are automatically created by the C model.
+ * </p>
+ *
+ * @see IBuffer
+ * This class is similar to the JDT BufferChangedEvent class. 
+ */
+
+public class BufferChangedEvent extends EventObject {
+	/**
+	 * The length of text that has been modified in the buffer.
+	 */
+	private int length;
+
+	/**
+	 * The offset into the buffer where the modification took place.
+	 */
+	private int offset;
+
+	/**
+	 * The text that was modified.
+	 */
+	private String text;
+
+	/**
+	 * Creates a new buffer changed event indicating that the given buffer has changed.
+	 */
+	public BufferChangedEvent(IBuffer buffer, int offset, int length, String text) {
+		super(buffer);
+		this.offset = offset;
+		this.length = length;
+		this.text = text;
+	}
+	/**
+	 * Returns the buffer which has changed.
+	 *
+	 * @return the buffer affected by the change
+	 */
+	public IBuffer getBuffer() {
+		return (IBuffer) source;
+	}
+	/**
+	 * Returns the length of text removed or replaced in the buffer, or
+	 * 0 if text has been inserted into the buffer.
+	 *
+	 * @return the length of the original text fragment modified by the 
+	 *   buffer change (<code> 0 </code> in case of insertion).
+	 */
+	public int getLength() {
+		return this.length;
+	}
+	/**
+	 * Returns the index of the first character inserted, removed, or replaced
+	 * in the buffer.
+	 *
+	 * @return the source offset of the textual manipulation in the buffer
+	 */
+	public int getOffset() {
+		return this.offset;
+	}
+	/**
+	 * Returns the text that was inserted, the replacement text,
+	 * or <code>null</code> if text has been removed.
+	 *
+	 * @return the text corresponding to the buffer change (<code> null </code>
+	 *   in case of deletion).
+	 */
+	public String getText() {
+		return this.text;
+	}
+
+}
Index: model/org/eclipse/cdt/core/model/CoreModel.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java,v
retrieving revision 1.9
diff -u -r1.9 CoreModel.java
--- model/org/eclipse/cdt/core/model/CoreModel.java	28 Feb 2003 21:29:24 -0000	1.9
+++ model/org/eclipse/cdt/core/model/CoreModel.java	27 Mar 2003 16:00:12 -0000
@@ -24,7 +24,7 @@
 	 * Creates an ICElement form and IPath.
 	 * Returns null if not found.
 	 */
-	public ICResource create(IPath path) {
+	public ICElement create(IPath path) {
 		return manager.create(path);
 	}
 
@@ -32,7 +32,7 @@
 	 * Creates an ICElement form and IFile.
 	 * Returns null if not found.
 	 */
-	public ICFile create(IFile file) {
+	public ICElement create(IFile file) {
 		return manager.create(file);
 	}
 
@@ -40,7 +40,7 @@
 	 * Creates an ICElement form and IFolder.
 	 * Returns null if not found.
 	 */
-	public ICFolder create(IFolder folder) {
+	public ICContainer create(IFolder folder) {
 		return manager.create(folder);
 	}
 
@@ -56,15 +56,15 @@
 	 * Creates an ICElement form and IResource.
 	 * Returns null if not found.
 	 */
-	public ICResource create(IResource resource) {
+	public ICElement create(IResource resource) {
 		return manager.create(resource);
 	}
 
 	/**
-	 * Returns the default ICRoot.
+	 * Returns the default ICModel.
 	 */
-	public ICRoot getCRoot() {
-		return manager.getCRoot();
+	public ICModel getCModel() {
+		return manager.getCModel();
 	}
 
 	/**
Index: model/org/eclipse/cdt/core/model/IArchive.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchive.java,v
retrieving revision 1.1
diff -u -r1.1 IArchive.java
--- model/org/eclipse/cdt/core/model/IArchive.java	26 Jun 2002 20:37:15 -0000	1.1
+++ model/org/eclipse/cdt/core/model/IArchive.java	27 Mar 2003 16:00:12 -0000
@@ -9,7 +9,7 @@
  * An IArchive represents a group of files combined  into  a
  * single file(the Archive), for example libxx.a.
  */
-public interface IArchive extends ICFile {
+public interface IArchive extends ICElement, IParent, IOpenable {
 	/**
 	 * Return the binaries contain in the archive.
  	 * It does not actually extract the files.
Index: model/org/eclipse/cdt/core/model/IArchiveContainer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchiveContainer.java,v
retrieving revision 1.1
diff -u -r1.1 IArchiveContainer.java
--- model/org/eclipse/cdt/core/model/IArchiveContainer.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/core/model/IArchiveContainer.java	27 Mar 2003 16:00:12 -0000
@@ -9,6 +9,6 @@
  * Represents a container of all the IArchive's found in the project
  * while inspecting the project.
  */
-public interface IArchiveContainer extends IParent, ICElement {
+public interface IArchiveContainer extends ICElement, IParent, IOpenable {
 	public IArchive[] getArchives();
 }
Index: model/org/eclipse/cdt/core/model/IBinary.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinary.java,v
retrieving revision 1.3
diff -u -r1.3 IBinary.java
--- model/org/eclipse/cdt/core/model/IBinary.java	22 Nov 2002 16:31:19 -0000	1.3
+++ model/org/eclipse/cdt/core/model/IBinary.java	27 Mar 2003 16:00:12 -0000
@@ -9,7 +9,7 @@
  * Represents a Binary file, for example an ELF excutable.
  * An ELF parser will inspect the binary.
  */
-public interface IBinary extends ICFile {
+public interface IBinary extends ICElement, IParent, IOpenable {
 	/**
 	 * Return whether the file was compiling with debug symbols.
 	 */
Index: model/org/eclipse/cdt/core/model/IBinaryContainer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryContainer.java,v
retrieving revision 1.1
diff -u -r1.1 IBinaryContainer.java
--- model/org/eclipse/cdt/core/model/IBinaryContainer.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/core/model/IBinaryContainer.java	27 Mar 2003 16:00:12 -0000
@@ -9,7 +9,7 @@
  * Represents a container of all the IBinary's found in the project
  * while inspecting the project.
  */
-public interface IBinaryContainer extends IParent, ICElement {
+public interface IBinaryContainer extends ICElement, IParent, IOpenable {
 
 	public IBinary[] getBinaries();
 }
Index: model/org/eclipse/cdt/core/model/IBuffer.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/IBuffer.java
diff -N model/org/eclipse/cdt/core/model/IBuffer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/IBuffer.java	27 Mar 2003 16:00:13 -0000
@@ -0,0 +1,257 @@
+package org.eclipse.cdt.core.model;
+
+/**********************************************************************
+ * 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 org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * A buffer contains the text contents of a resource. It is not language-specific.
+ * The contents may be in the process of being edited, differing from the actual contents of the 
+ * underlying resource. A buffer has an owner, which is an
+ * <code>IOpenable</code>. If a buffer does not have an underlying resource,
+ * saving the buffer has no effect. Buffers can be read-only.
+ * <p>
+ * This interface is similar to the JDT IBuffer interface.
+ */
+
+public interface IBuffer {
+
+	/**
+	 * Adds the given listener for changes to this buffer.
+	 * Has no effect if an identical listener is already registered or if the buffer
+	 * is closed.
+	 *
+	 * @param listener the listener of buffer changes
+	 */
+	public void addBufferChangedListener(IBufferChangedListener listener);
+	/**
+	 * Appends the given character array to the contents of the buffer.
+	 * This buffer will now have unsaved changes.
+	 * Any client can append to the contents of the buffer, not just the owner of the buffer.
+	 * Reports a buffer changed event.
+	 * <p>
+	 * Has no effect if this buffer is read-only.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param text the given character array to append to contents of the buffer
+	 */
+	public void append(char[] text);
+	/**
+	 * Appends the given string to the contents of the buffer.
+	 * This buffer will now have unsaved changes.
+	 * Any client can append to the contents of the buffer, not just the owner of the buffer.
+	 * Reports a buffer changed event.
+	 * <p>
+	 * Has no effect if this buffer is read-only.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param text the <code>String</code> to append to the contents of the buffer
+	 */
+	public void append(String text);
+	/**
+	 * Closes the buffer. Any unsaved changes are lost. Reports a buffer changed event
+	 * with a 0 offset and a 0 length. When this event is fired, the buffer should already
+	 * be closed.
+	 * <p>
+	 * Further operations on the buffer are not allowed, except for close.  If an
+	 * attempt is made to close an already closed buffer, the second attempt has no effect.
+	 */
+	public void close();
+	/**
+	 * Returns the character at the given position in this buffer.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param position a zero-based source offset in this buffer
+	 * @return the character at the given position in this buffer
+	 */
+	public char getChar(int position);
+	/**
+	 * Returns the contents of this buffer as a character array, or <code>null</code> if
+	 * the buffer has not been initialized.
+	 * <p>
+	 * Callers should make no assumption about whether the returned character array
+	 * is or is not the genuine article or a copy. In other words, if the client
+	 * wishes to change this array, they should make a copy. Likewise, if the
+	 * client wishes to hang on to the array in its current state, they should
+	 * make a copy.
+	 * </p>
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @return the characters contained in this buffer
+	 */
+	public char[] getCharacters();
+	/**
+	 * Returns the contents of this buffer as a <code>String</code>. Like all strings,
+	 * the result is an immutable value object., It can also answer <code>null</code> if
+	 * the buffer has not been initialized.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @return the contents of this buffer as a <code>String</code>
+	 */
+	public String getContents();
+	/**
+	 * Returns number of characters stored in this buffer.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @return the number of characters in this buffer
+	 */
+	public int getLength();
+	/**
+	 * Returns the resource element owning of this buffer.
+	 *
+	 * @return the resource element owning this buffer
+	 */
+	public IOpenable getOwner();
+	/**
+	 * Returns the given range of text in this buffer.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param offset the  zero-based starting offset
+	 * @param length the number of characters to retrieve
+	 * @return the given range of text in this buffer
+	 */
+	public String getText(int offset, int length);
+	/**
+	 * Returns the underlying resource for which this buffer was opened,
+	 * or <code>null</code> if this buffer was not opened on a resource.
+	 *
+	 * @return the underlying resource for this buffer, or <code>null</code>
+	 *  if none.
+	 */
+	public IResource getUnderlyingResource();
+	/**
+	 * Returns whether this buffer has been modified since it
+	 * was opened or since it was last saved.
+	 * If a buffer does not have an underlying resource, this method always
+	 * returns <code>true</code>.
+	 *
+	 * @return a <code>boolean</code> indicating presence of unsaved changes (in
+	 *   the absence of any underlying resource, it will always return <code>true</code>).
+	 */
+	public boolean hasUnsavedChanges();
+	/**
+	 * Returns whether this buffer has been closed.
+	 *
+	 * @return a <code>boolean</code> indicating whether this buffer is closed.
+	 */
+	public boolean isClosed();
+	/**
+	 * Returns whether this buffer is read-only.
+	 *
+	 * @return a <code>boolean</code> indicating whether this buffer is read-only
+	 */
+	public boolean isReadOnly();
+	/**
+	 * Removes the given listener from this buffer.
+	 * Has no affect if an identical listener is not registered or if the buffer is closed.
+	 *
+	 * @param listener the listener
+	 */
+	public void removeBufferChangedListener(IBufferChangedListener listener);
+	/**
+	 * Replaces the given range of characters in this buffer with the given text.
+	 * <code>position</code> and <code>position + length</code> must be in the range [0, getLength()].
+	 * <code>length</code> must not be negative.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param position the zero-based starting position of the affected text range in this buffer
+	 * @param length the length of the affected text range in this buffer
+	 * @param text the replacing text as a character array
+	 */
+	public void replace(int position, int length, char[] text);
+	/**
+	 * Replaces the given range of characters in this buffer with the given text.
+	 * <code>position</code> and <code>position + length</code> must be in the range [0, getLength()].
+	 * <code>length</code> must not be negative.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param position the zero-based starting position of the affected text range in this buffer
+	 * @param length the length of the affected text range in this buffer
+	 * @param text the replacing text as a <code>String</code>
+	 */
+	public void replace(int position, int length, String text);
+	/**
+	 * Saves the contents of this buffer to its underlying resource. If
+	 * successful, this buffer will have no unsaved changes.
+	 * The buffer is left open. Saving a buffer with no unsaved
+	 * changes has no effect - the underlying resource is not changed.
+	 * If the buffer does not have an underlying resource or is read-only, this
+	 * has no effect.
+	 * <p>
+	 * The <code>force</code> parameter controls how this method deals with
+	 * cases where the workbench is not completely in sync with the local file system.
+	 * If <code>false</code> is specified, this method will only attempt
+	 * to overwrite a corresponding file in the local file system provided
+	 * it is in sync with the workbench. This option ensures there is no 
+	 * unintended data loss; it is the recommended setting.
+	 * However, if <code>true</code> is specified, an attempt will be made
+	 * to write a corresponding file in the local file system, 
+	 * overwriting any existing one if need be.
+	 * In either case, if this method succeeds, the resource will be marked 
+	 * as being local (even if it wasn't before).
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param progress the progress monitor to notify
+	 * @param force a <code> boolean </code> flag indicating how to deal with resource
+	 *   inconsistencies.
+	 *
+	 * @exception CModelException if an error occurs writing the buffer 	to
+	 * the underlying resource
+	 *
+	 * @see org.eclipse.core.resources.IFile#setContents(java.io.InputStream, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void save(IProgressMonitor progress, boolean force) throws CModelException;
+	/**
+	 * Sets the contents of this buffer to the given character array.
+	 * This buffer will now have unsaved changes.
+	 * Any client can set the contents of the buffer, not just the owner of the buffer.
+	 * Reports a buffer changed event.
+	 * <p>
+	 * Equivalent to <code>replace(0,getLength(),contents)</code>.
+	 * </p>
+	 * <p>
+	 * Has no effect if this buffer is read-only.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param contents the new contents of this buffer as a character array
+	 */
+	public void setContents(char[] contents);
+	/**
+	 * Sets the contents of this buffer to the given <code>String</code>.
+	 * This buffer will now have unsaved changes.
+	 * Any client can set the contents of the buffer, not just the owner of the buffer.
+	 * Reports a buffer changed event.
+	 * <p>
+	 * Equivalent to <code>replace(0,getLength(),contents)</code>.
+	 * </p>
+	 * <p>
+	 * Has no effect if this buffer is read-only.
+	 * <p>
+	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
+	 *
+	 * @param contents the new contents of this buffer as a <code>String</code>
+	 */
+	public void setContents(String contents);
+
+}
Index: model/org/eclipse/cdt/core/model/IBufferChangedListener.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/IBufferChangedListener.java
diff -N model/org/eclipse/cdt/core/model/IBufferChangedListener.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/IBufferChangedListener.java	27 Mar 2003 16:00:13 -0000
@@ -0,0 +1,34 @@
+package org.eclipse.cdt.core.model;
+
+
+/**********************************************************************
+ * 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
+***********************************************************************/
+
+/**
+ * A listener, which gets notified when the contents of a specific buffer
+ * have changed, or when the buffer is closed.
+ * When a buffer is closed, the listener is notified <em>after</em> the buffer has been closed.
+ * A listener is not notified when a buffer is saved.
+ * <p>
+ * This interface may be implemented by clients.
+ * </p>
+ * 
+ * This interface is similar to the JDT IBufferChangedListener interface
+ */
+public interface IBufferChangedListener {
+	/** 
+	 * Notifies that the given event has occurred.
+	 *
+	 * @param event the change event
+	 */
+	public void bufferChanged(BufferChangedEvent event);
+
+}
Index: model/org/eclipse/cdt/core/model/ICContainer.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICContainer.java
diff -N model/org/eclipse/cdt/core/model/ICContainer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/ICContainer.java	27 Mar 2003 16:00:13 -0000
@@ -0,0 +1,27 @@
+package org.eclipse.cdt.core.model;
+
+/*
+ * (c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ */
+
+
+/**
+ * A C Folder Resource.
+ */
+public interface ICContainer extends ICElement, IParent, IOpenable {
+	/**
+	 * Returns an array of non-C resources directly contained in this project.
+	 * It does not transitively answer non-C resources contained in folders;
+	 * these would have to be explicitly iterated over.
+	 * <p>
+	 * Non-C resources includes files, folders, projects  not accounted for.
+	 * </p>
+	 * 
+	 * @return an array of non-C resources directly contained in this project
+	 * @exception JavaModelException if this element does not exist or if an
+	 *              exception occurs while accessing its corresponding resource
+	 */
+	Object[] getNonCResources() throws CModelException;
+
+}
Index: model/org/eclipse/cdt/core/model/ICElement.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java,v
retrieving revision 1.3
diff -u -r1.3 ICElement.java
--- model/org/eclipse/cdt/core/model/ICElement.java	18 Nov 2002 15:43:08 -0000	1.3
+++ model/org/eclipse/cdt/core/model/ICElement.java	27 Mar 2003 16:00:14 -0000
@@ -20,163 +20,160 @@
 
 	/**
 	 * Constant representing a C Root workspace (IWorkspaceRoot object).
-	 * A C element with this type can be safely cast to <code>ICRoot</code>.
+	 * A C element with this type can be safely cast to <code>ICModel</code>.
 	 */
-	public static final int C_ROOT = 10;
+	static final int C_MODEL = 10;
 
 	/**
 	 * Constant representing a C project(IProject object).
 	 * A C element with this type can be safely cast to <code>ICProject</code>.
 	 */
-	public static final int C_PROJECT = 11;
+	static final int C_PROJECT = 11;
 
 	/**
-	 * Constant representing a folder(ICFolder object).
-	 * A C element with this type can be safely cast to <code>ICFolder</code>.
+	 * Constant representing a folder(ICContainer object).
+	 * A C element with this type can be safely cast to <code>ICContainer</code>.
 	 */
-	public static final int C_FOLDER = 12;
-
-	/**
-	 * Constant representing a file(ICFile object).
-	 * A C element with this type can be safely cast to <code>ICFile</code>.
-	 */
-	public static final int C_FILE = 13;
+	static final int C_CCONTAINER = 12;
 
+	static final int C_BINARY = 14;
+	
+	static final int C_ARCHIVE = 18;
 	/**
 	 * Virtual container serving as a place holder.
 	 */
-	public static final int C_CONTAINER = 30;
+	static final int C_VCONTAINER = 30;
 
 	/**
 	 * Constant representing a C/C++ children of a Translation Unit
 	 */
-	public static final int C_UNIT = 60;
+	static final int C_UNIT = 60;
 
 	/**
 	 * Namespace.
 	 */
-	public static final int C_NAMESPACE = 61;
+	static final int C_NAMESPACE = 61;
 
 	/**
 	 * Using.
 	 */
-	public static final int C_USING = 62;
+	static final int C_USING = 62;
 
 	/**
 	 * Enumeration.
 	 */
-	public static final int C_ENUMERATION = 63;
+	static final int C_ENUMERATION = 63;
 
 	/**
 	 * Constant representing a class structure.
 	 */
-	public static final int C_CLASS = 64;
+	static final int C_CLASS = 64;
 
 	/**
 	 * Constant representing a struct structure.
 	 */
-	public static final int C_STRUCT = 65;
+	static final int C_STRUCT = 65;
 
 	/**
 	 * Constant representing a union structure.
 	 */
-	public static final int C_UNION = 66;
+	static final int C_UNION = 66;
 
 	/**
 	 * A method definition part of a structure(class, struct, union).
 	 */
-	public static final int C_METHOD = 67;
+	static final int C_METHOD = 67;
 
 	/**
 	 * A method declaration part of a structure(class, struct, union).
 	 */
-	public static final int C_METHOD_DECLARATION = 68;
+	static final int C_METHOD_DECLARATION = 68;
 
 	/**
 	 * A Field definition part of a structure(class, struct, union).
 	 */
-	public static final int C_FIELD = 69;
+	static final int C_FIELD = 69;
 
 	/**
 	 * a C/C++ function prototype.
 	 */
-	public static final int C_FUNCTION_DECLARATION = 70;
+	static final int C_FUNCTION_DECLARATION = 70;
 
 	/**
 	 * a C/C++ function.
 	 */
-	public static final int C_FUNCTION = 71;
+	static final int C_FUNCTION = 71;
 
 	/**
 	 * Preprocessor #include directive.
 	 */
-	public static final int C_INCLUDE = 72;
+	static final int C_INCLUDE = 72;
 
 	/**
 	 * C++ template class.
 	 */
-	public static final int C_TEMPLATE = 73;
+	static final int C_TEMPLATE = 73;
 
 	/**
 	 * Global variable.
 	 */
-	public static final int C_VARIABLE = 74;
+	static final int C_VARIABLE = 74;
 
 	/**
 	 * variable Declaration.
 	 */
-	public static final int C_VARIABLE_DECLARATION = 75;
+	static final int C_VARIABLE_DECLARATION = 75;
 
 	/**
 	 * Local Variable.
 	 */
-	public static final int C_VARIABLE_LOCAL = 76;
+	static final int C_VARIABLE_LOCAL = 76;
 
 	/**
 	 * A preprocessor macro.
 	 */
-	public static final int C_MACRO = 77;
+	static final int C_MACRO = 77;
 
 	/**
 	 * a Typedef.
 	 */
-	public static final int C_TYPEDEF = 78;
+	static final int C_TYPEDEF = 78;
 	
 	/**
 	 * Modifier indicating a class constructor
 	 */
-	public static final int C_CLASS_CTOR = 0x100;
+	static final int C_CLASS_CTOR = 0x100;
 	
 	/**
 	 * Modifier indicating a class destructor
 	 */
-	public static final int C_CLASS_DTOR = 0x200;
+	static final int C_CLASS_DTOR = 0x200;
 		
 	/**
 	 * Modifier indicating a static storage attribute
 	 */
-	public static final int C_STORAGE_STATIC = 0x400;
+	static final int C_STORAGE_STATIC = 0x400;
 		
 	/**
 	 * Modifier indicating an extern storage attribute
 	 */
-	public static final int C_STORAGE_EXTERN = 0x800;
+	static final int C_STORAGE_EXTERN = 0x800;
 
 	/**
 	 * Modifier indicating a private class
 	 */
-	public static final int CPP_PRIVATE = 0x1000;
+	static final int CPP_PRIVATE = 0x1000;
 
 	/**
 	 * Modifier indicating a public class
 	 */
 
-	public static final int CPP_PUBLIC = 0x2000;
+	static final int CPP_PUBLIC = 0x2000;
 
 	/**
 	 * Modifier indicating a friend class
 	 */
-	public static final int CPP_FRIEND = 0x4000;
+	static final int CPP_FRIEND = 0x4000;
 
 	/**
 	 * Returns whether this C element exists in the model.
@@ -200,14 +197,14 @@
 	 *   <code>ICElement</code>
 	 * @see ICElement
 	 */
-	public int getElementType();
+	int getElementType();
 
 	/**
 	 * Returns the C model.
 	 *
 	 * @return the C model
 	 */
-	ICRoot getCRoot();
+	ICModel getCModel();
 
 	/**
 	 * Returns the C project this element is contained in,
Index: model/org/eclipse/cdt/core/model/ICFile.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICFile.java,v
retrieving revision 1.3
diff -u -r1.3 ICFile.java
--- model/org/eclipse/cdt/core/model/ICFile.java	23 Jan 2003 19:27:01 -0000	1.3
+++ model/org/eclipse/cdt/core/model/ICFile.java	27 Mar 2003 16:00:14 -0000
@@ -5,18 +5,9 @@
  * All Rights Reserved.
  */
 
-import org.eclipse.core.resources.IFile;
 
 /**
  * A C File Resource.
  */
-public interface ICFile extends IParent, ICResource {
-
-	public boolean isBinary();
-
-	public boolean isArchive();
-
-	public boolean isTranslationUnit();
-
-	public IFile getFile();
+public interface ICFile extends ICElement {
 }
Index: model/org/eclipse/cdt/core/model/ICFolder.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICFolder.java
diff -N model/org/eclipse/cdt/core/model/ICFolder.java
--- model/org/eclipse/cdt/core/model/ICFolder.java	23 Jan 2003 19:27:07 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-package org.eclipse.cdt.core.model;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IFolder;
-
-/**
- * A C Folder Resource.
- */
-public interface ICFolder extends IParent, ICResource {
-
-	public IFolder getFolder();
-}
Index: model/org/eclipse/cdt/core/model/ICModel.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICModel.java
diff -N model/org/eclipse/cdt/core/model/ICModel.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/ICModel.java	27 Mar 2003 16:00:15 -0000
@@ -0,0 +1,192 @@
+package org.eclipse.cdt.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * Represent the root C element corresponding to the workspace. 
+ * Since there is only one such root element, it is commonly referred to as
+ * <em>the</em> C model element.
+ * The C model element needs to be opened before it can be navigated or manipulated.
+ * The C model element has no parent (it is the root of the C element 
+ * hierarchy). Its children are <code>ICProject</code>s.
+ * <p>
+ * This interface provides methods for performing copy, move, rename, and
+ * delete operations on multiple C elements.
+ * </p>
+ *
+ * @see CCore#create(org.eclipse.core.resources.IWorkspaceRoot)
+ */
+public interface ICModel extends ICElement, IParent, IOpenable {
+	/**
+	 * Copies the given elements to the specified container(s).
+	 * If one container is specified, all elements are copied to that
+	 * container. If more than one container is specified, the number of
+	 * elements and containers must match, and each element is copied to
+	 * its associated container.
+	 * <p>
+	 * Optionally, each copy can positioned before a sibling
+	 * element. If <code>null</code> is specified for a given sibling, the copy
+	 * is inserted as the last child of its associated container.
+	 * </p>
+	 * <p>
+	 * Optionally, each copy can be renamed. If 
+	 * <code>null</code> is specified for the new name, the copy
+	 * is not renamed. 
+	 * </p>
+	 * <p>
+	 * Optionally, any existing child in the destination container with
+	 * the same name can be replaced by specifying <code>true</code> for
+	 * force. Otherwise an exception is thrown in the event that a name
+	 * collision occurs.
+	 * </p>
+	 *
+	 * @param elements the elements to copy
+	 * @param containers the container, or list of containers
+	 * @param siblings the list of siblings element any of which may be
+	 *   <code>null</code>; or <code>null</code>
+	 * @param renamings the list of new names any of which may be
+	 *   <code>null</code>; or <code>null</code>
+	 * @param replace <code>true</code> if any existing child in a target container
+	 *   with the target name should be replaced, and <code>false</code> to throw an
+	 *   exception in the event of a name collision
+	 * @param monitor a progress monitor
+	 * @exception CModelException if an element could not be copied. Reasons include:
+	 * <ul>
+	 * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
+	 * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)
+	 * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)
+	 * <li> A new name is invalid (<code>INVALID_NAME</code>)
+	 * <li> A child in its associated container already exists with the same
+	 * 		name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)
+	 * <li> A container or element is read-only (<code>READ_ONLY</code>) 
+	 * </ul>
+	 */
+	void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException;
+	/**
+	 * Deletes the given elements, forcing the operation if necessary and specified.
+	 *
+	 * @param elements the elements to delete
+	 * @param force a flag controlling whether underlying resources that are not
+	 *    in sync with the local file system will be tolerated
+	 * @param monitor a progress monitor
+	 * @exception CModelException if an element could not be deleted. Reasons include:
+	 * <ul>
+	 * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
+	 * <li> An element is read-only (<code>READ_ONLY</code>) 
+	 * </ul>
+	 */
+	void delete(ICElement[] elements, boolean force, IProgressMonitor monitor) throws CModelException;
+
+	/**
+	 * Moves the given elements to the specified container(s).
+	 * If one container is specified, all elements are moved to that
+	 * container. If more than one container is specified, the number of
+	 * elements and containers must match, and each element is moved to
+	 * its associated container.
+	 * <p>
+	 * Optionally, each element can positioned before a sibling
+	 * element. If <code>null</code> is specified for sibling, the element
+	 * is inserted as the last child of its associated container.
+	 * </p>
+	 * <p>
+	 * Optionally, each element can be renamed. If 
+	 * <code>null</code> is specified for the new name, the element
+	 * is not renamed. 
+	 * </p>
+	 * <p>
+	 * Optionally, any existing child in the destination container with
+	 * the same name can be replaced by specifying <code>true</code> for
+	 * force. Otherwise an exception is thrown in the event that a name
+	 * collision occurs.
+	 * </p>
+	 *
+	 * @param elements the elements to move
+	 * @param containers the container, or list of containers
+	 * @param siblings the list of siblings element any of which may be
+	 *   <code>null</code>; or <code>null</code>
+	 * @param renamings the list of new names any of which may be
+	 *   <code>null</code>; or <code>null</code>
+	 * @param replace <code>true</code> if any existing child in a target container
+	 *   with the target name should be replaced, and <code>false</code> to throw an
+	 *   exception in the event of a name collision
+	 * @param monitor a progress monitor
+	 * @exception CModelException if an element could not be moved. Reasons include:
+	 * <ul>
+	 * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
+	 * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)
+	 * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)
+	 * <li> A new name is invalid (<code>INVALID_NAME</code>)
+	 * <li> A child in its associated container already exists with the same
+	 * 		name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)
+	 * <li> A container or element is read-only (<code>READ_ONLY</code>) 
+	 * </ul>
+	 *
+	 * @exception IllegalArgumentException any element or container is <code>null</code>
+	 */
+	void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException;
+
+	/**
+	 * Renames the given elements as specified.
+	 * If one container is specified, all elements are renamed within that
+	 * container. If more than one container is specified, the number of
+	 * elements and containers must match, and each element is renamed within
+	 * its associated container.
+	 *
+	 * @param elements the elements to rename
+	 * @param destinations the container, or list of containers
+	 * @param names the list of new names
+	 * @param replace <code>true</code> if an existing child in a target container
+	 *   with the target name should be replaced, and <code>false</code> to throw an
+	 *   exception in the event of a name collision
+	 * @param monitor a progress monitor
+	 * @exception CModelException if an element could not be renamed. Reasons include:
+	 * <ul>
+	 * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
+	 * <li> A new name is invalid (<code>INVALID_NAME</code>)
+	 * <li> A child already exists with the same name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)
+	 * <li> An element is read-only (<code>READ_ONLY</code>) 
+	 * </ul>
+	 */
+	void rename(ICElement[] elements, ICElement[] destinations, String[] names, boolean replace, IProgressMonitor monitor) throws CModelException;
+
+	/**
+	 * Returns the C project with the given name. This is a handle-only method. 
+	 * The project may or may not exist.
+	 */
+	ICProject getCProject(String name);
+
+	/**
+	 * Returns the C projects.
+	 */
+	ICProject[] getCProjects();
+
+	/**
+	 * Returns an array of non-C resources (i.e. non-C projects) in
+	 * the workspace.
+	 * <p>
+	 * Non-C projects include all projects that are closed (even if they have the
+	 * C nature).
+	 * </p>
+	 * 
+	 * @return an array of non-C projects contained in the workspace.
+	 * @throws CModelException if this element does not exist or if an
+	 *              exception occurs while accessing its corresponding resource
+	 * @since 2.1
+	 */
+	Object[] getNonCResources() throws CModelException;
+
+	/**
+	 * Returns the workspace associated with this C model.
+	 */
+	IWorkspace getWorkspace();
+
+}
Index: model/org/eclipse/cdt/core/model/ICOpenable.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICOpenable.java
diff -N model/org/eclipse/cdt/core/model/ICOpenable.java
--- model/org/eclipse/cdt/core/model/ICOpenable.java	19 Mar 2003 20:19:48 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,70 +0,0 @@
-package org.eclipse.cdt.core.model;
-
-/**********************************************************************
- * 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 org.eclipse.cdt.internal.core.model.IBuffer;
-import org.eclipse.cdt.internal.core.model.IBufferChangedListener;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * An openable is an element that can be opened, saved, and closed.
- * An openable might or might not have an associated buffer.
- */
-public interface ICOpenable extends IBufferChangedListener{
-	/**
-	 * Closes this element and its buffer (if any).
-	 */
-	public void close() throws CModelException;
-	/**
-	 * Returns the buffer opened for this element, or <code>null</code>
-	 * if this element does not have a buffer.
-	 */
-	public IBuffer getBuffer() throws CModelException;
-	/**
-	 * returns true if the associated buffer has some unsaved changes 
-	 */
-	boolean hasUnsavedChanges() throws CModelException;
-	/**
-	 * Returns whether the element is consistent with its underlying resource or buffer.
-	 * The element is consistent when opened, and is consistent if the underlying resource
-	 * or buffer has not been modified since it was last consistent.
-	 */
-	boolean isConsistent() throws CModelException;
-
-	/**
-	 * Returns whether this CFile is open.
-	 */
-	boolean isOpen();
-	
-	/**
-	 * Makes this element consistent with its underlying resource or buffer 
-	 * by updating the element's structure and properties as necessary.
-	 */
-	void makeConsistent(IProgressMonitor progress) throws CModelException;
-
-	/**
-	 * Opens this element and all parent elements that are not already open.
-	 * For translation units, a buffer is opened on the contents of the
-	 * underlying resource.
-	 */
-	public void open(IProgressMonitor progress) throws CModelException;
-	
-	/**
-	 * Saves any changes in this element's buffer to its underlying resource
-	 * via a workspace resource operation. 
-	 * <p>
-	 * The <code>force</code> parameter controls how this method deals with
-	 * cases where the workbench is not completely in sync with the local file system.
-	 */
-	public void save(IProgressMonitor progress, boolean force) throws CModelException;
-
-}
Index: model/org/eclipse/cdt/core/model/ICProject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java,v
retrieving revision 1.3
diff -u -r1.3 ICProject.java
--- model/org/eclipse/cdt/core/model/ICProject.java	23 Jan 2003 19:27:12 -0000	1.3
+++ model/org/eclipse/cdt/core/model/ICProject.java	27 Mar 2003 16:00:15 -0000
@@ -10,14 +10,14 @@
 
 /**
  * A C project represents a view of a project resource in terms of C 
- * elements such as ICFile, ICFolder ....
+ * elements such as , ICContainer, ITranslationUnit ....
  * <code>CCore.create(project)</code>.
  * </p>
  *
  * @see CCore#create(org.eclipse.core.resources.IProject)
  * @see IBuildEntry
  */
-public interface ICProject extends IParent, ICResource {
+public interface ICProject extends ICContainer {
 
 	/**
 	 * Returns the <code>ICElement</code> corresponding to the given
Index: model/org/eclipse/cdt/core/model/ICResource.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICResource.java,v
retrieving revision 1.3
diff -u -r1.3 ICResource.java
--- model/org/eclipse/cdt/core/model/ICResource.java	19 Mar 2003 20:19:48 -0000	1.3
+++ model/org/eclipse/cdt/core/model/ICResource.java	27 Mar 2003 16:00:15 -0000
@@ -6,5 +6,5 @@
 package org.eclipse.cdt.core.model;
 
 
-public interface ICResource extends IParent, ICElement, ICOpenable {
+public interface ICResource extends IParent, ICElement, IOpenable {
 }
Index: model/org/eclipse/cdt/core/model/ICRoot.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICRoot.java
diff -N model/org/eclipse/cdt/core/model/ICRoot.java
--- model/org/eclipse/cdt/core/model/ICRoot.java	23 Jan 2003 19:27:17 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,179 +0,0 @@
-package org.eclipse.cdt.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * Represent the root C element corresponding to the workspace. 
- * Since there is only one such root element, it is commonly referred to as
- * <em>the</em> C model element.
- * The C model element needs to be opened before it can be navigated or manipulated.
- * The C model element has no parent (it is the root of the C element 
- * hierarchy). Its children are <code>ICProject</code>s.
- * <p>
- * This interface provides methods for performing copy, move, rename, and
- * delete operations on multiple C elements.
- * </p>
- *
- * @see CCore#create(org.eclipse.core.resources.IWorkspaceRoot)
- */
-public interface ICRoot extends IParent, ICResource {
-	/**
-	 * Copies the given elements to the specified container(s).
-	 * If one container is specified, all elements are copied to that
-	 * container. If more than one container is specified, the number of
-	 * elements and containers must match, and each element is copied to
-	 * its associated container.
-	 * <p>
-	 * Optionally, each copy can positioned before a sibling
-	 * element. If <code>null</code> is specified for a given sibling, the copy
-	 * is inserted as the last child of its associated container.
-	 * </p>
-	 * <p>
-	 * Optionally, each copy can be renamed. If 
-	 * <code>null</code> is specified for the new name, the copy
-	 * is not renamed. 
-	 * </p>
-	 * <p>
-	 * Optionally, any existing child in the destination container with
-	 * the same name can be replaced by specifying <code>true</code> for
-	 * force. Otherwise an exception is thrown in the event that a name
-	 * collision occurs.
-	 * </p>
-	 *
-	 * @param elements the elements to copy
-	 * @param containers the container, or list of containers
-	 * @param siblings the list of siblings element any of which may be
-	 *   <code>null</code>; or <code>null</code>
-	 * @param renamings the list of new names any of which may be
-	 *   <code>null</code>; or <code>null</code>
-	 * @param replace <code>true</code> if any existing child in a target container
-	 *   with the target name should be replaced, and <code>false</code> to throw an
-	 *   exception in the event of a name collision
-	 * @param monitor a progress monitor
-	 * @exception CModelException if an element could not be copied. Reasons include:
-	 * <ul>
-	 * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li>
-	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
-	 * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)
-	 * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)
-	 * <li> A new name is invalid (<code>INVALID_NAME</code>)
-	 * <li> A child in its associated container already exists with the same
-	 * 		name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)
-	 * <li> A container or element is read-only (<code>READ_ONLY</code>) 
-	 * </ul>
-	 */
-	void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException;
-	/**
-	 * Deletes the given elements, forcing the operation if necessary and specified.
-	 *
-	 * @param elements the elements to delete
-	 * @param force a flag controlling whether underlying resources that are not
-	 *    in sync with the local file system will be tolerated
-	 * @param monitor a progress monitor
-	 * @exception CModelException if an element could not be deleted. Reasons include:
-	 * <ul>
-	 * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
-	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
-	 * <li> An element is read-only (<code>READ_ONLY</code>) 
-	 * </ul>
-	 */
-	void delete(ICElement[] elements, boolean force, IProgressMonitor monitor) throws CModelException;
-
-	/**
-	 * Moves the given elements to the specified container(s).
-	 * If one container is specified, all elements are moved to that
-	 * container. If more than one container is specified, the number of
-	 * elements and containers must match, and each element is moved to
-	 * its associated container.
-	 * <p>
-	 * Optionally, each element can positioned before a sibling
-	 * element. If <code>null</code> is specified for sibling, the element
-	 * is inserted as the last child of its associated container.
-	 * </p>
-	 * <p>
-	 * Optionally, each element can be renamed. If 
-	 * <code>null</code> is specified for the new name, the element
-	 * is not renamed. 
-	 * </p>
-	 * <p>
-	 * Optionally, any existing child in the destination container with
-	 * the same name can be replaced by specifying <code>true</code> for
-	 * force. Otherwise an exception is thrown in the event that a name
-	 * collision occurs.
-	 * </p>
-	 *
-	 * @param elements the elements to move
-	 * @param containers the container, or list of containers
-	 * @param siblings the list of siblings element any of which may be
-	 *   <code>null</code>; or <code>null</code>
-	 * @param renamings the list of new names any of which may be
-	 *   <code>null</code>; or <code>null</code>
-	 * @param replace <code>true</code> if any existing child in a target container
-	 *   with the target name should be replaced, and <code>false</code> to throw an
-	 *   exception in the event of a name collision
-	 * @param monitor a progress monitor
-	 * @exception CModelException if an element could not be moved. Reasons include:
-	 * <ul>
-	 * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li>
-	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
-	 * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)
-	 * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)
-	 * <li> A new name is invalid (<code>INVALID_NAME</code>)
-	 * <li> A child in its associated container already exists with the same
-	 * 		name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)
-	 * <li> A container or element is read-only (<code>READ_ONLY</code>) 
-	 * </ul>
-	 *
-	 * @exception IllegalArgumentException any element or container is <code>null</code>
-	 */
-	void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException;
-
-	/**
-	 * Renames the given elements as specified.
-	 * If one container is specified, all elements are renamed within that
-	 * container. If more than one container is specified, the number of
-	 * elements and containers must match, and each element is renamed within
-	 * its associated container.
-	 *
-	 * @param elements the elements to rename
-	 * @param destinations the container, or list of containers
-	 * @param names the list of new names
-	 * @param replace <code>true</code> if an existing child in a target container
-	 *   with the target name should be replaced, and <code>false</code> to throw an
-	 *   exception in the event of a name collision
-	 * @param monitor a progress monitor
-	 * @exception CModelException if an element could not be renamed. Reasons include:
-	 * <ul>
-	 * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
-	 * <li> A <code>CoreException</code> occurred while updating an underlying resource
-	 * <li> A new name is invalid (<code>INVALID_NAME</code>)
-	 * <li> A child already exists with the same name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)
-	 * <li> An element is read-only (<code>READ_ONLY</code>) 
-	 * </ul>
-	 */
-	void rename(ICElement[] elements, ICElement[] destinations, String[] names, boolean replace, IProgressMonitor monitor) throws CModelException;
-
-	/**
-	 * Returns the C project with the given name. This is a handle-only method. 
-	 * The project may or may not exist.
-	 */
-	ICProject getCProject(String name);
-
-	/**
-	 * Returns the C projects.
-	 */
-	ICProject[] getCProjects();
-
-	/**
-	 * Returns the workspace associated with this C model.
-	 */
-	IWorkspace getWorkspace();
-
-	IWorkspaceRoot getRoot();
-}
Index: model/org/eclipse/cdt/core/model/IOpenable.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/IOpenable.java
diff -N model/org/eclipse/cdt/core/model/IOpenable.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/core/model/IOpenable.java	27 Mar 2003 16:00:15 -0000
@@ -0,0 +1,68 @@
+package org.eclipse.cdt.core.model;
+
+/**********************************************************************
+ * 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 org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * An openable is an element that can be opened, saved, and closed.
+ * An openable might or might not have an associated buffer.
+ */
+public interface IOpenable extends IBufferChangedListener{
+	/**
+	 * Closes this element and its buffer (if any).
+	 */
+	public void close() throws CModelException;
+	/**
+	 * Returns the buffer opened for this element, or <code>null</code>
+	 * if this element does not have a buffer.
+	 */
+	public IBuffer getBuffer() throws CModelException;
+	/**
+	 * returns true if the associated buffer has some unsaved changes 
+	 */
+	boolean hasUnsavedChanges() throws CModelException;
+	/**
+	 * Returns whether the element is consistent with its underlying resource or buffer.
+	 * The element is consistent when opened, and is consistent if the underlying resource
+	 * or buffer has not been modified since it was last consistent.
+	 */
+	boolean isConsistent() throws CModelException;
+
+	/**
+	 * Returns whether this CFile is open.
+	 */
+	boolean isOpen();
+	
+	/**
+	 * Makes this element consistent with its underlying resource or buffer 
+	 * by updating the element's structure and properties as necessary.
+	 */
+	void makeConsistent(IProgressMonitor progress) throws CModelException;
+
+	/**
+	 * Opens this element and all parent elements that are not already open.
+	 * For translation units, a buffer is opened on the contents of the
+	 * underlying resource.
+	 */
+	public void open(IProgressMonitor progress) throws CModelException;
+	
+	/**
+	 * Saves any changes in this element's buffer to its underlying resource
+	 * via a workspace resource operation. 
+	 * <p>
+	 * The <code>force</code> parameter controls how this method deals with
+	 * cases where the workbench is not completely in sync with the local file system.
+	 */
+	public void save(IProgressMonitor progress, boolean force) throws CModelException;
+
+}
Index: model/org/eclipse/cdt/core/model/ITranslationUnit.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITranslationUnit.java,v
retrieving revision 1.2
diff -u -r1.2 ITranslationUnit.java
--- model/org/eclipse/cdt/core/model/ITranslationUnit.java	19 Mar 2003 20:19:48 -0000	1.2
+++ model/org/eclipse/cdt/core/model/ITranslationUnit.java	27 Mar 2003 16:00:16 -0000
@@ -16,7 +16,7 @@
  * Use <code>ICElement.isStructureKnown</code> to determine whether this is 
  * the case.
  */
-public interface ITranslationUnit extends ICFile , ISourceReference, ISourceManipulation {
+public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISourceReference, ISourceManipulation {
 	/**
 	 * Creates and returns an include declaration in this translation unit
 	 * with the given name.
Index: model/org/eclipse/cdt/internal/core/model/Archive.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java,v
retrieving revision 1.4
diff -u -r1.4 Archive.java
--- model/org/eclipse/cdt/internal/core/model/Archive.java	23 Feb 2003 19:23:40 -0000	1.4
+++ model/org/eclipse/cdt/internal/core/model/Archive.java	27 Mar 2003 16:00:16 -0000
@@ -5,23 +5,31 @@
  * All Rights Reserved.
  */
  
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.cdt.core.IBinaryParser;
+import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive;
+import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
+import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
+import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.IArchive;
 import org.eclipse.cdt.core.model.IBinary;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
 
-public class Archive extends CFile implements IArchive {
-
-	IResource archive;
+public class Archive extends Openable implements IArchive {
 
 	public Archive(ICElement parent, IFile file) {
-		super(parent, file);
+		this(parent, file.getLocation());
 	}
 
 	public Archive(ICElement parent, IPath path) {
-		super (parent, path);
+		super (parent, path, ICElement.C_ARCHIVE);
 	}
 
 	public IBinary[] getBinaries() {
@@ -38,4 +46,59 @@
 	protected ArchiveInfo getArchiveInfo() {
 		return (ArchiveInfo)getElementInfo();
 	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource)
+	 */
+	protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource)
+		throws CModelException {
+		CModelManager.getDefault().putInfo(this, info);
+		return computeChildren(info, underlyingResource);
+	}
+
+
+	public boolean computeChildren(OpenableInfo info, IResource res) {
+		IBinaryArchive ar = getBinaryArchive(res);
+		if (ar != null) {
+			IBinaryObject[] objects = ar.getObjects();
+			for (int i = 0; i < objects.length; i++) {
+				final IBinaryObject obj = objects[i];
+				Binary binary = new Binary(this, res.getLocation().append(obj.getName())) {
+					protected IBinaryObject getBinaryObject(IResource res) {
+						return obj;
+					}
+				};
+
+				// Force the loading of the children inf the Info by callin getElementInfo.
+				binary.getElementInfo();
+				info.addChild(binary);
+			}
+		} else {
+			return false;
+		}
+		return true;
+	}
+
+	IBinaryArchive getBinaryArchive(IResource res) {
+		IBinaryArchive archive = null;
+		IProject project = null;
+		IBinaryParser parser = null;
+		if (res != null) {
+			project = res.getProject();
+		}
+		if (project != null) {
+			parser = CModelManager.getDefault().getBinaryParser(project);
+		}
+		if (parser != null) {
+			try {
+				IPath path = res.getLocation();
+				IBinaryFile bfile = parser.getBinary(path);
+				if (bfile instanceof IBinaryArchive) {
+					archive = (IBinaryArchive) bfile;
+				}
+			} catch (IOException e) {
+			}
+		}
+		return archive;
+	}
+
 }
Index: model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java,v
retrieving revision 1.6
diff -u -r1.6 ArchiveContainer.java
--- model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java	26 Feb 2003 21:01:28 -0000	1.6
+++ model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java	27 Mar 2003 16:00:16 -0000
@@ -5,72 +5,41 @@
  * All Rights Reserved.
  */
  
+import java.util.Map;
+
+import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.IArchive;
 import org.eclipse.cdt.core.model.IArchiveContainer;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
 
-public class ArchiveContainer extends Parent implements IArchiveContainer {
+public class ArchiveContainer extends Openable implements IArchiveContainer {
 
-	CProject cProject;
-	
 	public ArchiveContainer (CProject cProject) {
-		super (cProject, null, "lib", CElement.C_CONTAINER);
-		this.cProject = cProject;
-		IProject project = cProject.getProject();
-		IFolder folder = project.getFolder("Virtual.lib");
-		setUnderlyingResource(folder);
+		super (cProject, null, "libraries", CElement.C_VCONTAINER);
 	}
 
 	public IArchive[] getArchives() {
-		ICElement[] e = getChildren(true);
+		((ArchiveContainerInfo)getElementInfo()).sync();
+		ICElement[] e = getChildren();
 		IArchive[] a = new IArchive[e.length];
 		System.arraycopy(e, 0, a, 0, e.length);
 		return a;
 	}
 
-	public boolean hasChildren() {
-		return (getChildren(true).length > 0);
-	}
-
-	public ICElement [] getChildren() {
-		return getChildren(false);
-	}
-
-	public ICElement [] getChildren(boolean sync) {
-		if (!cProject.hasStartBinaryRunner()) {
-			// It is vital to set this to true first, if not we are going to loop
-			cProject.setStartBinaryRunner(true);
-			BinaryRunner runner = new BinaryRunner(cProject);
-			Thread thread = new Thread(runner, "Archive Runner");
-			// thread.setPriority(Thread.NORM_PRIORITY - 1);
-			thread.setDaemon(true);
-			thread.start();
-			if (sync) {
-				try {
-					thread.join();
-				} catch (InterruptedException e) {
-				}
-			}
-		}
-		return super.getChildren();
+	public CElementInfo createElementInfo() {
+		return new ArchiveContainerInfo(this);
 	}
 
-	void addChildIfLib(IFile file) {
-		CModelManager factory = CModelManager.getDefault();
-		if (factory.isArchive(file)) {
-			ICElement celement = factory.create(file);
-			if (celement != null) {
-				if (celement instanceof IArchive) {
-					addChild (celement);
-				}
-			}
-		}
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource)
+	 */
+	protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource)
+		throws CModelException {
+		// this will bootstrap/start the runner for the project.
+		CModelManager.getDefault().getBinaryRunner(getCProject());
+		return true;
 	}
 
-	public CElementInfo createElementInfo() {
-		return new CElementInfo(this);
-	}
 }
Index: model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java	27 Mar 2003 16:00:16 -0000
@@ -0,0 +1,27 @@
+package org.eclipse.cdt.internal.core.model;
+
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ */
+public class ArchiveContainerInfo extends OpenableInfo {
+
+	/**
+	 * Constructs a new C Model Info 
+	 */
+	protected ArchiveContainerInfo(CElement element) {
+		super(element);
+	}
+
+	synchronized void sync() {
+		BinaryRunner runner = CModelManager.getDefault().getBinaryRunner(getElement().getCProject());
+		if (runner != null) {
+			runner.waitIfRunning();
+		}
+	}
+
+}
Index: model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java,v
retrieving revision 1.5
diff -u -r1.5 ArchiveInfo.java
--- model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java	26 Feb 2003 21:38:34 -0000	1.5
+++ model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java	27 Mar 2003 16:00:17 -0000
@@ -5,25 +5,12 @@
  * All Rights Reserved.
  */
 
-import java.io.IOException;
-
-import org.eclipse.cdt.core.IBinaryParser;
-import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive;
-import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
-import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
 
 /** 
  * Info for ICProject.
  */
 
-class ArchiveInfo extends CFileInfo {
-
-	IBinaryArchive archive;
+class ArchiveInfo extends OpenableInfo {
 
 	/**
 	 */
@@ -31,58 +18,4 @@
 		super(element);
 	}
 
-	public ICElement[] getChildren() {
-		if (hasChanged()) {
-			removeChildren();
-			IResource res = null;
-			try {
-				res = getElement().getResource();
-			} catch (CModelException e) {
-			}
-			IBinaryArchive ar = getBinaryArchive();
-			IBinaryObject[] objects = ar.getObjects();
-			for (int i = 0; i < objects.length; i++) {
-				final IBinaryObject obj = objects[i];
-				Binary binary = new Binary(getElement(), res.getLocation().append(obj.getName())) {
-					public CElementInfo createElementInfo() {
-						return new BinaryInfo(this) {
-							/**
-							 * @see org.eclipse.cdt.internal.core.model.BinaryInfo#getBinaryObject()
-							 */
-							IBinaryObject getBinaryObject() {
-								return obj;
-							}
-						};
-					}
-				};
-				BinaryInfo info = (BinaryInfo)binary.getElementInfo();
-				info.loadChildren();
-				addChild(binary);
-			}
-		}
-		return super.getChildren();
-	}
-
-	public boolean isArchive() {
-		return true;
-	}
-
-	IBinaryArchive getBinaryArchive() {
-		if (archive == null) {
-			IProject project = getElement().getCProject().getProject();
-			IBinaryParser parser = CModelManager.getDefault().getBinaryParser(project);
-			if (parser != null) {
-				try {
-					IPath path = getElement().getUnderlyingResource().getLocation();
-					IBinaryFile bfile = parser.getBinary(path);
-					if (bfile instanceof IBinaryArchive) {
-						archive = (IBinaryArchive) bfile;
-					}
-				} catch (CModelException e) {
-				} catch (IOException e) {
-				}
-			}
-		}
-		return archive;
-	}
 }
Index: model/org/eclipse/cdt/internal/core/model/Binary.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java,v
retrieving revision 1.4
diff -u -r1.4 Binary.java
--- model/org/eclipse/cdt/internal/core/model/Binary.java	22 Nov 2002 16:32:19 -0000	1.4
+++ model/org/eclipse/cdt/internal/core/model/Binary.java	27 Mar 2003 16:00:17 -0000
@@ -5,28 +5,37 @@
  * All Rights Reserved.
  */
  
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.resources.IFile;
-
-import org.eclipse.cdt.core.model.ICElement;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.core.IBinaryParser;
+import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
+import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
+import org.eclipse.cdt.core.IBinaryParser.ISymbol;
+import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.IBinary;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
 
-public class Binary extends CFile implements IBinary {
+public class Binary extends Openable implements IBinary {
 
 	public Binary(ICElement parent, IFile file) {
-		super(parent, file);
+		this(parent, file.getLocation());
 	}
 
 	public Binary(ICElement parent, IPath path) {
-		super (parent, path);
+		super (parent, path, ICElement.C_BINARY);
 	}
 
 	public Binary(ICElement parent, IFile file, String name) {
-		super(parent, file, name);
-	}
-
-	public boolean isBinary() {
-		return true;
+		super(parent, file, name, ICElement.C_BINARY);
 	}
 
 	public boolean hasDebug () {
@@ -45,9 +54,6 @@
 		return ((BinaryInfo)getElementInfo()).isSharedLib();
 	}
 
-	/**
-	 * @see org.eclipse.cdt.core.model.IBinary#isCore()
-	 */
 	public boolean isCore() {
 		return ((BinaryInfo)getElementInfo()).isCore();
 	}
@@ -85,6 +91,152 @@
 
 	public CElementInfo createElementInfo() {
 		return new BinaryInfo(this);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource)
+	 */
+	protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource)
+		throws CModelException {
+		CModelManager.getDefault().putInfo(this, info);
+		return computeChildren(info, underlyingResource);
+	}
+
+
+	boolean computeChildren(OpenableInfo info, IResource res) {
+		IBinaryObject bin = getBinaryObject(res);
+		if (bin != null) {
+			Map hash = new HashMap();
+			ISymbol[] symbols = bin.getSymbols();
+			for (int i = 0; i < symbols.length; i++) {
+				switch (symbols[i].getType()) {
+					case ISymbol.FUNCTION :
+						addFunction(info, symbols[i], hash);
+					break;
+
+					case ISymbol.VARIABLE :
+						addVariable(info, symbols[i], hash);
+					break;
+				}
+			}
+			if (info instanceof BinaryInfo) {
+				((BinaryInfo)info).loadInfo(bin);
+			}
+		} else {
+			return false;
+		}
+		return true;
+	}
+
+	protected IBinaryObject getBinaryObject(IResource res) {
+		IBinaryObject binary = null;
+		IBinaryParser parser = null;
+		IProject project = null;
+		if (res != null) {
+			project = res.getProject();
+		}
+		if (project != null) {
+			parser = CModelManager.getDefault().getBinaryParser(project);
+		}
+		if (parser != null) {
+			try {
+				IPath path = res.getLocation();
+				IBinaryFile bfile = parser.getBinary(path);
+				if (bfile instanceof IBinaryObject) {
+					binary = (IBinaryObject) bfile;
+				}
+			} catch (IOException e) {
+			}
+		}
+		return binary;
+	}
+
+	private void addFunction(OpenableInfo info, ISymbol symbol, Map hash) {
+		ICElement parent = this;
+		String filename = filename = symbol.getFilename();
+		Function function = null;
+
+		// Addr2line returns the funny "??" when it can find the file.
+		if (filename != null && !filename.equals("??")) {
+			TranslationUnit tu = null;
+			IPath path = new Path(filename);
+			if (hash.containsKey(path)) {
+				tu = (TranslationUnit) hash.get(path);
+			} else {
+				// A special ITranslationUnit we do not want the file to be parse.
+				tu = new TranslationUnit(parent, path) {
+					ArrayList array = new ArrayList(5);
+					public void addChild(ICElement e) {
+						array.add(e);
+						array.trimToSize();
+					}
+						
+					public ICElement [] getChildren() {
+						return (ICElement[])array.toArray(new ICElement[0]);
+					}
+
+					protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm,
+						Map newElements, IResource underlyingResource) throws CModelException {
+							return true;
+					}
+				};
+				hash.put(path, tu);
+				info.addChild(tu);
+			}
+			function = new Function(tu, symbol.getName());
+			tu.addChild(function);
+		} else {
+			function = new Function(parent, symbol.getName());
+			info.addChild(function);
+		}
+		//		if (function != null) {
+		//			if (!external) {
+		//				function.getFunctionInfo().setAccessControl(IConstants.AccStatic);
+		//			}
+		//		}
+	}
+
+	private void addVariable(OpenableInfo info, ISymbol symbol, Map hash) {
+		String filename = filename = symbol.getFilename();
+		ICElement parent = this;
+		Variable variable = null;
+		// Addr2line returns the funny "??" when it can not find the file.
+		if (filename != null && !filename.equals("??")) {
+			TranslationUnit tu = null;
+			IPath path = new Path(filename);
+			if (hash.containsKey(path)) {
+				tu = (TranslationUnit) hash.get(path);
+			} else {
+				tu = new TranslationUnit(parent, path) {
+					ArrayList array = new ArrayList(5);
+					public void addChild(ICElement e) {
+						array.add(e);
+						array.trimToSize();
+					}
+						
+					public ICElement [] getChildren() {
+						return (ICElement[])array.toArray(new ICElement[0]);
+					}
+
+					protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm,
+						Map newElements, IResource underlyingResource) throws CModelException {
+							return true;
+					}
+				};
+				hash.put(path, tu);
+				info.addChild(tu);
+			}
+			variable = new Variable(tu, symbol.getName());
+			tu.addChild(variable);
+		} else {
+			variable = new Variable(parent, symbol.getName());
+			info.addChild(variable);
+		}
+		//if (variable != null) {
+		//	if (!external) {
+		//		variable.getVariableInfo().setAccessControl(IConstants.AccStatic);
+		//	}
+		//}
 	}
 
 }
Index: model/org/eclipse/cdt/internal/core/model/BinaryContainer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java,v
retrieving revision 1.6
diff -u -r1.6 BinaryContainer.java
--- model/org/eclipse/cdt/internal/core/model/BinaryContainer.java	26 Feb 2003 21:01:28 -0000	1.6
+++ model/org/eclipse/cdt/internal/core/model/BinaryContainer.java	27 Mar 2003 16:00:17 -0000
@@ -5,101 +5,41 @@
  * All Rights Reserved.
  */
  
-import org.eclipse.cdt.core.model.CoreModel;
+import java.util.Map;
+
+import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.IBinary;
 import org.eclipse.cdt.core.model.IBinaryContainer;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.CoreException;
-
-public class BinaryContainer extends Parent implements IBinaryContainer {
+import org.eclipse.core.runtime.IProgressMonitor;
 
-	CProject cProject;
+public class BinaryContainer extends Openable implements IBinaryContainer {
 
 	public BinaryContainer (CProject cProject) {
-		this (cProject, "bin");
-	}
-
-	public BinaryContainer (CProject cProject, String name) {
-		super (cProject, null, name, CElement.C_CONTAINER);
-		this.cProject = cProject;
-		IProject project = cProject.getProject();
-		IFolder folder = project.getFolder("Virtual.bin");
-		setUnderlyingResource(folder);
+		super (cProject, null, "binaries", CElement.C_VCONTAINER);
 	}
 
 	public IBinary[] getBinaries() {
-		ICElement[] e = getChildren(true);
+		((BinaryContainerInfo)getElementInfo()).sync();
+		ICElement[] e = getChildren();
 		IBinary[] b = new IBinary[e.length];
 		System.arraycopy(e, 0, b, 0, e.length);
 		return b;
 	}
 
-	public boolean hasChildren() {
-		return (getChildren(true).length > 0);
-	}
-
-	public ICElement [] getChildren() {
-		return getChildren(false);
-	}
-
-	public ICElement [] getChildren(boolean sync) {
-		// The first time probe the entire project to discover binaries.
-		if (!cProject.hasStartBinaryRunner()) {
-			cProject.setStartBinaryRunner(true);
-			BinaryRunner runner = new BinaryRunner(cProject);
-			Thread thread = new Thread(runner, "Binary Runner");
-			// thread.setPriority(Thread.NORM_PRIORITY - 1);
-			thread.setDaemon(true);
-			thread.start();
-			if (sync) {
-				try {
-					thread.join();
-				} catch (InterruptedException e) {
-				}
-			}
-		}
-		return super.getChildren();
-	}
-
-	void addChildIfExec(CoreModel factory, IFile file) {
-		// Attempt to speed things up by rejecting up front
-		// Things we know should not be Binary files.
-		if (!factory.isTranslationUnit(file)) {
-			ICElement celement = factory.create(file);
-			if (celement != null) {
-				if (celement instanceof IBinary) {
-					IBinary bin = (IBinary)celement;
-					if (bin.isExecutable() || bin.isSharedLib()) {
-						addChild (bin);
-					}
-				}
-			}
-		}
-	}
-
 	public CElementInfo createElementInfo() {
-		return new CElementInfo(this);
+		return new BinaryContainerInfo(this);
 	}
 
-	class Visitor implements IResourceVisitor {
-		CoreModel factory = CoreModel.getDefault();
-		BinaryContainer cbin;
-
-		public Visitor (BinaryContainer element) {
-			cbin = element;
-		}
-
-		public boolean visit(IResource res) throws CoreException {
-			if (res instanceof IFile) {
-				cbin.addChildIfExec(factory, (IFile)res);
-				return false;
-			}
-			return true;
-		}
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource)
+	 */
+	protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource)
+		throws CModelException {
+		// this will bootstrap/start the runner for the project.
+		CModelManager.getDefault().getBinaryRunner(getCProject());
+		return true;
 	}
+
 }
Index: model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java	27 Mar 2003 16:00:17 -0000
@@ -0,0 +1,27 @@
+package org.eclipse.cdt.internal.core.model;
+
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ */
+public class BinaryContainerInfo extends OpenableInfo {
+
+	/**
+	 * Constructs a new C Model Info 
+	 */
+	protected BinaryContainerInfo(CElement element) {
+		super(element);
+	}
+
+	synchronized void sync() {
+		BinaryRunner runner = CModelManager.getDefault().getBinaryRunner(getElement().getCProject());
+		if (runner != null) {
+			runner.waitIfRunning();
+		}
+	}
+
+}
Index: model/org/eclipse/cdt/internal/core/model/BinaryInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryInfo.java,v
retrieving revision 1.7
diff -u -r1.7 BinaryInfo.java
--- model/org/eclipse/cdt/internal/core/model/BinaryInfo.java	26 Feb 2003 21:38:34 -0000	1.7
+++ model/org/eclipse/cdt/internal/core/model/BinaryInfo.java	27 Mar 2003 16:00:17 -0000
@@ -6,245 +6,120 @@
  */
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
 
 import org.eclipse.cdt.core.IBinaryParser;
 import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable;
 import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
 import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
 import org.eclipse.cdt.core.IBinaryParser.IBinaryShared;
-import org.eclipse.cdt.core.IBinaryParser.ISymbol;
 import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
 
-class BinaryInfo extends CFileInfo {
+class BinaryInfo extends OpenableInfo {
 
-	IBinaryObject binary;
-	Map hash;
+	int type;
+	boolean debug;
+	String cpu =  "";
+	String shared[] = new String[0];
+	long text;
+	long data;
+	long bss;
+	String soname = "";
+	boolean littleE;
 
 	public BinaryInfo(CElement element) {
 		super(element);
 	}
 
-	public boolean isBinary() {
-		return true;
-	}
-
-	public ICElement[] getChildren() {
-		if (hasChanged()) {
-			loadChildren();
-		}
-		return super.getChildren();
-	}
-
 	public String getCPU() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getCPU();
-		}
-		return "";
+		return cpu;
 	}
 
 	public boolean isSharedLib() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getType() == IBinaryObject.SHARED;
-		}
-		return false;
+		return type == IBinaryObject.SHARED;
 	}
 
 	public boolean isExecutable() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getType() == IBinaryObject.EXECUTABLE;
-		}
-		return false;
+		return type == IBinaryObject.EXECUTABLE;
 	}
 
 	public boolean isObject() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getType() == IBinaryObject.OBJECT;
-		}
-		return false;
+		return type == IBinaryObject.OBJECT;
 	}
 
 	public boolean isCore() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getType() == IBinaryObject.CORE;
-		}
-		return false;
+		return type == IBinaryObject.CORE;
 	}
 
 	public boolean hasDebug() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.hasDebug();
-		}
-		return false;
+		return debug;
 	}
 
 	public String[] getNeededSharedLibs() {
-		if (isExecutable()) {
-			IBinaryExecutable exec = (IBinaryExecutable) getBinaryObject();
-			return exec.getNeededSharedLibs();
-		}
-		return new String[0];
+		return shared;
 	}
 
 	public long getText() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getText();
-		}
-		return 0;
+		return text;
 	}
 
 	public long getData() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getData();
-		}
-		return 0;
+		return data;
 	}
 
 	public long getBSS() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.getBSS();
-		}
-		return 0;
+		return bss;
 	}
 
 	public String getSoname() {
-		if (isSharedLib()) {
-			IBinaryShared shared = (IBinaryShared) getBinaryObject();
-			return shared.getSoName();
-		}
-		return "";
+		return soname;
 	}
 
 	public boolean isLittleEndian() {
-		IBinaryObject bin = getBinaryObject();
-		if (bin != null) {
-			return bin.isLittleEndian();
-		}
-		return false;
-	}
-	
-	void loadChildren() {
-		if (hash == null) {
-			hash = new HashMap();
-		}
-		hash.clear();
-		removeChildren();
-		setIsStructureKnown(true);
-		IBinaryObject bin = getBinaryObject();
-		ISymbol[] symbols = bin.getSymbols();
-		for (int i = 0; i < symbols.length; i++) {
-			switch (symbols[i].getType()) {
-				case ISymbol.FUNCTION :
-					addFunction(symbols[i]);
-				break;
-
-				case ISymbol.VARIABLE :
-					addVariable(symbols[i]);
-				break;
-			}
-		}
+		return littleE;
 	}
 
-	IBinaryObject getBinaryObject() {
-		if (binary == null) {
-			IProject project = getElement().getCProject().getProject();
-			IBinaryParser parser = CModelManager.getDefault().getBinaryParser(project);
-			if (parser != null) {
-				try {
-					IPath path = getElement().getUnderlyingResource().getLocation();
-					IBinaryFile bfile = parser.getBinary(path);
-					if (bfile instanceof IBinaryObject) {
-						binary = (IBinaryObject) bfile;
-					}
-				} catch (CModelException e) {
-				} catch (IOException e) {
-				}
-			}
-		}
-		return binary;
+	protected void loadInfo() {
+		loadInfo(getBinaryObject());
 	}
 
-	private void addFunction(ISymbol symbol) {
-		ICElement parent = getElement();
-		String filename = filename = symbol.getFilename();
-		Function function = null;
-
-		// Addr2line returns the funny "??" when it can find the file.
-		if (filename != null && !filename.equals("??")) {
-			TranslationUnit tu = null;
-			IPath path = new Path(filename);
-			if (hash.containsKey(path)) {
-				tu = (TranslationUnit) hash.get(path);
-			} else {
-				// A special ITranslationUnit we do not want the file to be parse.
-				tu = new TranslationUnit(parent, path) {
-					ArrayList array = new ArrayList(5);
-					public void addChild(ICElement e) {
-						array.add(e);
-						array.trimToSize();
-					}
-						
-					public ICElement [] getChildren() {
-						return (ICElement[])array.toArray(new ICElement[0]);
-					}
-				};
-				hash.put(path, tu);
-				addChild(tu);
+	protected void loadInfo(IBinaryObject bin) {
+		if (bin != null) {
+			type = bin.getType();
+			cpu =  bin.getCPU();
+			debug = bin.hasDebug();
+			if (isExecutable()) {
+				IBinaryExecutable exec = (IBinaryExecutable) bin;
+				shared = exec.getNeededSharedLibs();
 			}
-			function = new Function(tu, symbol.getName());
-			tu.addChild(function);
-		} else {
-			function = new Function(parent, symbol.getName());
-			addChild(function);
+			text = bin.getText();
+			data = bin.getData();
+			bss = bin.getBSS();
+			if (isSharedLib()) {
+				IBinaryShared shared = (IBinaryShared) bin;
+				soname = shared.getSoName();
+			}
+			littleE = bin.isLittleEndian();
 		}
-		//		if (function != null) {
-		//			if (!external) {
-		//				function.getFunctionInfo().setAccessControl(IConstants.AccStatic);
-		//			}
-		//		}
-	}
-
-	private void addVariable(ISymbol symbol) {
-		String filename = filename = symbol.getFilename();
-		ICElement parent = getElement();
-		Variable variable = null;
-		// Addr2line returns the funny "??" when it can not find the file.
-		if (filename != null && !filename.equals("??")) {
-			TranslationUnit tu = null;
-			IPath path = new Path(filename);
-			if (hash.containsKey(path)) {
-				tu = (TranslationUnit) hash.get(path);
-			} else {
-				tu = new TranslationUnit(parent, path);
-				hash.put(path, tu);
-				addChild(tu);
+	}
+	
+	private IBinaryObject getBinaryObject() {
+		IBinaryObject binary = null;
+		IProject project = getElement().getCProject().getProject();
+		IBinaryParser parser = CModelManager.getDefault().getBinaryParser(project);
+		if (parser != null) {
+			try {
+				IPath path = getElement().getUnderlyingResource().getLocation();
+				IBinaryFile bfile = parser.getBinary(path);
+				if (bfile instanceof IBinaryObject) {
+					binary = (IBinaryObject) bfile;
+				}
+			} catch (CModelException e) {
+			} catch (IOException e) {
 			}
-			variable = new Variable(tu, symbol.getName());
-			tu.addChild(variable);
-		} else {
-			variable = new Variable(parent, symbol.getName());
-			addChild(variable);
 		}
-		//if (variable != null) {
-		//	if (!external) {
-		//		variable.getVariableInfo().setAccessControl(IConstants.AccStatic);
-		//	}
-		//}
+		return binary;
 	}
 
 }
Index: model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java,v
retrieving revision 1.1
diff -u -r1.1 BinaryRunner.java
--- model/org/eclipse/cdt/internal/core/model/BinaryRunner.java	18 Nov 2002 15:45:46 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/BinaryRunner.java	27 Mar 2003 16:00:18 -0000
@@ -5,39 +5,59 @@
  * All Rights Reserved.
  */
 
+import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICModel;
+import org.eclipse.cdt.core.model.ICProject;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IResourceVisitor;
 import org.eclipse.core.runtime.CoreException;
 
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.IArchive;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICRoot;
-
-public class BinaryRunner implements Runnable {
+public class BinaryRunner extends Thread {
 	ArchiveContainer clib;
 	BinaryContainer cbin;
-	CProject cproject;
+	ICProject cproject;
+	CModelManager factory;
 
-	public BinaryRunner(CProject cprj) {
+	public BinaryRunner(ICProject cprj) {
+		super("Binary Search Thread");
 		cproject = cprj;
 		cbin = (BinaryContainer)cprj.getBinaryContainer();
 		clib = (ArchiveContainer)cprj.getArchiveContainer();
+		factory = CModelManager.getDefault();
+		start();
 	}
 
 	public void run() {
-		cproject.setStartBinaryRunner(true);
 		clib.removeChildren();
 		cbin.removeChildren();
 		try {
 			cproject.getProject().accept(new Visitor(this));
 		} catch (CoreException e) {
 			//e.printStackTrace();
+		} catch (Exception e) {
+			// What is wrong ?
+			e.printStackTrace();
 		}
 		fireEvents(cbin);
 		fireEvents(clib);
+		// Tell the listeners we are done.
+		synchronized(this) {
+			notifyAll();
+		}
+	}
+
+	/**
+	 * wrap the wait call and the interrupteException.
+	 */
+	public synchronized void waitIfRunning() {
+		while (isAlive()) {
+			try {
+				wait();
+			} catch (InterruptedException e) {
+			}
+		}
 	}
 
 	public void fireEvents(Parent container) {
@@ -45,7 +65,7 @@
 		ICElement[] children = container.getChildren();
 		if (children.length > 0) {
 			CModelManager factory = CModelManager.getDefault();
-			ICElement root = (ICRoot)factory.getCRoot();
+			ICElement root = (ICModel)factory.getCModel();
 			CElementDelta cdelta = new CElementDelta(root);
 			cdelta.added(cproject);
 			cdelta.added(container);
@@ -57,31 +77,21 @@
 		}
 	}
 
-	void addChildIfBinary(CoreModel factory, IFile file) {
+	void addChildIfBinary(IFile file) {
 		// Attempt to speed things up by rejecting up front
 		// Things we know should not be Binary files.
 		if (!factory.isTranslationUnit(file)) {
-			if (factory.isBinary(file)) {
-				ICElement celement = factory.create(file);
-				if (celement != null) {
-					if (celement instanceof IBinary) {
-						IBinary bin = (IBinary)celement;
-						if (bin.isExecutable() || bin.isSharedLib()) {
-							cbin.addChild(bin);
-						}
-					}
-				}
-			} else if (factory.isArchive(file)) {
-				ICElement celement = factory.create(file);
-				if (celement instanceof IArchive) {
-					clib.addChild(celement);
-				}
+			IBinaryFile bin = factory.createBinaryFile(file);
+			if (bin != null) {
+				IResource res = file.getParent();
+				ICElement parent = factory.create(res);
+				// By creating the element, it will be added to the correct (bin/archive)container.
+				factory.create(parent, file, bin);
 			}
 		}
 	}
 
 	class Visitor implements IResourceVisitor {
-		CoreModel factory = CoreModel.getDefault();
 		BinaryRunner runner;
 
 		public Visitor (BinaryRunner r) {
@@ -90,7 +100,7 @@
 
 		public boolean visit(IResource res) throws CoreException {
 			if (res instanceof IFile) {
-				runner.addChildIfBinary(factory, (IFile)res);
+				runner.addChildIfBinary((IFile)res);
 				return false;
 			}
 			return true;
Index: model/org/eclipse/cdt/internal/core/model/Buffer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java,v
retrieving revision 1.1
diff -u -r1.1 Buffer.java
--- model/org/eclipse/cdt/internal/core/model/Buffer.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/Buffer.java	27 Mar 2003 16:00:19 -0000
@@ -14,8 +14,9 @@
 import java.io.ByteArrayInputStream;
 import java.util.ArrayList;
 
+import org.eclipse.cdt.core.model.*;
 import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICOpenable;
+import org.eclipse.cdt.core.model.IOpenable;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
@@ -32,7 +33,7 @@
 	protected int flags;
 	protected char[] contents;
 	protected ArrayList changeListeners;
-	protected ICOpenable owner;
+	protected IOpenable owner;
 	protected int gapStart= -1;
 	protected int gapEnd= -1;
 
@@ -44,7 +45,7 @@
 	/**
 	 * Creates a new buffer on an underlying resource.
 	 */
-	protected Buffer(IFile file, ICOpenable owner, boolean readOnly) {
+	protected Buffer(IFile file, IOpenable owner, boolean readOnly) {
 		this.file = file;
 		this.owner = owner;
 		if (file == null) {
@@ -157,7 +158,7 @@
 	/**
 	 * @see org.eclipse.cdt.internal.core.model.IBuffer#getOwner()
 	 */
-	public ICOpenable getOwner() {
+	public IOpenable getOwner() {
 		return this.owner;
 	}
 
Index: model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java
diff -N model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java
--- model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java	19 Mar 2003 20:19:36 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,111 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-/**********************************************************************
- * 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.util.EventObject;
-
-/**
- * A   buffer changed event describes how a buffer has changed. These events are
- * used in <code>IBufferChangedListener</code> notifications.
- * <p>
- * For text insertions, <code>getOffset</code> is the offset
- * of the first inserted character, <code>getText</code> is the
- * inserted text, and <code>getLength</code> is 0.
- * </p>
- * <p>
- * For text removals, <code>getOffset</code> is the offset
- * of the first removed character, <code>getText</code> is <code>null</code>,
- * and <code>getLength</code> is the length of the text that was removed.
- * </p>
- * <p>
- * For replacements (including <code>IBuffer.setContents</code>), 
- * <code>getOffset</code> is the offset
- * of the first replaced character, <code>getText</code> is the replacement
- * text, and <code>getLength</code> is the length of the original text
- * that was replaced.
- * </p>
- * <p>
- * When a buffer is closed, <code>getOffset</code> is 0, <code>getLength</code>
- * is 0, and <code>getText</code> is <code>null</code>.
- * </p>
- * <p>
- * This class is not intended to be instantiated or subclassed by clients.
- * Instances of this class are automatically created by the C model.
- * </p>
- *
- * @see IBuffer
- * This class is similar to the JDT BufferChangedEvent class. 
- */
-
-public class BufferChangedEvent extends EventObject {
-	/**
-	 * The length of text that has been modified in the buffer.
-	 */
-	private int length;
-
-	/**
-	 * The offset into the buffer where the modification took place.
-	 */
-	private int offset;
-
-	/**
-	 * The text that was modified.
-	 */
-	private String text;
-
-	/**
-	 * Creates a new buffer changed event indicating that the given buffer has changed.
-	 */
-	public BufferChangedEvent(IBuffer buffer, int offset, int length, String text) {
-		super(buffer);
-		this.offset = offset;
-		this.length = length;
-		this.text = text;
-	}
-	/**
-	 * Returns the buffer which has changed.
-	 *
-	 * @return the buffer affected by the change
-	 */
-	public IBuffer getBuffer() {
-		return (IBuffer) source;
-	}
-	/**
-	 * Returns the length of text removed or replaced in the buffer, or
-	 * 0 if text has been inserted into the buffer.
-	 *
-	 * @return the length of the original text fragment modified by the 
-	 *   buffer change (<code> 0 </code> in case of insertion).
-	 */
-	public int getLength() {
-		return this.length;
-	}
-	/**
-	 * Returns the index of the first character inserted, removed, or replaced
-	 * in the buffer.
-	 *
-	 * @return the source offset of the textual manipulation in the buffer
-	 */
-	public int getOffset() {
-		return this.offset;
-	}
-	/**
-	 * Returns the text that was inserted, the replacement text,
-	 * or <code>null</code> if text has been removed.
-	 *
-	 * @return the text corresponding to the buffer change (<code> null </code>
-	 *   in case of deletion).
-	 */
-	public String getText() {
-		return this.text;
-	}
-
-}
Index: model/org/eclipse/cdt/internal/core/model/BufferManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java,v
retrieving revision 1.1
diff -u -r1.1 BufferManager.java
--- model/org/eclipse/cdt/internal/core/model/BufferManager.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/BufferManager.java	27 Mar 2003 16:00:19 -0000
@@ -13,9 +13,10 @@
 
 import java.util.Enumeration;
 
+import org.eclipse.cdt.core.model.*;
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICOpenable;
+import org.eclipse.cdt.core.model.IOpenable;
 import org.eclipse.cdt.internal.core.util.LRUCache;
 import org.eclipse.cdt.internal.core.util.OverflowingLRUCache;
 import org.eclipse.core.resources.IFile;
@@ -92,7 +93,7 @@
 	/**
 	 * @see org.eclipse.cdt.internal.core.model.IBufferFactory#createBuffer(org.eclipse.cdt.core.model.IOpenable)
 	 */
-	public IBuffer createBuffer(ICOpenable owner) {
+	public IBuffer createBuffer(IOpenable owner) {
 		ICElement element = (ICElement)owner;
 		try{
 			IResource resource = element.getResource();
@@ -112,7 +113,7 @@
 	 * or <code>null</code> if the owner does not have an open
 	 * buffer associated with it.
 	 */
-	public IBuffer getBuffer(ICOpenable owner) {
+	public IBuffer getBuffer(IOpenable owner) {
 		return (IBuffer)openBuffers.get(owner);
 	}
 	/**
Index: model/org/eclipse/cdt/internal/core/model/CContainer.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CContainer.java
diff -N model/org/eclipse/cdt/internal/core/model/CContainer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/CContainer.java	27 Mar 2003 16:00:20 -0000
@@ -0,0 +1,149 @@
+package org.eclipse.cdt.internal.core.model;
+
+/*
+ * (c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ */
+ 
+import java.util.ArrayList;
+import java.util.Map;
+
+import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.IArchive;
+import org.eclipse.cdt.core.model.IBinary;
+import org.eclipse.cdt.core.model.ICContainer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public class CContainer extends Openable implements ICContainer {
+
+	public CContainer (ICElement parent, IResource res) {
+		this (parent, res, ICElement.C_CCONTAINER);
+	}
+
+	public CContainer (ICElement parent, IResource res, int type) {
+		super (parent, res, type);
+	}
+
+	/**
+	 * Returns a the collection of binary files in this ccontainer
+	 *
+	 * @see ICContainer#getBinaries()
+	 */
+	public IBinary[] getBinaries() throws CModelException {
+		ArrayList list = getChildrenOfType(C_BINARY);
+		IBinary[] array = new IBinary[list.size()];
+		list.toArray(array);
+		return array;
+	}
+
+	/**
+	 * Returns a the collection of archive files in this ccontainer
+	 *
+	 * @see ICContainer#getArchives()
+	 */
+	public IArchive[] getArchives() throws CModelException {
+		ArrayList list = getChildrenOfType(C_ARCHIVE);
+		IArchive[] array = new IArchive[list.size()];
+		list.toArray(array);
+		return array;
+	}
+
+	/**
+	 * @see ICContainer#getTranslationUnits()
+	 */
+	public ITranslationUnit[] getTranslationUnit() throws CModelException {
+		ArrayList list = getChildrenOfType(C_UNIT);
+		ITranslationUnit[] array = new ITranslationUnit[list.size()];
+		list.toArray(array);
+		return array;
+	}
+
+	protected CElementInfo createElementInfo () {
+		return new CContainerInfo(this);
+	}
+	
+	// CHECKPOINT: folders will return the hash code of their path
+	public int hashCode() {
+		return getPath().hashCode();
+	}
+
+	/**
+	 * @see Openable
+	 */
+	protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm,
+		Map newElements, IResource underlyingResource) throws CModelException {
+
+		boolean validInfo = false;
+		try {
+			IResource res = getResource();
+			if (res != null && (res instanceof IWorkspaceRoot || res.getProject().isOpen())) {
+				// put the info now, because computing the roots requires it
+				CModelManager.getDefault().putInfo(this, info);
+				validInfo = computeChildren(info, res);
+			}
+		} finally {
+			if (!validInfo) {
+				CModelManager.getDefault().removeInfo(this);
+			}
+		}
+		return validInfo;
+	}
+
+	/* (non-Javadoc)
+	 * Returns an array of non-c resources contained in the receiver.
+	 * @see org.eclipse.cdt.core.model.ICContainer#getNonCResources()
+	 */
+	public Object[] getNonCResources() throws CModelException {
+		return ((CContainerInfo)getElementInfo()).getNonCResources(getResource());
+	}
+
+	protected  boolean computeChildren(OpenableInfo info, IResource res) {
+		ArrayList vChildren = new ArrayList();
+		ArrayList notChildren = new ArrayList();
+		try {
+			IResource[] resources = null;
+			if (res != null) {
+				//System.out.println ("  Resource: " + res.getFullPath().toOSString());
+				switch(res.getType()) {
+					case IResource.ROOT:
+					case IResource.PROJECT:
+					case IResource.FOLDER:
+						IContainer container = (IContainer)res;
+						resources = container.members(false);
+						break;
+
+					case IResource.FILE:
+						break;
+				}
+			}
+
+			if (resources != null) {
+				CModelManager factory = CModelManager.getDefault();
+				for (int i = 0; i < resources.length; i++) {
+					// Check for Valid C Element only.
+					ICElement celement  = factory.create(this, resources[i]);
+					if (celement != null) {
+						vChildren.add(celement);
+					} else {
+						notChildren.add(resources[i]);
+					}
+				}
+			}
+		} catch (CoreException e) {
+			//System.out.println (e);
+			//CPlugin.log (e);
+			e.printStackTrace();
+		}
+		ICElement[] children = new ICElement[vChildren.size()];
+		vChildren.toArray(children);
+		info.setChildren(children);
+		((CContainerInfo)getElementInfo()).setNonCResources(notChildren.toArray());
+		return true;
+	}
+}
Index: model/org/eclipse/cdt/internal/core/model/CContainerInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CContainerInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/CContainerInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/CContainerInfo.java	27 Mar 2003 16:00:20 -0000
@@ -0,0 +1,85 @@
+package org.eclipse.cdt.internal.core.model;
+
+import java.util.ArrayList;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ */
+public class CContainerInfo extends OpenableInfo {
+
+	/**
+	 * Shared empty collection used for efficiency.
+	 */
+	static Object[] NO_NON_C_RESOURCES = new Object[] {};
+
+	Object[] nonCResources = null;
+
+	/**
+	 * Constructs a new C Model Info 
+	 */
+	protected CContainerInfo(CElement element) {
+		super(element);
+	}
+
+	/**
+	 * @param container
+	 * @return
+	 */
+	public Object[] getNonCResources(IResource res) {
+		if (nonCResources != null)
+			return nonCResources;
+
+		ArrayList notChildren = new ArrayList();
+		ICElement parent = getElement();
+		try {
+			IResource[] resources = null;
+			if (res != null) {
+				switch(res.getType()) {
+					case IResource.ROOT:
+					case IResource.PROJECT:
+					case IResource.FOLDER:
+						IContainer container = (IContainer)res;
+						resources = container.members(false);
+						break;
+
+					case IResource.FILE:
+						break;
+				}
+			}
+
+			if (resources != null) {
+				CModelManager factory = CModelManager.getDefault();
+				for (int i = 0; i < resources.length; i++) {
+					// Check for Valid C projects only.
+					ICElement celement = factory.create(parent, resources[i]);
+					if (celement == null) {
+						notChildren.add(resources[i]);
+					}
+				}
+			}
+		} catch (CoreException e) {
+			//System.out.println (e);
+			//CPlugin.log (e);
+			e.printStackTrace();
+		}
+		setNonCResources(notChildren.toArray());	
+		return nonCResources;
+	}
+
+	/**
+	 * @param container
+	 * @return
+	 */
+	public void setNonCResources(Object[] resources) {
+		nonCResources = resources;
+	}
+}
Index: model/org/eclipse/cdt/internal/core/model/CElement.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java,v
retrieving revision 1.5
diff -u -r1.5 CElement.java
--- model/org/eclipse/cdt/internal/core/model/CElement.java	20 Mar 2003 16:43:16 -0000	1.5
+++ model/org/eclipse/cdt/internal/core/model/CElement.java	27 Mar 2003 16:00:20 -0000
@@ -7,9 +7,9 @@
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;
-import org.eclipse.cdt.core.model.ICOpenable;
+import org.eclipse.cdt.core.model.IOpenable;
 import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ICRoot;
+import org.eclipse.cdt.core.model.ICModel;
 import org.eclipse.cdt.core.model.IParent;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IPath;
@@ -102,12 +102,20 @@
 		return getElementInfo().isStructureKnown();
 	}
 
-	public ICRoot getCRoot () {
-		return getParent().getCRoot();
+	public ICModel getCModel () {
+		ICElement current = this;
+		do {
+			if (current instanceof ICModel) return (ICModel) current;
+		} while ((current = current.getParent()) != null);
+		return null;
 	}
 
 	public ICProject getCProject() {
-		return getParent().getCProject();
+		ICElement current = this;
+		do {
+			if (current instanceof ICProject) return (ICProject) current;
+		} while ((current = current.getParent()) != null);
+		return null;
 	}
 
 	protected void addChild(ICElement e) {
@@ -160,28 +168,6 @@
 	protected abstract CElementInfo createElementInfo();
 
 	/**
-	 * Finds a member corresponding to a give element.
-	 */     
-	//public ICElement findEqualMember(ICElement elem) {
-	//	if (this instanceof IParent) {
-	//		ICElement[] members = ((IParent)this).getChildren();
-	//		if (members != null) {          
-	//			for (int i= members.length - 1; i >= 0; i--) {
-	//			ICElement curr= members[i];
-	//			if (curr.equals(elem)) {
-	//				return curr;
-	//			} else {
-	//				ICElement res= curr.findEqualMember(elem);
-	//				if (res != null) {
-	//					return res;
-	//				}
-	//			}
-	//		}
-	//	}
-	//	return null;
-	//}
-
-	/**
 	 * Tests if an element has the same name, type and an equal parent.
 	 */
 	public boolean equals (Object o) {
@@ -189,15 +175,6 @@
 			return true;
 		if (o instanceof CElement) {
 			CElement other = (CElement) o;
-			try {
-				IResource tres = getResource();
-				IResource ores = other.getResource();
-				if (ores != null && tres != null) {
-					return tres.equals(ores);
-				}
-			} catch (CModelException e) {
-				//e.printStackTrace();
-			}
 			if (fType != other.fType)
 				return false;
 			if (other.fName != null && fName.equals(other.fName)) {
@@ -241,14 +218,14 @@
 	// util
 	public static String getTypeString(int type) {
 		switch (type) {
-			case C_ROOT:
-				return "CROOT"; 
+			case C_MODEL:
+				return "CMODEL"; 
 			case C_PROJECT:
 				return "CPROJECT"; 
-			case C_FOLDER:
-				return "CFOLDER"; 
-			case C_FILE:
-				return "CFILE"; 
+			case C_CCONTAINER:
+				return "CCONTAINER";
+			case C_UNIT:
+				return "TRANSLATION_UNIT"; 
 			case C_FUNCTION:
 				return "C_FUNCTION"; 
 			case C_FUNCTION_DECLARATION:
@@ -319,9 +296,9 @@
 	 *
 	 * <p>Subclasses that are not IOpenable's must override this method.
 	 */
-	public ICOpenable getOpenableParent() {
+	public IOpenable getOpenableParent() {
 		
-		return (ICOpenable)fParent;
+		return (IOpenable)fParent;
 	}
 
 
@@ -331,17 +308,18 @@
 	 * @exception CModelException this element is not present or accessible
 	 */
 	protected void openHierarchy() throws CModelException {
-		if (this instanceof ICOpenable) {
-			((CResource) this).openWhenClosed(null);
+		if (this instanceof IOpenable) {
+			((Openable) this).openWhenClosed(null);
 		} else {
-			CResource openableParent = (CResource)getOpenableParent();
+			Openable openableParent = (Openable)getOpenableParent();
 			if (openableParent != null) {
 				CElementInfo openableParentInfo = (CElementInfo) CModelManager.getDefault().getInfo((ICElement) openableParent);
 				if (openableParentInfo == null) {
 					openableParent.openWhenClosed(null);
-				} else {
+				} 
+				//else {
 					CModelManager.getDefault().putInfo( this, createElementInfo());
-				}
+				//}
 			}
 		}
 	}	
Index: model/org/eclipse/cdt/internal/core/model/CElementDelta.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java,v
retrieving revision 1.4
diff -u -r1.4 CElementDelta.java
--- model/org/eclipse/cdt/internal/core/model/CElementDelta.java	27 Nov 2002 04:45:27 -0000	1.4
+++ model/org/eclipse/cdt/internal/core/model/CElementDelta.java	27 Mar 2003 16:00:22 -0000
@@ -6,11 +6,8 @@
  */
 import java.util.ArrayList;
 
-import org.eclipse.cdt.core.model.IArchive;
-import org.eclipse.cdt.core.model.IBinary;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICElementDelta;
-import org.eclipse.cdt.core.model.ICResource;
 import org.eclipse.core.resources.IResourceDelta;
 
 
@@ -101,7 +98,7 @@
 
 		// if a child delta is added to a translation unit delta or below, 
 		// it's a fine grained delta
-		if (!(fChangedElement instanceof ICResource)) {
+		if (!(fChangedElement.getElementType() >= ICElement.C_UNIT)) {
 			fineGrained();
 		}
 	
@@ -203,18 +200,6 @@
 		CElementDelta addedDelta = new CElementDelta(element);
 		addedDelta.fKind = ADDED;
 		insertDeltaTree(element, addedDelta);
-		// Added also to the Containers
-		if (element instanceof IArchive) {
-			CProject cproj = (CProject)element.getCProject();
-			ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer();
-			container.addChild(element);
-		} else if (element instanceof IBinary) {
-			if (((IBinary)element).isExecutable() ||((IBinary)element).isSharedLib()) {
-				CProject cproj = (CProject)element.getCProject();
-				BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer();
-				container.addChild(element);
-			}
-		}
 	}
 
 	/**
Index: model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java,v
retrieving revision 1.2
diff -u -r1.2 CElementDeltaBuilder.java
--- model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java	20 Mar 2003 16:43:28 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java	27 Mar 2003 16:00:23 -0000
@@ -10,19 +10,6 @@
  * Rational Software - Initial API and implementation
 ***********************************************************************/
 
-import org.eclipse.cdt.core.model.ICElement;
-
-/**
- * A C element delta biulder creates a C element delta on a C element between
- * the version of the C element at the time the comparator was created and the
- * current version of the C element.
- *
- * It performs this operation by locally caching the contents of 
- * the C element when it is created. When the method buildDeltas() is called, it
- * creates a delta over the cached contents and the new contents.
- * 
- * This class is similar to the JDT CElementDeltaBuilder class.
- */
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -252,7 +239,7 @@
 	
 	// if building a delta on a translation unit or below, 
 	// it's a fine grained delta
-	if (cElement.getElementType() >= ICElement.C_FILE) {
+	if (cElement.getElementType() >= ICElement.C_UNIT) {
 		this.delta.fineGrained();
 	}
 	
Index: model/org/eclipse/cdt/internal/core/model/CElementInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java,v
retrieving revision 1.3
diff -u -r1.3 CElementInfo.java
--- model/org/eclipse/cdt/internal/core/model/CElementInfo.java	19 Mar 2003 20:19:36 -0000	1.3
+++ model/org/eclipse/cdt/internal/core/model/CElementInfo.java	27 Mar 2003 16:00:23 -0000
@@ -31,6 +31,7 @@
 	 * Shared empty collection used for efficiency.
 	 */
 	protected static ICElement[] fgEmptyChildren = new ICElement[]{};
+
 	/**
 	 * Is the structure of this element known
 	 * @see ICElement.isStructureKnown()
Index: model/org/eclipse/cdt/internal/core/model/CFile.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFile.java,v
retrieving revision 1.2
diff -u -r1.2 CFile.java
--- model/org/eclipse/cdt/internal/core/model/CFile.java	19 Mar 2003 20:19:36 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/CFile.java	27 Mar 2003 16:00:24 -0000
@@ -12,29 +12,36 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 
-public class CFile extends CResource implements ICFile {
+public class CFile extends CElement implements ICFile {
+
+	IFile file;
 	
 	IPath location;
 
-	public CFile(ICElement parent, IFile file) {
-		this(parent, file, file.getLocation(), file.getName());
+	public CFile(ICElement parent, IFile file){
+		//this (parent, file, ICElement.C_FILE);
+		this(parent, file, 0);
+	}
+
+	public CFile(ICElement parent, IFile file, int type) {
+		this(parent, file, file.getLocation(), file.getName(), type);
 	}
 
-	public CFile(ICElement parent, IFile file, String name) {
-		this(parent, file, file.getLocation(), name);
+	public CFile(ICElement parent, IFile file, String name, int type) {
+		this(parent, file, file.getLocation(), name, type);
 	}
 
-	public CFile(ICElement parent, IPath location) {
+	public CFile(ICElement parent, IPath location, int type) {
 	 	this(parent, ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(location),
-			location, location.lastSegment());
+			location, location.lastSegment(), type);
 	}
 
-	public CFile(ICElement parent, IResource res, IPath location, String name) {
-		super(parent, res, name, CElement.C_FILE);
+	public CFile(ICElement parent, IFile res, IPath location, String name, int type) {
+		super(parent, name, type);
 		this.location = location;
+		file = res;
 	}
 
-
 	public IPath getLocation () {
 		return location;
 	}
@@ -44,24 +51,7 @@
 	}
 
 	public IFile getFile () {
-		try {
-			return (IFile)getUnderlyingResource();
-		} catch (CModelException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	public boolean isBinary() {
-		return getCFileInfo().isBinary();
-	}
-
-	public boolean isArchive() {
-		return getCFileInfo().isArchive();
-	}
-
-	public boolean isTranslationUnit() {
-		return getCFileInfo().isTranslationUnit();
+		return file;
 	}
 
 	protected CFileInfo getCFileInfo() {
@@ -71,4 +61,18 @@
 	protected CElementInfo createElementInfo () {
 		return new CFileInfo(this);
 	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.model.ICElement#getResource()
+	 */
+	public IResource getResource() throws CModelException {
+		return file;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.model.ICElement#getUnderlyingResource()
+	 */
+	public IResource getUnderlyingResource() throws CModelException {
+		return file;
+	}
+
 }
Index: model/org/eclipse/cdt/internal/core/model/CFileInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFileInfo.java,v
retrieving revision 1.1
diff -u -r1.1 CFileInfo.java
--- model/org/eclipse/cdt/internal/core/model/CFileInfo.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/CFileInfo.java	27 Mar 2003 16:00:24 -0000
@@ -5,28 +5,12 @@
  * All Rights Reserved.
  */
 
-public class CFileInfo extends CResourceInfo {
+public class CFileInfo extends CElementInfo {
 
 	/**
 	 * Constructs a new C Model Info 
 	 */
 	protected CFileInfo(CElement element) {
 		super(element);
-	}
-
-	protected boolean hasChildren() {
-		return false;
-	}
-
-	public boolean isBinary() {
-		return false;
-	}
-
-	public boolean isArchive() {
-		return false;
-	}
-
-	public boolean isTranslationUnit() {
-		return (this instanceof TranslationUnitInfo);
 	}
 }
Index: model/org/eclipse/cdt/internal/core/model/CFolder.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CFolder.java
diff -N model/org/eclipse/cdt/internal/core/model/CFolder.java
--- model/org/eclipse/cdt/internal/core/model/CFolder.java	19 Mar 2003 20:19:36 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,38 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
- 
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICFolder;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public class CFolder extends CResource implements ICFolder {
-
-	public CFolder (ICElement parent, IFolder folder) {
-		super (parent, folder, ICElement.C_FOLDER);
-	}
-
-	public IFolder getFolder () {
-		try {
-			return (IFolder)getUnderlyingResource();
-		} catch (CModelException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	protected CElementInfo createElementInfo () {
-		return new CFolderInfo(this);
-	}
-	
-	// CHECKPOINT: folders will return the hash code of their path
-	public int hashCode() {
-		return getPath().hashCode();
-	}
-	
-}
Index: model/org/eclipse/cdt/internal/core/model/CFolderInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CFolderInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/CFolderInfo.java
--- model/org/eclipse/cdt/internal/core/model/CFolderInfo.java	26 Jun 2002 20:37:14 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- */
-public class CFolderInfo extends CResourceInfo {
-
-	/**
-	 * Constructs a new C Model Info 
-	 */
-	protected CFolderInfo(CElement element) {
-		super(element);
-	}
-}
Index: model/org/eclipse/cdt/internal/core/model/CModel.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CModel.java
diff -N model/org/eclipse/cdt/internal/core/model/CModel.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/CModel.java	27 Mar 2003 16:00:24 -0000
@@ -0,0 +1,114 @@
+package org.eclipse.cdt.internal.core.model;
+
+/*
+ * (c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ */
+ 
+import java.util.ArrayList;
+
+import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICModel;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public class CModel extends CContainer implements ICModel {
+
+	public CModel () {
+		this(ResourcesPlugin.getWorkspace().getRoot());
+	}
+
+	public CModel(IWorkspaceRoot root) {
+		super (null, root, ICElement.C_MODEL);
+	}
+
+	public ICProject getCProject(String name) {
+		IProject project = getWorkspace().getRoot().getProject(name);			
+		return CModelManager.getDefault().create(project);			
+	}
+
+	public ICProject[] getCProjects() {
+		ArrayList list = getChildrenOfType(C_PROJECT);
+		ICProject[] array= new ICProject[list.size()];
+		list.toArray(array);
+		return array;
+	}
+
+	public IWorkspace getWorkspace() {
+		try {
+			return getUnderlyingResource().getWorkspace();
+		} catch (CModelException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	public void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
+		String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
+		if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT ) {
+			runOperation(new CopyResourceElementsOperation(elements, containers, replace), elements, siblings, renamings, monitor);
+		} else {
+			throw new CModelException (new CModelStatus());
+			//runOperation(new CopyElementsOperation(elements, containers, force), elements, siblings, renamings, monitor);
+		}
+	}
+
+	public void delete(ICElement[] elements, boolean force, IProgressMonitor monitor)
+		throws CModelException {
+		if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) {
+			runOperation(new DeleteResourceElementsOperation(elements, force), monitor);
+		} else {
+			throw new CModelException (new CModelStatus());
+			//runOperation(new DeleteElementsOperation(elements, force), monitor);
+		}
+	}
+
+	public void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
+		String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
+		if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) {
+			runOperation(new MoveResourceElementsOperation(elements, containers, replace), elements, siblings, renamings, monitor);
+		} else {
+			throw new CModelException (new CModelStatus());
+			//runOperation(new MoveElementsOperation(elements, containers, force), elements, siblings, renamings, monitor);
+		}
+	}
+
+	public void rename(ICElement[] elements, ICElement[] destinations, String[] renamings,
+		boolean force, IProgressMonitor monitor) throws CModelException {
+		if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) {
+			runOperation(new RenameResourceElementsOperation(elements, destinations,
+					renamings, force), monitor);
+		} else {
+			throw new CModelException (new CModelStatus());
+			//runOperation(new RenameElementsOperation(elements, containers, renamings, force), monitor);
+		}
+	}
+
+	/**
+	 * Configures and runs the <code>MultiOperation</code>.
+	 */
+	protected void runOperation(MultiOperation op, ICElement[] elements, ICElement[] siblings, String[] renamings, IProgressMonitor monitor) throws CModelException {
+		op.setRenamings(renamings);
+		if (siblings != null) {
+			for (int i = 0; i < elements.length; i++) {
+				op.setInsertBefore(elements[i], siblings[i]);
+			}
+		}
+		runOperation(op, monitor);
+	}
+
+	protected CElementInfo createElementInfo () {
+		return new CModelInfo(this);
+	}
+
+	// CHECKPOINT: Roots will return the hashcode of their resource
+	public int hashCode() {
+		return resource.hashCode();
+	}
+	
+}
Index: model/org/eclipse/cdt/internal/core/model/CModelCache.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java,v
retrieving revision 1.1
diff -u -r1.1 CModelCache.java
--- model/org/eclipse/cdt/internal/core/model/CModelCache.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/CModelCache.java	27 Mar 2003 16:00:24 -0000
@@ -66,12 +66,12 @@
  */
 public Object getInfo(ICElement element) {
 	switch (element.getElementType()) {
+		case ICElement.C_MODEL:
 		case ICElement.C_PROJECT:
-		case ICElement.C_ROOT:
 			return this.projectAndRootCache.get(element);
-		case ICElement.C_FOLDER:
+		case ICElement.C_CCONTAINER:
 			return this.folderCache.get(element);		
-		case ICElement.C_FILE:
+		case ICElement.C_UNIT:
 			return this.fileCache.get(element);
 		default:
 			return this.childrenCache.get(element);
@@ -84,12 +84,12 @@
  */
 protected Object peekAtInfo(ICElement element) {
 	switch (element.getElementType()) {
+		case ICElement.C_MODEL:
 		case ICElement.C_PROJECT:
-		case ICElement.C_ROOT:
 			return this.projectAndRootCache.get(element);
-		case ICElement.C_FOLDER:
+		case ICElement.C_CCONTAINER:
 			return this.folderCache.get(element);
-		case ICElement.C_FILE:
+		case ICElement.C_UNIT:
 			return this.fileCache.peek(element);
 		default:
 			return this.childrenCache.get(element);
@@ -101,14 +101,14 @@
  */
 protected void putInfo(ICElement element, Object info) {
 	switch (element.getElementType()) {
+		case ICElement.C_MODEL:
 		case ICElement.C_PROJECT:
-		case ICElement.C_ROOT:
 			this.projectAndRootCache.put(element, info);
 			break;
-		case ICElement.C_FOLDER:
+		case ICElement.C_CCONTAINER:
 			this.folderCache.put(element, info);
 			break;
-		case ICElement.C_FILE:
+		case ICElement.C_UNIT:
 			this.fileCache.put(element, info);
 			break;
 		default:
@@ -120,14 +120,14 @@
  */
 protected void removeInfo(ICElement element) {
 	switch (element.getElementType()) {
+		case ICElement.C_MODEL:
 		case ICElement.C_PROJECT:
-		case ICElement.C_ROOT:
 			this.projectAndRootCache.remove(element);
 			break;
-		case ICElement.C_FOLDER:
+		case ICElement.C_CCONTAINER:
 			this.folderCache.remove(element);
 			break;
-		case ICElement.C_FILE:
+		case ICElement.C_UNIT:
 			this.fileCache.remove(element);
 			break;
 		default:
Index: model/org/eclipse/cdt/internal/core/model/CModelInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CModelInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/CModelInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/CModelInfo.java	27 Mar 2003 16:00:24 -0000
@@ -0,0 +1,65 @@
+package org.eclipse.cdt.internal.core.model;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * @see ICModel
+ */
+public class CModelInfo extends CContainerInfo {
+
+	/**
+	 * A array with all the non-java projects contained by this model
+	 */
+	Object[] nonCResources;
+
+	/**
+	 * Constructs a new C Model Info 
+	 */
+	protected CModelInfo(CElement element) {
+		super(element);
+	}
+
+	/**
+	 * Compute the non-java resources contained in this java project.
+	 */
+	private Object[] computeNonCResources() {
+		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+		int length = projects.length;
+		Object[] nonCProjects = null;
+		int index = 0;
+		for (int i = 0; i < length; i++) {
+			IProject project = projects[i];
+			if (!CProject.hasCNature(project)) {
+				if (nonCProjects == null) {
+					nonCProjects = new Object[length];
+				}
+				nonCProjects[index++] = project;
+			}
+		}
+		if (index == 0) return NO_NON_C_RESOURCES;
+		if (index < length) {
+			System.arraycopy(nonCProjects, 0, nonCProjects = new Object[index], 0, index);
+		}
+		return nonCProjects;
+	}
+
+	/**
+	 * Returns an array of non-C resources contained in the receiver.
+	 */
+	Object[] getNonCResources() {
+
+		Object[] resources = nonCResources;
+		if (resources == null) {
+			resources = computeNonCResources();
+			nonCResources = resources;
+		}
+		return resources;
+	}
+
+}
Index: model/org/eclipse/cdt/internal/core/model/CModelManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java,v
retrieving revision 1.16
diff -u -r1.16 CModelManager.java
--- model/org/eclipse/cdt/internal/core/model/CModelManager.java	19 Mar 2003 20:19:36 -0000	1.16
+++ model/org/eclipse/cdt/internal/core/model/CModelManager.java	27 Mar 2003 16:00:26 -0000
@@ -7,12 +7,9 @@
  
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
 
 import org.eclipse.cdt.core.CCProjectNature;
 import org.eclipse.cdt.core.CCorePlugin;
@@ -23,13 +20,11 @@
 import org.eclipse.cdt.core.model.ElementChangedEvent;
 import org.eclipse.cdt.core.model.IArchive;
 import org.eclipse.cdt.core.model.IBinary;
+import org.eclipse.cdt.core.model.ICContainer;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICElementDelta;
-import org.eclipse.cdt.core.model.ICFile;
-import org.eclipse.cdt.core.model.ICFolder;
+import org.eclipse.cdt.core.model.ICModel;
 import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ICResource;
-import org.eclipse.cdt.core.model.ICRoot;
 import org.eclipse.cdt.core.model.IElementChangedListener;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -48,30 +43,31 @@
 
 public class CModelManager implements IResourceChangeListener {
 
-	private Map fParsedResources =  Collections.synchronizedMap(new HashMap());
-	
-	//private static HashMap fParsers = new HashMap();
-
+        /**
+         * Unique handle onto the CModel
+         */
+        final CModel cModel = new CModel();
+        
 	/**
 	 * Used to convert <code>IResourceDelta</code>s into <code>ICElementDelta</code>s.
 	 */
-	protected DeltaProcessor fDeltaProcessor= new DeltaProcessor();
+	protected DeltaProcessor fDeltaProcessor = new DeltaProcessor();
 
 	/**
 	 * Queue of deltas created explicily by the C Model that
 	 * have yet to be fired.
 	 */
-	private ArrayList fCModelDeltas= new ArrayList();
+	private ArrayList fCModelDeltas = new ArrayList();
 
 	/**
 	 * Turns delta firing on/off. By default it is on.
 	 */
-	protected boolean fFire= true;
+	protected boolean fFire = true;
 
 	/**
 	 * Collection of listeners for C element deltas
 	 */
-	protected ArrayList fElementChangedListeners= new ArrayList();
+	protected ArrayList fElementChangedListeners = new ArrayList();
 
 	/**
 	 * A map from ITranslationUnit to IWorkingCopy of the shared working copies.
@@ -92,6 +88,11 @@
 	 */
 	public ICProject[] cProjectsCache;
 
+	/**
+	 * The list of started BinaryRunners on projects.
+	 */
+	private HashMap binaryRunners = new HashMap();
+
 	public static final String [] sourceExtensions = {"c", "cxx", "cc", "C", "cpp"};
 
 	public static final String [] headerExtensions = {"h", "hh", "hpp"};
@@ -103,7 +104,7 @@
 
 	public static CModelManager getDefault() {
 		if (factory == null) {
-			factory = new CModelManager ();
+			factory = new CModelManager();
 
 			// Register to the workspace;
 			ResourcesPlugin.getWorkspace().addResourceChangeListener(factory,
@@ -116,35 +117,37 @@
 	}
 
 	/**
-	 * Returns the CRoot for the given workspace, creating
+	 * Returns the CModel for the given workspace, creating
 	 * it if it does not yet exist.
 	 */
-	public ICRoot getCRoot(IWorkspaceRoot root) {
-		return create(root);
+	public ICModel getCModel(IWorkspaceRoot root) {
+		return getCModel();
+		//return create(root);
 	}
 
-	public ICRoot getCRoot () {
-		return create(ResourcesPlugin.getWorkspace().getRoot());
+	public ICModel getCModel() {
+		return cModel;
 	}
 
-	public ICResource create (IPath path) {
+	public ICElement create (IPath path) {
 		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
 		// Assume it is fullpath relative to workspace
 		IResource res = root.findMember(path);
 		if (res == null) {
 			IPath rootPath = root.getLocation();
 			if (path.equals(rootPath))
-				return getCRoot(root);
+				return getCModel(root);
 			res = root.getContainerForLocation(path);
 			if (res == null || !res.exists())
 				res = root.getFileForLocation(path);
 			if (res != null && !res.exists())
 				res = null;
 		}
-		return create (res);
+		// TODO: for extenal resources ??
+		return create(res);
 	}
 
-	public ICResource create (IResource resource) {
+	public ICElement create (IResource resource) {
 		if (resource == null) {
 			return null;
 		}
@@ -163,7 +166,7 @@
 		}
 	}
 
-	public ICResource create(ICElement parent, IResource resource) {
+	public ICElement create(ICElement parent, IResource resource) {
 		int type = resource.getType();
 		switch (type) {
 			case IResource.PROJECT :
@@ -179,54 +182,79 @@
 		}
 	}
 
-	public ICFile create(IFile file) {
+	public ICElement create(IFile file) {
 		IResource parent = file.getParent();
 		ICElement cparent = null;
 		if (parent instanceof IFolder) {
-			cparent = create ((IFolder)parent);
+			cparent = create((IFolder)parent);
 		} else if (parent instanceof IProject) {
-			cparent = create ((IProject)parent);
+			cparent = create((IProject)parent);
 		}
 		if (cparent != null)
-			return (ICFile) create (cparent, file);
+			return create(cparent, file);
 		return null;
 	}
 
-	public synchronized ICFile create(ICElement parent, IFile file) {
-		ICFile cfile = (ICFile)fParsedResources.get(file);
-		if (cfile == null) {
-			if (file.exists()) {
-				if (isArchive(file)) {
+	public ICElement create(ICElement parent, IFile file) {
+		return create(parent, file, null);
+	}
+
+	public synchronized ICElement create(ICElement parent, IFile file, IBinaryFile bin) {
+		ICElement cfile = null;
+		if (file.exists()) {
+			// Try to create the binaryFile first.
+			if (bin == null) {
+				bin = createBinaryFile(file);
+			}
+			if (bin != null) {
+				if (bin.getType() == IBinaryFile.ARCHIVE) {
 					cfile = new Archive(parent, file);
-				} else if (isBinary(file)) {
-					cfile = new Binary(parent, file);
-				} else if (isTranslationUnit(file)) {
-					cfile = new TranslationUnit(parent, file);
 				} else {
-					cfile = new CFile(parent, file);
+					cfile = new Binary(parent, file);
+				}
+			} else if (isTranslationUnit(file)) {
+				cfile = new TranslationUnit(parent, file);
+			} 
+			//else {
+			//	cfile = new CFile(parent, file);
+			//}
+		} else {
+			// Probably it was deleted, find it
+			if (parent instanceof CElement) {
+				ICElement[] children = ((CElement)parent).getElementInfo().getChildren();
+				for (int i = 0; i < children.length; i++) {
+					try {
+						IResource res = children[i].getResource();
+						if (res != null && res.equals(file)) {
+							cfile = children[i];
+							break;
+						}
+					} catch (CModelException e) {
+					}
 				}
-				fParsedResources.put(file, cfile);
 			}
 		}
 		// Added also to the Containers
-		if (cfile != null) {
-			if (cfile instanceof IArchive) {
-				CProject cproj = (CProject)cfile.getCProject();
-				ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer();
-				container.addChild(cfile);
-			} else if (cfile instanceof IBinary) {
-				IBinary bin = (IBinary)cfile;
-				if (bin.isExecutable() || bin.isSharedLib()) {
+		if (cfile != null && (cfile instanceof IBinary || cfile instanceof IArchive)) {
+			if (bin == null) {
+				bin = createBinaryFile(file);
+			}
+			if (bin != null) {
+				if (bin.getType() == IBinaryFile.ARCHIVE) {
+					CProject cproj = (CProject)cfile.getCProject();
+					ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer();
+					container.addChild(cfile);
+				} else if (bin.getType() == IBinaryFile.EXECUTABLE || bin.getType() == IBinaryFile.SHARED) {
 					CProject cproj = (CProject)cfile.getCProject();
 					BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer();
-					container.addChild(bin);
+					container.addChild(cfile);
 				}
 			}
 		}
 		return cfile;
 	}
 
-	public ICFolder create(IFolder folder) {
+	public ICContainer create(IFolder folder) {
 		IResource parent = folder.getParent();
 		ICElement cparent = null;
 		if (parent instanceof IFolder) {
@@ -235,17 +263,12 @@
 			cparent = create ((IProject)parent);
 		}
 		if (cparent != null)
-			return (ICFolder) create (cparent, folder);
+			return (ICContainer) create (cparent, folder);
 		return null;
 	}
 
-	public synchronized ICFolder create(ICElement parent, IFolder folder) {
-		ICFolder cfolder = (ICFolder)fParsedResources.get(folder);
-		if (cfolder == null) {
-			cfolder = new CFolder(parent, folder);
-			fParsedResources.put(folder, cfolder);
-		}
-		return cfolder;
+	public ICContainer create(ICElement parent, IFolder folder) {
+		return new CContainer(parent, folder);
 	}
 		
 	public ICProject create(IProject project) {
@@ -257,28 +280,20 @@
 		return create(celement, project);
 	}
 
-	public synchronized ICProject create(ICElement parent, IProject project) {
-		ICProject cproject = (ICProject)fParsedResources.get(project);
-		if (cproject == null) {
-			if (hasCNature(project)) {
-				cproject = new CProject(parent, project);
-				fParsedResources.put(project, cproject);
-			}
+	public ICProject create(ICElement parent, IProject project) {
+		if (hasCNature(project)) {
+			return new CProject(parent, project);
 		}
-		return cproject;
+		return null;
 	}
 
-	public ICRoot create(IWorkspaceRoot root) {
-		ICRoot croot = (ICRoot)fParsedResources.get(root);
-		if (croot == null) {
-			croot = new CRoot(root);
-			fParsedResources.put(root, croot);
-		}
-		return croot;
+	public ICModel create(IWorkspaceRoot root) {
+		return getCModel();
+		//return new CModel(root);
 	}
 
 	private void removeChildrenContainer(Parent container, IResource resource) {
-		if ( container.hasChildren() ) {
+		if (container.hasChildren()) {
 			ICElement[] children = container.getChildren();
 			for (int i = 0; i < children.length; i++) {
 				try {
@@ -322,70 +337,43 @@
 //System.out.println("RELEASE " + celement.getElementName());
 
 		// Remove from the containers.
-		if (celement.getElementType() == ICElement.C_FILE) {
-			CFile cfile = (CFile)celement;
-			if (cfile.isArchive()) {
+		int type = celement.getElementType();
+		if (type == ICElement.C_ARCHIVE) {
 //System.out.println("RELEASE Archive " + cfile.getElementName());
-				CProject cproj = (CProject)cfile.getCProject();
-				ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer();
-				container.removeChild(cfile);
-			} else if (cfile.isBinary()) {
-				if (! ((IBinary)celement).isObject()) {
+			CProject cproj = (CProject)celement.getCProject();
+			ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer();
+			container.removeChild(celement);
+		} else if (type == ICElement.C_BINARY) {
+			if (! ((IBinary)celement).isObject()) {
 //System.out.println("RELEASE Binary " + cfile.getElementName());
-					CProject cproj = (CProject)cfile.getCProject();
-					BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer();
-					container.removeChild(cfile);
-				}
+				CProject cproj = (CProject)celement.getCProject();
+				BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer();
+				container.removeChild(celement);
 			}
 		}
 
+		// Remove the child from the parent list.
 		Parent parent = (Parent)celement.getParent();
 		if (parent != null) {
 			parent.removeChild(celement);
 		}
-		try {
-			// Remove in the hashMap all the prefixOf the resource, this
-			// will catch things when it is a container to remove the entire hierarchy
-			IResource res = celement.getUnderlyingResource();
-			if (res != null) {
-				IPath resPath = res.getFullPath();
-				if (resPath != null) {
-					ArrayList list = new ArrayList();
-					Set s = fParsedResources.keySet();
-					synchronized (s) {
-						Iterator keys = s.iterator();
-						while (keys.hasNext()) {
-							IResource r = (IResource)keys.next();
-							IPath p = r.getFullPath();
-							if (p != null && resPath.isPrefixOf(p)) {
-//System.out.println("Removing [" + resPath + "] " + p);
-								list.add(r);
-							}
-						}
-					}
-					for (int i = 0; i < list.size(); i++) {
-						fParsedResources.remove((IResource)list.get(i));
-					}
-				}
-				fParsedResources.remove(res);
+
+		if (celement instanceof CElement) {
+			CElementInfo info = ((CElement)celement).getElementInfo();
+			ICElement[] children = info.getChildren();
+			for (int i = 0; i < children.length; i++) {
+				releaseCElement(children[i]);
 			}
-		} catch (CModelException e) {
 		}
+		removeInfo(celement);
 	}
 
 	public ICElement getCElement(IResource res) {
-		return (ICElement)fParsedResources.get(res);
+		return create(res);
 	}
 
 	public ICElement getCElement(IPath path) {
-		Iterator iterator = fParsedResources.keySet().iterator();
-		while (iterator.hasNext()) {
-			IResource res = (IResource)iterator.next();
-			if (res.getFullPath().equals(path)) {
-				return (ICElement)fParsedResources.get(res);
-			}
-		}
-		return null;
+		return create(path);
 	}
 	
 	public IBinaryParser getBinaryParser(IProject project) {
@@ -396,85 +384,14 @@
 		return new NullBinaryParser();
 	}
 
-//	public IBinaryParser getBinaryParser(IProject project) {
-//		// It is in the property of the project of the cdtproject
-//		// For now the default is Elf.
-//		IBinaryParser parser = (IBinaryParser)fParsers.get(project);
-//		if (parser == null) {
-//			String format = getBinaryParserFormat(project);
-//			if (format == null || format.length() == 0) {
-//				format = getDefaultBinaryParserFormat();
-//			}
-//			if (format != null && format.length() > 0) {
-//				parser = CCorePlugin.getDefault().getBinaryParser(format);
-//			}
-//			if (parser == null) {
-//				parser = defaultBinaryParser;
-//			}
-//			fParsers.put(project, parser);
-//		}
-//		return parser;
-//	}
-
-//	public String getDefaultBinaryParserFormat() {
-//		String format = CCorePlugin.getDefault().getPluginPreferences().getDefaultString(BINARY_PARSER);
-//		if (format == null || format.length() == 0) {
-//			return "ELF";
-//		}
-//		return format;
-//	}
-
-//	public String getBinaryParserFormat(IProject project) {
-//		// It can be in the property of the project or in the .cdtproject
-//		String format = null;
-//		// FIXME: Ask the .cdtproject.
-//		try {
-//			if (project != null) {
-//				format = project.getPersistentProperty(binaryParserKey);
-//			}
-//		} catch (CoreException e) {
-//		}
-//		return format;
-//	}
-
-//	public void setDefaultBinaryParserFormat(String format) {
-//		CCorePlugin.getDefault().getPluginPreferences().setDefault(BINARY_PARSER, format);
-//	}
-//
-//	public void setBinaryParserFormat(IProject project, String format, IProgressMonitor monitor) {
-//		try {
-//			if (project != null) {
-//				project.setPersistentProperty(binaryParserKey, format);
-//				fParsers.remove(project);
-//				IPath projPath = project.getFullPath();
-//				if (projPath != null) {
-//					Collection c = fParsedResources.values();
-//					ArrayList list = new ArrayList();
-//					synchronized (c) {
-//						Iterator values = c.iterator();
-//						while (values.hasNext()) {
-//							ICElement ce = (ICElement)values.next();
-//							if (!(ce instanceof ICRoot || ce instanceof ICProject)) {
-//							   	if (ce.getCProject().getProject().equals(project)) {
-//									list.add(ce);
-//								}
-//							}
-//						}
-//					}
-//					for (int i = 0; i < list.size(); i++) {
-//						ICElement ce = (ICElement)list.get(i);
-//						releaseCElement(ce);
-//					}
-//				}
-//				// Fired and ICElementDelta.PARSER_CHANGED
-//				CElementDelta delta = new CElementDelta(getCRoot());
-//				delta.binaryParserChanged(create(project));
-//				registerCModelDelta(delta);
-//				fire();
-//			}
-//		} catch (CoreException e) {
-//		}
-//	}
+	public IBinaryFile createBinaryFile(IFile file) {
+		try {
+			IBinaryParser parser = getBinaryParser(file.getProject());
+			return parser.getBinary(file.getLocation());
+		} catch (IOException e) {
+		}
+		return null;
+	}
 
 	/**
 	 * TODO: this is a temporary hack until, the CDescriptor manager is
@@ -482,28 +399,9 @@
 	 */
 	public void resetBinaryParser(IProject project) {
 		if (project != null) {
-			IPath projPath = project.getFullPath();
-			if (projPath != null) {
-				Collection c = fParsedResources.values();
-				ArrayList list = new ArrayList();
-				synchronized (c) {
-					Iterator values = c.iterator();
-					while (values.hasNext()) {
-						ICElement ce = (ICElement)values.next();
-						if (!(ce instanceof ICRoot || ce instanceof ICProject)) {
-							if (ce.getCProject().getProject().equals(project)) {
-								list.add(ce);
-							}
-						}
-					}
-				}
-				for (int i = 0; i < list.size(); i++) {
-					ICElement ce = (ICElement)list.get(i);
-					releaseCElement(ce);
-				}
-			}
+			releaseCElement(project);
 			// Fired and ICElementDelta.PARSER_CHANGED
-			CElementDelta delta = new CElementDelta(getCRoot());
+			CElementDelta delta = new CElementDelta(getCModel());
 			delta.binaryParserChanged(create(project));
 			registerCModelDelta(delta);
 			fire();
@@ -628,6 +526,17 @@
 		return ok;
 	}
 
+	public BinaryRunner getBinaryRunner(ICProject cProject) {
+		BinaryRunner runner = null;
+		synchronized(binaryRunners) {
+			if (binaryRunners.get(cProject) == null) {
+				runner = new BinaryRunner(cProject);
+				binaryRunners.put(cProject, runner);
+			}
+		}
+		return runner;
+	}
+
 	/**
 	 * addElementChangedListener method comment.
 	 */
@@ -702,19 +611,6 @@
 	}
 
 	/**
-	 * Note that the project is about to be deleted.
-	 *
-	 * fix for 1FW67PA
-	 */
-	public void deleting(IResource resource) {
-		deleting(getCElement(resource));
-	}
-
-	public void deleting(ICElement celement) {
-		releaseCElement(celement);
-	}
-
-	/**
 	 * Fire C Model deltas, flushing them after the fact. 
 	 * If the firing mode has been turned off, this has no effect. 
 	 */
@@ -759,7 +655,7 @@
 			return;
 
 		Iterator deltas = fCModelDeltas.iterator();
-		ICElement cRoot = getCRoot();
+		ICElement cRoot = getCModel();
 		CElementDelta rootDelta = new CElementDelta(cRoot);
 		boolean insertedTree = false;
 		while (deltas.hasNext()) {
@@ -777,7 +673,7 @@
 				insertedTree = true;
 			}
 		}
-		if (insertedTree){
+		if (insertedTree) {
 			fCModelDeltas = new ArrayList(1);
 			fCModelDeltas.add(rootDelta);
 		} else {
@@ -795,7 +691,7 @@
 				operation.run(monitor);
 			} else {
 		// use IWorkspace.run(...) to ensure that a build will be done in autobuild mode
-				getCRoot().getUnderlyingResource().getWorkspace().run(operation, monitor);
+				getCModel().getUnderlyingResource().getWorkspace().run(operation, monitor);
 			}
 		} catch (CoreException ce) {
 			if (ce instanceof CModelException) {
@@ -827,7 +723,7 @@
 		switch (resource.getType()) {
 			case IResource.ROOT :
 			if (this.cProjectsCache == null) {
-				this.cProjectsCache = this.getCRoot().getCProjects();
+				this.cProjectsCache = this.getCModel().getCProjects();
 			}
 				
 			IResourceDelta[] children = delta.getAffectedChildren();
Index: model/org/eclipse/cdt/internal/core/model/CModelOperation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java,v
retrieving revision 1.1
diff -u -r1.1 CModelOperation.java
--- model/org/eclipse/cdt/internal/core/model/CModelOperation.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/CModelOperation.java	27 Mar 2003 16:00:27 -0000
@@ -22,7 +22,7 @@
 
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ICRoot;
+import org.eclipse.cdt.core.model.ICModel;
 import org.eclipse.cdt.core.model.ICModelStatus;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;
 import org.eclipse.cdt.core.model.ICElementDelta;
@@ -346,11 +346,11 @@
 	/**
 	 * Returns the C Model this operation is operating in.
 	 */
-	public ICRoot getCRoot() {
+	public ICModel getCModel() {
 		if (fElementsToProcess == null || fElementsToProcess.length == 0) {
-			return getParentElement().getCRoot();
+			return getParentElement().getCModel();
 		} else {
-			return fElementsToProcess[0].getCRoot();
+			return fElementsToProcess[0].getCModel();
 		}
 	}
 
@@ -399,7 +399,7 @@
 		if (fElementsToProcess != null && fElementsToProcess.length > 0) {
 			ICProject project = fElementsToProcess[0].getCProject();
 			if (project != null) {
-				return project.getCRoot().getWorkspace();
+				return project.getCModel().getWorkspace();
 			}
 		}
 		return null;
@@ -459,7 +459,7 @@
 	 * on the C Model.
 	 */
 	public CElementDelta newCElementDelta() {
-		return new CElementDelta(getCRoot());
+		return new CElementDelta(getCModel());
 	}
 
 	/**
Index: model/org/eclipse/cdt/internal/core/model/CProject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java,v
retrieving revision 1.4
diff -u -r1.4 CProject.java
--- model/org/eclipse/cdt/internal/core/model/CProject.java	19 Mar 2003 20:19:36 -0000	1.4
+++ model/org/eclipse/cdt/internal/core/model/CProject.java	27 Mar 2003 16:00:28 -0000
@@ -5,30 +5,29 @@
  * All Rights Reserved.
  */
  
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.IBinaryContainer;
-import org.eclipse.cdt.core.model.IArchiveContainer;
-import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.CProjectNature;
 import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.IArchiveContainer;
+import org.eclipse.cdt.core.model.IBinaryContainer;
+import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
 
-public class CProject extends CResource implements ICProject {
-
-	boolean runner = false;
+public class CProject extends CContainer implements ICProject {
 
 	public CProject (ICElement parent, IProject project) {
 		super (parent, project, CElement.C_PROJECT);
 	}
 
 	public IBinaryContainer getBinaryContainer() {
-		return getCProjectInfo().getBinaryContainer();
+		return ((CProjectInfo)getElementInfo()).getBinaryContainer();
 	}
 
 	public IArchiveContainer getArchiveContainer() {
-		return getCProjectInfo().getArchiveContainer();
+		return ((CProjectInfo)getElementInfo()).getArchiveContainer();
 	}
 
 	public IProject getProject() {
@@ -40,10 +39,6 @@
 		return null;
 	}
 
-	public ICProject getCProject() {
-		return this;
-	}
-
 	public ICElement findElement(IPath path) throws CModelException {
 		ICElement celem = null;
 		if (path.isAbsolute()) {
@@ -62,16 +57,13 @@
 		return celem;
 	}
 
-	synchronized protected boolean hasStartBinaryRunner() {
-		return runner;
-	}
-
-	synchronized protected void setStartBinaryRunner(boolean done) {
-		runner = done;
-	}
-
-	protected CProjectInfo getCProjectInfo() {
-		return (CProjectInfo)getElementInfo();
+	public static boolean hasCNature (IProject p) {
+		try {
+			return p.hasNature(CProjectNature.C_NATURE_ID);
+		} catch (CoreException e) {
+			//throws exception if the project is not open.
+		}
+		return false;
 	}
 
 	protected CElementInfo createElementInfo() {
Index: model/org/eclipse/cdt/internal/core/model/CProjectInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java,v
retrieving revision 1.1
diff -u -r1.1 CProjectInfo.java
--- model/org/eclipse/cdt/internal/core/model/CProjectInfo.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/CProjectInfo.java	27 Mar 2003 16:00:28 -0000
@@ -5,7 +5,6 @@
  * All Rights Reserved.
  */
 
-import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.IArchiveContainer;
 import org.eclipse.cdt.core.model.IBinaryContainer;
 
@@ -13,40 +12,31 @@
  * Info for ICProject.
  */
 
-class CProjectInfo extends CResourceInfo {
+class CProjectInfo extends CContainerInfo {
 
 	private BinaryContainer vBin;
 	private ArchiveContainer vLib;
 
-	public IBinaryContainer getBinaryContainer() {
+	/**
+	 */
+	public CProjectInfo(CElement element) {
+		super(element);
+		vBin = null;
+		vLib = null;
+	}
+
+	synchronized public IBinaryContainer getBinaryContainer() {
 		if (vBin == null) {
 			vBin = new BinaryContainer((CProject)getElement());
-			addChild(vBin);
 		}
 		return vBin;
 	}
 
-	public IArchiveContainer getArchiveContainer() {
+	synchronized public IArchiveContainer getArchiveContainer() {
 		if (vLib == null) {
 			vLib = new ArchiveContainer((CProject)getElement());
-			addChild(vLib);
 		}
 		return vLib;
 	}
 
-	public ICElement[] getChildren() {
-        // ensure that BinaryContqainer and ArchiveContainer
-        // have been added as children. Side affect of get methods!
-		getBinaryContainer();
-		getArchiveContainer();
-		return super.getChildren();
-	}
-
-	/**
-	 */
-	public CProjectInfo(CElement element) {
-		super(element);
-		vBin = null;
-		vLib = null;
-	}
 }
Index: model/org/eclipse/cdt/internal/core/model/CResource.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CResource.java
diff -N model/org/eclipse/cdt/internal/core/model/CResource.java
--- model/org/eclipse/cdt/internal/core/model/CResource.java	19 Mar 2003 20:19:36 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,289 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
- 
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICModelStatusConstants;
-import org.eclipse.cdt.core.model.ICResource;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public abstract class CResource extends Parent implements ICResource {
-	
-	public CResource (ICElement parent, IPath path, int type) {
-		// Check if the file is under the workspace.
-		this (parent, ResourcesPlugin.getWorkspace().getRoot().getFileForLocation (path),
-			path.lastSegment(), type);
-	}
-
-	public CResource (ICElement parent, IResource resource, int type) {
-		this (parent, resource, resource.getName(), type);
-	}
-	
-	public CResource (ICElement parent, IResource resource, String name, int type) {
-		super (parent, resource, name, type);
-	}
-
-	public IResource getUnderlyingResource() throws CModelException {
-		return resource;
-	}
-
-	public IResource getResource() throws CModelException {
-		return resource;
-	}
-	
-	protected abstract CElementInfo createElementInfo ();
-	/**
-	 * The buffer associated with this element has changed. Registers
-	 * this element as being out of synch with its buffer's contents.
-	 * If the buffer has been closed, this element is set as NOT out of
-	 * synch with the contents.
-	 *
-	 * @see IBufferChangedListener
-	 */
-	public void bufferChanged(BufferChangedEvent event) {
-		if (event.getBuffer().isClosed()) {
-			CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
-			getBufferManager().removeBuffer(event.getBuffer());
-		} else {
-			CModelManager.getDefault().getElementsOutOfSynchWithBuffers().put(this, this);
-		}
-	}	
-	/**
-	 * Updates the info objects for this element and all of its children by
-	 * removing the current infos, generating new infos, and then placing
-	 * the new infos into the C Model cache tables.
-	 */
-	protected void buildStructure(CResourceInfo info, IProgressMonitor monitor) throws CModelException {
-
-		if (monitor != null && monitor.isCanceled()) return;
-	
-		// remove existing (old) infos
-		removeInfo();
-		HashMap newElements = new HashMap(11);
-		info.setIsStructureKnown(generateInfos(info, monitor, newElements, getResource()));
-		CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
-		for (Iterator iter = newElements.keySet().iterator(); iter.hasNext();) {
-			ICElement key = (ICElement) iter.next();
-			Object value = newElements.get(key);
-			CModelManager.getDefault().putInfo(key, value);
-		}
-		
-		// add the info for this at the end, to ensure that a getInfo cannot reply null in case the LRU cache needs
-		// to be flushed. Might lead to performance issues.
-		CModelManager.getDefault().putInfo(this, info);	
-	}
-
-	/**
-	 * Close the buffer associated with this element, if any.
-	 */
-	protected void closeBuffer(CFileInfo info) {
-		if (!hasBuffer()) return; // nothing to do
-		IBuffer buffer = null;
-		buffer = getBufferManager().getBuffer(this);
-		if (buffer != null) {
-			buffer.close();
-			buffer.removeBufferChangedListener(this);
-		}
-	}
-	/**
-	 * Derived classes may override.
-	 */
-	protected boolean generateInfos(CResourceInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException{
-		return false;
-	}
-	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#getBuffer()
-	 */
-	public IBuffer getBuffer() throws CModelException {
-		if (hasBuffer()) {
-			// ensure element is open
-			if (!isOpen()) {
-				getElementInfo();
-			}
-			IBuffer buffer = getBufferManager().getBuffer(this);
-			if (buffer == null) {
-				// try to (re)open a buffer
-				buffer = openBuffer(null);
-			}
-			return buffer;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * Answers the buffer factory to use for creating new buffers
-	 */
-	public IBufferFactory getBufferFactory(){
-		return getBufferManager().getDefaultBufferFactory();
-	}
-
-	/**
-	 * Returns the buffer manager for this element.
-	 */
-	protected BufferManager getBufferManager() {
-		return BufferManager.getDefaultBufferManager();
-	}
-	
-	/**
-	 * Returns true if this element may have an associated source buffer,
-	 * otherwise false. Subclasses must override as required.
-	 */
-	protected boolean hasBuffer() {
-		return false;
-	}
-	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#hasUnsavedChanges()
-	 */
-	public boolean hasUnsavedChanges() throws CModelException{
-	
-		if (isReadOnly() || !isOpen()) {
-			return false;
-		}
-		IBuffer buf = this.getBuffer();
-		if (buf != null && buf.hasUnsavedChanges()) {
-			return true;
-		}
-		// for roots and projects must check open buffers
-		// to see if they have an child with unsaved changes
-		if (fType == C_ROOT ||
-			fType == C_PROJECT) {
-			Enumeration openBuffers= getBufferManager().getOpenBuffers();
-			while (openBuffers.hasMoreElements()) {
-				IBuffer buffer= (IBuffer)openBuffers.nextElement();
-				if (buffer.hasUnsavedChanges()) {
-					ICElement owner= (ICElement)buffer.getOwner();
-					if (isAncestorOf(owner)) {
-						return true;
-					}
-				}
-			}
-		}
-	
-		return false;
-	}
-	/**
-	 * Subclasses must override as required.
-	 * 
-	 * @see org.eclipse.cdt.core.model.ICOpenable#isConsistent()
-	 */
-	public boolean isConsistent() throws CModelException {
-		return true;
-	}
-
-	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#isOpen()
-	 */	
-	public boolean isOpen() {
-		synchronized(CModelManager.getDefault()){
-			return CModelManager.getDefault().getInfo(this) != null;
-		}
-	}
-
-	/**
-	 * Returns true if this represents a source element.
-	 * Openable source elements have an associated buffer created
-	 * when they are opened.
-	 */
-	protected boolean isSourceElement() {
-		return false;
-	}
-
-	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#makeConsistent(IProgressMonitor)
-	 */
-	public void makeConsistent(IProgressMonitor pm) throws CModelException {
-		if (!isConsistent()) {
-			buildStructure((CFileInfo)getElementInfo(), pm);
-		}
-	}
-
-	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#open(IProgressMonitor)
-	 */
-	public void open(IProgressMonitor pm) throws CModelException {
-		if (!isOpen()) {
-			this.openWhenClosed(pm);
-		}
-	}
-
-	/**
-	 * Opens a buffer on the contents of this element, and returns
-	 * the buffer, or returns <code>null</code> if opening fails.
-	 * By default, do nothing - subclasses that have buffers
-	 * must override as required.
-	 */
-	protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException {
-		return null;
-	}
-
-	/**
-	 * 	Open the parent element if necessary
-	 * 
-	 */
-	protected void openParent(IProgressMonitor pm) throws CModelException {
-
-		CResource openableParent = (CResource)getOpenableParent();
-		if (openableParent != null) {
-			if (!openableParent.isOpen()){
-				openableParent.openWhenClosed(pm);
-			}
-		}
-	}
-
-	/**
-	 * Open a <code>IOpenable</code> that is known to be closed (no check for
-	 * <code>isOpen()</code>).
-	 */
-	protected void openWhenClosed(IProgressMonitor pm) throws CModelException {
-		try {
-			
-			// 1) Parent must be open - open the parent if necessary
-			openParent(pm);
-
-			// 2) create the new element info and open a buffer if needed
-			CResourceInfo info = (CResourceInfo) createElementInfo();
-			IResource resource = getResource();
-			if (resource != null && isSourceElement()) {
-				this.openBuffer(pm);
-			} 
-
-			// 3) build the structure of the openable
-			buildStructure(info, pm);
-		
-			// if any problems occuring openning the element, ensure that it's info
-			// does not remain in the cache	(some elements, pre-cache their info
-			// as they are being opened).
-		} catch (CModelException e) {
-			CModelManager.getDefault().removeInfo(this);
-			throw e;
-		}
-	}
-
-	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#save(IProgressMonitor, boolean)
-	 */
-	public void save(IProgressMonitor pm, boolean force) throws CModelException {
-		if (isReadOnly() || this.getResource().isReadOnly()) {
-			throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
-		}
-		IBuffer buf = getBuffer();
-		if (buf != null) { 
-			buf.save(pm, force);
-			this.makeConsistent(pm); // update the element info of this element
-		}
-	}
-		
-}
Index: model/org/eclipse/cdt/internal/core/model/CResourceInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CResourceInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/CResourceInfo.java
--- model/org/eclipse/cdt/internal/core/model/CResourceInfo.java	13 Oct 2002 21:30:28 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,69 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- */
-public class CResourceInfo extends CElementInfo {
-
-	/**
-	 * Constructs a new C Model Info 
-	 */
-	protected CResourceInfo(CElement element) {
-		super(element);
-	}
-
-	// Always return true, save the unnecessary probing from the Treeviewer.
-	protected boolean hasChildren () {
-		return true;
-	}
-
-	protected ICElement [] getChildren () {
-		try {
-			IResource[] resources = null;
-			IResource res = getElement().getUnderlyingResource();
-			if (res != null) {
-				//System.out.println ("  Resource: " + res.getFullPath().toOSString());
-				switch(res.getType()) {
-					case IResource.ROOT:
-					case IResource.PROJECT:
-					case IResource.FOLDER:
-						IContainer container = (IContainer)res;
-						resources = container.members(false);
-						break;
-
-					case IResource.FILE:
-						break;
-				}
-			}
-
-			if (resources != null) {
-				CModelManager factory = CModelManager.getDefault();
-				for (int i = 0; i < resources.length; i++) {
-					// Check for Valid C projects only.
-					if(resources[i].getType() == IResource.PROJECT) {
-						IProject proj = (IProject)resources[i];
-						if (!factory.hasCNature(proj)) {	
-							continue;
-						}
-					}
-					addChild(factory.create(getElement(), resources[i]));
-				}
-			}
-		} catch (CoreException e) {
-			//System.out.println (e);
-			//CPlugin.log (e);
-			e.printStackTrace();
-		}
-		return super.getChildren();
-	}
-}
Index: model/org/eclipse/cdt/internal/core/model/CRoot.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CRoot.java
diff -N model/org/eclipse/cdt/internal/core/model/CRoot.java
--- model/org/eclipse/cdt/internal/core/model/CRoot.java	19 Mar 2003 20:19:36 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,120 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
- 
-import java.util.ArrayList;
-
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ICResource;
-import org.eclipse.cdt.core.model.ICRoot;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public class CRoot extends CResource implements ICRoot {
-
-	public CRoot(IWorkspaceRoot root) {
-		super (null, root, root.getName(), ICElement.C_ROOT);
-	}
-	
-	public ICRoot getCModel() {
-		return this;
-	}
-	public ICProject getCProject(String name) {
-		CModelManager factory = CModelManager.getDefault();
-		return (ICProject)factory.create(getWorkspace().getRoot().getProject(name));
-	}
-
-	public ICProject[] getCProjects() {
-		ArrayList list = getChildrenOfType(C_PROJECT);
-		ICProject[] array= new ICProject[list.size()];
-		list.toArray(array);
-		return array;
-	}
-
-	public IWorkspace getWorkspace() {
-		try {
-			return getUnderlyingResource().getWorkspace();
-		} catch (CModelException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	public IWorkspaceRoot getRoot() {
-		try {
-			return (IWorkspaceRoot)getUnderlyingResource();
-		} catch (CModelException e) {
-		}
-		return null;
-	}
-
-	public void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
-		String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
-		if (elements != null && elements[0] != null && elements[0] instanceof ICResource ) {
-			runOperation(new CopyResourceElementsOperation(elements, containers, replace), elements, siblings, renamings, monitor);
-		} else {
-			throw new CModelException (new CModelStatus());
-			//runOperation(new CopyElementsOperation(elements, containers, force), elements, siblings, renamings, monitor);
-		}
-	}
-
-	public void delete(ICElement[] elements, boolean force, IProgressMonitor monitor)
-		throws CModelException {
-		if (elements != null && elements[0] != null && elements[0] instanceof ICResource) {
-			runOperation(new DeleteResourceElementsOperation(elements, force), monitor);
-		} else {
-			throw new CModelException (new CModelStatus());
-			//runOperation(new DeleteElementsOperation(elements, force), monitor);
-		}
-	}
-
-	public void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
-		String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
-		if (elements != null && elements[0] != null && elements[0] instanceof ICResource ) {
-			runOperation(new MoveResourceElementsOperation(elements, containers, replace), elements, siblings, renamings, monitor);
-		} else {
-			throw new CModelException (new CModelStatus());
-			//runOperation(new MoveElementsOperation(elements, containers, force), elements, siblings, renamings, monitor);
-		}
-	}
-
-	public void rename(ICElement[] elements, ICElement[] destinations, String[] renamings,
-		boolean force, IProgressMonitor monitor) throws CModelException {
-		if (elements != null && elements[0] != null && elements[0] instanceof ICResource) {
-			runOperation(new RenameResourceElementsOperation(elements, destinations,
-					renamings, force), monitor);
-		} else {
-			throw new CModelException (new CModelStatus());
-			//runOperation(new RenameElementsOperation(elements, containers, renamings, force), monitor);
-		}
-	}
-
-	/**
-	 * Configures and runs the <code>MultiOperation</code>.
-	 */
-	protected void runOperation(MultiOperation op, ICElement[] elements, ICElement[] siblings, String[] renamings, IProgressMonitor monitor) throws CModelException {
-		op.setRenamings(renamings);
-		if (siblings != null) {
-			for (int i = 0; i < elements.length; i++) {
-				op.setInsertBefore(elements[i], siblings[i]);
-			}
-		}
-		runOperation(op, monitor);
-	}
-
-	protected CElementInfo createElementInfo () {
-		return new CRootInfo(this);
-	}
-
-	// CHECKPOINT: Roots will return the hashcode of their resource
-	public int hashCode() {
-		return resource.hashCode();
-	}
-	
-}
Index: model/org/eclipse/cdt/internal/core/model/CRootInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CRootInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/CRootInfo.java
--- model/org/eclipse/cdt/internal/core/model/CRootInfo.java	26 Jun 2002 20:37:14 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * @see ICModel
- */
-public class CRootInfo extends CResourceInfo {
-
-	/**
-	 * Constructs a new C Model Info 
-	 */
-	protected CRootInfo(CElement element) {
-		super(element);
-	}
-}
Index: model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java,v
retrieving revision 1.1
diff -u -r1.1 CommitWorkingCopyOperation.java
--- model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java	27 Mar 2003 16:00:28 -0000
@@ -11,6 +11,7 @@
  * Rational Software - Initial API and implementation
 ***********************************************************************/
 
+import org.eclipse.cdt.core.model.*;
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICModelStatus;
Index: model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java,v
retrieving revision 1.1
diff -u -r1.1 CopyElementsOperation.java
--- model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java	27 Mar 2003 16:00:29 -0000
@@ -4,15 +4,11 @@
  * (c) Copyright IBM Corp. 2000, 2001.
  * All Rights Reserved.
  */
-import java.util.HashMap;
-import java.util.Map;
-
-
+import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.IParent;
 import org.eclipse.cdt.core.model.ICModelStatus;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;
-import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.IParent;
 
 /**
  * This operation copies/moves a collection of elements from their current
@@ -49,7 +45,7 @@
  */
 public class CopyElementsOperation extends MultiOperation {
 
-	private Map fSources = new HashMap();
+	//private Map fSources = new HashMap();
 
 	/**
 	 * When executed, this operation will copy the given elements to the
Index: model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java,v
retrieving revision 1.2
diff -u -r1.2 CopyResourceElementsOperation.java
--- model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java	26 Jul 2002 19:15:12 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java	27 Mar 2003 16:00:29 -0000
@@ -16,7 +16,6 @@
 import org.eclipse.cdt.core.model.ICModelStatus;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;
 import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ICResource;
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
@@ -126,9 +125,9 @@
 		String destName = (newName != null) ? newName : source.getElementName();
 
 		// copy resource
-		IFile sourceResource = (IFile)((ICResource)source).getResource();
+		IFile sourceResource = (IFile)source.getResource();
 		// can be an IFolder or an IProject
-		IContainer destFolder = (IContainer)((ICResource)dest).getResource();
+		IContainer destFolder = (IContainer)dest.getResource();
 		IFile destFile = destFolder.getFile(new Path(destName));
 		if (!destFile.equals(sourceResource)) {
 			try {
@@ -185,7 +184,7 @@
 	 */
 	protected void processElement(ICElement element) throws CModelException {
 		ICElement dest = getDestinationParent(element);
-		if (element instanceof ICResource) {
+		if (element.getElementType() <= ICElement.C_UNIT) {
 			processResource(element, dest);
 			//fCreatedElements.add(dest.getCompilationUnit(element.getElementName()));
 		} else {
Index: model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java,v
retrieving revision 1.2
diff -u -r1.2 CreateElementInTUOperation.java
--- model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java	26 Jul 2002 19:15:12 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java	27 Mar 2003 16:00:30 -0000
@@ -5,23 +5,22 @@
  * All Rights Reserved.
  */
 
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-
+import org.eclipse.cdt.core.model.*;
+import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICResource;
+import org.eclipse.cdt.core.model.ICModelStatus;
+import org.eclipse.cdt.core.model.ICModelStatusConstants;
 import org.eclipse.cdt.core.model.ISourceRange;
 import org.eclipse.cdt.core.model.ISourceReference;
 import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.core.model.ICModelStatus;
-import org.eclipse.cdt.core.model.ICModelStatusConstants;
-import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
 
 /**
  * <p>This abstract class implements behavior common to <code>CreateElementInCUOperations</code>.
@@ -140,30 +139,44 @@
 		beginTask(getMainTaskName(), getMainAmountOfWork());
 		CElementDelta delta = newCElementDelta();
 		ITranslationUnit unit = getTranslationUnit();
+		// generateNewTranslationUnitDOM(unit);
 		insertElement();
 		if (fCreationOccurred) {
 			//a change has really occurred
-			IFile file = (IFile)((ICResource)unit).getResource();
-			StringBuffer buffer = getContent(file);
+			IBuffer buffer = unit.getBuffer();
+			if (buffer == null) return;
+			char[] bufferContents = buffer.getCharacters();
+			if (bufferContents == null) return;
+			//char[] elementContents = normalizeCRS(..);
+			char[] elementContents = fCreatedElement.getSource().toCharArray();
+			//IFile file = (IFile)((ICResource)unit).getResource();
+			//StringBuffer buffer = getContent(file);
 			switch (fReplacementLength) {
 				case -1 : 
 					// element is append at the end
-					buffer.append(fCreatedElement.getSource());
+					//buffer.append(fCreatedElement.getSource());
+					buffer.append(elementContents);
 					break;
 
 				case 0 :
 					// element is inserted
-					buffer.insert(fInsertionPosition, fCreatedElement.getSource());
+					//buffer.insert(fInsertionPosition, fCreatedElement.getSource());
+					buffer.replace(fInsertionPosition, 0, elementContents);
 					break;
 
 				default :
 					// element is replacing the previous one
 					buffer.replace(fInsertionPosition, fReplacementLength, fCreatedElement.getSource());
 			}
-			save(buffer, file);
+			unit.save(null, false);
+			//save(buffer, file);
+			boolean isWorkingCopy = unit.isWorkingCopy();
+			//if (isWorkingCopy) {
+			//	this.setAttributes(...);
+			//}
 			worked(1);
 			fResultElements = generateResultHandles();
-			//if (!isWorkingCopy) { // if unit is working copy, then save will have already fired the delta
+			if (!isWorkingCopy) { // if unit is working copy, then save will have already fired the delta
 				if (unit.getParent().exists()) {
 					for (int i = 0; i < fResultElements.length; i++) {
 						delta.added(fResultElements[i]);
@@ -171,7 +184,7 @@
 					addDelta(delta);
 				} // else unit is created outside classpath
 				  // non-java resource delta will be notified by delta processor
-			//}
+			}
 		}
 		done();
 	}
Index: model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java,v
retrieving revision 1.2
diff -u -r1.2 DeleteResourceElementsOperation.java
--- model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java	26 Jul 2002 19:15:12 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java	27 Mar 2003 16:00:31 -0000
@@ -8,7 +8,6 @@
 
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICResource;
 
 /**
  * This operation deletes a collection of resources and all of their children.
@@ -37,7 +36,7 @@
 	 * <code>deletePackageFragment</code> depending on the type of <code>element</code>.
 	 */
 	protected void processElement(ICElement element) throws CModelException {
-		deleteResource(((ICResource)element).getResource(), fForce);
+		deleteResource(element.getResource(), fForce);
 	}
 
 	/**
Index: model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java,v
retrieving revision 1.1
diff -u -r1.1 DeltaProcessor.java
--- model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java	26 Jun 2002 20:37:14 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java	27 Mar 2003 16:00:32 -0000
@@ -12,7 +12,7 @@
 
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICElementDelta;
-import org.eclipse.cdt.core.model.ICRoot;
+import org.eclipse.cdt.core.model.ICModel;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.CoreModel;
@@ -101,6 +101,22 @@
 	}
 
 	/**
+	 * Adds the given child handle to its parent's cache of children. 
+	 */
+	protected void addToParentInfo(Openable child) {
+
+		Openable parent = (Openable) child.getParent();
+		if (parent != null && parent.isOpen()) {
+			//try {
+				CElementInfo info = (CElementInfo)parent.getElementInfo();
+				info.addChild(child);
+			//} //catch (CModelException e) {
+				// do nothing - we already checked if open
+			//}
+		}
+	}
+
+	/**
 	 * Processing for an element that has been added:<ul>
 	 * <li>If the element is a project, do nothing, and do not process
 	 * children, as when a project is created it does not yet have any
@@ -111,6 +127,9 @@
 	 */
 	protected void elementAdded(ICElement element, IResourceDelta delta) {
 
+		if (element instanceof Openable) {
+			addToParentInfo((Openable)element);
+		}
 		if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
 			//ICElement movedFromElement = createElement(delta.getMovedFromPath());
 			if  (movedFromElement == null)
@@ -125,8 +144,8 @@
 	/**
 	 * Processing for the closing of an element - there are two cases:<ul>
 	 * <li>when a project is closed (in the platform sense), the
-	 * 		CRoot reports this as if the CProject has been removed.
-	 * <li>otherwise, the CRoot reports this
+	 * 		CModel reports this as if the CProject has been removed.
+	 * <li>otherwise, the CModel reports this
 	 *		as a the element being closed (CHANGED + F_CLOSED).
 	 * </ul>
 	 * <p>In both cases, the children of the element are not processed. When
@@ -146,8 +165,8 @@
 	/**
 	 * Processing for the opening of an element - there are two cases:<ul>
 	 * <li>when a project is opened (in the platform sense), the
-	 * 		CRoot reports this as if the CProject has been added.
-	 * <li>otherwise, the CRoot reports this
+	 * 		CModel reports this as if the CProject has been added.
+	 * <li>otherwise, the CModel reports this
 	 *		as a the element being opened (CHANGED + F_CLOSED).
 	 * </ul>
 	 */
@@ -246,12 +265,12 @@
 	/**
 	 * Converts a <code>IResourceDelta</code> rooted in a <code>Workspace</code> into
 	 * the corresponding set of <code>ICElementDelta</code>, rooted in the
-	 * relevant <code>CRoot</code>s.
+	 * relevant <code>CModel</code>s.
 	 */
 	public ICElementDelta[] processResourceDelta(IResourceDelta changes) {
 
 		try {
-			ICElement root = (ICRoot)CModelManager.getDefault().getCRoot();
+			ICElement root = (ICModel)CModelManager.getDefault().getCModel();
 			currentElement = null;
 			
 /*
Index: model/org/eclipse/cdt/internal/core/model/ElementCache.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java,v
retrieving revision 1.1
diff -u -r1.1 ElementCache.java
--- model/org/eclipse/cdt/internal/core/model/ElementCache.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/ElementCache.java	27 Mar 2003 16:00:32 -0000
@@ -12,7 +12,7 @@
 ***********************************************************************/
 
 import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICOpenable;
+import org.eclipse.cdt.core.model.IOpenable;
 import org.eclipse.cdt.internal.core.util.LRUCache;
 import org.eclipse.cdt.internal.core.util.OverflowingLRUCache;
 
@@ -43,7 +43,7 @@
 	 * by closing the element.
 	 */
 	protected boolean close(LRUCacheEntry entry) {
-		ICOpenable element = (ICOpenable) entry._fKey;
+		IOpenable element = (IOpenable) entry._fKey;
 		try {
 			if (element.hasUnsavedChanges()) {
 				return false;
Index: model/org/eclipse/cdt/internal/core/model/FieldInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java,v
retrieving revision 1.1
diff -u -r1.1 FieldInfo.java
--- model/org/eclipse/cdt/internal/core/model/FieldInfo.java	26 Mar 2003 16:03:03 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/FieldInfo.java	27 Mar 2003 16:00:32 -0000
@@ -16,7 +16,7 @@
 public class FieldInfo extends SourceManipulationInfo {
 
 	int flags = 0;
-	String typeStr;
+	String typeStr = "";
 	boolean isConst = false;
 	boolean isVolatile = false;
 	boolean isMutable = false;
Index: model/org/eclipse/cdt/internal/core/model/FunctionInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java,v
retrieving revision 1.2
diff -u -r1.2 FunctionInfo.java
--- model/org/eclipse/cdt/internal/core/model/FunctionInfo.java	26 Mar 2003 16:03:03 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/FunctionInfo.java	27 Mar 2003 16:00:32 -0000
@@ -8,7 +8,7 @@
 class FunctionInfo extends SourceManipulationInfo {
 
 	protected int flags;
-	protected String returnType;
+	protected String returnType = "";
 	protected int numOfParams;
 
 	protected FunctionInfo (CElement element) {
Index: model/org/eclipse/cdt/internal/core/model/IBuffer.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/IBuffer.java
diff -N model/org/eclipse/cdt/internal/core/model/IBuffer.java
--- model/org/eclipse/cdt/internal/core/model/IBuffer.java	19 Mar 2003 20:19:36 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,259 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-
-/**********************************************************************
- * 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 org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICOpenable;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * A buffer contains the text contents of a resource. It is not language-specific.
- * The contents may be in the process of being edited, differing from the actual contents of the 
- * underlying resource. A buffer has an owner, which is an
- * <code>IOpenable</code>. If a buffer does not have an underlying resource,
- * saving the buffer has no effect. Buffers can be read-only.
- * <p>
- * This interface is similar to the JDT IBuffer interface.
- */
-
-public interface IBuffer {
-
-	/**
-	 * Adds the given listener for changes to this buffer.
-	 * Has no effect if an identical listener is already registered or if the buffer
-	 * is closed.
-	 *
-	 * @param listener the listener of buffer changes
-	 */
-	public void addBufferChangedListener(IBufferChangedListener listener);
-	/**
-	 * Appends the given character array to the contents of the buffer.
-	 * This buffer will now have unsaved changes.
-	 * Any client can append to the contents of the buffer, not just the owner of the buffer.
-	 * Reports a buffer changed event.
-	 * <p>
-	 * Has no effect if this buffer is read-only.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param text the given character array to append to contents of the buffer
-	 */
-	public void append(char[] text);
-	/**
-	 * Appends the given string to the contents of the buffer.
-	 * This buffer will now have unsaved changes.
-	 * Any client can append to the contents of the buffer, not just the owner of the buffer.
-	 * Reports a buffer changed event.
-	 * <p>
-	 * Has no effect if this buffer is read-only.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param text the <code>String</code> to append to the contents of the buffer
-	 */
-	public void append(String text);
-	/**
-	 * Closes the buffer. Any unsaved changes are lost. Reports a buffer changed event
-	 * with a 0 offset and a 0 length. When this event is fired, the buffer should already
-	 * be closed.
-	 * <p>
-	 * Further operations on the buffer are not allowed, except for close.  If an
-	 * attempt is made to close an already closed buffer, the second attempt has no effect.
-	 */
-	public void close();
-	/**
-	 * Returns the character at the given position in this buffer.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param position a zero-based source offset in this buffer
-	 * @return the character at the given position in this buffer
-	 */
-	public char getChar(int position);
-	/**
-	 * Returns the contents of this buffer as a character array, or <code>null</code> if
-	 * the buffer has not been initialized.
-	 * <p>
-	 * Callers should make no assumption about whether the returned character array
-	 * is or is not the genuine article or a copy. In other words, if the client
-	 * wishes to change this array, they should make a copy. Likewise, if the
-	 * client wishes to hang on to the array in its current state, they should
-	 * make a copy.
-	 * </p>
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @return the characters contained in this buffer
-	 */
-	public char[] getCharacters();
-	/**
-	 * Returns the contents of this buffer as a <code>String</code>. Like all strings,
-	 * the result is an immutable value object., It can also answer <code>null</code> if
-	 * the buffer has not been initialized.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @return the contents of this buffer as a <code>String</code>
-	 */
-	public String getContents();
-	/**
-	 * Returns number of characters stored in this buffer.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @return the number of characters in this buffer
-	 */
-	public int getLength();
-	/**
-	 * Returns the resource element owning of this buffer.
-	 *
-	 * @return the resource element owning this buffer
-	 */
-	public ICOpenable getOwner();
-	/**
-	 * Returns the given range of text in this buffer.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param offset the  zero-based starting offset
-	 * @param length the number of characters to retrieve
-	 * @return the given range of text in this buffer
-	 */
-	public String getText(int offset, int length);
-	/**
-	 * Returns the underlying resource for which this buffer was opened,
-	 * or <code>null</code> if this buffer was not opened on a resource.
-	 *
-	 * @return the underlying resource for this buffer, or <code>null</code>
-	 *  if none.
-	 */
-	public IResource getUnderlyingResource();
-	/**
-	 * Returns whether this buffer has been modified since it
-	 * was opened or since it was last saved.
-	 * If a buffer does not have an underlying resource, this method always
-	 * returns <code>true</code>.
-	 *
-	 * @return a <code>boolean</code> indicating presence of unsaved changes (in
-	 *   the absence of any underlying resource, it will always return <code>true</code>).
-	 */
-	public boolean hasUnsavedChanges();
-	/**
-	 * Returns whether this buffer has been closed.
-	 *
-	 * @return a <code>boolean</code> indicating whether this buffer is closed.
-	 */
-	public boolean isClosed();
-	/**
-	 * Returns whether this buffer is read-only.
-	 *
-	 * @return a <code>boolean</code> indicating whether this buffer is read-only
-	 */
-	public boolean isReadOnly();
-	/**
-	 * Removes the given listener from this buffer.
-	 * Has no affect if an identical listener is not registered or if the buffer is closed.
-	 *
-	 * @param listener the listener
-	 */
-	public void removeBufferChangedListener(IBufferChangedListener listener);
-	/**
-	 * Replaces the given range of characters in this buffer with the given text.
-	 * <code>position</code> and <code>position + length</code> must be in the range [0, getLength()].
-	 * <code>length</code> must not be negative.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param position the zero-based starting position of the affected text range in this buffer
-	 * @param length the length of the affected text range in this buffer
-	 * @param text the replacing text as a character array
-	 */
-	public void replace(int position, int length, char[] text);
-	/**
-	 * Replaces the given range of characters in this buffer with the given text.
-	 * <code>position</code> and <code>position + length</code> must be in the range [0, getLength()].
-	 * <code>length</code> must not be negative.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param position the zero-based starting position of the affected text range in this buffer
-	 * @param length the length of the affected text range in this buffer
-	 * @param text the replacing text as a <code>String</code>
-	 */
-	public void replace(int position, int length, String text);
-	/**
-	 * Saves the contents of this buffer to its underlying resource. If
-	 * successful, this buffer will have no unsaved changes.
-	 * The buffer is left open. Saving a buffer with no unsaved
-	 * changes has no effect - the underlying resource is not changed.
-	 * If the buffer does not have an underlying resource or is read-only, this
-	 * has no effect.
-	 * <p>
-	 * The <code>force</code> parameter controls how this method deals with
-	 * cases where the workbench is not completely in sync with the local file system.
-	 * If <code>false</code> is specified, this method will only attempt
-	 * to overwrite a corresponding file in the local file system provided
-	 * it is in sync with the workbench. This option ensures there is no 
-	 * unintended data loss; it is the recommended setting.
-	 * However, if <code>true</code> is specified, an attempt will be made
-	 * to write a corresponding file in the local file system, 
-	 * overwriting any existing one if need be.
-	 * In either case, if this method succeeds, the resource will be marked 
-	 * as being local (even if it wasn't before).
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param progress the progress monitor to notify
-	 * @param force a <code> boolean </code> flag indicating how to deal with resource
-	 *   inconsistencies.
-	 *
-	 * @exception CModelException if an error occurs writing the buffer 	to
-	 * the underlying resource
-	 *
-	 * @see org.eclipse.core.resources.IFile#setContents(java.io.InputStream, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void save(IProgressMonitor progress, boolean force) throws CModelException;
-	/**
-	 * Sets the contents of this buffer to the given character array.
-	 * This buffer will now have unsaved changes.
-	 * Any client can set the contents of the buffer, not just the owner of the buffer.
-	 * Reports a buffer changed event.
-	 * <p>
-	 * Equivalent to <code>replace(0,getLength(),contents)</code>.
-	 * </p>
-	 * <p>
-	 * Has no effect if this buffer is read-only.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param contents the new contents of this buffer as a character array
-	 */
-	public void setContents(char[] contents);
-	/**
-	 * Sets the contents of this buffer to the given <code>String</code>.
-	 * This buffer will now have unsaved changes.
-	 * Any client can set the contents of the buffer, not just the owner of the buffer.
-	 * Reports a buffer changed event.
-	 * <p>
-	 * Equivalent to <code>replace(0,getLength(),contents)</code>.
-	 * </p>
-	 * <p>
-	 * Has no effect if this buffer is read-only.
-	 * <p>
-	 * A <code>RuntimeException</code> might be thrown if the buffer is closed.
-	 *
-	 * @param contents the new contents of this buffer as a <code>String</code>
-	 */
-	public void setContents(String contents);
-
-}
Index: model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java
diff -N model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java
--- model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java	19 Mar 2003 20:19:36 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-package org.eclipse.cdt.internal.core.model;
-/**********************************************************************
- * 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
-***********************************************************************/
-
-/**
- * A listener, which gets notified when the contents of a specific buffer
- * have changed, or when the buffer is closed.
- * When a buffer is closed, the listener is notified <em>after</em> the buffer has been closed.
- * A listener is not notified when a buffer is saved.
- * <p>
- * This interface may be implemented by clients.
- * </p>
- * 
- * This interface is similar to the JDT IBufferChangedListener interface
- */
-public interface IBufferChangedListener {
-	/** 
-	 * Notifies that the given event has occurred.
-	 *
-	 * @param event the change event
-	 */
-	public void bufferChanged(BufferChangedEvent event);
-
-}
Index: model/org/eclipse/cdt/internal/core/model/IBufferFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IBufferFactory.java,v
retrieving revision 1.1
diff -u -r1.1 IBufferFactory.java
--- model/org/eclipse/cdt/internal/core/model/IBufferFactory.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/IBufferFactory.java	27 Mar 2003 16:00:32 -0000
@@ -11,7 +11,8 @@
  * Rational Software - Initial API and implementation
 ***********************************************************************/
 
-import org.eclipse.cdt.core.model.ICOpenable;
+import org.eclipse.cdt.core.model.*;
+import org.eclipse.cdt.core.model.IOpenable;
 /**
  * A factory that creates <code>IBuffer</code>s for CFiles.
  * <p>
@@ -31,5 +32,5 @@
 	 * @param owner the owner of the buffer
 	 * @see IBuffer
 	 */
-	IBuffer createBuffer(ICOpenable owner);
+	IBuffer createBuffer(IOpenable owner);
 }
Index: model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java,v
retrieving revision 1.1
diff -u -r1.1 IWorkingCopy.java
--- model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java	27 Mar 2003 16:00:33 -0000
@@ -13,7 +13,6 @@
 
 
 import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ITranslationUnit;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IResource;
Index: model/org/eclipse/cdt/internal/core/model/Openable.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/Openable.java
diff -N model/org/eclipse/cdt/internal/core/model/Openable.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/Openable.java	27 Mar 2003 16:00:34 -0000
@@ -0,0 +1,310 @@
+package org.eclipse.cdt.internal.core.model;
+
+/*
+ * (c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ */
+ 
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.cdt.core.model.BufferChangedEvent;
+import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.IBuffer;
+import org.eclipse.cdt.core.model.IBufferChangedListener;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICModelStatusConstants;
+import org.eclipse.cdt.core.model.IOpenable;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public abstract class Openable extends Parent implements IOpenable, IBufferChangedListener {
+	
+	public Openable (ICElement parent, IPath path, int type) {
+		// Check if the file is under the workspace.
+		this (parent, ResourcesPlugin.getWorkspace().getRoot().getFileForLocation (path),
+			path.lastSegment(), type);
+	}
+
+	public Openable (ICElement parent, IResource resource, int type) {
+		this (parent, resource, resource.getName(), type);
+	}
+	
+	public Openable (ICElement parent, IResource resource, String name, int type) {
+		super (parent, resource, name, type);
+	}
+
+	public IResource getUnderlyingResource() throws CModelException {
+		IResource res = getResource();
+		if (res == null) {
+			ICElement p = getParent();
+			if (p != null) {
+				res = p.getUnderlyingResource();
+			}
+		}
+		return res;
+	}
+
+	public IResource getResource() throws CModelException {
+		return resource;
+	}
+	
+	protected abstract CElementInfo createElementInfo ();
+
+	/**
+	 * The buffer associated with this element has changed. Registers
+	 * this element as being out of synch with its buffer's contents.
+	 * If the buffer has been closed, this element is set as NOT out of
+	 * synch with the contents.
+	 *
+	 * @see IBufferChangedListener
+	 */
+	public void bufferChanged(BufferChangedEvent event) {
+		if (event.getBuffer().isClosed()) {
+			CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
+			getBufferManager().removeBuffer(event.getBuffer());
+		} else {
+			CModelManager.getDefault().getElementsOutOfSynchWithBuffers().put(this, this);
+		}
+	}	
+	/**
+	 * Updates the info objects for this element and all of its children by
+	 * removing the current infos, generating new infos, and then placing
+	 * the new infos into the C Model cache tables.
+	 */
+	protected void buildStructure(OpenableInfo info, IProgressMonitor monitor) throws CModelException {
+
+		if (monitor != null && monitor.isCanceled()) return;
+	
+		// remove existing (old) infos
+		removeInfo();
+		HashMap newElements = new HashMap(11);
+		info.setIsStructureKnown(generateInfos(info, monitor, newElements, getResource()));
+		CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
+		for (Iterator iter = newElements.keySet().iterator(); iter.hasNext();) {
+			ICElement key = (ICElement) iter.next();
+			Object value = newElements.get(key);
+			CModelManager.getDefault().putInfo(key, value);
+		}
+		
+		// add the info for this at the end, to ensure that a getInfo cannot reply null in case the LRU cache needs
+		// to be flushed. Might lead to performance issues.
+		CModelManager.getDefault().putInfo(this, info);	
+	}
+
+	/**
+	 * Close the buffer associated with this element, if any.
+	 */
+	protected void closeBuffer(OpenableInfo info) {
+		if (!hasBuffer()) return; // nothing to do
+		IBuffer buffer = null;
+		buffer = getBufferManager().getBuffer(this);
+		if (buffer != null) {
+			buffer.close();
+			buffer.removeBufferChangedListener(this);
+		}
+	}
+
+	/**
+	 * Builds this element's structure and properties in the given
+	 * info object, based on this element's current contents (i.e. buffer
+	 * contents if this element has an open buffer, or resource contents
+	 * if this element does not have an open buffer). Children
+	 * are placed in the given newElements table (note, this element
+	 * has already been placed in the newElements table). Returns true
+	 * if successful, or false if an error is encountered while determining
+	 * the structure of this element.
+	 */
+	protected abstract boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException;
+	//protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException {
+	//	return false;
+	//}
+
+	/**
+	 * @see org.eclipse.cdt.core.model.IOpenable#getBuffer()
+	 */
+	public IBuffer getBuffer() throws CModelException {
+		if (hasBuffer()) {
+			// ensure element is open
+			if (!isOpen()) {
+				getElementInfo();
+			}
+			IBuffer buffer = getBufferManager().getBuffer(this);
+			if (buffer == null) {
+				// try to (re)open a buffer
+				buffer = openBuffer(null);
+			}
+			return buffer;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Answers the buffer factory to use for creating new buffers
+	 */
+	public IBufferFactory getBufferFactory(){
+		return getBufferManager().getDefaultBufferFactory();
+	}
+
+	/**
+	 * Returns the buffer manager for this element.
+	 */
+	protected BufferManager getBufferManager() {
+		return BufferManager.getDefaultBufferManager();
+	}
+	
+	/**
+	 * Returns true if this element may have an associated source buffer,
+	 * otherwise false. Subclasses must override as required.
+	 */
+	protected boolean hasBuffer() {
+		return false;
+	}
+	/**
+	 * @see org.eclipse.cdt.core.model.IOpenable#hasUnsavedChanges()
+	 */
+	public boolean hasUnsavedChanges() throws CModelException{
+	
+		if (isReadOnly() || !isOpen()) {
+			return false;
+		}
+		IBuffer buf = this.getBuffer();
+		if (buf != null && buf.hasUnsavedChanges()) {
+			return true;
+		}
+		// for roots and projects must check open buffers
+		// to see if they have an child with unsaved changes
+		if (fType == C_MODEL ||
+			fType == C_PROJECT) {
+			Enumeration openBuffers= getBufferManager().getOpenBuffers();
+			while (openBuffers.hasMoreElements()) {
+				IBuffer buffer= (IBuffer)openBuffers.nextElement();
+				if (buffer.hasUnsavedChanges()) {
+					ICElement owner= (ICElement)buffer.getOwner();
+					if (isAncestorOf(owner)) {
+						return true;
+					}
+				}
+			}
+		}
+	
+		return false;
+	}
+	/**
+	 * Subclasses must override as required.
+	 * 
+	 * @see org.eclipse.cdt.core.model.IOpenable#isConsistent()
+	 */
+	public boolean isConsistent() throws CModelException {
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.cdt.core.model.IOpenable#isOpen()
+	 */	
+	public boolean isOpen() {
+		synchronized(CModelManager.getDefault()){
+			return CModelManager.getDefault().getInfo(this) != null;
+		}
+	}
+
+	/**
+	 * Returns true if this represents a source element.
+	 * Openable source elements have an associated buffer created
+	 * when they are opened.
+	 */
+	protected boolean isSourceElement() {
+		return false;
+	}
+
+	/**
+	 * @see org.eclipse.cdt.core.model.IOpenable#makeConsistent(IProgressMonitor)
+	 */
+	public void makeConsistent(IProgressMonitor pm) throws CModelException {
+		if (!isConsistent()) {
+			buildStructure((OpenableInfo)getElementInfo(), pm);
+		}
+	}
+
+	/**
+	 * @see org.eclipse.cdt.core.model.IOpenable#open(IProgressMonitor)
+	 */
+	public void open(IProgressMonitor pm) throws CModelException {
+		if (!isOpen()) {
+			this.openWhenClosed(pm);
+		}
+	}
+
+	/**
+	 * Opens a buffer on the contents of this element, and returns
+	 * the buffer, or returns <code>null</code> if opening fails.
+	 * By default, do nothing - subclasses that have buffers
+	 * must override as required.
+	 */
+	protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException {
+		return null;
+	}
+
+	/**
+	 * 	Open the parent element if necessary
+	 * 
+	 */
+	protected void openParent(IProgressMonitor pm) throws CModelException {
+
+		Openable openableParent = (Openable)getOpenableParent();
+		if (openableParent != null) {
+			if (!openableParent.isOpen()){
+				openableParent.openWhenClosed(pm);
+			}
+		}
+	}
+
+	/**
+	 * Open a <code>IOpenable</code> that is known to be closed (no check for
+	 * <code>isOpen()</code>).
+	 */
+	protected void openWhenClosed(IProgressMonitor pm) throws CModelException {
+		try {
+			
+			// 1) Parent must be open - open the parent if necessary
+			openParent(pm);
+
+			// 2) create the new element info and open a buffer if needed
+			OpenableInfo info = (OpenableInfo) createElementInfo();
+			IResource resource = getResource();
+			if (resource != null && isSourceElement()) {
+				this.openBuffer(pm);
+			} 
+
+			// 3) build the structure of the openable
+			buildStructure(info, pm);
+		
+			// if any problems occuring openning the element, ensure that it's info
+			// does not remain in the cache	(some elements, pre-cache their info
+			// as they are being opened).
+		} catch (CModelException e) {
+			CModelManager.getDefault().removeInfo(this);
+			throw e;
+		}
+	}
+
+	/**
+	 * @see org.eclipse.cdt.core.model.IOpenable#save(IProgressMonitor, boolean)
+	 */
+	public void save(IProgressMonitor pm, boolean force) throws CModelException {
+		if (isReadOnly() || this.getResource().isReadOnly()) {
+			throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
+		}
+		IBuffer buf = getBuffer();
+		if (buf != null) { 
+			buf.save(pm, force);
+			this.makeConsistent(pm); // update the element info of this element
+		}
+	}
+		
+}
Index: model/org/eclipse/cdt/internal/core/model/OpenableInfo.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/OpenableInfo.java
diff -N model/org/eclipse/cdt/internal/core/model/OpenableInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ model/org/eclipse/cdt/internal/core/model/OpenableInfo.java	27 Mar 2003 16:00:34 -0000
@@ -0,0 +1,20 @@
+package org.eclipse.cdt.internal.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+
+/**
+ */
+public class OpenableInfo extends CElementInfo {
+
+	/**
+	 * Constructs a new C Model Info 
+	 */
+	protected OpenableInfo(CElement element) {
+		super(element);
+	}
+
+}
Index: model/org/eclipse/cdt/internal/core/model/Parent.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java,v
retrieving revision 1.3
diff -u -r1.3 Parent.java
--- model/org/eclipse/cdt/internal/core/model/Parent.java	19 Mar 2003 20:19:36 -0000	1.3
+++ model/org/eclipse/cdt/internal/core/model/Parent.java	27 Mar 2003 16:00:34 -0000
@@ -101,7 +101,7 @@
 	}
 
 	public IResource getResource() throws CModelException {
-		return null;
+		return resource;
 	}
 
 	protected void setChanged () {
Index: model/org/eclipse/cdt/internal/core/model/SourceManipulation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java,v
retrieving revision 1.3
diff -u -r1.3 SourceManipulation.java
--- model/org/eclipse/cdt/internal/core/model/SourceManipulation.java	19 Mar 2003 20:19:36 -0000	1.3
+++ model/org/eclipse/cdt/internal/core/model/SourceManipulation.java	27 Mar 2003 16:00:34 -0000
@@ -7,7 +7,7 @@
  
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICOpenable;
+import org.eclipse.cdt.core.model.IOpenable;
 import org.eclipse.cdt.core.model.ISourceManipulation;
 import org.eclipse.cdt.core.model.ISourceRange;
 import org.eclipse.cdt.core.model.ISourceReference;
@@ -43,7 +43,7 @@
 		if (rename != null) {
 			renamings= new String[] {rename};
 		}
-		getCRoot().copy(elements, containers, siblings, renamings, force, monitor);
+		getCModel().copy(elements, containers, siblings, renamings, force, monitor);
 	}
 
 	/**
@@ -51,7 +51,7 @@
 	 */
 	public void delete(boolean force, IProgressMonitor monitor) throws CModelException {
 		ICElement[] elements = new ICElement[] {this};
-		getCRoot().delete(elements, force, monitor);
+		getCModel().delete(elements, force, monitor);
 	}
 
 	/**
@@ -72,7 +72,7 @@
 		if (rename != null) {
 			renamings= new String[] {rename};
 		}
-		getCRoot().move(elements, containers, siblings, renamings, force, monitor);
+		getCModel().move(elements, containers, siblings, renamings, force, monitor);
 	}
 
 	/**
@@ -85,7 +85,7 @@
 		ICElement[] elements= new ICElement[] {this};
 		ICElement[] dests= new ICElement[] {this.getParent()};
 		String[] renamings= new String[] {name};
-		getCRoot().rename(elements, dests, renamings, force, monitor);
+		getCModel().rename(elements, dests, renamings, force, monitor);
 	}
 
 	/**
@@ -107,13 +107,13 @@
 
 	/**
 	 * Returns the first parent of the element that is an instance of
-	 * ICOpenable.
+	 * IOpenable.
 	 */
-	public ICOpenable getOpenableParent() {
+	public IOpenable getOpenableParent() {
 		ICElement current = getParent();
 		while (current != null){
-			if (current instanceof ICOpenable){
-				return (ICOpenable) current;
+			if (current instanceof IOpenable){
+				return (IOpenable) current;
 			}
 			current = current.getParent();
 		}
Index: model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java,v
retrieving revision 1.2
diff -u -r1.2 SourceManipulationInfo.java
--- model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java	20 Mar 2003 16:44:05 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java	27 Mar 2003 16:00:35 -0000
@@ -87,7 +87,7 @@
 		if (rename != null) {
 			renamings= new String[] {rename};
 		}
-		getElement().getCRoot().copy(elements, containers, siblings, renamings, force, monitor);
+		getElement().getCModel().copy(elements, containers, siblings, renamings, force, monitor);
 	}
 
 	/**
@@ -95,7 +95,7 @@
 	 */
 	public void delete(boolean force, IProgressMonitor monitor) throws CModelException {
 		ICElement[] elements = new ICElement[] {getElement()};
-		getElement().getCRoot().delete(elements, force, monitor);
+		getElement().getCModel().delete(elements, force, monitor);
 	}
 
 	/**
@@ -116,7 +116,7 @@
 		if (rename != null) {
 			renamings= new String[] {rename};
 		}
-		getElement().getCRoot().move(elements, containers, siblings, renamings, force, monitor);
+		getElement().getCModel().move(elements, containers, siblings, renamings, force, monitor);
 	}
 
 	/**
@@ -129,7 +129,7 @@
 		ICElement[] elements= new ICElement[] {getElement()};
 		ICElement[] dests= new ICElement[] {getElement().getParent()};
 		String[] renamings= new String[] {name};
-		getElement().getCRoot().rename(elements, dests, renamings, force, monitor);
+		getElement().getCModel().rename(elements, dests, renamings, force, monitor);
 	}
 	
 	/**
Index: model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java,v
retrieving revision 1.2
diff -u -r1.2 TranslationUnit.java
--- model/org/eclipse/cdt/internal/core/model/TranslationUnit.java	19 Mar 2003 20:19:36 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/TranslationUnit.java	27 Mar 2003 16:00:36 -0000
@@ -12,6 +12,7 @@
 import java.util.Map;
 
 import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.IBuffer;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.IInclude;
 import org.eclipse.cdt.core.model.IParent;
@@ -27,16 +28,18 @@
 /**
  * @see ITranslationUnit
  */
-public class TranslationUnit extends CFile implements ITranslationUnit {
+public class TranslationUnit extends Openable implements ITranslationUnit {
+
+	IPath location = null;
 
 	SourceManipulationInfo sourceManipulationInfo = null;
 
 	public TranslationUnit(ICElement parent, IFile file) {
-		super(parent, file);
+		super(parent, file, ICElement.C_UNIT);
 	}
 
 	public TranslationUnit(ICElement parent, IPath path) {
-		super(parent, path);
+		super(parent, path, ICElement.C_UNIT);
 	}
 
 	public ITranslationUnit getTranslationUnit () {
@@ -121,6 +124,32 @@
 		return (IUsing[])aList.toArray(new IUsing[0]);
 	}
 
+	public void setLocation(IPath loc) {
+		location = loc;
+	}
+
+	public IPath getLocation() {
+		if (location == null) {
+			IFile file = getFile();
+			if (file != null) {
+				location = file.getLocation();
+			} else {
+				return getPath();
+			}
+		}
+		return location;
+	}
+
+	protected IFile getFile() {
+		try {
+			IResource res = getResource();
+			if (res instanceof IFile) {
+				return (IFile)res;
+			}
+		} catch (CModelException e) {
+		}
+		return null;
+	}
 
 	/**
 	 * @see ISourceManipulation
@@ -188,7 +217,7 @@
 	/**
 	 * @see org.eclipse.cdt.internal.core.model.CFile#buildStructure(CFileInfo, IProgressMonitor)
 	 */
-	protected void buildStructure(CFileInfo info, IProgressMonitor monitor) throws CModelException {
+	protected void buildStructure(OpenableInfo info, IProgressMonitor monitor) throws CModelException {
 		if (monitor != null && monitor.isCanceled()) return;
 
 		// remove existing (old) infos
@@ -268,9 +297,9 @@
 	}
 	
 	/**
-	 * @see org.eclipse.cdt.internal.core.model.CResource#generateInfos(CResourceInfo, IProgressMonitor, Map, IResource)
+	 * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(OpenableInfo, IProgressMonitor, Map, IResource)
 	 */
-	protected boolean generateInfos(CResourceInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException {
+	protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException {
 		// put the info now, because getting the contents requires it
 		CModelManager.getDefault().putInfo(this, info);
 		TranslationUnitInfo unitInfo = (TranslationUnitInfo) info;
@@ -368,14 +397,14 @@
 	}
 
 	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#isConsistent()
+	 * @see org.eclipse.cdt.core.model.IOpenable#isConsistent()
 	 */
 	public boolean isConsistent() throws CModelException {
 		return CModelManager.getDefault().getElementsOutOfSynchWithBuffers().get(this) == null;
 	}
 
 	/**
-	 * @see org.eclipse.cdt.internal.core.model.CResource#isSourceElement()
+	 * @see org.eclipse.cdt.internal.core.model.Openable#isSourceElement()
 	 */
 	protected boolean isSourceElement() {
 		return true;
@@ -388,18 +417,18 @@
 	}
 
 	/**
-	 * @see org.eclipse.cdt.core.model.ICOpenable#makeConsistent(IProgressMonitor)
+	 * @see org.eclipse.cdt.core.model.IOpenable#makeConsistent(IProgressMonitor)
 	 */
 	public void makeConsistent(IProgressMonitor pm) throws CModelException {
 		if (!isConsistent()) {
 			// create a new info and make it the current info
-			CFileInfo info = (CFileInfo) createElementInfo();
+			OpenableInfo info = (OpenableInfo) createElementInfo();
 			buildStructure(info, pm);
 		}
 	}
 
 	/**
-	 * @see org.eclipse.cdt.internal.core.model.CResource#openBuffer(IProgressMonitor)
+	 * @see org.eclipse.cdt.internal.core.model.Openable#openBuffer(IProgressMonitor)
 	 */
 	protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException {
 
Index: model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java,v
retrieving revision 1.4
diff -u -r1.4 TranslationUnitInfo.java
--- model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java	19 Mar 2003 20:19:36 -0000	1.4
+++ model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java	27 Mar 2003 16:00:36 -0000
@@ -18,7 +18,7 @@
 /**
  * The Element Info of a Translation Unit.
  */
-class TranslationUnitInfo extends CFileInfo {
+class TranslationUnitInfo extends OpenableInfo {
 
 	/** 
 	 * Timestamp of original resource at the time this element
Index: model/org/eclipse/cdt/internal/core/model/VariableInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java,v
retrieving revision 1.2
diff -u -r1.2 VariableInfo.java
--- model/org/eclipse/cdt/internal/core/model/VariableInfo.java	26 Mar 2003 16:03:03 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/VariableInfo.java	27 Mar 2003 16:00:36 -0000
@@ -8,7 +8,7 @@
 class VariableInfo extends SourceManipulationInfo {
 
 	protected int flags;
-	String typeStr;
+	String typeStr = "";
 	
 	protected VariableInfo (CElement element) {
 		super(element);
Index: model/org/eclipse/cdt/internal/core/model/WorkingCopy.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java,v
retrieving revision 1.1
diff -u -r1.1 WorkingCopy.java
--- model/org/eclipse/cdt/internal/core/model/WorkingCopy.java	19 Mar 2003 20:19:36 -0000	1.1
+++ model/org/eclipse/cdt/internal/core/model/WorkingCopy.java	27 Mar 2003 16:00:37 -0000
@@ -14,6 +14,7 @@
 import java.io.ByteArrayInputStream;
 import java.util.Map;
 
+import org.eclipse.cdt.core.model.*;
 import org.eclipse.cdt.core.model.CModelException;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICModelStatusConstants;



Back to the top