1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 03:53:21 +02:00

New methos getResource().

This commit is contained in:
Alain Magloire 2002-11-18 15:46:45 +00:00
parent 12958aff89
commit d4532d506e
3 changed files with 10 additions and 6 deletions

View file

@ -81,7 +81,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
public boolean exists() { public boolean exists() {
try { try {
return getCorrespondingResource() != null; return getResource() != null;
} catch (CModelException e) { } catch (CModelException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -89,7 +89,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
} }
public boolean isReadOnly () { public boolean isReadOnly () {
return true; return getElementInfo().isReadOnly();
} }
public boolean isStructureKnown() throws CModelException { 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 getUnderlyingResource() throws CModelException;
public abstract IResource getCorrespondingResource() throws CModelException; public abstract IResource getResource() throws CModelException;
protected abstract CElementInfo createElementInfo(); protected abstract CElementInfo createElementInfo();
@ -184,8 +184,8 @@ public abstract class CElement extends PlatformObject implements ICElement {
if (o instanceof CElement) { if (o instanceof CElement) {
CElement other = (CElement) o; CElement other = (CElement) o;
try { try {
IResource tres = getCorrespondingResource(); IResource tres = getResource();
IResource ores = other.getCorrespondingResource(); IResource ores = other.getResource();
if (ores != null && tres != null) { if (ores != null && tres != null) {
return tres.equals(ores); return tres.equals(ores);
} }

View file

@ -82,7 +82,7 @@ public abstract class Parent extends CElement implements IParent {
return resource; return resource;
} }
public IResource getCorrespondingResource() throws CModelException { public IResource getResource() throws CModelException {
return null; return null;
} }

View file

@ -126,6 +126,10 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
return getParent().getUnderlyingResource(); return getParent().getUnderlyingResource();
} }
public IResource getResource() throws CModelException {
return null;
}
protected CElementInfo createElementInfo () { protected CElementInfo createElementInfo () {
return new SourceManipulationInfo(this); return new SourceManipulationInfo(this);
} }