mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
New methos getResource().
This commit is contained in:
parent
12958aff89
commit
d4532d506e
3 changed files with 10 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue