|
Eclipse CDT Pre-release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICModel
Represent the root C element corresponding to the workspace.
Since there is only one such root element, it is commonly referred to as
the 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 ICProject
s.
This interface provides methods for performing copy, move, rename, and delete operations on multiple C elements.
CCore#create(org.eclipse.core.resources.IWorkspaceRoot)
Field Summary |
---|
Method Summary | |
---|---|
void |
copy(ICElement[] elements,
ICElement[] containers,
ICElement[] siblings,
String[] renamings,
boolean replace,
IProgressMonitor monitor)
Copies the given elements to the specified container(s). |
void |
delete(ICElement[] elements,
boolean force,
IProgressMonitor monitor)
Deletes the given elements, forcing the operation if necessary and specified. |
ICProject |
getCProject(String name)
Returns the C project with the given name. |
ICProject[] |
getCProjects()
Returns the C projects. |
Object[] |
getNonCResources()
Returns an array of non-C resources (i.e. non-C projects) in the workspace. |
IWorkspace |
getWorkspace()
Returns the workspace associated with this C model. |
void |
move(ICElement[] elements,
ICElement[] containers,
ICElement[] siblings,
String[] renamings,
boolean replace,
IProgressMonitor monitor)
Moves the given elements to the specified container(s). |
void |
rename(ICElement[] elements,
ICElement[] destinations,
String[] names,
boolean replace,
IProgressMonitor monitor)
Renames the given elements as specified. |
Methods inherited from interface org.eclipse.cdt.core.model.ICElement |
---|
accept, exists, getAncestor, getCModel, getCProject, getElementName, getElementType, getParent, getPath, getResource, getUnderlyingResource, isReadOnly, isStructureKnown |
Methods inherited from interface org.eclipse.cdt.core.model.IParent |
---|
getChildren, getChildrenOfType, hasChildren |
Methods inherited from interface org.eclipse.cdt.core.model.IOpenable |
---|
close, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, makeConsistent, open, save |
Methods inherited from interface org.eclipse.cdt.core.model.IBufferChangedListener |
---|
bufferChanged |
Method Detail |
---|
void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException
Optionally, each copy can positioned before a sibling
element. If null
is specified for a given sibling, the copy
is inserted as the last child of its associated container.
Optionally, each copy can be renamed. If
null
is specified for the new name, the copy
is not renamed.
Optionally, any existing child in the destination container with
the same name can be replaced by specifying true
for
force. Otherwise an exception is thrown in the event that a name
collision occurs.
elements
- the elements to copycontainers
- the container, or list of containerssiblings
- the list of siblings element any of which may be
null
; or null
renamings
- the list of new names any of which may be
null
; or null
replace
- true
if any existing child in a target container
with the target name should be replaced, and false
to throw an
exception in the event of a name collisionmonitor
- a progress monitor
CModelException
- if an element could not be copied. Reasons include:
CoreException
occurred while updating an underlying resource
INVALID_DESTINATION
)
INVALID_SIBLING
)
INVALID_NAME
)
replace
has been specified as false
(NAME_COLLISION
)
READ_ONLY
)
void delete(ICElement[] elements, boolean force, IProgressMonitor monitor) throws CModelException
elements
- the elements to deleteforce
- a flag controlling whether underlying resources that are not
in sync with the local file system will be toleratedmonitor
- a progress monitor
CModelException
- if an element could not be deleted. Reasons include:
CoreException
occurred while updating an underlying resource
READ_ONLY
)
void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException
Optionally, each element can positioned before a sibling
element. If null
is specified for sibling, the element
is inserted as the last child of its associated container.
Optionally, each element can be renamed. If
null
is specified for the new name, the element
is not renamed.
Optionally, any existing child in the destination container with
the same name can be replaced by specifying true
for
force. Otherwise an exception is thrown in the event that a name
collision occurs.
elements
- the elements to movecontainers
- the container, or list of containerssiblings
- the list of siblings element any of which may be
null
; or null
renamings
- the list of new names any of which may be
null
; or null
replace
- true
if any existing child in a target container
with the target name should be replaced, and false
to throw an
exception in the event of a name collisionmonitor
- a progress monitor
CModelException
- if an element could not be moved. Reasons include:
CoreException
occurred while updating an underlying resource
INVALID_DESTINATION
)
INVALID_SIBLING
)
INVALID_NAME
)
replace
has been specified as false
(NAME_COLLISION
)
READ_ONLY
)
IllegalArgumentException
- any element or container is null
void rename(ICElement[] elements, ICElement[] destinations, String[] names, boolean replace, IProgressMonitor monitor) throws CModelException
elements
- the elements to renamedestinations
- the container, or list of containersnames
- the list of new namesreplace
- true
if an existing child in a target container
with the target name should be replaced, and false
to throw an
exception in the event of a name collisionmonitor
- a progress monitor
CModelException
- if an element could not be renamed. Reasons include:
CoreException
occurred while updating an underlying resource
INVALID_NAME
)
replace
has been specified as false
(NAME_COLLISION
)
READ_ONLY
)
ICProject getCProject(String name)
name
- of the ProjectICProject[] getCProjects() throws CModelException
CModelException
Object[] getNonCResources() throws CModelException
Non-C projects include all projects that are closed (even if they have the C nature).
CModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceIWorkspace getWorkspace()
|
Eclipse CDT Pre-release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |