Package ro.sync.exml.plugin
Class PluginDescriptor
- java.lang.Object
-
- ro.sync.exml.plugin.PluginDescriptor
-
@API(type=NOT_EXTENDABLE, src=PUBLIC) public class PluginDescriptor extends java.lang.Object
Descriptor of the plugin.A plugin is characterised by:
- name The plugin name as it will appear in the oXygen menus.
- description A short description of what the plugin does.
- vendor The name of the vendor.
- version The current version.
- baseDir The base dir used for file crreation.
- extensions A set of extensions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PluginDescriptor.PluginExtensionDescription
Contains a plugin description + plugin type + keyboard shortcuts
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ADDITIONAL_DITA_OT
Additional DITA OT plugin type.static java.lang.String
ADDITIONAL_FRAMEWORKS
Additional frameworks location plugin type.static java.lang.String
ADDITIONAL_UI_TRANSLATIONS
Additional translations plugin type.static java.lang.String
ADDITIONAL_XPROC_ENGINE
Additional XProc Engine type.static java.lang.String
AUTHOR_STYLESHEET
Extension that provide an Author CSS.static java.lang.String
COMPONENTS_VALIDATOR_EXTENSION
The startup extension.static java.lang.String
DOCUMENT_PROCESSOR
Document processor extension type.static java.lang.String
DOCUMENT_VALIDATOR
Extension point for external document validatorstatic java.lang.String
GENERAL_EXTENSION
General extension type.static java.lang.String
GENERAL_STYLES_FILTER
CSS Styles filter plugin type.static java.lang.String
LOCK_HANDLER_FACTORY
A lock handler factory.static java.lang.String
OPEN_REDIRECTOR
Open redirector plugin type.static java.lang.String
OPTION_PAGE
Option page extension plugin type.static java.lang.String
OPTION_PAGE_GROUP
Option page group extension plugin type.static java.lang.String
REFACTORING_OPERATIONS_PROVIDER
Refactoring operations provider plugin type.static java.lang.String
SELECTION_PROCESSOR
Selection processor extension type.static java.lang.String
TARGETED_URL_HANDLER
Targeted URL stream handler extension type.static java.lang.String
TRANSFORMER
An XSLT transformer extension.static java.lang.String
TRUSTED_HOSTS
Extension point to provide trusted hosts.static java.lang.String
URL_CHOOSER
URL stream handler extension type.static java.lang.String
URL_CHOOSER_TOOLBAR
URL stream handler extension type.static java.lang.String
URL_HANDLER
URL stream handler extension type.static java.lang.String
URL_STREAM_HANDLER
Deprecated.static java.lang.String
WEBAPP_CSS_RESOURCE
WebappStaticResourcesFolderstatic java.lang.String
WEBAPP_SERVLET
WebApp plugin servlet.static java.lang.String
WEBAPP_SERVLET_FILTER
WebApp plugin servlet filter.static java.lang.String
WEBAPP_STATIC_RESOURCE_FOL
WebappStaticResourcesFolderstatic java.lang.String
WORKSPACE_ACCESS
Workspace access plugin type.static java.lang.String
WORKSPACE_ACCESS_JS
Workspace access plugin type implemented in JavaScript.static java.lang.String
WORKSPACE_ACCESS_JS_MODULE
A JavaScript module of the Workspace access plugin.static java.lang.String
XQUERY_TRANSFORMER
An XQuery transformer extension.
-
Constructor Summary
Constructors Constructor Description PluginDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContextInstance(java.lang.Object contextInstance)
Add a context instance.void
addExtension(PluginDescriptor.PluginExtensionDescription descr)
Put an extension corresponding to the specified key.void
addPluginContributedToolbar(ro.sync.exml.plugin.PluginContributedToolbar toolbarInfo)
Add a toolbar.void
addPluginContributedView(ro.sync.exml.plugin.PluginContributedView viewInfo)
Add a contributed viewjava.io.File
getBaseDir()
Get the base directory of the plugin.java.lang.String
getConfigUrlPath()
java.util.List<java.lang.Object>
getContextInstances()
Getter for all context instances.java.util.List<ro.sync.exml.plugin.PluginContributedToolbar>
getContributedToolbars()
Gets the toolbars contributed by this plugin.java.util.List<ro.sync.exml.plugin.PluginContributedView>
getContributedViews()
java.lang.String
getDescription()
Get the description of the plugin.java.util.List<PluginDescriptor.PluginExtensionDescription>
getExtensions()
Get all the extensions of a plugin.java.util.List<PluginDescriptor.PluginExtensionDescription>
getExtensions(java.lang.String key)
Get the extension corresponding to the specified key.java.lang.String
getID()
java.lang.String
getLicense()
java.lang.String
getName()
Gets the name of the plugin.java.lang.String
getVendor()
Get the vendor of the plugin.java.lang.String
getVersion()
Get the version of the plugin.boolean
isDisabledFromFile()
boolean
isEnabledStatus()
Get the enabled status.void
setBaseDir(java.io.File baseDir)
Set the base dir of the plugin.void
setConfigUrlPath(java.lang.String configUrlPath)
void
setDescription(java.lang.String description)
Set the description of the plugin.void
setDisabledFromFile(boolean isDisabledFromFile)
Sets the disabled status from 'plugin.disable' file.void
setEnabledStatus(boolean enabledStatus)
Set the plugin enabled status.void
setID(java.lang.String id)
Sets the ID of the plugin.void
setLicense(java.lang.String license)
void
setName(java.lang.String name)
Set the name of the plugin.void
setShouldAcceptLicense(boolean shouldAcceptLicense)
void
setVendor(java.lang.String vendor)
Set the vendor of the plugin.void
setVersion(java.lang.String version)
Set the version of the plugin.boolean
shouldAcceptLicense()
java.lang.String
toString()
The string representation of the plugin descriptor.
-
-
-
Field Detail
-
WEBAPP_CSS_RESOURCE
public static final java.lang.String WEBAPP_CSS_RESOURCE
WebappStaticResourcesFolder- See Also:
- Constant Field Values
-
SELECTION_PROCESSOR
public static final java.lang.String SELECTION_PROCESSOR
Selection processor extension type.- See Also:
- Constant Field Values
-
WEBAPP_SERVLET_FILTER
public static final java.lang.String WEBAPP_SERVLET_FILTER
WebApp plugin servlet filter.- See Also:
- Constant Field Values
-
WEBAPP_SERVLET
public static final java.lang.String WEBAPP_SERVLET
WebApp plugin servlet.- See Also:
- Constant Field Values
-
WEBAPP_STATIC_RESOURCE_FOL
public static final java.lang.String WEBAPP_STATIC_RESOURCE_FOL
WebappStaticResourcesFolder- See Also:
- Constant Field Values
-
GENERAL_EXTENSION
public static final java.lang.String GENERAL_EXTENSION
General extension type.- See Also:
- Constant Field Values
-
DOCUMENT_PROCESSOR
public static final java.lang.String DOCUMENT_PROCESSOR
Document processor extension type.- See Also:
- Constant Field Values
-
URL_STREAM_HANDLER
@Deprecated public static final java.lang.String URL_STREAM_HANDLER
Deprecated.URL stream handler extension type.- See Also:
- Constant Field Values
-
URL_HANDLER
public static final java.lang.String URL_HANDLER
URL stream handler extension type.- See Also:
- Constant Field Values
-
TARGETED_URL_HANDLER
public static final java.lang.String TARGETED_URL_HANDLER
Targeted URL stream handler extension type.- See Also:
- Constant Field Values
-
TRANSFORMER
public static final java.lang.String TRANSFORMER
An XSLT transformer extension.- See Also:
- Constant Field Values
-
XQUERY_TRANSFORMER
public static final java.lang.String XQUERY_TRANSFORMER
An XQuery transformer extension.- See Also:
- Constant Field Values
-
URL_CHOOSER
public static final java.lang.String URL_CHOOSER
URL stream handler extension type.- See Also:
- Constant Field Values
-
URL_CHOOSER_TOOLBAR
public static final java.lang.String URL_CHOOSER_TOOLBAR
URL stream handler extension type.- See Also:
- Constant Field Values
-
COMPONENTS_VALIDATOR_EXTENSION
public static final java.lang.String COMPONENTS_VALIDATOR_EXTENSION
The startup extension.- See Also:
- Constant Field Values
-
OPEN_REDIRECTOR
public static final java.lang.String OPEN_REDIRECTOR
Open redirector plugin type.- See Also:
- Constant Field Values
-
WORKSPACE_ACCESS
public static final java.lang.String WORKSPACE_ACCESS
Workspace access plugin type.- See Also:
- Constant Field Values
-
WORKSPACE_ACCESS_JS
public static final java.lang.String WORKSPACE_ACCESS_JS
Workspace access plugin type implemented in JavaScript.- See Also:
- Constant Field Values
-
WORKSPACE_ACCESS_JS_MODULE
public static final java.lang.String WORKSPACE_ACCESS_JS_MODULE
A JavaScript module of the Workspace access plugin.- See Also:
- Constant Field Values
-
OPTION_PAGE
public static final java.lang.String OPTION_PAGE
Option page extension plugin type.- See Also:
- Constant Field Values
-
OPTION_PAGE_GROUP
public static final java.lang.String OPTION_PAGE_GROUP
Option page group extension plugin type.- See Also:
- Constant Field Values
-
GENERAL_STYLES_FILTER
public static final java.lang.String GENERAL_STYLES_FILTER
CSS Styles filter plugin type. This filter will be used to filter CSS styles for any document presented in author mode.- See Also:
- Constant Field Values
-
LOCK_HANDLER_FACTORY
public static final java.lang.String LOCK_HANDLER_FACTORY
A lock handler factory.- See Also:
- Constant Field Values
-
REFACTORING_OPERATIONS_PROVIDER
public static final java.lang.String REFACTORING_OPERATIONS_PROVIDER
Refactoring operations provider plugin type.- See Also:
- Constant Field Values
-
ADDITIONAL_DITA_OT
public static final java.lang.String ADDITIONAL_DITA_OT
Additional DITA OT plugin type.- See Also:
- Constant Field Values
-
ADDITIONAL_XPROC_ENGINE
public static final java.lang.String ADDITIONAL_XPROC_ENGINE
Additional XProc Engine type.- See Also:
- Constant Field Values
-
AUTHOR_STYLESHEET
public static final java.lang.String AUTHOR_STYLESHEET
Extension that provide an Author CSS.- See Also:
- Constant Field Values
-
ADDITIONAL_FRAMEWORKS
public static final java.lang.String ADDITIONAL_FRAMEWORKS
Additional frameworks location plugin type.- See Also:
- Constant Field Values
-
ADDITIONAL_UI_TRANSLATIONS
public static final java.lang.String ADDITIONAL_UI_TRANSLATIONS
Additional translations plugin type.- See Also:
- Constant Field Values
-
TRUSTED_HOSTS
public static final java.lang.String TRUSTED_HOSTS
Extension point to provide trusted hosts.- See Also:
- Constant Field Values
-
DOCUMENT_VALIDATOR
public static final java.lang.String DOCUMENT_VALIDATOR
Extension point for external document validator- See Also:
- Constant Field Values
-
-
Method Detail
-
getExtensions
public java.util.List<PluginDescriptor.PluginExtensionDescription> getExtensions(java.lang.String key)
Get the extension corresponding to the specified key.Available extensions for the moment are: SELECTION_PROCESSOR & GENERAL_EXTENSION.
- Parameters:
key
- The extension key.- Returns:
- The extension corresponding to the specified key.
-
getExtensions
public java.util.List<PluginDescriptor.PluginExtensionDescription> getExtensions()
Get all the extensions of a plugin.- Returns:
- an immutable list of all the extensions of a plugin.
-
addExtension
public void addExtension(PluginDescriptor.PluginExtensionDescription descr)
Put an extension corresponding to the specified key. Available extensions for the moment are: SELECTION_PROCESSOR & GENERAL_EXTENSION.- Parameters:
descr
- The plugin extension description.
-
addContextInstance
public void addContextInstance(java.lang.Object contextInstance)
Add a context instance.- Parameters:
contextInstance
- a context instance.
-
getContextInstances
public java.util.List<java.lang.Object> getContextInstances()
Getter for all context instances.- Returns:
- the context instances.
-
getDescription
public java.lang.String getDescription()
Get the description of the plugin.- Returns:
- The description of the plugin.
-
setDescription
public void setDescription(java.lang.String description)
Set the description of the plugin.- Parameters:
description
- The description of the plugin.
-
getName
public java.lang.String getName()
Gets the name of the plugin.- Returns:
- The name of the plugin.
-
setName
public void setName(java.lang.String name)
Set the name of the plugin.- Parameters:
name
- The name of the plugin.
-
setID
public void setID(java.lang.String id)
Sets the ID of the plugin. Empty string is treated as no ID.- Parameters:
id
- ID of the plugin.
-
getID
public java.lang.String getID()
- Returns:
- Returns the id of the plugin or
null
if the plugin doesn't have an ID.
-
getVendor
public java.lang.String getVendor()
Get the vendor of the plugin.- Returns:
- The vendor name.
-
setVendor
public void setVendor(java.lang.String vendor)
Set the vendor of the plugin.- Parameters:
vendor
- The vendor of the plugin.
-
getVersion
public java.lang.String getVersion()
Get the version of the plugin.- Returns:
- The plugin version.
-
setVersion
public void setVersion(java.lang.String version)
Set the version of the plugin.- Parameters:
version
- The version of the plugin.
-
isEnabledStatus
public boolean isEnabledStatus()
Get the enabled status.- Returns:
- Returns
true
if the plugin is enabled.
-
setEnabledStatus
public void setEnabledStatus(boolean enabledStatus)
Set the plugin enabled status.- Parameters:
enabledStatus
-true
if the plugin is enabled.false
if the plugin is disabled.
-
isDisabledFromFile
public boolean isDisabledFromFile()
- Returns:
- Returns
true
if the plugin is disabled using 'plugin.disable' file.
-
setDisabledFromFile
public void setDisabledFromFile(boolean isDisabledFromFile)
Sets the disabled status from 'plugin.disable' file.- Parameters:
isDisabledFromFile
- Thetrue
if the plugin is disabled using 'plugin.disable' file.
-
getBaseDir
public java.io.File getBaseDir()
Get the base directory of the plugin.- Returns:
- The plugin base directory.
-
setBaseDir
public void setBaseDir(java.io.File baseDir)
Set the base dir of the plugin.- Parameters:
baseDir
- The base dir of the plugin.
-
getConfigUrlPath
public java.lang.String getConfigUrlPath()
- Returns:
- Returns the configUrl.
-
setConfigUrlPath
public void setConfigUrlPath(java.lang.String configUrlPath)
- Parameters:
configUrlPath
- The configUrl to set.
-
addPluginContributedView
public void addPluginContributedView(ro.sync.exml.plugin.PluginContributedView viewInfo)
Add a contributed view- Parameters:
viewInfo
- Information about the view
-
getContributedViews
public java.util.List<ro.sync.exml.plugin.PluginContributedView> getContributedViews()
- Returns:
- Returns the contributedViews.
-
addPluginContributedToolbar
public void addPluginContributedToolbar(ro.sync.exml.plugin.PluginContributedToolbar toolbarInfo)
Add a toolbar.- Parameters:
toolbarInfo
- Information about the new toolbar.
-
getContributedToolbars
public java.util.List<ro.sync.exml.plugin.PluginContributedToolbar> getContributedToolbars()
Gets the toolbars contributed by this plugin.- Returns:
- The list of contributed toolbars.
-
shouldAcceptLicense
public boolean shouldAcceptLicense()
- Returns:
- Returns the shouldAcceptLicense.
-
setShouldAcceptLicense
public void setShouldAcceptLicense(boolean shouldAcceptLicense)
- Parameters:
shouldAcceptLicense
- The shouldAcceptLicense to set.
-
toString
public java.lang.String toString()
The string representation of the plugin descriptor.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation.
-
getLicense
public java.lang.String getLicense()
- Returns:
- Returns the license.
-
setLicense
public void setLicense(java.lang.String license)
- Parameters:
license
- The license to set.
-
-