|
Eclipse CDT 7.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.core.model.CoreModel
public class CoreModel
Field Summary | |
---|---|
static java.lang.String |
CORE_MODEL_ID
|
Method Summary | |
---|---|
void |
addCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener,
int eventTypes)
|
void |
addElementChangedListener(IElementChangedListener listener)
|
ICElement |
create(IFile file)
Creates an ICElement for an IFile. |
ICContainer |
create(IFolder folder)
Creates an ICElement for an IFolder. |
ICElement |
create(IPath path)
Creates an ICElement for an IPath. |
ICProject |
create(IProject project)
Creates an ICElement for an IProject. |
ICElement |
create(IResource resource)
Creates an ICElement for an IResource. |
static ICModel |
create(IWorkspaceRoot root)
Returns the C model. |
org.eclipse.cdt.core.settings.model.ICProjectDescription |
createProjectDescription(IProject project,
boolean loadIfExists)
this method is a full equivalent to createProjectDescription(project, loadIfExists, false) . |
org.eclipse.cdt.core.settings.model.ICProjectDescription |
createProjectDescription(IProject project,
boolean loadIfExists,
boolean creating)
the method creates and returns a writable project description |
ITranslationUnit |
createTranslationUnitFrom(ICProject cproject,
IPath path)
Creates a translation from an IPath. |
ICModel |
getCModel()
Returns the default ICModel. |
static CoreModel |
getDefault()
Return the singleton. |
static IIncludeEntry[] |
getIncludeEntries(IPath path)
This method returns the include entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return. |
static IIncludeFileEntry[] |
getIncludeFileEntries(IPath path)
This method returns the include file entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return. |
static IMacroEntry[] |
getMacroEntries(IPath path)
This method returns the macro entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return. |
static IMacroFileEntry[] |
getMacroFileEntries(IPath path)
This method returns the macro file entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return. |
static IPathEntryContainer |
getPathEntryContainer(IPath containerPath,
ICProject project)
Answers the project specific value for a given container. |
static PathEntryContainerInitializer |
getPathEntryContainerInitializer(java.lang.String containerID)
Helper method finding the pathentry container initializer registered for a given container ID or null if none was found while
iterating over the contributions to extension point to the extension
point "org.eclipse.cdt.core.PathEntryContainerInitializer". |
static IPathEntryStore |
getPathEntryStore(IProject project)
Return the IPathEntryStore of the project. |
org.eclipse.cdt.core.settings.model.ICProjectDescription |
getProjectDescription(IProject project)
returns the project description associated with this project or null if the project does not contain the CDT data associated with it. |
org.eclipse.cdt.core.settings.model.ICProjectDescription |
getProjectDescription(IProject project,
boolean write)
returns the project description associated with this project or null if the project does not contain the CDT data associated with it. |
org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager |
getProjectDescriptionManager()
|
static IPathEntry[] |
getRawPathEntries(ICProject cproject)
Returns the raw pathentries for the project. |
static java.lang.String |
getRegistedContentTypeId(IProject project,
java.lang.String name)
Return the registered content type id, for example: CONTENT_TYPE_CHEADER CONTENT_TYPE_CXXHEADER CONTENT_TYPE_CSOURCE CONTENT_TYPE_CXXSOURCE CONTENT_TYPE_ASMSOURCE or null is return if no id match the list |
static java.lang.String[] |
getRegistedContentTypeIds()
Return an array of the register contentTypes. |
static IPathEntry[] |
getResolvedPathEntries(ICProject cproject)
This method returns the resolved pathentries for the project All pathEntry.CDT_CONTAINER entries in the project's will be replaced by the entries they resolve to. |
static boolean |
hasCCNature(IProject project)
Return true if project has C++ nature. |
static boolean |
hasCNature(IProject project)
Return true if project has C nature. |
boolean |
isArchive(IFile file)
Return true if IFile is an Achive, *.a |
boolean |
isBinary(IFile file)
Return true if IFile is an ELF. |
boolean |
isExecutable(IFile file)
Return true if IFile is an ELF executable |
boolean |
isNewStyleProject(IProject project)
Answers whether the given project is a new-style project, i.e. |
boolean |
isObject(IFile file)
Return true if IFile is a an object(ELF), i.e. *.o |
static boolean |
isScannerInformationEmpty(IResource resource)
The method returns whether scanner information for a resource is empty or not. |
boolean |
isSharedLib(IFile file)
Return true if IFile is a shared library, i.e. libxx.so |
static boolean |
isTranslationUnit(IFile file)
Return true if IFile is a possible TranslationUnit. |
static boolean |
isValidASMSourceUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidCHeaderUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidCSourceUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidCXXHeaderUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidCXXSourceUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidHeaderUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidSourceUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static boolean |
isValidTranslationUnitName(IProject project,
java.lang.String name)
Return true if name is a valid name for a translation unit. |
static IContainerEntry |
newContainerEntry(IPath id)
Creates and returns a new entry of kind CDT_CONTAINER for
the given path. |
static IContainerEntry |
newContainerEntry(IPath id,
boolean isExported)
Creates and returns a new entry of kind CDT_CONTAINER for
the given path. |
static IIncludeEntry |
newIncludeEntry(IPath resourcePath,
IPath basePath,
IPath includePath)
Creates and returns a new entry of kind CDT_INCLUDE |
static IIncludeEntry |
newIncludeEntry(IPath resourcePath,
IPath basePath,
IPath includePath,
boolean isSystemInclude)
* Creates and returns a new entry of kind CDT_INCLUDE |
static IIncludeEntry |
newIncludeEntry(IPath resourcePath,
IPath basePath,
IPath includePath,
boolean isSystemInclude,
IPath[] exclusionPatterns)
Creates and returns a new entry of kind CDT_INCLUDE |
static IIncludeEntry |
newIncludeEntry(IPath resourcePath,
IPath basePath,
IPath includePath,
boolean isSystemInclude,
IPath[] exclusionPatterns,
boolean isExported)
Creates and returns a new entry of kind CDT_INCLUDE |
static IIncludeFileEntry |
newIncludeFileEntry(IPath resourcePath,
IPath includeFile)
Creates a new entry of kind CDT_INCLUDE_FILE |
static IIncludeFileEntry |
newIncludeFileEntry(IPath resourcePath,
IPath baseRef,
IPath basePath,
IPath includeFilePath,
IPath[] exclusionPatterns,
boolean isExported)
Creates and returns a new entry of kind CDT_INCLUDE_FILE |
static IIncludeEntry |
newIncludeRefEntry(IPath resourcePath,
IPath baseRef,
IPath includePath)
Creates and returns a new entry of kind CDT_INCLUDE |
static ILibraryEntry |
newLibraryEntry(IPath resourcePath,
IPath basePath,
IPath libraryPath,
IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath,
IPath sourceAttachmentPrefixMapping,
boolean isExported)
Creates and returns a new entry of kind CDT_LIBRARY
for the archive or folder identified by the given absolute path. |
static ILibraryEntry |
newLibraryRefEntry(IPath resourcePath,
IPath baseRef,
IPath libraryPath)
Creates and returns a new entry of kind CDT_LIBRARY
for the archive or folder identified by the given absolute path. |
static IMacroEntry |
newMacroEntry(IPath resourcePath,
java.lang.String macroName,
java.lang.String macroValue)
Creates and returns an entry kind CDT_MACRO |
static IMacroEntry |
newMacroEntry(IPath resourcePath,
java.lang.String macroName,
java.lang.String macroValue,
IPath[] exclusionPatterns)
Creates and returns an entry kind CDT_MACRO |
static IMacroEntry |
newMacroEntry(IPath resourcePath,
java.lang.String macroName,
java.lang.String macroValue,
IPath[] exclusionPatterns,
boolean isExported)
Creates and returns an entry kind CDT_MACRO |
static IMacroFileEntry |
newMacroFileEntry(IPath resourcePath,
IPath macroFile)
Creates an entry kind CDT_MACRO_FILE |
static IMacroFileEntry |
newMacroFileEntry(IPath resourcePath,
IPath basePath,
IPath baseRef,
IPath macroFilePath,
IPath[] exclusionPatterns,
boolean isExported)
Creates and returns an entry kind CDT_MACRO_FILE |
static IMacroEntry |
newMacroRefEntry(IPath resourcePath,
IPath baseRef,
java.lang.String macroName)
Creates and returns an entry kind CDT_MACRO |
static IOutputEntry |
newOutputEntry(IPath outputPath)
Creates and returns a new entry of kind CDT_OUTPUT for
the project's output folder
|
static IOutputEntry |
newOutputEntry(IPath outputPath,
IPath[] exclusionPatterns)
Creates and returns a new entry of kind CDT_OUPUT for
the project |
static IProjectEntry |
newProjectEntry(IPath projectPath)
Creates and returns a new non-exported entry of kind CDT_PROJECT
for the project identified by the given absolute path. |
static IProjectEntry |
newProjectEntry(IPath projectPath,
boolean isExported)
Creates and returns a new entry of kind CDT_PROJECT for
the project identified by the given workspace-relative path. |
static ISourceEntry |
newSourceEntry(IPath sourcePath)
Creates and returns a new entry of kind CDT_SOURCE for
the project's source folder identified by the given absolute
workspace-relative path. |
static ISourceEntry |
newSourceEntry(IPath sourcePath,
IPath[] exclusionPatterns)
Creates and returns a new entry of kind CDT_SOURCE for
the project's source folder identified by the given absolute
workspace-relative path but excluding all source files with paths
matching any of the given patterns. |
static void |
pathEntryContainerUpdates(IPathEntryContainerExtension container,
PathEntryContainerChanged[] changes,
IProgressMonitor monitor)
Helper method use by a pathentry container implementing IPathEntryContainerExtension
It notify the model of changes. |
void |
removeCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener)
|
void |
removeElementChangedListener(IElementChangedListener listener)
Removes the given element changed listener. |
static void |
run(IWorkspaceRunnable action,
IProgressMonitor monitor)
Runs the given action as an atomic C model operation. |
static void |
run(IWorkspaceRunnable action,
ISchedulingRule rule,
IProgressMonitor monitor)
Runs the given action as an atomic C model operation. |
static void |
setPathEntryContainer(ICProject[] affectedProjects,
IPathEntryContainer container,
IProgressMonitor monitor)
Bind a container reference path to some actual containers ( IPathEntryContainer ). |
static void |
setPathEntryStore(IProject project,
IPathEntryStore store)
Set in the map the store, but not persisted. |
void |
setProjectDescription(IProject project,
org.eclipse.cdt.core.settings.model.ICProjectDescription des)
this method is called to save/apply the project description the method should be called to apply changes made to the project description returned by the getProjectDescription(IProject, boolean) or createProjectDescription(IProject, boolean) |
void |
setProjectDescription(IProject project,
org.eclipse.cdt.core.settings.model.ICProjectDescription des,
boolean force,
IProgressMonitor monitor)
|
static void |
setRawPathEntries(ICProject cproject,
IPathEntry[] newEntries,
IProgressMonitor monitor)
Sets the pathentries of this project using a list of entries. |
void |
shutdown()
|
void |
startup()
|
void |
updateProjectDescriptions(IProject[] projects,
IProgressMonitor monitor)
Forces the cached data of the specified projects to be re-calculated. |
static ICModelStatus |
validatePathEntries(ICProject cProject,
IPathEntry[] entries)
Validate a given path entries for a project, using the following rules: Entries cannot collide with each other; that is, all entry paths must be unique. |
static ICModelStatus |
validatePathEntry(ICProject cProject,
IPathEntry entry,
boolean checkSourceAttachment,
boolean recurseInContainers)
Returns a C model status describing the problem related to this entry if any, a status object with code IStatus.OK if the entry is fine (that is, if the
given entry denotes a valid element). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CORE_MODEL_ID
Method Detail |
---|
public ICElement create(IPath path)
public ITranslationUnit createTranslationUnitFrom(ICProject cproject, IPath path)
public ICElement create(IFile file)
public ICContainer create(IFolder folder)
public ICProject create(IProject project)
public ICElement create(IResource resource)
public static ICModel create(IWorkspaceRoot root)
root
- the given root
null
if the root is nullpublic ICModel getCModel()
public boolean isSharedLib(IFile file)
public boolean isObject(IFile file)
public boolean isExecutable(IFile file)
public boolean isBinary(IFile file)
public boolean isArchive(IFile file)
public static boolean isTranslationUnit(IFile file)
public static java.lang.String[] getRegistedContentTypeIds()
public static boolean isValidTranslationUnitName(IProject project, java.lang.String name)
public static boolean isValidHeaderUnitName(IProject project, java.lang.String name)
public static boolean isValidSourceUnitName(IProject project, java.lang.String name)
public static boolean isValidCSourceUnitName(IProject project, java.lang.String name)
public static boolean isValidCXXSourceUnitName(IProject project, java.lang.String name)
public static boolean isValidASMSourceUnitName(IProject project, java.lang.String name)
public static boolean isValidCXXHeaderUnitName(IProject project, java.lang.String name)
public static boolean isValidCHeaderUnitName(IProject project, java.lang.String name)
public static java.lang.String getRegistedContentTypeId(IProject project, java.lang.String name)
public static boolean hasCNature(IProject project)
public static boolean hasCCNature(IProject project)
public static IProjectEntry newProjectEntry(IPath projectPath)
CDT_PROJECT
for the project identified by the given absolute path.
A project entry is used to denote a prerequisite project. The exported IPathEntry[] entries of the project will be contributed.
The prerequisite project is referred to using an absolute path relative to the workspace root.
The resulting entry is not exported to dependent projects. This method
is equivalent to newProjectEntry(path,false)
.
projectPath
- the workspace-relative path of the project
newProjectEntry(IPath, boolean)
public static IProjectEntry newProjectEntry(IPath projectPath, boolean isExported)
CDT_PROJECT
for
the project identified by the given workspace-relative path.
A project entry is used to denote a prerequisite project. All the IPathEntries of the project will be contributed as a whole. The prerequisite project is referred to using an absolute path relative to the workspace root.
projectPath
- the absolute workspace-relative path of the prerequisite projectisExported
- indicates whether this entry is contributed to dependent
projects
public static IContainerEntry newContainerEntry(IPath id)
CDT_CONTAINER
for
the given path. The path of the container will be used during resolution
so as to map this container entry to a set of other entries the
container is acting for.
The resulting entry is not exported to dependent projects. This method
is equivalent to newContainerEntry(path,false)
.
id
- the id of the container
public static IContainerEntry newContainerEntry(IPath id, boolean isExported)
CDT_CONTAINER
for
the given path. The path of the container will be used during resolution
so as to map this container entry to a set of other entries the
container is acting for.
The resulting entry is not exported to dependent projects. This method
is equivalent to newContainerEntry(path,false)
.
public static ILibraryEntry newLibraryRefEntry(IPath resourcePath, IPath baseRef, IPath libraryPath)
CDT_LIBRARY
for the archive or folder identified by the given absolute path.
resourcePath
- the affected project-relative resource pathbaseRef
- the base reference path to find the librarylibraryPath
- the library name.
public static ILibraryEntry newLibraryEntry(IPath resourcePath, IPath basePath, IPath libraryPath, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IPath sourceAttachmentPrefixMapping, boolean isExported)
CDT_LIBRARY
for the archive or folder identified by the given absolute path.
Note that this operation does not attempt to validate or access the
resources at the given paths.
resourcePath
- the affected project-relative resource pathbasePath
- the base path of the librarylibraryPath
- the path of the librarysourceAttachmentPath
- the project-relative path of the corresponding source archive or
folder, or null
if none.sourceAttachmentRootPath
- the location of the root within the source archive or folder
or null
.sourceAttachmentPrefixMapping
- prefix mapping or null
.isExported
- whether the entry is exported
public static IOutputEntry newOutputEntry(IPath outputPath)
CDT_OUTPUT
for
the project's output folder
outputPath
- the project-relative path of a folder
public static IOutputEntry newOutputEntry(IPath outputPath, IPath[] exclusionPatterns)
CDT_OUPUT
for
the project
outputPath
- the project-relative path of a folderexclusionPatterns
- the possibly empty list of exclusion patterns represented as
relative paths
public static ISourceEntry newSourceEntry(IPath sourcePath)
CDT_SOURCE
for
the project's source folder identified by the given absolute
workspace-relative path.
The source folder is referred to using an absolute path relative to the
workspace root, e.g. /Project/src
. A project's source
folders are located with that project. That is, a source entry
specifying the path /P1/src
is only usable for project
P1
.
Note that all sources/binaries inside a project are contributed as a
whole through a project entry (see newProjectEntry
).
Particular source entries cannot be selectively exported.
sourcePath
- the project-relative path of a source folder
public static ISourceEntry newSourceEntry(IPath sourcePath, IPath[] exclusionPatterns)
CDT_SOURCE
for
the project's source folder identified by the given absolute
workspace-relative path but excluding all source files with paths
matching any of the given patterns. This specifies that all package
fragments within the root will have children of type ICompilationUnit
.
The source folder is referred to using an absolute path relative to the
workspace root, e.g. /Project/src
. A project's source
folders are located with that project. That is, a source entry
specifying the path /P1/src
is only usable for project
P1
.
sourcePath
- the absolute project-relative path of a source folderexclusionPatterns
- the possibly empty list of exclusion patterns represented as
relative paths
public static IIncludeEntry newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath)
CDT_INCLUDE
resourcePath
- the affected project-relative resource pathbasePath
- the base path of the includePathincludePath
- the absolute path of the include
public static IIncludeEntry newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude)
CDT_INCLUDE
resourcePath
- the affected project-relative resource pathbasePath
- the base path of the includePathincludePath
- the absolute path of the includeisSystemInclude
- whether this include path should be consider a system include path
public static IIncludeEntry newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude, IPath[] exclusionPatterns)
CDT_INCLUDE
resourcePath
- the affected project-relative resource pathbasePath
- the base path of the includePathincludePath
- the absolute path of the includeisSystemInclude
- whether this include path should be consider the system
include pathexclusionPatterns
- exclusion patterns in the resource if a container
public static IIncludeEntry newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude, IPath[] exclusionPatterns, boolean isExported)
CDT_INCLUDE
resourcePath
- the affected project-relative resource pathbasePath
- the base path of the includeincludePath
- the path of the includeisSystemInclude
- wheter this include path should be consider the system
include pathexclusionPatterns
- exclusion patterns in the resource if a containerisExported
- if the entry ix exported to reference projects
public static IIncludeEntry newIncludeRefEntry(IPath resourcePath, IPath baseRef, IPath includePath)
CDT_INCLUDE
resourcePath
- the affected project-relative resource pathbaseRef
- the base reference path of the includeincludePath
- the path of the include
public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath, IPath includeFile)
CDT_INCLUDE_FILE
public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath, IPath baseRef, IPath basePath, IPath includeFilePath, IPath[] exclusionPatterns, boolean isExported)
CDT_INCLUDE_FILE
resourcePath
- the affected project-relative resource pathbasePath
- the base path of the includeincludeFilePath
- the path of the includeexclusionPatterns
- exclusion patterns in the resource if a containerisExported
- if the entry ix exported to reference projects
public static IMacroEntry newMacroEntry(IPath resourcePath, java.lang.String macroName, java.lang.String macroValue)
CDT_MACRO
resourcePath
- the affected project-relative resource pathmacroName
- the name of the macromacroValue
- the value of the macro
public static IMacroEntry newMacroEntry(IPath resourcePath, java.lang.String macroName, java.lang.String macroValue, IPath[] exclusionPatterns)
CDT_MACRO
resourcePath
- the affected project-relative resource pathmacroName
- the name of the macromacroValue
- the value of the macroexclusionPatterns
- exclusion patterns in the resource if a containerpublic static IMacroEntry newMacroEntry(IPath resourcePath, java.lang.String macroName, java.lang.String macroValue, IPath[] exclusionPatterns, boolean isExported)
CDT_MACRO
resourcePath
- the affected workspace-relative resource pathmacroName
- the name of the macromacroValue
- the value of the macroexclusionPatterns
- exclusion patterns in the resource if a containerpublic static IMacroEntry newMacroRefEntry(IPath resourcePath, IPath baseRef, java.lang.String macroName)
CDT_MACRO
resourcePath
- the affected workspace-relative resource pathbaseRef
- the base reference pathmacroName
- the name of the macropublic static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath macroFile)
CDT_MACRO_FILE
public static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath macroFilePath, IPath[] exclusionPatterns, boolean isExported)
CDT_MACRO_FILE
resourcePath
- the affected workspace-relative resource pathbasePath
- the base pathmacroFilePath
- the file path where the macros are defineexclusionPatterns
- exclusion patterns in the resource if a containerpublic static IPathEntryContainer getPathEntryContainer(IPath containerPath, ICProject project) throws CModelException
null
.
Both the container path and the project context are supposed to be
non-null.
The containerPath is a formed by a first ID segment followed with extra
segments, which can be used as additional hints for resolution. If no
container was ever recorded for this container path onto this project
(using setPathEntryContainer
, then a PathEntryContainerInitializer
will be activated if any was registered for this container ID onto the
extension point "org.eclipse.cdt.core.PathEntryContainerInitializer".
PathEntry container values are persisted locally to the workspace, but
are not preserved from a session to another. It is thus highly
recommended to register a PathEntryContainerInitializer
for each referenced container (through the extension point
"org.eclipse.cdt.core.PathEntryContainerInitializer").
containerPath
- the name of the container, which needs to be resolvedproject
- a specific project in which the container is being resolved
null
if unable to
find one.
CModelException
- if an exception occurred while resolving the container,
or if the resolved container contains illegal entries
(contains CDT_CONTAINER entries or null entries).PathEntryContainerInitializer
,
IPathEntryContainer
,
setPathEntryContainer(ICProject[], IPathEntryContainer, IProgressMonitor)
public static void setPathEntryContainer(ICProject[] affectedProjects, IPathEntryContainer container, IProgressMonitor monitor) throws CModelException
IPathEntryContainer
).
This API must be invoked whenever changes in container need to be
reflected onto the CModel.
In reaction to changing container values, the CModel will be updated to reflect the new state of the updated container.
This functionality cannot be used while the resource tree is locked.
PathEntry container values are persisted locally to the workspace, but
are not preserved from a session to another. It is thus highly
recommended to register a PathEntryContainerInitializer
for each referenced container (through the extension point
"org.eclipse.cdt.core.PathEntryContainerInitializer").
Note: setting a container to null
will cause it to be
lazily resolved again whenever its value is required. In particular,
this will cause a registered initializer to be invoked again.
affectedProjects
- -
the set of projects for which this container is being boundcontainer
- -
the container for the affected projectsmonitor
- a monitor to report progress
CModelException
PathEntryContainerInitializer
,
getPathEntryContainer(IPath, ICProject)
,
IPathEntryContainer
public static void pathEntryContainerUpdates(IPathEntryContainerExtension container, PathEntryContainerChanged[] changes, IProgressMonitor monitor)
IPathEntryContainerExtension
It notify the model of changes.
Note: the paths in the PathEntryContainerChanged[]
array must be on
source that the container was set too. If not the changes will be silently ignore.
container
- changes
- array of changes.monitor
- progress monitorpublic static void setRawPathEntries(ICProject cproject, IPathEntry[] newEntries, IProgressMonitor monitor) throws CModelException
Setting the pathentries to null
specifies a default
classpath (the project root). Setting the pathentry to an empty array
specifies an empty pathentry.
newEntries
- a list of entriesmonitor
- the given progress monitor
CModelException
- if the entries could not be set. Reasons include:public static IPathEntry[] getRawPathEntries(ICProject cproject) throws CModelException
setRawPathEntries
CModelException
- if this element does not exist or if an exception occurs
while accessing its corresponding resourceIPathEntry
public static IPathEntry[] getResolvedPathEntries(ICProject cproject) throws CModelException
The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.
CModelException
IPathEntry
public static IIncludeEntry[] getIncludeEntries(IPath path) throws CModelException
The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.
CModelException
IPathEntry
public static IIncludeFileEntry[] getIncludeFileEntries(IPath path) throws CModelException
The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.
CModelException
IPathEntry
public static IMacroEntry[] getMacroEntries(IPath path) throws CModelException
The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.
CModelException
IPathEntry
public static IMacroFileEntry[] getMacroFileEntries(IPath path) throws CModelException
The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.
CModelException
IPathEntry
public static PathEntryContainerInitializer getPathEntryContainerInitializer(java.lang.String containerID)
null
if none was found while
iterating over the contributions to extension point to the extension
point "org.eclipse.cdt.core.PathEntryContainerInitializer".
A containerID is the first segment of any container path, used to identify the registered container initializer.
containerID
- -
a containerID identifying a registered initializer
null
if none was found.public static IPathEntryStore getPathEntryStore(IProject project) throws CoreException
CoreException
public static void setPathEntryStore(IProject project, IPathEntryStore store)
project
- store
- public static ICModelStatus validatePathEntries(ICProject cProject, IPathEntry[] entries)
This validation is intended to anticipate issues prior to assigning it to a project. In particular, it will automatically be performed during the setting operation (if validation fails, the classpath setting will not complete) and during getResolvedPathEntries.
cProject
- the given C project
IStatus.OK
if
the entries location are compatible, otherwise a status
object indicating what is wrong with thempublic static ICModelStatus validatePathEntry(ICProject cProject, IPathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers)
IStatus.OK
if the entry is fine (that is, if the
given entry denotes a valid element).
cProject
- the given C projectentry
- the given entrycheckSourceAttachment
- a flag to determine if source attachement should be checkedrecurseInContainers
- flag indicating whether validation should be applied to container entries recursively
IStatus.OK
if the entry is finepublic static CoreModel getDefault()
public void addElementChangedListener(IElementChangedListener listener)
public void removeElementChangedListener(IElementChangedListener listener)
listener
- the listenerpublic void startup()
Plugin#startup
public void shutdown()
public static void run(IWorkspaceRunnable action, IProgressMonitor monitor) throws CoreException
After running a method that modifies C elements, registered listeners receive after-the-fact notification of what just transpired, in the form of a element changed event. This method allows clients to call a number of methods that modify C elements and only have element changed event notifications reported at the end of the entire batch.
If this method is called outside the dynamic scope of another such call, this method runs the action and then reports a single element changed event describing the net effect of all changes done to C elements by the action.
If this method is called in the dynamic scope of another such call, this method simply runs the action.
action
- the action to performmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if the operation failed.public static void run(IWorkspaceRunnable action, ISchedulingRule rule, IProgressMonitor monitor) throws CoreException
After running a method that modifies C elements, registered listeners receive after-the-fact notification of what just transpired, in the form of a element changed event. This method allows clients to call a number of methods that modify C elements and only have element changed event notifications reported at the end of the entire batch.
If this method is called outside the dynamic scope of another such call, this method runs the action and then reports a single element changed event describing the net effect of all changes done to C elements by the action.
If this method is called in the dynamic scope of another such call, this method simply runs the action.
The supplied scheduling rule is used to determine whether this operation can be
run simultaneously with workspace changes in other threads. See
IWorkspace.run(...)
for more details.
action
- the action to performrule
- the scheduling rule to use when running this operation, or
null
if there are no scheduling restrictions for this operation.monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if the operation failed.public static boolean isScannerInformationEmpty(IResource resource)
null
is supplied the method returns true
.
resource
- public org.eclipse.cdt.core.settings.model.ICProjectDescription createProjectDescription(IProject project, boolean loadIfExists) throws CoreException
createProjectDescription(project, loadIfExists, false)
.
CoreException
createProjectDescription(IProject, boolean, boolean)
public org.eclipse.cdt.core.settings.model.ICProjectDescription createProjectDescription(IProject project, boolean loadIfExists, boolean creating) throws CoreException
project
- project for which the project description is requestedloadIfExists
- if true the method first tries to load and return the project description
from the settings file (.cproject)
if false, the stored settings are ignored and the new (empty) project description is createdcreating
- if true the created project description will be contain the true "isCdtProjectCreating" state.
NOTE: in case the project already contains the project description AND its "isCdtProjectCreating" is false
the resulting description will be created with the false "isCdtProjectCreating" state
NOTE: changes made to the returned project description will not be applied until the setProjectDescription(IProject, ICProjectDescription)
is called
ICProjectDescription
CoreException
public org.eclipse.cdt.core.settings.model.ICProjectDescription getProjectDescription(IProject project)
getProjectDescription(IProject, boolean)
for more detail
project
-
setProjectDescription(IProject, ICProjectDescription)
is calledgetProjectDescription(IProject, boolean)
public void setProjectDescription(IProject project, org.eclipse.cdt.core.settings.model.ICProjectDescription des) throws CoreException
getProjectDescription(IProject, boolean)
or createProjectDescription(IProject, boolean)
project
- des
-
CoreException
getProjectDescription(IProject, boolean)
,
createProjectDescription(IProject, boolean)
public void setProjectDescription(IProject project, org.eclipse.cdt.core.settings.model.ICProjectDescription des, boolean force, IProgressMonitor monitor) throws CoreException
CoreException
public org.eclipse.cdt.core.settings.model.ICProjectDescription getProjectDescription(IProject project, boolean write)
project
- project for which the description is requestedwrite
- if true, the writable description copy is returned.
If false the cached read-only description is returned.
CDT core maintains the cached project description settings. If only read access is needed to description,
then the read-only project description should be obtained.
This description always operates with cached data and thus it is better to use it for performance reasons
All set* calls to the read-only description result in the WriteAccessException
When the writable description is requested, the description copy is created.
Changes to this description will not be reflected/used by the core and Build System untill the
setProjectDescription(IProject, ICProjectDescription)
is called
Each getProjectDescription(project, true) returns a new copy of the project description
The writable description uses the cached data untill the first set call
after that the description communicates directly to the Build System
i.e. the implementer of the org.eclipse.cdt.core.CConfigurationDataProvider extension
This ensures the Core<->Build System settings integrity
ICProjectDescription
or null if the project does not contain the
CDT data associated with it.public void updateProjectDescriptions(IProject[] projects, IProgressMonitor monitor) throws CoreException
projects
argument is null
al projects
within the workspace are updated
projects
- monitor
-
CoreException
public boolean isNewStyleProject(IProject project)
public void addCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener, int eventTypes)
public void removeCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener)
public org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager getProjectDescriptionManager()
|
Eclipse CDT 7.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |