Package ro.sync.ecss.extensions.api
Class ExtensionsBundle
- java.lang.Object
-
- ro.sync.ecss.extensions.api.ExtensionsBundle
-
- All Implemented Interfaces:
Extension
- Direct Known Subclasses:
AntExtensionsBundle
,DITAExtensionsBundle
,DITAValExtensionsBundle
,DocBookExtensionsBundleBase
,DOTProjectExtensionsBundle
,SchematronExtensionsBundle
,TEIExtensionsBundleBase
,WSDLExtensionsBundle
,XHTMLExtensionsBundle
,XSDExtensionsBundle
,XSLTExtensionsBundle
@API(type=EXTENDABLE, src=PUBLIC) public abstract class ExtensionsBundle extends java.lang.Object implements Extension
Abstract class representing a bundle for all extensions handlers. Extensions of this class must be defined for every document type association defined in the Preferences/Document type association section.
The bundle is created each time the document type association where it is defined matches the current document opened in an editor or the properties of the enclosing document type have been modified while the document type is active. At most one instance of an extensions bundle exist at a given time in the editor.
Note: References to objects that need to be persistent throughout the existence of an editor must not be kept here..
-
-
Constructor Summary
Constructors Constructor Description ExtensionsBundle()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AttributesValueEditor
createAttributesValueEditor(boolean forEclipsePlugin)
Creates a newAttributesValueEditor
instance used to get values for the current attribute.AuthorDnDListener
createAuthorAWTDndListener()
Creates a newAuthorDnDListener
instance responsible for handling AWT author drag and drop events.AuthorBreadCrumbCustomizer
createAuthorBreadCrumbCustomizer()
Create an Author Bread Crumb customizer used for nodes rendering in the Bread Crumb (components path which appears in the top of the Author editor).AuthorExtensionStateListener
createAuthorExtensionStateListener()
Returns theAuthorExtensionStateListener
which will be notified when the Author extension where it is defined is activated and deactivated during the detection process.AuthorOutlineCustomizer
createAuthorOutlineCustomizer()
Create an Author Outline customizer used for custom filtering and nodes rendering in the Outline.AuthorPreloadProcessor
createAuthorPreloadProcessor()
Returns theAuthorPreloadProcessor
which will be notified before the document is presented in the application.AuthorReferenceResolver
createAuthorReferenceResolver()
Creates a newAuthorReferenceResolver
instance used to expand content references.StylesFilter
createAuthorStylesFilter()
Creates a newStylesFilter
instance for the CSS styles filtering.AuthorDnDListener
createAuthorSWTDndListener()
Creates a newAuthorDnDListener
instance responsible for handling SWT author drag and drop events.AuthorTableCellSepProvider
createAuthorTableCellSepProvider()
Creates a newAuthorTableCellSepProvider
instance responsible for providing information about the table cells painting their separators.AuthorTableCellSpanProvider
createAuthorTableCellSpanProvider()
Creates a newAuthorTableCellSpanProvider
instance responsible for providing information about the table cells spanning.AuthorTableColumnWidthProvider
createAuthorTableColumnWidthProvider()
Creates a newAuthorTableColumnWidthProvider
instance responsible for providing information and for handling modifications regarding table width and column widths.CustomAttributeValueEditor
createCustomAttributeValueEditor(boolean forEclipsePlugin)
Creates a newCustomAttributeValueEditor
instance used to get values for the current attribute.EditPropertiesHandler
createEditPropertiesHandler()
A custom implementation to handle editing properties of an author node.ElementLocatorProvider
createElementLocatorProvider()
Creates a newElementLocatorProvider
instance responsible for providing an implementation of anElementLocator
based on the structure of a link.AuthorExternalObjectInsertionHandler
createExternalObjectInsertionHandler()
Create a handler which gets notified when external resources need to be inserted in the Author page.IDTypeRecognizer
createIDTypeRecognizer()
Creates a newIDTypeRecognizer
instance responsible for providing an implementation which can recognize ID declarations and references.LinkTextResolver
createLinkTextResolver()
Creates a newLinkTextResolver
instance responsible for resolving a specific link marked in the CSS file and returning a text content from the targeted location.SchemaManagerFilter
createSchemaManagerFilter()
Creates a newSchemaManagerFilter
instance used to filter the content completion proposals from the schema manager.TextPageExternalObjectInsertionHandler
createTextPageExternalObjectInsertionHandler()
Create a handler which gets notified when external resources need to be inserted in the Text page.TextDnDListener
createTextSWTDndListener()
Creates a newTextDnDListener
instance responsible for handling SWT text drag and drop events.XMLNodeRendererCustomizer
createXMLNodeCustomizer()
Create an XML node customizer used for custom nodes rendering in the Author outline, Text page outline, Author bread crumb, content completion window or the DITA Map view.java.lang.String
customizeLinkTooltipDescription(java.net.URL currentEditorURL, AuthorNode contextNode, java.lang.String linkHref, AuthorAccess authorAccess, java.lang.String computedDescription)
Customize the tooltip description when hovering over a link.AuthorActionEventHandler
getAuthorActionEventHandler()
Creates a special handler for author actions events (such as key events).AuthorImageDecorator
getAuthorImageDecorator()
Get anAuthorImageDecorator
.AuthorSchemaAwareEditingHandler
getAuthorSchemaAwareEditingHandler()
If Schema Aware mode is active in Oxygen, all actions that can generate invalid content will be redirected toward this support.AuthorTableOperationsHandler
getAuthorTableOperationsHandler()
Get theAuthorTableOperationsHandler
instance responsible for handling table operations.ClipboardFragmentProcessor
getClipboardFragmentProcessor()
Get a processor for Author Document Fragments in the clipboard (which will be pasted, dropped, etc).abstract java.lang.String
getDocumentTypeID()
This should never returnnull
if theOptionsStorage
support it is intended to be used.java.lang.String
getDocumentTypeName()
Get the name of the document type which created this bundle (as set in the Oxygen -> Preferences -> Document Types.java.lang.String
getHelpPageID(java.lang.String currentEditorPage)
Get the help page ID for this particular framework extensions bundle.ProfilingConditionalTextProvider
getProfilingConditionalTextProvider()
Creates a newProfilingConditionalTextProvider
instance responsible for providing custom support regarding profiling and conditional text.SpellCheckerHelper
getSpellCheckerHelper()
Get a helper for the spell checker.UniqueAttributesRecognizer
getUniqueAttributesIdentifier()
Get an unique attributes creator and identifier.WebappExtensionsProvider
getWebappExtensionsProvier()
boolean
isContentReference(AuthorNode node)
Check if this node references another node which should replace it entirely.java.net.URL
resolveCustomAttributeValue(CustomAttributeValueContext attributeValueEditingContext)
Resolve a custom attribute value to an URL which will be opened by Oxygen.java.net.URL
resolveCustomHref(java.lang.String linkHref)
When clicking a href the bundle can custom solve the href to an URL.java.net.URL
resolveCustomHref(java.net.URL currentEditorURL, java.lang.String linkHref, AuthorAccess authorAccess)
When clicking a href the bundle can custom solve the href to an URL.java.net.URL
resolveCustomHref(java.net.URL currentEditorURL, AuthorNode contextNode, java.lang.String linkHref, AuthorAccess authorAccess)
When clicking a href the bundle can custom solve the href to an URL.void
setDocumentTypeName(java.lang.String documentTypeName)
Set the name of the document type which created this bundle.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ro.sync.ecss.extensions.api.Extension
getDescription
-
-
-
-
Method Detail
-
createAuthorReferenceResolver
public AuthorReferenceResolver createAuthorReferenceResolver()
Creates a newAuthorReferenceResolver
instance used to expand content references. The method is called each time an opened document in an Author editor page matches the document type association where the extensions bundle is defined.- Returns:
- A new
AuthorReferenceResolver
instance.
-
createAuthorStylesFilter
public StylesFilter createAuthorStylesFilter()
Creates a new
StylesFilter
instance for the CSS styles filtering.Use this to replace the default styles associated to a node form the document object model, or the styles of the pseudo elements
:before
and:after
.The method is called each time an opened document in an Author editor page matches the document type association where the extensions bundle is defined.
- Returns:
- A new
StylesFilter
instance, ornull
.
-
createAuthorTableCellSpanProvider
public AuthorTableCellSpanProvider createAuthorTableCellSpanProvider()
Creates a newAuthorTableCellSpanProvider
instance responsible for providing information about the table cells spanning. The table cell span provider is not reused between different tables. The method is called for each table in the document so a new instance should be provided each time.- Returns:
- A new
AuthorTableCellSpanProvider
instance.
-
createAuthorTableColumnWidthProvider
public AuthorTableColumnWidthProvider createAuthorTableColumnWidthProvider()
Creates a newAuthorTableColumnWidthProvider
instance responsible for providing information and for handling modifications regarding table width and column widths. The table column width provider is not reused between different tables. The method is called for each table in the document so a new instance should be provided each time.- Returns:
- A new
AuthorTableColumnWidthProvider
instance.
-
createAuthorTableCellSepProvider
public AuthorTableCellSepProvider createAuthorTableCellSepProvider()
Creates a newAuthorTableCellSepProvider
instance responsible for providing information about the table cells painting their separators. The table cell separators provider is not reused between different tables. The method is called for each table in the document so a new instance should be provided each time.- Returns:
- A new
AuthorTableCellSepProvider
instance.
-
getAuthorTableOperationsHandler
public AuthorTableOperationsHandler getAuthorTableOperationsHandler()
Get theAuthorTableOperationsHandler
instance responsible for handling table operations.- Returns:
- Author table operations handler.
- Since:
- 14
-
createAuthorExtensionStateListener
public AuthorExtensionStateListener createAuthorExtensionStateListener()
Returns theAuthorExtensionStateListener
which will be notified when the Author extension where it is defined is activated and deactivated during the detection process. This method is called each time the Document Type association where the Author extension and the extensions bundle are defined matches a document opened in an Author page.- Returns:
- A new
AuthorExtensionStateListener
instance.
-
createAuthorPreloadProcessor
public AuthorPreloadProcessor createAuthorPreloadProcessor()
Returns theAuthorPreloadProcessor
which will be notified before the document is presented in the application.- Returns:
- A new
AuthorPreloadProcessor
instance. - Since:
- 23.0
-
createAuthorAWTDndListener
public AuthorDnDListener createAuthorAWTDndListener()
Creates a newAuthorDnDListener
instance responsible for handling AWT author drag and drop events. This method is called each time the Document Type association where the extensions bundle is defined matches a document opened in an Author page.- Returns:
- The AWT drag and drop listener implementation.
-
createAuthorSWTDndListener
public AuthorDnDListener createAuthorSWTDndListener()
Creates a newAuthorDnDListener
instance responsible for handling SWT author drag and drop events. This method is called each time the Document Type association where the extensions bundle is defined matches a document opened in an Author page.- Returns:
- The SWT drag and drop listener implementation.
-
createTextSWTDndListener
public TextDnDListener createTextSWTDndListener()
Creates a newTextDnDListener
instance responsible for handling SWT text drag and drop events. This method is called each time the Document Type association where the extensions bundle is defined matches a document opened in a Text page.- Returns:
- The SWT drag and drop listener implementation.
-
createElementLocatorProvider
public ElementLocatorProvider createElementLocatorProvider()
Creates a newElementLocatorProvider
instance responsible for providing an implementation of anElementLocator
based on the structure of a link. TheElementLocator
is capable of locating an element pointed by the supplied link. This method is called each time an element needs to be located based on a link specification.- Returns:
- A new
ElementLocatorProvider
instance.
-
createIDTypeRecognizer
public IDTypeRecognizer createIDTypeRecognizer()
Creates a newIDTypeRecognizer
instance responsible for providing an implementation which can recognize ID declarations and references. This method is called each time an ID must be recognized or certain ID-aware searches or refactory actions are performed.- Returns:
- A new
IDTypeRecognizer
instance.
-
createSchemaManagerFilter
public SchemaManagerFilter createSchemaManagerFilter()
Creates a newSchemaManagerFilter
instance used to filter the content completion proposals from the schema manager. This method is called each time the document type where the extensions bundle is defined matches a document opened in an editor.- Returns:
- A new
SchemaManagerFilter
instance.
-
createAttributesValueEditor
public AttributesValueEditor createAttributesValueEditor(boolean forEclipsePlugin)
Creates a newAttributesValueEditor
instance used to get values for the current attribute. This is used especially from the "Attributes View" and from attributes editing dialogs available on Author mode and Outliner.- Parameters:
forEclipsePlugin
- Iftrue
the code is called from the Eclipse plugin.- Returns:
- A new
AttributesValueEditor
instance.
-
createCustomAttributeValueEditor
public CustomAttributeValueEditor createCustomAttributeValueEditor(boolean forEclipsePlugin)
Creates a newCustomAttributeValueEditor
instance used to get values for the current attribute. This is used especially from the "Attributes View" and from attributes editing dialogs available on Author mode and Outliner.- Parameters:
forEclipsePlugin
- Iftrue
the code is called from the Eclipse plugin.- Returns:
- A new
CustomAttributeValueEditor
instance. - Since:
- 15
-
getUniqueAttributesIdentifier
public UniqueAttributesRecognizer getUniqueAttributesIdentifier()
Get an unique attributes creator and identifier.- Returns:
- The unique attributes identifier
-
getClipboardFragmentProcessor
public ClipboardFragmentProcessor getClipboardFragmentProcessor()
Get a processor for Author Document Fragments in the clipboard (which will be pasted, dropped, etc).- Returns:
- a processor for Author Document Fragments in the clipboard (which will be pasted, dropped, etc).
- Since:
- 12.2
-
getDocumentTypeID
public abstract java.lang.String getDocumentTypeID()
This should never returnnull
if theOptionsStorage
support it is intended to be used. If this returnsnull
you will not be able to addOptionListener
or store and retrieve any options at all.- Returns:
- The unique identifier of the Document Type.
-
resolveCustomAttributeValue
public java.net.URL resolveCustomAttributeValue(CustomAttributeValueContext attributeValueEditingContext)
Resolve a custom attribute value to an URL which will be opened by Oxygen. This method is called when the "Open File at Cursor" action is called in the Text editor page.- Parameters:
attributeValueEditingContext
- The editing context.- Returns:
- The URL which should be opened as a result of "Open File at Cursor" being invoked on the attribute value.
- Since:
- 22
-
resolveCustomHref
public java.net.URL resolveCustomHref(java.lang.String linkHref) throws java.io.IOException
When clicking a href the bundle can custom solve the href to an URL.- Parameters:
linkHref
- The link href as derrived from the CSS- Returns:
- The resolved absolute URL if null if the default behavior will be performed
- Throws:
java.io.IOException
- If the link is recognized by the extensions bundle, but could not be mapped to an URL.
-
resolveCustomHref
public java.net.URL resolveCustomHref(java.net.URL currentEditorURL, java.lang.String linkHref, AuthorAccess authorAccess) throws java.io.IOException
When clicking a href the bundle can custom solve the href to an URL.- Parameters:
currentEditorURL
- The URL of the current editor.linkHref
- The link href as derrived from the CSSauthorAccess
- The Author Access.- Returns:
- The resolved absolute URL if null if the default behavior will be performed
- Throws:
java.io.IOException
- If the link is recognized by the extensions bundle, but could not be mapped to an URL.
-
resolveCustomHref
public java.net.URL resolveCustomHref(java.net.URL currentEditorURL, AuthorNode contextNode, java.lang.String linkHref, AuthorAccess authorAccess) throws CustomResolverException, java.io.IOException
When clicking a href the bundle can custom solve the href to an URL.- Parameters:
currentEditorURL
- The URL of the current editor.contextNode
- The context node in which the href needs to be computed.linkHref
- The link href as derrived from the CSSauthorAccess
- The Author Access.- Returns:
- The resolved absolute URL if null if the default behavior will be performed
- Throws:
CustomResolverException
- If the link is recognized by the extensions bundle, but could not be mapped to an URL. It offers a solution to the user. This solution is invoked when the user clicks on the error message.java.io.IOException
- If the link is recognized by the extensions bundle, but could not be mapped to an URL.- Since:
- 15
-
customizeLinkTooltipDescription
public java.lang.String customizeLinkTooltipDescription(java.net.URL currentEditorURL, AuthorNode contextNode, java.lang.String linkHref, AuthorAccess authorAccess, java.lang.String computedDescription)
Customize the tooltip description when hovering over a link.- Parameters:
currentEditorURL
- The current document URLcontextNode
- The context nodelinkHref
- The link href.authorAccess
- The Author accesscomputedDescription
- The already computed description. Usually something like: "Click to open: URL"- Returns:
- The customized description.
- Since:
- 22.1
-
createAuthorOutlineCustomizer
public AuthorOutlineCustomizer createAuthorOutlineCustomizer()
Create an Author Outline customizer used for custom filtering and nodes rendering in the Outline.- Returns:
- The Author Outline customizer.
-
createAuthorBreadCrumbCustomizer
public AuthorBreadCrumbCustomizer createAuthorBreadCrumbCustomizer()
Create an Author Bread Crumb customizer used for nodes rendering in the Bread Crumb (components path which appears in the top of the Author editor).- Returns:
- The Author Bread Crumb customizer.
-
getAuthorSchemaAwareEditingHandler
public AuthorSchemaAwareEditingHandler getAuthorSchemaAwareEditingHandler()
If Schema Aware mode is active in Oxygen, all actions that can generate invalid content will be redirected toward this support. The support can either resolve a specific case, let the default implementation take place or reject the edit entirely by throwing anInvalidEditException
. It is recommended to extend classAuthorSchemaAwareEditingHandlerAdapter
in order to be protected from any API additions that may occur in interfaceAuthorSchemaAwareEditingHandler
.- Returns:
- A custom editing handler for schema aware actions, or null if there is no handler and the default processing should take place.
-
createExternalObjectInsertionHandler
public AuthorExternalObjectInsertionHandler createExternalObjectInsertionHandler()
Create a handler which gets notified when external resources need to be inserted in the Author page. The usual usage for this is to get notified when URLs are dropped from the project or DITA Maps manager in the Author page.- Returns:
- The External URLs handler
- Since:
- 12
-
createTextPageExternalObjectInsertionHandler
public TextPageExternalObjectInsertionHandler createTextPageExternalObjectInsertionHandler()
Create a handler which gets notified when external resources need to be inserted in the Text page. The usual usage for this is to get notified when URLs are dropped from the project or DITA Maps manager in the Text page.- Returns:
- The External URLs handler
- Since:
- 19
-
getDocumentTypeName
public java.lang.String getDocumentTypeName()
Get the name of the document type which created this bundle (as set in the Oxygen -> Preferences -> Document Types. You can use it in your extensions bundle to see the name of the document type which created this bundle.- Returns:
- the name of the document type.
- Since:
- 12
-
setDocumentTypeName
public void setDocumentTypeName(java.lang.String documentTypeName)
Set the name of the document type which created this bundle. This must not get called by the user code, it is set internal.- Parameters:
documentTypeName
- The name of the document type which created this bundle
-
isContentReference
public boolean isContentReference(AuthorNode node)
Check if this node references another node which should replace it entirely. This is used in the tables to replace conreffed table rows entirely- Parameters:
node
- The node- Returns:
true
if this node references another node which should replace it entirely.
-
getProfilingConditionalTextProvider
public ProfilingConditionalTextProvider getProfilingConditionalTextProvider()
Creates a newProfilingConditionalTextProvider
instance responsible for providing custom support regarding profiling and conditional text.- Returns:
- A new
ProfilingConditionalTextProvider
instance. - Since:
- 13.2
-
createXMLNodeCustomizer
public XMLNodeRendererCustomizer createXMLNodeCustomizer()
Create an XML node customizer used for custom nodes rendering in the Author outline, Text page outline, Author bread crumb, content completion window or the DITA Map view.- Returns:
- The XML node customizer.
- Since:
- 13.2
-
createLinkTextResolver
public LinkTextResolver createLinkTextResolver()
Creates a newLinkTextResolver
instance responsible for resolving a specific link marked in the CSS file and returning a text content from the targeted location. This text content will be presented as a static text associated with the link in author page. This resolver will be used when function oxy_link-text() is encountered inside the CSS rules on the 'content' property.- Returns:
- A new
LinkTextResolver
instance. - Since:
- 14.2
-
createEditPropertiesHandler
public EditPropertiesHandler createEditPropertiesHandler()
A custom implementation to handle editing properties of an author node. For example when a user double clicks on an element tag we will invoke this extension and a specific dialog can be presented.- Returns:
- An implementation that can edit the properties of nodes.
- Since:
- 17.1
-
getAuthorActionEventHandler
public AuthorActionEventHandler getAuthorActionEventHandler()
Creates a special handler for author actions events (such as key events). These events normally have built-in handling but this handler gets a chance to perform something different.- Returns:
- An event handler.
- Since:
- 18
-
getAuthorImageDecorator
public AuthorImageDecorator getAuthorImageDecorator()
Get anAuthorImageDecorator
. Permits decoration of the images that are displayed in the Author view. For instance it can overlay some meta-information over the image.- Returns:
- An
AuthorImageDecorator
, ornull
. - Since:
- 18
-
getHelpPageID
public java.lang.String getHelpPageID(java.lang.String currentEditorPage)
Get the help page ID for this particular framework extensions bundle. If the returned help page ID is an URL, a web browser will be opened pointing to that URL when the user presses F1 in the dialog or when using the Help button. If the returned help page ID is an identifier, when help is invoked, the application will open the Oxygen User's Manual and locate this identifier inside it.- Parameters:
currentEditorPage
- The current editor page mode (Text/Grid/Author/Schema), one of the constants in the "ro.sync.exml.editor.EditorPageConstants" interface.- Returns:
- The help page ID, by default no help page ID is returned.
- Since:
- 18.1
- See Also:
HelpPageProvider.getHelpPageID()
-
getWebappExtensionsProvier
public WebappExtensionsProvider getWebappExtensionsProvier()
- Returns:
- An object that provides Web Author specific extensions, may be
null
. - Since:
- 21.1
-
getSpellCheckerHelper
public SpellCheckerHelper getSpellCheckerHelper()
Get a helper for the spell checker.- Returns:
- Helper utilities implemented at framework level.
- Since:
- 26.1
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-
-