diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java index c66ebbe2ebc..58d70fe0056 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java @@ -81,7 +81,7 @@ public abstract class CElement extends PlatformObject implements ICElement { public boolean exists() { try { - return getCorrespondingResource() != null; + return getResource() != null; } catch (CModelException e) { e.printStackTrace(); } @@ -89,7 +89,7 @@ public abstract class CElement extends PlatformObject implements ICElement { } public boolean isReadOnly () { - return true; + return getElementInfo().isReadOnly(); } public boolean isStructureKnown() throws CModelException { @@ -149,7 +149,7 @@ public abstract class CElement extends PlatformObject implements ICElement { public abstract IResource getUnderlyingResource() throws CModelException; - public abstract IResource getCorrespondingResource() throws CModelException; + public abstract IResource getResource() throws CModelException; protected abstract CElementInfo createElementInfo(); @@ -184,8 +184,8 @@ public abstract class CElement extends PlatformObject implements ICElement { if (o instanceof CElement) { CElement other = (CElement) o; try { - IResource tres = getCorrespondingResource(); - IResource ores = other.getCorrespondingResource(); + IResource tres = getResource(); + IResource ores = other.getResource(); if (ores != null && tres != null) { return tres.equals(ores); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java index 95f4fb7c7b6..3072d84b5b5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java @@ -82,7 +82,7 @@ public abstract class Parent extends CElement implements IParent { return resource; } - public IResource getCorrespondingResource() throws CModelException { + public IResource getResource() throws CModelException { return null; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java index f63247e63b4..87e479b58b4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java @@ -126,6 +126,10 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I return getParent().getUnderlyingResource(); } + public IResource getResource() throws CModelException { + return null; + } + protected CElementInfo createElementInfo () { return new SourceManipulationInfo(this); }