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

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.internal.core.BuildObject
      extended by org.eclipse.cdt.managedbuilder.internal.core.OptionCategory
All Implemented Interfaces:
IBuildObject, IOptionCategory

public class OptionCategory
extends BuildObject
implements IOptionCategory


Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IOptionCategory
ALL, FILTER_ALL, FILTER_FILE, FILTER_PROJECT, ICON, OWNER, PROJECT
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IBuildObject
ID, NAME
 
Constructor Summary
OptionCategory(IHoldsOptions parent, org.eclipse.cdt.core.settings.model.ICStorageElement element)
          Create an based on the specification stored in the project file (.cdtbuild).
OptionCategory(IHoldsOptions parent, IManagedConfigElement element)
          This constructor is called to create an option category defined by an extension point in a plugin manifest file, or returned by a dynamic element provider
OptionCategory(IOptionCategory owner)
           
 
Method Summary
 void addChildCategory(OptionCategory category)
           
static java.lang.Object findOptionCategoryByMatchName(java.lang.String matchName, IOptionCategory[] cats)
          Finds an option category from an array of categories by comparing against a match name.
 IOptionCategory[] getChildCategories()
          Returns the list of children of this node in the option category tree
 java.net.URL getIconPath()
          Get the path name of an alternative icon for the option group.
 java.lang.String getManagedBuildRevision()
           
 IHoldsOptions getOptionHolder()
          Returns the holder (parent) of this category.
 java.lang.Object[][] getOptions(IConfiguration configuration)
           
 java.lang.Object[][] getOptions(IConfiguration configuration, IHoldsOptions optionHolder)
          Returns an array of ITool/IOption pairs for the options in this category for a given configuration.
 java.lang.Object[][] getOptions(IResourceConfiguration resConfig)
           
 java.lang.Object[][] getOptions(IResourceInfo resinfo, IHoldsOptions optionHolder)
          Returns an array of ITool/IOption pairs for the options in this category for a given resource configuration.
 IOptionCategory getOwner()
          Returns the category that owns this category, or null if this is the top category for a tool.
 ITool getTool()
          Returns the tool that ultimately owns this category.
 org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
           
 boolean isDirty()
          Returns true if this element has changes that need to be saved in the project file, else false.
 boolean isExtensionElement()
           
 void loadFromManifest(IManagedConfigElement element)
           
static java.lang.String makeMatchName(IBuildObject catOrTool)
          Creates a name that uniquely identifies a category.
 void resolveReferences()
           
 void serialize(org.eclipse.cdt.core.settings.model.ICStorageElement element)
          Persist the OptionCategory to the project file.
 void setDirty(boolean isDirty)
          Sets the element's "dirty" (have I been modified?)
 void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
           
 
Methods inherited from class org.eclipse.cdt.managedbuilder.internal.core.BuildObject
getBaseId, getId, getName, getVersionFromId, setId, setManagedBuildRevision, setName, toString, updateManagedBuildRevision
 
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, getName
 

Constructor Detail

OptionCategory

public OptionCategory(IOptionCategory owner)

OptionCategory

public OptionCategory(IHoldsOptions parent,
                      IManagedConfigElement element)
This constructor is called to create an option category defined by an extension point in a plugin manifest file, or returned by a dynamic element provider

Parameters:
parent - The IHoldsOptions parent of this catgeory, or null if defined at the top level
element - The category definition from the manifest file or a dynamic element provider

OptionCategory

public OptionCategory(IHoldsOptions parent,
                      org.eclipse.cdt.core.settings.model.ICStorageElement element)
Create an based on the specification stored in the project file (.cdtbuild).

Parameters:
parent - The IHoldsOptions object the OptionCategory will be added to.
element - The XML element that contains the OptionCategory settings.
Method Detail

loadFromManifest

public void loadFromManifest(IManagedConfigElement element)

serialize

public void serialize(org.eclipse.cdt.core.settings.model.ICStorageElement element)
Persist the OptionCategory to the project file.

Parameters:
doc -
element -

getChildCategories

public IOptionCategory[] getChildCategories()
Description copied from interface: IOptionCategory
Returns the list of children of this node in the option category tree

Specified by:
getChildCategories in interface IOptionCategory
Returns:

addChildCategory

public void addChildCategory(OptionCategory category)

getOptions

public java.lang.Object[][] getOptions(IConfiguration configuration,
                                       IHoldsOptions optionHolder)
Description copied from interface: IOptionCategory
Returns an array of ITool/IOption pairs for the options in this category for a given configuration.

Specified by:
getOptions in interface IOptionCategory
Returns:
Object[][]

getOptions

public java.lang.Object[][] getOptions(IConfiguration configuration)
Specified by:
getOptions in interface IOptionCategory

getOptions

public java.lang.Object[][] getOptions(IResourceInfo resinfo,
                                       IHoldsOptions optionHolder)
Description copied from interface: IOptionCategory
Returns an array of ITool/IOption pairs for the options in this category for a given resource configuration.

Specified by:
getOptions in interface IOptionCategory
Returns:
Object[][]

getOptions

public java.lang.Object[][] getOptions(IResourceConfiguration resConfig)
Specified by:
getOptions in interface IOptionCategory

getOwner

public IOptionCategory getOwner()
Description copied from interface: IOptionCategory
Returns the category that owns this category, or null if this is the top category for a tool.

Specified by:
getOwner in interface IOptionCategory
Returns:

getOptionHolder

public IHoldsOptions getOptionHolder()
Description copied from interface: IOptionCategory
Returns the holder (parent) of this category. This may be an object implementing ITool or IToolChain, which both extend IHoldsOptions. The call can return null, for example the top option category of a tool will return null. Note that the name getOptionHolder() has been choosen, because Tool implements both ITool and IOptionCategory and ITool.getParent() exists already.

Specified by:
getOptionHolder in interface IOptionCategory
Returns:
IHoldsOptions

getTool

public ITool getTool()
Description copied from interface: IOptionCategory
Returns the tool that ultimately owns this category. If owned by a toolChain return null.

Specified by:
getTool in interface IOptionCategory
Returns:

getIconPath

public java.net.URL getIconPath()
Description copied from interface: IOptionCategory
Get the path name of an alternative icon for the option group. Or null if no alternative icon was defined.

Specified by:
getIconPath in interface IOptionCategory
Returns:
URL

isExtensionElement

public boolean isExtensionElement()

isDirty

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

Specified by:
isDirty in interface IOptionCategory
Returns:
boolean

setDirty

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

Specified by:
setDirty in interface IOptionCategory

resolveReferences

public void resolveReferences()

getManagedBuildRevision

public java.lang.String getManagedBuildRevision()
Specified by:
getManagedBuildRevision in interface IBuildObject
Overrides:
getManagedBuildRevision in class BuildObject
Returns:
Returns the managedBuildRevision.

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.

makeMatchName

public static java.lang.String makeMatchName(IBuildObject catOrTool)
Creates a name that uniquely identifies a category. The match name is a concatenation of the tool and categories, e.g. Tool->Cat1->Cat2 maps onto the string "Tool|Cat1|Cat2|"

Parameters:
category - or tool for which to build the match name
Returns:
match name

findOptionCategoryByMatchName

public static java.lang.Object findOptionCategoryByMatchName(java.lang.String matchName,
                                                             IOptionCategory[] cats)
Finds an option category from an array of categories by comparing against a match name. The match name is a concatenation of the tool and categories, e.g. Tool->Cat1->Cat2 maps onto the string "Tool|Cat1|Cat2|"

Parameters:
matchName - an identifier to search
categories - as returned by getChildCategories(), i.e. non-flattened
Returns:
category or tool, if found and null otherwise