org.eclipse.cdt.managedbuilder.internal.core
Class ManagedProject

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.internal.core.BuildObject
      extended by org.eclipse.cdt.managedbuilder.internal.core.ManagedProject
All Implemented Interfaces:
IBuildObject, IBuildObjectPropertiesContainer, IBuildPropertiesRestriction, IManagedProject, IBuildPropertyChangeListener

public class ManagedProject
extends BuildObject
implements IManagedProject, IBuildPropertiesRestriction, IBuildPropertyChangeListener


Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IManagedProject
BUILD_ARTEFACT_TYPE, BUILD_PROPERTIES, MANAGED_PROJECT_ELEMENT_NAME, PROJECTTYPE
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IBuildObject
ID, NAME
 
Constructor Summary
ManagedProject(org.eclipse.cdt.core.settings.model.ICProjectDescription des)
           
ManagedProject(org.eclipse.core.resources.IResource owner, IProjectType projectType)
          Create a project instance from the project-type specified in the argument, that is owned by the specified Eclipse project.
ManagedProject(ManagedBuildInfo buildInfo, org.eclipse.cdt.core.settings.model.ICStorageElement element, boolean loadConfigs, java.lang.String managedBuildRevision)
          Create the project instance from project file.
 
Method Summary
 void addConfiguration(Configuration configuration)
           
 void applyConfiguration(Configuration cfg)
           
 IConfiguration createConfiguration(IConfiguration parent, java.lang.String id)
          Creates a configuration for this project populated with the tools and options settings from the parent configuration.
 IConfiguration createConfigurationClone(IConfiguration parent, java.lang.String id)
          Creates a configuration for this project populated with the tools and options settings from the parent configuration.
 IBuildObjectProperties getBuildProperties()
           
 IConfiguration getConfiguration(java.lang.String id)
          Returns the configuration with the given id, or null if not found.
 java.util.Map getConfigurationMap()
           
 IConfiguration[] getConfigurations()
          Returns all of the configurations defined by this project-type.
 java.lang.String getDefaultArtifactName()
          Returns the default build artifact name for the project
 org.eclipse.core.resources.IResource getOwner()
          Returns the owner of the managed project (an IProject).
 IProjectType getProjectType()
          Answers the IProjectType that is the superclass of this project-type, or null if the attribute was not specified.
 java.lang.String[] getRequiredTypeIds()
           
 java.lang.String[] getSupportedTypeIds()
           
 java.lang.String[] getSupportedValueIds(java.lang.String typeId)
           
 org.eclipse.cdt.utils.envvar.StorableEnvironment getUserDefinedEnvironmet()
           
 org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
           
 boolean isDirty()
          Returns true if this project has changes that need to be saved in the project file, else false.
 boolean isValid()
          Returns true if this project is valid else false.
 void propertiesChanged()
           
 void removeConfiguration(java.lang.String id)
          Removes the configuration with the ID specified in the argument.
 boolean requiresType(java.lang.String typeId)
           
 boolean resolveReferences()
           
 void serialize(org.eclipse.cdt.core.settings.model.ICStorageElement element, boolean saveChildren)
           
 void serializeProjectInfo(org.eclipse.cdt.core.settings.model.ICStorageElement element)
           
 void setDirty(boolean isDirty)
          Sets the element's "dirty" (have I been modified?)
 void setProjectType(IProjectType projectType)
           
 void setUserDefinedEnvironmet(org.eclipse.cdt.utils.envvar.StorableEnvironment env)
           
 void setValid(boolean isValid)
          Sets the element's "Valid" flag.
 void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
           
 boolean supportsType(IBuildPropertyType type)
           
 boolean supportsType(java.lang.String typeId)
           
 boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value)
           
 boolean supportsValue(java.lang.String typeId, java.lang.String valueId)
           
 void updateManagedBuildRevision(java.lang.String revision)
           
 void updateOwner(org.eclipse.core.resources.IResource resource)
          Sets the owner of the managed project.
 
Methods inherited from class org.eclipse.cdt.managedbuilder.internal.core.BuildObject
getBaseId, getId, getManagedBuildRevision, getName, getVersionFromId, setId, setManagedBuildRevision, setName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.cdt.managedbuilder.core.IBuildObject
getBaseId, getId, getManagedBuildRevision, getName
 

Constructor Detail

ManagedProject

public ManagedProject(org.eclipse.core.resources.IResource owner,
                      IProjectType projectType)
Create a project instance from the project-type specified in the argument, that is owned by the specified Eclipse project.

Parameters:
owner - the Eclipse project that owns the Managed Project
projectType -

ManagedProject

public ManagedProject(org.eclipse.cdt.core.settings.model.ICProjectDescription des)

ManagedProject

public ManagedProject(ManagedBuildInfo buildInfo,
                      org.eclipse.cdt.core.settings.model.ICStorageElement element,
                      boolean loadConfigs,
                      java.lang.String managedBuildRevision)
Create the project instance from project file.

Parameters:
buildInfo -
element -
managedBuildRevision - the fileVersion of Managed Build System
Method Detail

serializeProjectInfo

public void serializeProjectInfo(org.eclipse.cdt.core.settings.model.ICStorageElement element)

serialize

public void serialize(org.eclipse.cdt.core.settings.model.ICStorageElement element,
                      boolean saveChildren)

getOwner

public org.eclipse.core.resources.IResource getOwner()
Description copied from interface: IManagedProject
Returns the owner of the managed project (an IProject).

Specified by:
getOwner in interface IManagedProject
Returns:
IResource

updateOwner

public void updateOwner(org.eclipse.core.resources.IResource resource)
Description copied from interface: IManagedProject
Sets the owner of the managed project.

