public class PluginDescriptor extends java.lang.Object implements XMLPersistent
PluginLauncher
Modifier and Type | Class and Description |
---|---|
static class |
PluginDescriptor.PluginClassNameSorter
Sort plugins on class name.
|
static class |
PluginDescriptor.PluginIdent |
static class |
PluginDescriptor.PluginKernelNameSorter
Sort plugins on name with kernel plugins appearing first.
|
static class |
PluginDescriptor.PluginNameSorter
Sort plugins on name.
|
static class |
PluginDescriptor.PluginOnlineIdent |
Modifier and Type | Field and Description |
---|---|
static javax.swing.ImageIcon |
DEFAULT_ICON |
static java.awt.Image |
DEFAULT_IMAGE |
static int |
ICON_SIZE |
static java.lang.String |
ID_AUTHOR |
static java.lang.String |
ID_CHANGELOG |
static java.lang.String |
ID_CLASSNAME
Deprecated.
Use
PluginDescriptor.PluginIdent.ID_CLASSNAME instead |
static java.lang.String |
ID_DEPENDENCIES |
static java.lang.String |
ID_DEPENDENCY |
static java.lang.String |
ID_DESCRIPTION |
static java.lang.String |
ID_EMAIL |
static java.lang.String |
ID_ICON_URL |
static java.lang.String |
ID_IMAGE_URL |
static java.lang.String |
ID_JAR_URL |
static java.lang.String |
ID_NAME |
static java.lang.String |
ID_REQUIRED_KERNEL_VERSION
Deprecated.
|
static java.lang.String |
ID_URL |
static java.lang.String |
ID_WEB |
static int |
IMAGE_SIZE |
Constructor and Description |
---|
PluginDescriptor() |
PluginDescriptor(java.lang.Class<? extends Plugin> clazz)
Create from class, used for local plugin.
|
PluginDescriptor(PluginDescriptor.PluginOnlineIdent ident,
RepositoryPreferences.RepositoryInfo repos)
Create from plugin online identifier, used for online plugin only.
|
Modifier and Type | Method and Description |
---|---|
static void |
addToList(java.util.List<PluginDescriptor> list,
PluginDescriptor plugin) |
static void |
addToList(java.util.List<PluginDescriptor> list,
PluginDescriptor plugin,
int position) |
boolean |
equals(java.lang.Object obj) |
static boolean |
existInList(java.util.List<PluginDescriptor> list,
PluginDescriptor.PluginIdent ident)
Returns true if the specified plugin is present in the specified list.
|
static boolean |
existInList(java.util.List<PluginDescriptor> list,
PluginDescriptor plugin)
Returns true if the specified plugin is present in the specified list.
|
static boolean |
existInList(java.util.List<PluginDescriptor> list,
java.lang.String className)
Returns true if the specified plugin is present in the specified list.
|
static boolean |
existInList(java.util.Set<PluginDescriptor> plugins,
PluginDescriptor.PluginIdent ident) |
java.lang.String |
getAuthor()
Returns the author's plugin name.
|
java.lang.String |
getAuthorPackageName()
Returns the author package name (first part of simple package name)
|
java.lang.String |
getChangeLog() |
java.lang.String |
getChangesLog()
Deprecated.
Use
getChangeLog() instead |
java.lang.String |
getClassAsString()
Deprecated.
useless method
|
java.lang.String |
getClassName()
Returns the plugin class name.
|
java.lang.String |
getDesc()
Deprecated.
use
getDescription() instead |
java.lang.String |
getDescription() |
java.lang.String |
getEmail() |
java.lang.String |
getFilename()
return associated filename
|
javax.swing.ImageIcon |
getIcon() |
java.awt.Image |
getIconAsImage() |
java.lang.String |
getIconExtension()
return icon extension
|
java.lang.String |
getIconFilename()
return icon filename
|
java.lang.String |
getIconUrl() |
PluginDescriptor.PluginIdent |
getIdent() |
java.awt.Image |
getImage() |
java.lang.String |
getImageExtension()
return image extension
|
java.lang.String |
getImageFilename()
return image filename
|
java.lang.String |
getImageUrl() |
static int |
getIndex(java.util.List<PluginDescriptor> list,
PluginDescriptor.PluginIdent ident)
Returns the index for the specified plugin in the specified list.
|
static int |
getIndex(java.util.List<PluginDescriptor> list,
PluginDescriptor plugin)
Returns the index for the specified plugin in the specified list.
|
static int |
getIndex(java.util.List<PluginDescriptor> list,
java.lang.String className)
Returns the index for the specified plugin in the specified list.
|
java.lang.String |
getJarExtension()
Returns the JAR file extension.
|
java.lang.String |
getJarFilename()
return jar filename
|
java.lang.String |
getJarUrl() |
java.lang.String |
getName() |
java.lang.String |
getPackageName()
Returns the package name of the plugin class.
|
static PluginDescriptor |
getPlugin(java.util.List<PluginDescriptor> list,
PluginDescriptor.PluginIdent ident,
boolean acceptNewer) |
static PluginDescriptor |
getPlugin(java.util.List<PluginDescriptor> list,
java.lang.String className) |
java.lang.Class<? extends Plugin> |
getPluginClass() |
java.lang.String |
getPluginJarPath() |
static java.util.ArrayList<PluginDescriptor> |
getPlugins(java.util.List<PluginDescriptor> list,
java.lang.String className) |
RepositoryPreferences.RepositoryInfo |
getRepository() |
java.util.List<PluginDescriptor.PluginIdent> |
getRequired() |
Version |
getRequiredKernelVersion() |
java.lang.String |
getSimpleClassName() |
java.lang.String |
getSimplePackageName()
Returns the minimum package name (remove "icy" or/and "plugin" header)
|
java.lang.String |
getUrl() |
Version |
getVersion() |
java.lang.String |
getWeb()
Returns the website url of this plugin.
|
java.lang.String |
getXMLExtension()
Returns the XML file extension.
|
java.lang.String |
getXMLFilename()
return xml filename (local XML file)
|
java.lang.String |
getXmlUrl() |
int |
hashCode() |
boolean |
isAbstract()
Return true if the plugin class is abstract
|
boolean |
isActionable()
return true if the plugin has an action which can be started from menu
|
boolean |
isAllLoaded()
Returns true if both descriptor and images are loaded.
|
boolean |
isBeta()
Return true if the plugin is in beta state
|
boolean |
isBundled()
Return true if the plugin is bundled inside another plugin (mean it does not have a proper
descriptor)
|
boolean |
isChangeLogLoaded()
Returns true if change log is loaded.
|
boolean |
isClassLoaded() |
boolean |
isDescriptorLoaded()
Returns true if descriptor is loaded.
|
boolean |
isEnabled() |
boolean |
isIconLoaded()
Returns true if icon is loaded.
|
boolean |
isImageLoaded()
Returns true if image is loaded.
|
boolean |
isImagesLoaded()
Returns true if image and icon are loaded.
|
boolean |
isInstalled()
Return true if plugin is installed (corresponding JAR file exist)
|
boolean |
isInstanceOf(java.lang.Class<?> baseClazz)
Check if the plugin class is an instance of (or subclass of) the specified class.
|
boolean |
isInterface()
Return true if the plugin class is an interface
|
boolean |
isKernelPlugin()
Return true if this plugin is a system application plugin (declared in plugins.kernel
package).
|
boolean |
isLoaded()
Deprecated.
Use
isDescriptorLoaded() instead |
boolean |
isNewer(PluginDescriptor plugin) |
boolean |
isNewerOrEqual(PluginDescriptor plugin) |
boolean |
isOlder(PluginDescriptor plugin) |
boolean |
isOlderOrEqual(PluginDescriptor plugin) |
boolean |
isPrivate()
Return true if the plugin class is private
|
boolean |
load(boolean loadImages)
Deprecated.
Use
loadDescriptor() or loadAll() instead |
boolean |
loadAll()
Load descriptor and images if not already done
|
boolean |
loadChangeLog()
Load change log field (xmlUrl field should be correctly filled)
|
boolean |
loadDescriptor()
Load descriptor informations (xmlUrl field should be correctly filled)
|
boolean |
loadDescriptor(boolean reload)
Load descriptor informations (xmlUrl field should be correctly filled).
|
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
boolean |
loadFromXML(org.w3c.dom.Node node,
boolean loadChangeLog) |
boolean |
loadFromXML(java.lang.String path) |
boolean |
loadFromXML(java.net.URL xmlUrl) |
boolean |
loadIcon()
Load 64x64 icon (icon url field should be correctly filled)
|
boolean |
loadImage()
Load 256x256 image (image url field should be correctly filled)
|
boolean |
loadImages()
Load icon and image (both icon and image url fields should be correctly filled)
|
static boolean |
removeFromList(java.util.List<PluginDescriptor> list,
java.lang.String className) |
boolean |
requires(PluginDescriptor plugin)
Return true if specified plugin is required by current plugin
|
boolean |
saveToXML() |
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
void |
setAuthor(java.lang.String author) |
void |
setChangeLog(java.lang.String value) |
void |
setChangesLog(java.lang.String value)
Deprecated.
|
void |
setDescription(java.lang.String desc) |
void |
setEmail(java.lang.String email) |
void |
setEnabled(boolean enabled) |
void |
setIconUrl(java.lang.String iconUrl) |
void |
setImageUrl(java.lang.String imageUrl) |
void |
setJarUrl(java.lang.String jarUrl) |
void |
setName(java.lang.String name) |
void |
setRepository(RepositoryPreferences.RepositoryInfo repository) |
void |
setWeb(java.lang.String web) |
void |
setXmlUrl(java.lang.String xmlUrl) |
java.lang.String |
toString() |
public static final int ICON_SIZE
public static final int IMAGE_SIZE
public static final javax.swing.ImageIcon DEFAULT_ICON
public static final java.awt.Image DEFAULT_IMAGE
@Deprecated public static final java.lang.String ID_CLASSNAME
PluginDescriptor.PluginIdent.ID_CLASSNAME
instead@Deprecated public static final java.lang.String ID_REQUIRED_KERNEL_VERSION
PluginDescriptor.PluginIdent.ID_REQUIRED_KERNEL_VERSION
insteadpublic static final java.lang.String ID_URL
public static final java.lang.String ID_NAME
public static final java.lang.String ID_JAR_URL
public static final java.lang.String ID_IMAGE_URL
public static final java.lang.String ID_ICON_URL
public static final java.lang.String ID_AUTHOR
public static final java.lang.String ID_CHANGELOG
public static final java.lang.String ID_WEB
public static final java.lang.String ID_EMAIL
public static final java.lang.String ID_DESCRIPTION
public static final java.lang.String ID_DEPENDENCIES
public static final java.lang.String ID_DEPENDENCY
public PluginDescriptor()
public PluginDescriptor(java.lang.Class<? extends Plugin> clazz)
public PluginDescriptor(PluginDescriptor.PluginOnlineIdent ident, RepositoryPreferences.RepositoryInfo repos) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static int getIndex(java.util.List<PluginDescriptor> list, PluginDescriptor plugin)
public static int getIndex(java.util.List<PluginDescriptor> list, PluginDescriptor.PluginIdent ident)
public static int getIndex(java.util.List<PluginDescriptor> list, java.lang.String className)
public static boolean existInList(java.util.List<PluginDescriptor> list, PluginDescriptor plugin)
public static boolean existInList(java.util.List<PluginDescriptor> list, PluginDescriptor.PluginIdent ident)
public static boolean existInList(java.util.List<PluginDescriptor> list, java.lang.String className)
public static boolean existInList(java.util.Set<PluginDescriptor> plugins, PluginDescriptor.PluginIdent ident)
public static void addToList(java.util.List<PluginDescriptor> list, PluginDescriptor plugin, int position)
public static void addToList(java.util.List<PluginDescriptor> list, PluginDescriptor plugin)
public static boolean removeFromList(java.util.List<PluginDescriptor> list, java.lang.String className)
public static java.util.ArrayList<PluginDescriptor> getPlugins(java.util.List<PluginDescriptor> list, java.lang.String className)
public static PluginDescriptor getPlugin(java.util.List<PluginDescriptor> list, java.lang.String className)
public static PluginDescriptor getPlugin(java.util.List<PluginDescriptor> list, PluginDescriptor.PluginIdent ident, boolean acceptNewer)
@Deprecated public boolean load(boolean loadImages)
public boolean loadDescriptor()
public boolean loadDescriptor(boolean reload)
false
if the operation failed.public boolean loadChangeLog()
public boolean loadIcon()
public boolean loadImage()
public boolean loadImages()
public boolean loadAll()
public boolean isInstanceOf(java.lang.Class<?> baseClazz)
public boolean isAbstract()
public boolean isPrivate()
public boolean isInterface()
public boolean isActionable()
public boolean isBundled()
public boolean isBeta()
public boolean isKernelPlugin()
public boolean loadFromXML(java.lang.String path)
public boolean loadFromXML(java.net.URL xmlUrl)
public boolean loadFromXML(org.w3c.dom.Node node)
XMLPersistent
loadFromXML
in interface XMLPersistent
public boolean loadFromXML(org.w3c.dom.Node node, boolean loadChangeLog)
public boolean saveToXML()
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent
public boolean isClassLoaded()
public java.lang.String getClassName()
public java.lang.String getSimpleClassName()
public java.lang.String getPackageName()
public java.lang.String getSimplePackageName()
public java.lang.String getAuthorPackageName()
@Deprecated public java.lang.String getClassAsString()
public java.lang.Class<? extends Plugin> getPluginClass()
public java.lang.String getPluginJarPath()
null
if the plugin is not installed).public java.lang.String getFilename()
public java.lang.String getXMLExtension()
public java.lang.String getXMLFilename()
public java.lang.String getIconExtension()
public java.lang.String getIconFilename()
public java.lang.String getImageExtension()
public java.lang.String getImageFilename()
public java.lang.String getJarExtension()
public java.lang.String getJarFilename()
public javax.swing.ImageIcon getIcon()
public java.awt.Image getIconAsImage()
public java.awt.Image getImage()
public PluginDescriptor.PluginIdent getIdent()
public java.lang.String getName()
public Version getVersion()
public java.lang.String getUrl()
public java.lang.String getXmlUrl()
@Deprecated public java.lang.String getDesc()
getDescription()
insteadpublic java.lang.String getDescription()
public void setXmlUrl(java.lang.String xmlUrl)
xmlUrl
- the xmlUrl to setpublic void setRepository(RepositoryPreferences.RepositoryInfo repository)
repository
- the repository to setpublic java.lang.String getJarUrl()
public void setJarUrl(java.lang.String jarUrl)
jarUrl
- the jarUrl to setpublic java.lang.String getImageUrl()
public void setImageUrl(java.lang.String imageUrl)
imageUrl
- the imageUrl to setpublic java.lang.String getIconUrl()
public void setIconUrl(java.lang.String iconUrl)
iconUrl
- the iconUrl to setpublic java.lang.String getAuthor()
public java.lang.String getWeb()
public java.lang.String getEmail()
public java.lang.String getChangeLog()
@Deprecated public java.lang.String getChangesLog()
getChangeLog()
insteadpublic Version getRequiredKernelVersion()
public boolean isDescriptorLoaded()
@Deprecated public boolean isLoaded()
isDescriptorLoaded()
insteadpublic boolean isChangeLogLoaded()
public boolean isIconLoaded()
public boolean isImageLoaded()
public boolean isImagesLoaded()
public boolean isAllLoaded()
public java.util.List<PluginDescriptor.PluginIdent> getRequired()
public RepositoryPreferences.RepositoryInfo getRepository()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- the enabled to setpublic boolean isInstalled()
public void setName(java.lang.String name)
name
- the name to setpublic void setAuthor(java.lang.String author)
author
- the author to setpublic void setWeb(java.lang.String web)
web
- the web to setpublic void setEmail(java.lang.String email)
email
- the email to setpublic void setDescription(java.lang.String desc)
desc
- the description to setpublic void setChangeLog(java.lang.String value)
value
- the changeLog to set@Deprecated public void setChangesLog(java.lang.String value)
setChangeLog(String)
public boolean requires(PluginDescriptor plugin)
public boolean isOlderOrEqual(PluginDescriptor plugin)
public boolean isOlder(PluginDescriptor plugin)
public boolean isNewerOrEqual(PluginDescriptor plugin)
public boolean isNewer(PluginDescriptor plugin)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object