public interface ICModel extends ICElement, IParent, IOpenable
ICProject
s.
This interface provides methods for performing copy, move, rename, and delete operations on multiple C elements.
CoreModel#create(org.eclipse.core.resources.IWorkspaceRoot)
ASM_LABEL, C_ARCHIVE, C_BINARY, C_CCONTAINER, C_CLASS, C_CLASS_CTOR, C_CLASS_DECLARATION, C_CLASS_DTOR, C_ENUMERATION, C_ENUMERATOR, C_FIELD, C_FUNCTION, C_FUNCTION_DECLARATION, C_INCLUDE, C_MACRO, C_METHOD, C_METHOD_DECLARATION, C_MODEL, C_NAMESPACE, C_PROJECT, C_STORAGE_EXTERN, C_STORAGE_STATIC, C_STRUCT, C_STRUCT_DECLARATION, C_TEMPLATE_CLASS, C_TEMPLATE_CLASS_DECLARATION, C_TEMPLATE_FUNCTION, C_TEMPLATE_FUNCTION_DECLARATION, C_TEMPLATE_METHOD, C_TEMPLATE_METHOD_DECLARATION, C_TEMPLATE_STRUCT, C_TEMPLATE_STRUCT_DECLARATION, C_TEMPLATE_UNION, C_TEMPLATE_UNION_DECLARATION, C_TEMPLATE_VARIABLE, C_TYPEDEF, C_UNION, C_UNION_DECLARATION, C_UNIT, C_UNKNOWN_DECLARATION, C_USING, C_VARIABLE, C_VARIABLE_DECLARATION, C_VARIABLE_LOCAL, C_VCONTAINER, CPP_FRIEND, CPP_PRIVATE, CPP_PROTECTED, CPP_PUBLIC, EMPTY_ARRAY
Modifier and Type | Method and Description |
---|---|
void |
copy(ICElement[] elements,
ICElement[] containers,
ICElement[] siblings,
java.lang.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(java.lang.String name)
Returns the C project with the given name.
|
ICProject[] |
getCProjects()
Returns the C projects.
|
java.lang.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,
java.lang.String[] renamings,
boolean replace,
IProgressMonitor monitor)
Moves the given elements to the specified container(s).
|
void |
rename(ICElement[] elements,
ICElement[] destinations,
java.lang.String[] names,
boolean replace,
IProgressMonitor monitor)
Renames the given elements as specified.
|
accept, exists, getAncestor, getCModel, getCProject, getElementName, getElementType, getHandleIdentifier, getLocationURI, getParent, getPath, getResource, getUnderlyingResource, isReadOnly, isStructureKnown
getChildren, getChildrenOfType, hasChildren
close, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, makeConsistent, open, save
bufferChanged
void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings, java.lang.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 sibling elements, 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 monitorCModelException
- 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 monitorCModelException
- 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, java.lang.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 monitorCModelException
- 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
)
java.lang.IllegalArgumentException
- any element or container is null
void rename(ICElement[] elements, ICElement[] destinations, java.lang.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 monitorCModelException
- 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(java.lang.String name)
name
- of the projectICProject[] getCProjects() throws CModelException
CModelException
java.lang.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()
Copyright (c) IBM Corp. and others 2004, 2014. All Rights Reserved.