Specified by:
updateOwner in interface IManagedProject

getProjectType

public IProjectType getProjectType()
Description copied from interface: IManagedProject
Answers the IProjectType that is the superclass of this project-type, or null if the attribute was not specified.

Specified by:
getProjectType in interface IManagedProject
Returns:
IProjectType

createConfiguration

public IConfiguration createConfiguration(IConfiguration parent,
                                          java.lang.String id)
Description copied from interface: IManagedProject
Creates a configuration for this project populated with the tools and options settings from the parent configuration. As options and tools change in the parent, unoverridden values are updated in the child configuration as well.

This method performs steps 3 & 4 described above.

Specified by:
createConfiguration in interface IManagedProject
Parameters:
parent - The IConfiguration to use as a settings template
id - The unique id the new configuration will have
Returns:
IConfiguration of the new configuration

createConfigurationClone

public IConfiguration createConfigurationClone(IConfiguration parent,
                                               java.lang.String id)
Description copied from interface: IManagedProject
Creates a configuration for this project populated with the tools and options settings from the parent configuration. As opposed to the createConfiguration method, this method creates a configuration from an existing configuration in the project.

In this case, the new configuration is cloned from the existing configuration, and does not retain a pointer to the existing configuration.

Specified by:
createConfigurationClone in interface IManagedProject
Parameters:
parent - The IConfiguration to clone
id - The unique id the new configuration will have
Returns:
IConfiguration of the new configuration

getConfiguration

public IConfiguration getConfiguration(java.lang.String id)
Description copied from interface: IManagedProject
Returns the configuration with the given id, or null if not found.

Specified by:
getConfiguration in interface IManagedProject
Parameters:
id - The unique id of the configuration
Returns:
IConfiguration

getConfigurations

public IConfiguration[] getConfigurations()
Description copied from interface: IManagedProject
Returns all of the configurations defined by this project-type.

Specified by:
getConfigurations in interface IManagedProject
Returns:
IConfiguration[]

removeConfiguration

public void removeConfiguration(java.lang.String id)
Description copied from interface: IManagedProject
Removes the configuration with the ID specified in the argument.

Specified by:
removeConfiguration in interface IManagedProject
Parameters:
id - The unique id of the configuration

addConfiguration

public void addConfiguration(Configuration configuration)

getConfigurationMap

public java.util.Map getConfigurationMap()

getDefaultArtifactName

public java.lang.String getDefaultArtifactName()
Description copied from interface: IManagedProject
Returns the default build artifact name for the project

Specified by:
getDefaultArtifactName in interface IManagedProject
Returns:
String

resolveReferences

public boolean resolveReferences()

isDirty

public boolean isDirty()
Description copied from interface: IManagedProject
Returns true if this project has changes that need to be saved in the project file, else false.

Specified by:
isDirty in interface IManagedProject
Returns:
boolean

setDirty

public void setDirty(boolean isDirty)
Description copied from interface: IManagedProject
Sets the element's "dirty" (have I been modified?) flag.

Specified by:
setDirty in interface IManagedProject

isValid

public boolean isValid()
Description copied from interface: IManagedProject
Returns true if this project is valid else false.

Specified by:
isValid in interface IManagedProject
Returns:
boolean

setValid

public void setValid(boolean isValid)
Description copied from interface: IManagedProject
Sets the element's "Valid" flag.

Specified by:
setValid in interface IManagedProject

getVersion

public org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
Specified by:
getVersion in interface IBuildObject
Overrides:
getVersion in class BuildObject
Returns:
Returns the version.

setVersion

public void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
Specified by:
setVersion in interface IBuildObject
Overrides:
setVersion in class BuildObject
Parameters:
version - The version to set.

getUserDefinedEnvironmet

public org.eclipse.cdt.utils.envvar.StorableEnvironment getUserDefinedEnvironmet()

setUserDefinedEnvironmet

public void setUserDefinedEnvironmet(org.eclipse.cdt.utils.envvar.StorableEnvironment env)

updateManagedBuildRevision

public void updateManagedBuildRevision(java.lang.String revision)
Overrides:
updateManagedBuildRevision in class BuildObject

setProjectType

public void setProjectType(IProjectType projectType)

applyConfiguration

public void applyConfiguration(Configuration cfg)

getBuildProperties

public IBuildObjectProperties getBuildProperties()
Specified by:
getBuildProperties in interface IBuildObjectPropertiesContainer

propertiesChanged

public void propertiesChanged()
Specified by:
propertiesChanged in interface IBuildPropertyChangeListener

supportsType

public boolean supportsType(IBuildPropertyType type)

supportsValue

public boolean supportsValue(IBuildPropertyType type,
                             IBuildPropertyValue value)

supportsType

public boolean supportsType(java.lang.String typeId)
Specified by:
supportsType in interface IBuildPropertiesRestriction

supportsValue

public boolean supportsValue(java.lang.String typeId,
                             java.lang.String valueId)
Specified by:
supportsValue in interface IBuildPropertiesRestriction

getRequiredTypeIds

public java.lang.String[] getRequiredTypeIds()
Specified by:
getRequiredTypeIds in interface IBuildPropertiesRestriction

getSupportedTypeIds

public java.lang.String[] getSupportedTypeIds()
Specified by:
getSupportedTypeIds in interface IBuildPropertiesRestriction

getSupportedValueIds

public java.lang.String[] getSupportedValueIds(java.lang.String typeId)
Specified by:
getSupportedValueIds in interface IBuildPropertiesRestriction

requiresType

public boolean requiresType(java.lang.String typeId)
Specified by:
requiresType in interface IBuildPropertiesRestriction