Interface ICProjectDescriptionManager
public interface ICProjectDescriptionManager
This interface represents the manager of CDT Project descriptions.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Flag indicating that the user has called createProjectDescription.static final int
Flag indicating that a new empty ICProjectDescription should be created and returned (irrespective of whether one already exists)static final int
Return the project description only if it's already loadedstatic final int
Flag indicating writable project description is requiredstatic final int
Flag indicating that the Project is in the process of being created (i.e.static final int
Flag indicating that the description should be serialized even if the ProjectDescription isn't marked as modified.static final int
Flag indicating that the project description shouldn't be serialized. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCProjectDescriptionListener
(ICProjectDescriptionListener listener, int eventTypes) Register a listener for changes on the set of known ICProjectDescriptions for the specified set of eventscreateProjectDescription
(org.eclipse.core.resources.IProject project, boolean loadIfExists) This method is a full equivalent to:
-createProjectDescription(IProject, boolean, false)
-getProjectDescription(IProject, GET_WRITABLE | loadIfExists ? 0 : GET_EMPTY_PROJECT_DESCRIPTION)
and returns a writable project description which is either empty or a copy of the previous configuration description if loadIfExists == true.createProjectDescription
(org.eclipse.core.resources.IProject project, boolean loadIfExists, boolean creating) the method creates and returns a writable project descriptiongetPreferenceConfiguration
(String buildSystemId) getPreferenceConfiguration
(String buildSystemId, boolean write) getProjectDescription
(org.eclipse.core.resources.IProject project) returns the project description associated with this project or null if the project does not contain the CDT data associated with it.getProjectDescription
(org.eclipse.core.resources.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.getProjectDescription
(org.eclipse.core.resources.IProject project, int flags) getProjectDescriptionWorkspacePreferences
(boolean write) Returns the workspace project description preferences.boolean
boolean
isNewStyleProject
(org.eclipse.core.resources.IProject project) void
Remove the listener from the set of ICProjecctDescriptionListenersvoid
setPreferenceConfiguration
(String buildSystemId, ICConfigurationDescription des) void
setProjectDescription
(org.eclipse.core.resources.IProject project, 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 thegetProjectDescription(IProject, boolean)
orcreateProjectDescription(IProject, boolean)
Note that having persisted changes to the description, the passed in ICProjectDescription is read-only and shouldn't be used.void
setProjectDescription
(org.eclipse.core.resources.IProject project, ICProjectDescription des, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) This method is called tovoid
setProjectDescription
(org.eclipse.core.resources.IProject project, ICProjectDescription des, int flags, org.eclipse.core.runtime.IProgressMonitor monitor) boolean
setProjectDescriptionWorkspacePreferences
(ICProjectDescriptionWorkspacePreferences prefs, boolean updateProjects, org.eclipse.core.runtime.IProgressMonitor monitor) used to apply the project description workspace preferencesvoid
updateExternalSettingsProviders
(String[] ids, org.eclipse.core.runtime.IProgressMonitor monitor) forces the external settings providers of the specified IDs to be rescanned and all configurations referencing the specified providers to be updatedvoid
updateProjectDescriptions
(org.eclipse.core.resources.IProject[] projects, org.eclipse.core.runtime.IProgressMonitor monitor) forces the cached data of the specified projects to be re-loaded.
-
Field Details
-
SET_FORCE
static final int SET_FORCEFlag indicating that the description should be serialized even if the ProjectDescription isn't marked as modified. -
SET_NO_SERIALIZE
static final int SET_NO_SERIALIZEFlag indicating that the project description shouldn't be serialized. -
GET_WRITABLE
static final int GET_WRITABLEFlag indicating writable project description is required -
GET_IF_LOADDED
static final int GET_IF_LOADDEDReturn the project description only if it's already loaded- See Also:
-
GET_EMPTY_PROJECT_DESCRIPTION
static final int GET_EMPTY_PROJECT_DESCRIPTIONFlag indicating that a new empty ICProjectDescription should be created and returned (irrespective of whether one already exists)- Since:
- 5.1
- See Also:
-
GET_CREATE_DESCRIPTION
static final int GET_CREATE_DESCRIPTIONFlag indicating that the user has called createProjectDescription. i.e. a description should be returned irrespective of whether one already exists. If the project already has a description and !GET_EMPTY_PROJECT_DESCRIPTION
the existing description will be returned, otherwise a new description is returned- Since:
- 5.1
- See Also:
-
PROJECT_CREATING
static final int PROJECT_CREATINGFlag indicating that the Project is in the process of being created (i.e. the user is working through the new project dialog...) This flag doesn't affect whether a description should or shouldn't be created.- Since:
- 5.1
- See Also:
-
-
Method Details
-
createProjectDescription
ICProjectDescription createProjectDescription(org.eclipse.core.resources.IProject project, boolean loadIfExists) throws org.eclipse.core.runtime.CoreException This method is a full equivalent to:
-createProjectDescription(IProject, boolean, false)
-getProjectDescription(IProject, GET_WRITABLE | loadIfExists ? 0 : GET_EMPTY_PROJECT_DESCRIPTION)
and returns a writable project description which is either empty or a copy of the previous configuration description if loadIfExists == true.- Throws:
org.eclipse.core.runtime.CoreException
- if the Project doesn't exist, or the storage couldn't be found- See Also:
-
createProjectDescription
ICProjectDescription createProjectDescription(org.eclipse.core.resources.IProject project, boolean loadIfExists, boolean creating) throws org.eclipse.core.runtime.CoreException the method creates and returns a writable project description- Parameters:
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 thesetProjectDescription(IProject, ICProjectDescription)
is called- Returns:
ICProjectDescription
- Throws:
org.eclipse.core.runtime.CoreException
- if the Project doesn't exist, or the storage couldn't be found
-
setProjectDescription
void setProjectDescription(org.eclipse.core.resources.IProject project, ICProjectDescription des) throws org.eclipse.core.runtime.CoreException 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 thegetProjectDescription(IProject, boolean)
orcreateProjectDescription(IProject, boolean)
Note that having persisted changes to the description, the passed in ICProjectDescription is read-only and shouldn't be used. If the user wishes to continue editing the ICProjectDescription they must ensure they getProjectDescription again.- Parameters:
project
-des
-- Throws:
org.eclipse.core.runtime.CoreException
- See Also:
-
setProjectDescription
void setProjectDescription(org.eclipse.core.resources.IProject project, ICProjectDescription des, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException This method is called to- Parameters:
project
-des
-force
-monitor
-- Throws:
org.eclipse.core.runtime.CoreException
-
setProjectDescription
void setProjectDescription(org.eclipse.core.resources.IProject project, ICProjectDescription des, int flags, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException - Parameters:
project
-des
-flags
-monitor
-- Throws:
org.eclipse.core.runtime.CoreException
-
getProjectDescription
returns the project description associated with this project or null if the project does not contain the CDT data associated with it. this is a convenience method fully equivalent to getProjectDescription(project, true) seegetProjectDescription(IProject, boolean)
for more detail- Parameters:
project
-- Returns:
- a writable copy of the ICProjectDescription or null if the project does not contain the
CDT data associated with it.
Note: changes to the project description will not be reflected/used by the core
until the
setProjectDescription(IProject, ICProjectDescription)
is called - See Also:
-
getProjectDescription
ICProjectDescription getProjectDescription(org.eclipse.core.resources.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.- Parameters:
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 theWriteAccessException
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 until thesetProjectDescription(IProject, ICProjectDescription)
is called Each getProjectDescription(project, true) returns a new copy of the project description The writable description uses the cached data until 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- Returns:
ICProjectDescription
or null if the project does not contain the CDT data associated with it.
-
getProjectDescription
- Parameters:
project
-flags
- some combination ofGET_WRITABLE
,GET_IF_LOADDED
,GET_EMPTY_PROJECT_DESCRIPTION
,GET_CREATE_DESCRIPTION
, andPROJECT_CREATING
- Returns:
ICProjectDescription
ornull
if the project does not contain the CDT data associated with it.- See Also:
-
updateProjectDescriptions
void updateProjectDescriptions(org.eclipse.core.resources.IProject[] projects, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException forces the cached data of the specified projects to be re-loaded. if theprojects
argument isnull
all projects within the workspace are updated- Parameters:
projects
-monitor
-- Throws:
org.eclipse.core.runtime.CoreException
-
isNewStyleProject
boolean isNewStyleProject(org.eclipse.core.resources.IProject project) - Parameters:
project
-- Returns:
- whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
-
isNewStyleProject
- Parameters:
des
-- Returns:
- whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
-
addCProjectDescriptionListener
Register a listener for changes on the set of known ICProjectDescriptions for the specified set of events- Parameters:
listener
-eventTypes
- see the eventTypes inCProjectDescriptionEvent
- See Also:
-
removeCProjectDescriptionListener
Remove the listener from the set of ICProjecctDescriptionListeners- Parameters:
listener
-
-
getProjectDescriptionWorkspacePreferences
Returns the workspace project description preferences. if thewrite
argument isfalse
, the returned preferences are read-only otherwise the preferences are writable. NOTE: the changes made to the preferences will NOT get applied until the preferences are set via thesetProjectDescriptionWorkspacePreferences(ICProjectDescriptionWorkspacePreferences, boolean, IProgressMonitor)
method- Parameters:
write
- if true, the writable preferences copy is returned.- Returns:
- the workspace project description preferences
- See Also:
-
setProjectDescriptionWorkspacePreferences
boolean setProjectDescriptionWorkspacePreferences(ICProjectDescriptionWorkspacePreferences prefs, boolean updateProjects, org.eclipse.core.runtime.IProgressMonitor monitor) used to apply the project description workspace preferences- Parameters:
prefs
- - preferences to be appliedupdateProjects
- - iftrue
all project descriptions within the workspace will be updated to reflect/use the settings specified with the given preferencesmonitor
-- Returns:
true
if newprefs
differ from the old ones, i.e. preferences changed
-
updateExternalSettingsProviders
void updateExternalSettingsProviders(String[] ids, org.eclipse.core.runtime.IProgressMonitor monitor) forces the external settings providers of the specified IDs to be rescanned and all configurations referencing the specified providers to be updated- Parameters:
ids
- the ids of externalSettinsProvider extensions- See Also:
-
getPreferenceConfiguration
ICConfigurationDescription getPreferenceConfiguration(String buildSystemId) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
getPreferenceConfiguration
ICConfigurationDescription getPreferenceConfiguration(String buildSystemId, boolean write) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
setPreferenceConfiguration
void setPreferenceConfiguration(String buildSystemId, ICConfigurationDescription des) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-