public class IlvPlugin extends Object
Plug-in properties
Properties of a plug-in are defined with the attributes of the root
<plugin>
element in the plugin.xml
of the
plug-in. Plug-in properties are:
name
attribute. It is accessible
with the getName()
method.version
attribute or the
name of the directory that contains the plug-in. It is accessible
with the getVersion()
and getPluginVersion()
methods.
<Major version>[.<Minor version>[.<Service version>[.<Qualifier version>]]]As an example, valid versions can be:
If the version
attribute is not defined, the version is
determined from the name of the directory that contains the plug-in.
In this case, the name of the directory must be constructed as follows:
<ID of the plug-in>_<Major version component>.<Minor version component>.<Service version component>.<qualifier version component>Here is a list of valid directory names that include the specification of a version:
version
attribute is specified nor the directory
name includes a version specification, the plug-in is set the version
1.0.0
provider-name
attribute. It is accessible
with the getProviderName()
method.id
attribute. It is accessible
with the getID()
method.description
attribute.
It is accessible with the getDescription()
method.installMode
attribute.
It is accessible with the getInstallMode()
method.pluginInstallerJavaClass
attribute.
If this attribute is specified, a IlvPluginInstaller
is automatically
instantiated with the specified class and is accessible with the method
getInstaller()
.
Plug-in resource files
When plug-ins are installed, settings and resource property files specific
to the plug-in are added to the application. Files are referred to in the
plugin.xml
file of the plug-in with file names that are
relative to the root path of the library Jar file of the plug-in
that contains them.
Settings files are declared in the XML elements selected with the
/plugin/settings/file
XPath expression. The relative
file name of the settings file is provided with the name
attribute of those selected elements.
Resource property files are declared in the XML elements selected with the
/plugin/resources/resource
XPath expression. The relative
filename of the resource property file is provided with the
name
attribute of those selected elements.
Plug-in libraries
Classes and resource files specific to a plug-in are contained in library
Jar files that are added to the class loader of the host application
when the plug-in is installed. Libraries are declared in the
plugin.xml
file of the plug-in in the settings elements
selected with the /plugin/runtime/library
XPath
expression. The filename is defined in the name
attribute
of those settings elements and is relative to the directory that contains
the plug-in.
You can find documentation and examples of using plug-ins in the Perforce JViews Application Framework User's Manual, in the chapter on Plug-ins.
IlvPluginManager
Modifier and Type | Method and Description |
---|---|
IlvApplication |
getApplication()
Returns the application of the plug-in.
|
ClassLoader |
getClassLoader()
The class loader associated with this plugin.
|
ClassLoader[] |
getClassLoaders()
Deprecated.
Only one class loader is created for each plugin.
This class loader takes into account all the libraries of the plugin
as well as all the plugin that are required by this plugin.
This method returns an array of one class loader that contains
the class loader given with the method |
IlvPlugin |
getDependentPlugin(int index)
Returns the plug-in at the specified storage
index in the list of installed plug-ins that
depend on this plug-in. |
int |
getDependentPluginCount()
Returns the number of installed plug-ins that depend on this
plug-in.
|
String |
getDescription()
Returns the description of the plug-in.
|
File |
getDirectory()
Returns the file directory where this plug-in is defined.
|
String |
getID()
Returns the ID of this plug-in.
|
IlvPluginInstaller |
getInstaller()
Returns the installer of the plug-in.
|
String |
getInstallMode()
Returns the installation mode of this plug-in as defined in the
plugin.xml file of this plug-in. |
String |
getName()
Returns the name of the plug-in.
|
String |
getNameKey()
Returns the resource key of the name of the plug-in.
|
IlvPlugin |
getParentPlugin()
Returns the plug-in that owns the plug-in.
|
IlvPlugin |
getPlugin(int index)
Returns the child plug-in stored at the specified
index . |
IlvPlugin |
getPlugin(String id)
Returns the child plug-in of this plug-in with the specified ID.
|
int |
getPluginCount()
Returns the number of child plug-ins owned by this plug-in.
|
IlvPluginManager |
getPluginManager()
Returns the plugin manager that contains this plugin.
|
IlvPlugin[] |
getPlugins()
Returns the child plug-ins of this plug-in.
|
IlvPluginVersion |
getPluginVersion()
Returns the
IlvPluginVersion of this plug-in. |
String |
getPropertyFile(int index)
Returns the property file at the specified storage
index . |
int |
getPropertyFileCount()
Returns the number of property files declared in the
plugin.xml
file of this plug-in. |
String |
getProviderName()
Returns the name of the provider of this plug-in.
|
ResourceBundle |
getResourceBundle()
Returns the resource bundle that contains all the internationalization
resources declared in the
plugin.xml file of this plug-in. |
IlvSettingsElement |
getSettingsElement()
Returns the
<plugin> root settings element that
defines the plug-in in its associated plugin.xml file. |
IlvSettingsManager |
getSettingsManager()
Returns the settings manager that manages the settings of this plug-in.
|
URL |
getURL()
Returns the URL of the file directory where this plug-in is defined.
|
IlvURLResolver |
getURLResolver()
Returns the URL resolver that resolves URLs for resources
defined in this plug-in.
|
String |
getVersion()
Returns the version of this plug-in as a string.
|
boolean |
isInstalled()
Determines whether the plug-in is installed.
|
void |
setApplication(IlvApplication application)
Sets the application of the plug-in.
|
public String getProviderName()
public String getVersion()
getPluginVersion()
public IlvPluginVersion getPluginVersion()
IlvPluginVersion
of this plug-in.getVersion()
public String getID()
plugin.xml
definition
file, the returned ID the name of the directory that contains the plug-in.public void setApplication(IlvApplication application)
application
- The application of the plug-in.getApplication()
,
IlvPluginInstaller
public IlvApplication getApplication()
public File getDirectory()
public URL getURL()
public String getName()
plugin.xml
file defining the plug-in.public String getNameKey()
getString(getNameKey())
.@Deprecated public ClassLoader[] getClassLoaders()
This method returns an array of one class loader that contains
the class loader given with the method getClassLoader()
.
plugin.xml
file of the plug-in.public IlvURLResolver getURLResolver()
public ResourceBundle getResourceBundle()
plugin.xml
file of this plug-in.getPropertyFileCount()
,
getPropertyFile(int)
public int getPropertyFileCount()
plugin.xml
file of this plug-in.getPropertyFile(int)
public String getPropertyFile(int index)
index
.getResourceBundle()
,
getPropertyFileCount()
public ClassLoader getClassLoader()
This class loader allows to find resources and classes that are
in the directory of the plugin or in the libraries declared
in the plugin.xml
manifest file of the plugin.
public boolean isInstalled()
true
if the plug-in is installed; false
otherwise.public IlvPlugin getPlugin(String id)
plugin.xml
file of this plug-in
as child elements of the element selected with plugin/plugins
.id
- The ID of the plug-in to return.null
if no
child plug-ins are defined with this ID.getPlugin(int)
,
getPlugins()
public IlvPlugin getPlugin(int index)
index
.getPlugin(String)
,
getPlugins()
public IlvPlugin[] getPlugins()
plugin.xml
file of this plug-in
as child elements of the element selected with plugin/plugins
.public int getPluginCount()
getPlugins()
public IlvSettingsManager getSettingsManager()
plugin.xml
file of this plug-in
with the elements selected with plugin/settings/file
XPath expression.public IlvPlugin getParentPlugin()
public int getDependentPluginCount()
A plug-in A depends on another plug-in B if A refers to B in its list of required plug-ins or if A is a child plug-in of B.
getDependentPlugin(int)
public IlvPlugin getDependentPlugin(int index)
index
in the list of installed plug-ins that
depend on this plug-in.getDependentPluginCount()
public String getInstallMode()
plugin.xml
file of this plug-in.
The return value can be one of the following:IlvPluginManager.INSTALL_BY_DEFAULT
IlvPluginManager.NOT_INSTALL_BY_DEFAULT
IlvPluginManager.NEVER_INSTALL_BY_DEFAULT
IlvPluginManager.isInitiallyInstalled(ilog.views.appframe.plugin.IlvPlugin)
to determine
whether this plug-in
should be installed when the application is being launched.public IlvPluginInstaller getInstaller()
plugin.xml
file of the plug-in.null
if no plug-in
installer is specified in the plugin.xml
file
of the plug-in.public IlvSettingsElement getSettingsElement()
<plugin>
root settings element that
defines the plug-in in its associated plugin.xml
file.This settings element can be used for accessing user information that has not been interpreted for the plug-in.
public String getDescription()
"description"
attribute of the root
<plugin>
element in the plugin.xml
file
of this plug-in. This string is probably a
key of a resource string that should be translated according to the locale.public IlvPluginManager getPluginManager()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.