public class ConfigurationElementHandle extends Handle implements IConfigurationElement
objectManager| Constructor and Description |
|---|
ConfigurationElementHandle(IObjectManager objectManager,
int id) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
createExecutableExtension(java.lang.String propertyName)
Creates and returns a new instance of the executable extension
identified by the named attribute of this configuration element.
|
java.lang.String |
getAttribute(java.lang.String propertyName)
Returns the named attribute of this configuration element, or
null if none. |
java.lang.String |
getAttribute(java.lang.String attrName,
java.lang.String locale)
When multi-language support is enabled, this method returns the named attribute of this
configuration element in the specified locale, or
null if none. |
java.lang.String |
getAttributeAsIs(java.lang.String name)
Returns the named attribute of this configuration element, or
null if none. |
java.lang.String[] |
getAttributeNames()
Returns the names of the attributes of this configuration element.
|
IConfigurationElement[] |
getChildren()
Returns all configuration elements that are children of this
configuration element.
|
IConfigurationElement[] |
getChildren(java.lang.String name)
Returns all child configuration elements with the given name.
|
protected ConfigurationElement |
getConfigurationElement() |
IContributor |
getContributor()
Returns the contributor of this configuration element.
|
IExtension |
getDeclaringExtension()
Returns the extension that declares this configuration element.
|
int |
getHandleId()
Returns unique identifier of the registry object from which this element was created.
|
java.lang.String |
getName()
Returns the name of this configuration element.
|
java.lang.String |
getNamespace()
Returns the namespace for this configuration element.
|
java.lang.String |
getNamespaceIdentifier()
Returns the namespace name for this configuration element.
|
java.lang.Object |
getParent()
Returns the element which contains this element.
|
java.lang.String |
getValue()
Returns the text value of this configuration element.
|
java.lang.String |
getValue(java.lang.String locale)
When multi-language support is enabled, this method returns the text value of this
configuration element in the specified locale, or
null if none. |
java.lang.String |
getValueAsIs()
Returns the untranslated text value of this configuration element.
|
boolean |
isValid()
Returns whether this configuration element object is valid.
|
protected boolean |
shouldPersist() |
java.lang.String |
toString()
WARNING: this method must return string containing
getHandleId() identifier, because some clients might have
misused previously returned Object.toString() value which was in fact just Handle.hashCode() value which
in turn was alwas the value of getHandleId(). |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitequalspublic ConfigurationElementHandle(IObjectManager objectManager, int id)
protected ConfigurationElement getConfigurationElement()
protected boolean shouldPersist()
public java.lang.String getAttribute(java.lang.String propertyName)
IConfigurationElementnull if none.
The names of configuration element attributes are the same as the attribute names of the corresponding XML element. For example, the configuration markup
<bg pattern="stripes"/>corresponds to a configuration element named
"bg"
with an attribute named "pattern"
with attribute value "stripes".
Note that any translation specified in the plug-in manifest file is automatically applied.
getAttribute in interface IConfigurationElementpropertyName - the name of the attributenull if nonepublic java.lang.String getAttribute(java.lang.String attrName,
java.lang.String locale)
IConfigurationElementnull if none.
The locale matching tries to find the best match between available translations and the requested locale, falling back to a more generic locale ("en") when the specific locale ("en_US") is not available.
If multi-language support is not enabled, this method is equivalent to the method
IConfigurationElement.getAttribute(String).
getAttribute in interface IConfigurationElementattrName - the name of the attributelocale - the requested localenull if noneIConfigurationElement.getAttribute(String),
IExtensionRegistry.isMultiLanguage()public java.lang.String[] getAttributeNames()
IConfigurationElementThe names of configuration element attributes are the same as the attribute names of the corresponding XML element. For example, the configuration markup
<bg color="blue" pattern="stripes"/>corresponds to a configuration element named
"bg"
with attributes named "color"
and "pattern".
getAttributeNames in interface IConfigurationElementpublic IConfigurationElement[] getChildren()
IConfigurationElementEach child corresponds to a nested XML element in the configuration markup. For example, the configuration markup
<view>     <verticalHint>top</verticalHint>     <horizontalHint>left</horizontalHint> </view>corresponds to a configuration element, named
"view",
with two children.
getChildren in interface IConfigurationElementIConfigurationElement.getChildren(String)public java.lang.Object createExecutableExtension(java.lang.String propertyName)
throws CoreException
IConfigurationElementThe specified class is instantiated using its 0-argument public constructor.
Then the following checks are done:
If the specified class implements the IExecutableExtension
interface, the method IExecutableExtension.setInitializationData(IConfigurationElement, String, Object)
is called, passing to the object the configuration information that was used to create it.
If the specified class implements IExecutableExtensionFactory
interface, the method IExecutableExtensionFactory.create()
is invoked.
Unlike other methods on this object, invoking this method may activate the plug-in.
createExecutableExtension in interface IConfigurationElementpropertyName - the name of the propertyCoreException - if an instance of the executable extension
could not be created for any reasonIExecutableExtension.setInitializationData(IConfigurationElement, String, Object),
IExecutableExtensionFactorypublic java.lang.String getAttributeAsIs(java.lang.String name)
IConfigurationElementnull if none.
The names of configuration element attributes are the same as the attribute names of the corresponding XML element. For example, the configuration markup
<bg pattern="stripes"/>corresponds to a configuration element named
"bg"
with an attribute named "pattern"
with attribute value "stripes".
Note that any translation specified in the plug-in manifest file for this attribute is not automatically applied.
getAttributeAsIs in interface IConfigurationElementname - the name of the attributenull if nonepublic IConfigurationElement[] getChildren(java.lang.String name)
IConfigurationElementgetChildren in interface IConfigurationElementname - the name of the child configuration elementIConfigurationElement.getChildren()public IExtension getDeclaringExtension()
IConfigurationElementgetDeclaringExtension in interface IConfigurationElementpublic java.lang.String getName()
IConfigurationElement<wizard name="Create Project"/>corresponds to a configuration element named
"wizard".getName in interface IConfigurationElementpublic java.lang.Object getParent()
IConfigurationElementIExtension.
Otherwise the returned value can be downcast to
IConfigurationElement.getParent in interface IConfigurationElementnullpublic java.lang.String getValue()
IConfigurationElement<script lang="javascript">.\scripts\cp.js</script>corresponds to a configuration element
"script"
with value ".\scripts\cp.js".
Values may span multiple lines (i.e., contain carriage returns and/or line feeds).
Note that any translation specified in the plug-in manifest file is automatically applied.
getValue in interface IConfigurationElementnullpublic java.lang.String getValue(java.lang.String locale)
IConfigurationElementnull if none.
The locale matching tries to find the best match between available translations and the requested locale, falling back to a more generic locale ("en") when the specific locale ("en_US") is not available.
If multi-language support is not enabled, this method is equivalent to the method
IConfigurationElement.getValue().
getValue in interface IConfigurationElementlocale - the requested localenullIConfigurationElement.getValue(String),
IExtensionRegistry.isMultiLanguage()public java.lang.String getValueAsIs()
IConfigurationElement<script lang="javascript">.\scripts\cp.js</script>corresponds to a configuration element
"script"
with value ".\scripts\cp.js".
Values may span multiple lines (i.e., contain carriage returns and/or line feeds).
Note that translation specified in the plug-in manifest file is not automatically applied. For example, the configuration markup
<tooltip>#hattip</tooltip>corresponds to a configuration element, named
"tooltip",
with value "#hattip".
getValueAsIs in interface IConfigurationElementnullpublic java.lang.String getNamespace()
IConfigurationElementgetNamespace in interface IConfigurationElementIExtensionRegistrypublic java.lang.String getNamespaceIdentifier()
IConfigurationElementgetNamespaceIdentifier in interface IConfigurationElementpublic IContributor getContributor()
IConfigurationElementgetContributor in interface IConfigurationElementpublic boolean isValid()
IConfigurationElementisValid in interface IConfigurationElementtrue if the object is valid, and false
if it is no longer validpublic int getHandleId()
IConfigurationElementgetHandleId in interface IConfigurationElementIConfigurationElement.equals(Object)public java.lang.String toString()
getHandleId() identifier, because some clients might have
misused previously returned Object.toString() value which was in fact just Handle.hashCode() value which
in turn was alwas the value of getHandleId().
Please read bug 515587 for details.
toString in class java.lang.Object