1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

ICModel and ICProject no longer extends ICContainer

This commit is contained in:
Alain Magloire 2004-03-21 06:58:33 +00:00
parent f980b3161f
commit 7de97b8a11
12 changed files with 211 additions and 140 deletions

View file

@ -1,3 +1,22 @@
2004-03-21 Alain Magloire
The methods CoreModel.create() are now handle operation.
Meaning it will generate a ICElement even if the file does
not exists. ICModel and ICProject no longer implements
ICContainer.
* model/org/eclipse/cdt/core/model/ICModel.java
* model/org/eclipse/cdt/core/model/ICProject.java
* model/eclipse/cdt/internal/core/model/CContainer.java
* model/eclipse/cdt/internal/core/model/CContainerInfo.java
* model/eclipse/cdt/internal/core/model/CModel.java
* model/eclipse/cdt/internal/core/model/CModelInfo.java
* model/eclipse/cdt/internal/core/model/CModelManager.java
* model/eclipse/cdt/internal/core/model/CProject.java
* model/eclipse/cdt/internal/core/model/CCProjectInfo.java
* model/eclipse/cdt/internal/core/model/DeltaProcessor.java
2004-03-19 David Inglis 2004-03-19 David Inglis
* model/org/eclipse/cdt/core/model/CoreModel.java * model/org/eclipse/cdt/core/model/CoreModel.java

View file

@ -161,11 +161,14 @@ public interface ICModel extends ICElement, IParent, IOpenable {
/** /**
* Returns the C project with the given name. This is a handle-only method. * Returns the C project with the given name. This is a handle-only method.
* The project may or may not exist. * The project may or may not exist.
*
* @param name of the Project
*/ */
ICProject getCProject(String name); ICProject getCProject(String name);
/** /**
* Returns the C projects. * Returns the C projects.
*
*/ */
ICProject[] getCProjects(); ICProject[] getCProjects();

View file

@ -45,11 +45,25 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/** /**
* Returns the source root folders of the project. * Returns the source root folders of the project.
*
* <p>NOTE: This is equivalent to <code>getChildren()</code>.
*
* @return ISourceRoot - root folders * @return ISourceRoot - root folders
* @exception CModelException * @exception CModelException
*/ */
ISourceRoot[] getSourceRoots() throws CModelException; ISourceRoot[] getSourceRoots() throws CModelException;
/**
* Returns all of the existing source roots that exist
* on the pathentry, in the order they are defined by the ".cdtproject".
*
* @return all of the existing package fragment roots that exist
* on the classpath
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
*/
ISourceRoot[] getAllSourceRoots() throws CModelException;
/** /**
* *
* @param entry * @param entry

View file

@ -117,6 +117,18 @@ public class CContainer extends Openable implements ICContainer {
return new TranslationUnit(this, file); return new TranslationUnit(this, file);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.core.model.ICContainer#getCContainers()
*/
public ICContainer[] getCContainers() throws CModelException {
List list = getChildrenOfType(C_CCONTAINER);
ICContainer[] array = new ICContainer[list.size()];
list.toArray(array);
return array;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -239,13 +251,4 @@ public class CContainer extends Openable implements ICContainer {
return true; return true;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.core.model.ICContainer#getCContainers()
*/
public ICContainer[] getCContainers() throws CModelException {
// TODO Auto-generated method stub
return null;
}
} }

View file

@ -21,11 +21,6 @@ import org.eclipse.core.runtime.CoreException;
*/ */
public class CContainerInfo extends OpenableInfo { public class CContainerInfo extends OpenableInfo {
/**
* Shared empty collection used for efficiency.
*/
static Object[] NO_NON_C_RESOURCES = new Object[] {};
Object[] nonCResources = null; Object[] nonCResources = null;
/** /**

View file

@ -16,6 +16,11 @@ import org.eclipse.core.resources.IResource;
*/ */
class CElementInfo { class CElementInfo {
/**
* Shared empty collection used for efficiency.
*/
static Object[] NO_NON_C_RESOURCES = new Object[] {};
protected CElement element; protected CElement element;
/** /**

View file

@ -31,9 +31,11 @@ public class CModel extends Openable implements ICModel {
super (null, root, ICElement.C_MODEL); super (null, root, ICElement.C_MODEL);
} }
public ICProject getCProject(String name) { public boolean equals(Object o) {
IProject project = getWorkspace().getRoot().getProject(name); if (!(o instanceof CModel)) {
return CModelManager.getDefault().create(project); return false;
}
return super.equals(o);
} }
public ICProject[] getCProjects() { public ICProject[] getCProjects() {
@ -43,6 +45,14 @@ public class CModel extends Openable implements ICModel {
return array; return array;
} }
/**
* ICModel#getCProject(String)
*/
public ICProject getCProject(String name) {
IProject project = ((IWorkspaceRoot)getResource()).getProject(name);
return CModelManager.getDefault().create(project);
}
/** /**
* Returns the active C project associated with the specified * Returns the active C project associated with the specified
* resource, or <code>null</code> if no C project yet exists * resource, or <code>null</code> if no C project yet exists

View file

@ -11,7 +11,9 @@ import org.eclipse.core.resources.ResourcesPlugin;
/** /**
* @see ICModel * @see ICModel
*/ */
public class CModelInfo extends CContainerInfo { public class CModelInfo extends OpenableInfo {
Object[] nonCResources = null;
/** /**
* Constructs a new C Model Info * Constructs a new C Model Info
@ -57,4 +59,11 @@ public class CModelInfo extends CContainerInfo {
return nonCResources; return nonCResources;
} }
/**
* @return
*/
public void setNonCResources(Object[] resources) {
nonCResources = resources;
}
} }

View file

@ -38,7 +38,6 @@ import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.core.model.ISourceRoot; import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.core.model.IWorkingCopy; import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager; import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -53,7 +52,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
public class CModelManager implements IResourceChangeListener, ICDescriptorListener { public class CModelManager implements IResourceChangeListener, ICDescriptorListener {
@ -188,9 +186,6 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
return null; return null;
} }
if (cproject == null) {
cproject = create(resource.getProject());
}
int type = resource.getType(); int type = resource.getType();
switch (type) { switch (type) {
case IResource.PROJECT : case IResource.PROJECT :
@ -200,7 +195,7 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
case IResource.FOLDER : case IResource.FOLDER :
return create((IFolder)resource, cproject); return create((IFolder)resource, cproject);
case IResource.ROOT : case IResource.ROOT :
return create((IWorkspaceRoot)resource); return getCModel((IWorkspaceRoot)resource);
default : default :
return null; return null;
} }
@ -213,10 +208,6 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
return cModel.getCProject(project); return cModel.getCProject(project);
} }
public ICModel create(IWorkspaceRoot root) {
return getCModel();
}
public ICContainer create(IFolder folder, ICProject cproject) { public ICContainer create(IFolder folder, ICProject cproject) {
if (folder == null) { if (folder == null) {
return null; return null;
@ -227,7 +218,7 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
ICContainer celement = null; ICContainer celement = null;
IPath resourcePath = folder.getFullPath(); IPath resourcePath = folder.getFullPath();
try { try {
ISourceRoot[] roots = cproject.getSourceRoots(); ISourceRoot[] roots = cproject.getAllSourceRoots();
for (int i = 0; i < roots.length; ++i) { for (int i = 0; i < roots.length; ++i) {
ISourceRoot root = roots[i]; ISourceRoot root = roots[i];
IPath rootPath = root.getPath(); IPath rootPath = root.getPath();
@ -239,21 +230,9 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
String[] segments = path.segments(); String[] segments = path.segments();
ICContainer cfolder = root; ICContainer cfolder = root;
for (int j = 0; j < segments.length; j++) { for (int j = 0; j < segments.length; j++) {
IResource res = cfolder.getResource(); cfolder = cfolder.getCContainer(segments[j]);
if (res instanceof IContainer) {
IContainer container = (IContainer)res;
res = container.findMember(new Path(segments[j]));
if (res instanceof IFolder) {
cfolder = cfolder.getCContainer(segments[j]);
} else {
cfolder = null;
break;
}
}
}
if (cfolder != null) {
celement = cfolder;
} }
celement = cfolder;
} }
} }
} catch (CModelException e) { } catch (CModelException e) {
@ -271,43 +250,36 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
} }
ICElement celement = null; ICElement celement = null;
try { try {
ISourceRoot[] roots = cproject.getSourceRoots(); ISourceRoot[] roots = cproject.getAllSourceRoots();
for (int i = 0; i < roots.length; ++i) { for (int i = 0; i < roots.length; ++i) {
ISourceRoot root = roots[i]; ISourceRoot root = roots[i];
IPath rootPath = root.getPath(); IPath rootPath = root.getPath();
if (root.isOnSourceEntry(file)) { if (root.isOnSourceEntry(file)) {
IPath resourcePath = file.getFullPath(); IPath resourcePath = file.getFullPath();
IPath path = resourcePath.removeFirstSegments(rootPath.segmentCount()); IPath path = resourcePath.removeFirstSegments(rootPath.segmentCount());
String fileName = path.lastSegment();
path = path.removeLastSegments(1);
String[] segments = path.segments(); String[] segments = path.segments();
ICContainer cfolder = root; ICContainer cfolder = root;
for (int j = 0; j < segments.length; j++) { for (int j = 0; j < segments.length; j++) {
IResource res = cfolder.getResource(); cfolder = cfolder.getCContainer(segments[j]);
if (res instanceof IContainer) { }
IContainer container = (IContainer)res;
res = container.findMember(new Path(segments[j])); if (isValidTranslationUnitName(fileName)) {
if (res instanceof IFolder) { celement = cfolder.getTranslationUnit(fileName);
cfolder = cfolder.getCContainer(segments[j]); } else if (cproject.isOnOutputEntry(file)) {
} else if (res instanceof IFile) { IBinaryFile bin = createBinaryFile(file);
IFile f = (IFile)res; if (bin != null) {
if (isTranslationUnit(f)) { if (bin.getType() == IBinaryFile.ARCHIVE) {
celement = new TranslationUnit(cfolder, f); celement = new Archive(cfolder, file, (IBinaryArchive)bin);
} else if (cproject.isOnOutputEntry(f)) { ArchiveContainer vlib = (ArchiveContainer)cproject.getArchiveContainer();
IBinaryFile bin = createBinaryFile(f); vlib.addChild(celement);
if (bin != null) { } else {
if (bin.getType() == IBinaryFile.ARCHIVE) { celement = new Binary(cfolder, file, (IBinaryObject)bin);
celement = new Archive(cfolder, f, (IBinaryArchive)bin); if (bin.getType() == IBinaryFile.EXECUTABLE || bin.getType() == IBinaryFile.SHARED) {
ArchiveContainer vlib = (ArchiveContainer)cproject.getArchiveContainer(); BinaryContainer vbin = (BinaryContainer)cproject.getBinaryContainer();
vlib.addChild(celement); vbin.addChild(celement);
} else {
celement = new Binary(cfolder, f, (IBinaryObject)bin);
if (bin.getType() == IBinaryFile.EXECUTABLE || bin.getType() == IBinaryFile.SHARED) {
BinaryContainer vbin = (BinaryContainer)cproject.getBinaryContainer();
vbin.addChild(celement);
}
}
}
} }
break;
} }
} }
} }
@ -336,45 +308,7 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
} }
return celement; return celement;
} }
/*
public synchronized ICElement create(ICElement parent, IFile file, IBinaryFile bin) {
ICElement cfile = null;
if (isTranslationUnit(file)) {
cfile = new TranslationUnit(parent, file);
} else 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, (IBinaryArchive)bin);
} else {
cfile = new Binary(parent, file, bin);
}
}
}
// Added also to the Containers
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(cfile);
}
}
}
return cfile;
}
*/
public void releaseCElement(ICElement celement) { public void releaseCElement(ICElement celement) {
// Guard. // Guard.

View file

@ -12,6 +12,7 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CProjectNature; import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser;
@ -40,7 +41,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Preferences; import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
public class CProject extends CContainer implements ICProject { public class CProject extends Openable implements ICProject {
private static final String CUSTOM_DEFAULT_OPTION_VALUE = "#\r\n\r#custom-non-empty-default-value#\r\n\r#"; //$NON-NLS-1$ private static final String CUSTOM_DEFAULT_OPTION_VALUE = "#\r\n\r#custom-non-empty-default-value#\r\n\r#"; //$NON-NLS-1$
@ -87,6 +88,39 @@ public class CProject extends CContainer implements ICProject {
return false; return false;
} }
public static boolean hasCCNature(IProject p) {
try {
return p.hasNature(CCProjectNature.CC_NATURE_ID);
} catch (CoreException e) {
//throws exception if the project is not open.
}
return false;
}
private boolean isCProject() {
return hasCNature(getProject()) || hasCCNature(getProject());
}
/**
* Returns true if this handle represents the same C project
* as the given handle. Two handles represent the same
* project if they are identical or if they represent a project with
* the same underlying resource and occurrence counts.
*
* @see CElement#equals(Object)
*/
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof CProject))
return false;
CProject other = (CProject) o;
return getProject().equals(other.getProject());
}
protected CElementInfo createElementInfo() { protected CElementInfo createElementInfo() {
return new CProjectInfo(this); return new CProjectInfo(this);
} }
@ -255,6 +289,9 @@ public class CProject extends CContainer implements ICProject {
* Project preferences may include custom encoding. * Project preferences may include custom encoding.
*/ */
private Preferences getPreferences() { private Preferences getPreferences() {
if (!(isCProject())) {
return null;
}
Preferences preferences = new Preferences(); Preferences preferences = new Preferences();
Iterator iter = CModelManager.OptionNames.iterator(); Iterator iter = CModelManager.OptionNames.iterator();
@ -281,6 +318,9 @@ public class CProject extends CContainer implements ICProject {
private void savePreferences(Preferences preferences) { private void savePreferences(Preferences preferences) {
if (preferences == null) if (preferences == null)
return; return;
if (!isCProject()) {
return; // ignore
}
Iterator iter = CModelManager.OptionNames.iterator(); Iterator iter = CModelManager.OptionNames.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
@ -305,6 +345,9 @@ public class CProject extends CContainer implements ICProject {
* Set cached preferences, no preferences are saved, only info is updated * Set cached preferences, no preferences are saved, only info is updated
*/ */
private void setPreferences(Preferences preferences) { private void setPreferences(Preferences preferences) {
if (!isCProject()) {
return; // ignore
}
// Do nothing // Do nothing
} }
@ -355,9 +398,31 @@ public class CProject extends CContainer implements ICProject {
* @see org.eclipse.cdt.core.model.ICProject#getSourceRoots() * @see org.eclipse.cdt.core.model.ICProject#getSourceRoots()
*/ */
public ISourceRoot[] getSourceRoots() throws CModelException { public ISourceRoot[] getSourceRoots() throws CModelException {
Object[] children;
int length;
children = getChildren();
length = children.length;
ISourceRoot[] roots = new ISourceRoot[length];
System.arraycopy(children, 0, roots, 0, length);
return roots;
//return computeSourceRoots();
}
/**
*
* @return
* @throws CModelException
*/
public ISourceRoot[] getAllSourceRoots() throws CModelException {
return computeSourceRoots(); return computeSourceRoots();
} }
/**
*
*/
public IOutputEntry[] getOutputEntries() throws CModelException { public IOutputEntry[] getOutputEntries() throws CModelException {
IPathEntry[] entries = getResolvedPathEntries(); IPathEntry[] entries = getResolvedPathEntries();
ArrayList list = new ArrayList(entries.length); ArrayList list = new ArrayList(entries.length);
@ -371,6 +436,9 @@ public class CProject extends CContainer implements ICProject {
return outputs; return outputs;
} }
/**
*
*/
public boolean isOnOutputEntry(IResource resource) { public boolean isOnOutputEntry(IResource resource) {
IPath path = resource.getFullPath(); IPath path = resource.getFullPath();
@ -394,8 +462,7 @@ public class CProject extends CContainer implements ICProject {
} }
private boolean isOnOutputEntry(IOutputEntry entry, IPath path) { private boolean isOnOutputEntry(IOutputEntry entry, IPath path) {
if (entry.getPath().isPrefixOf(path) if (entry.getPath().isPrefixOf(path) && !Util.isExcluded(path, entry.fullExclusionPatternChars())) {
&& !Util.isExcluded(path, entry.fullExclusionPatternChars())) {
return true; return true;
} }
return false; return false;
@ -484,4 +551,20 @@ public class CProject extends CContainer implements ICProject {
return false; return false;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElement#exists()
*/
public boolean exists() {
if (!isCProject()) {
return false;
}
return super.exists();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getNonCResources()
*/
public Object[] getNonCResources() throws CModelException {
return ((CProjectInfo) getElementInfo()).getNonCResources(getResource());
}
} }

View file

@ -20,10 +20,11 @@ import org.eclipse.core.runtime.IPath;
* Info for ICProject. * Info for ICProject.
*/ */
class CProjectInfo extends CContainerInfo { class CProjectInfo extends OpenableInfo {
BinaryContainer vBin; BinaryContainer vBin;
ArchiveContainer vLib; ArchiveContainer vLib;
Object[] nonCResources = null;
/** /**
*/ */
@ -54,7 +55,8 @@ class CProjectInfo extends CContainerInfo {
if (nonCResources != null) if (nonCResources != null)
return nonCResources; return nonCResources;
// determine if src == project and/or if bin == project CProject cproject = (CProject)getElement();
// determine if src == project
IPath projectPath = res.getProject().getFullPath(); IPath projectPath = res.getProject().getFullPath();
ISourceRoot root = null; ISourceRoot root = null;
ICElement[] elements = getChildren(); ICElement[] elements = getChildren();
@ -108,4 +110,11 @@ class CProjectInfo extends CContainerInfo {
return nonCResources; return nonCResources;
} }
/**
* @param container
* @return
*/
public void setNonCResources(Object[] resources) {
nonCResources = resources;
}
} }

View file

@ -9,7 +9,6 @@ import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IArchiveContainer; import org.eclipse.cdt.core.model.IArchiveContainer;
import org.eclipse.cdt.core.model.IBinaryContainer; import org.eclipse.cdt.core.model.IBinaryContainer;
import org.eclipse.cdt.core.model.ICContainer;
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICElementDelta; import org.eclipse.cdt.core.model.ICElementDelta;
import org.eclipse.cdt.core.model.ICModel; import org.eclipse.cdt.core.model.ICModel;
@ -18,7 +17,6 @@ import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.core.model.ISourceRoot; import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager; import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IResourceDelta;
@ -70,7 +68,7 @@ public class DeltaProcessor {
ICProject cpj = manager.create((IProject)resParent); ICProject cpj = manager.create((IProject)resParent);
if (cpj != null) { if (cpj != null) {
try { try {
ISourceRoot[] roots = cpj.getSourceRoots(); ISourceRoot[] roots = cpj.getAllSourceRoots();
for (int i = 0; i < roots.length; i++) { for (int i = 0; i < roots.length; i++) {
if (roots[i].isOnSourceEntry(resource)) { if (roots[i].isOnSourceEntry(resource)) {
parent = roots[i]; parent = roots[i];
@ -139,22 +137,6 @@ public class DeltaProcessor {
} }
} }
// return an handler
if (celement == null) {
IResource resParent = resource.getParent();
ICElement parent = manager.create(resParent, null);
if (parent instanceof ICContainer) {
String name = resource.getName();
if (resource instanceof IFile) {
if (manager.isValidTranslationUnitName(name)) {
celement = ((ICContainer)parent).getTranslationUnit(name);
}
} else if (resource instanceof IFolder) {
celement = ((ICContainer)parent).getCContainer(name);
}
}
}
return celement; return celement;
} }
@ -440,13 +422,18 @@ public class DeltaProcessor {
} else { } else {
elementDelta.addResourceDelta(delta); elementDelta.addResourceDelta(delta);
} }
if (parent instanceof CContainer) { if (parent instanceof Openable && ((Openable)parent).isOpen()) {
// if info not created yet no need to null NonCResources... CElementInfo info = ((Openable)parent).getElementInfo();
if (CModelManager.getDefault().peekAtInfo(parent) != null) { switch (parent.getElementType()) {
CElementInfo info = ((CContainer)parent).getElementInfo(); case ICElement.C_MODEL:
if (info instanceof CContainerInfo) { ((CModelInfo)info).setNonCResources(null);
((CContainerInfo)info).setNonCResources(null); break;
} case ICElement.C_PROJECT:
((CProjectInfo)info).setNonCResources(null);
break;
case ICElement.C_CCONTAINER:
((CContainerInfo)info).setNonCResources(null);
break;
} }
} }
} }