Package ro.sync.ecss.extensions.dita
Class DITAExtensionsBundle
- java.lang.Object
-
- ro.sync.ecss.extensions.api.ExtensionsBundle
-
- ro.sync.ecss.extensions.dita.DITAExtensionsBundle
-
- All Implemented Interfaces:
ContextKeyManagerProvider
,Extension
- Direct Known Subclasses:
DITAMapExtensionsBundle
,LWDITAExtensionsBundle
@API(type=INTERNAL, src=PUBLIC) public class DITAExtensionsBundle extends ExtensionsBundle implements ContextKeyManagerProvider
The DITA framework extensions bundle.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContextKeyManager
keyManager
The key manager that is context aware and is used to resolve key refs.protected ContextKeyManagerProvider
keyManagerProvider
The provider for the key manager which is context aware and is used to resolve key refs.
-
Constructor Summary
Constructors Constructor Description DITAExtensionsBundle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorExtensionStateListener
createAuthorExtensionStateListener()
Returns theAuthorExtensionStateListener
which will be notified when the Author extension where it is defined is activated and deactivated during the detection process.AuthorReferenceResolver
createAuthorReferenceResolver()
Creates a newAuthorReferenceResolver
instance used to expand content references.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.protected ContextKeyManager
createContextKeyManager(EditingSessionContext context)
Create a context key manager to be used when resolving keyrefs.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.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).ContextKeyManager
getContextKeyManager()
java.lang.String
getDescription()
java.lang.String
getDocumentTypeID()
This should never returnnull
if theOptionsStorage
support it is intended to be used.java.lang.String
getHelpPageID(java.lang.String currentEditorPage)
Get the help page ID for this particular framework extensions bundle.ContextKeyManager
getKeyManager()
Returns the keys manager.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.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.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.-
Methods inherited from class ro.sync.ecss.extensions.api.ExtensionsBundle
createAttributesValueEditor, createAuthorAWTDndListener, createAuthorBreadCrumbCustomizer, createAuthorOutlineCustomizer, createAuthorPreloadProcessor, createAuthorStylesFilter, createAuthorSWTDndListener, createCustomAttributeValueEditor, createTextSWTDndListener, getDocumentTypeName, getWebappExtensionsProvier, resolveCustomHref, resolveCustomHref, setDocumentTypeName
-
-
-
-
Field Detail
-
keyManager
protected ContextKeyManager keyManager
The key manager that is context aware and is used to resolve key refs.
-
keyManagerProvider
protected final ContextKeyManagerProvider keyManagerProvider
The provider for the key manager which is context aware and is used to resolve key refs.
-
-
Method Detail
-
createAuthorExtensionStateListener
public AuthorExtensionStateListener createAuthorExtensionStateListener()
Description copied from class:ExtensionsBundle
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.- Overrides:
createAuthorExtensionStateListener
in classExtensionsBundle
- Returns:
- A new
AuthorExtensionStateListener
instance. - See Also:
ExtensionsBundle.createAuthorExtensionStateListener()
-
createContextKeyManager
protected ContextKeyManager createContextKeyManager(EditingSessionContext context)
Create a context key manager to be used when resolving keyrefs. The key manager may resolve keys depending on the editing session context. The current implementation checks theDITAAccess.DITA_ROOT_MAP_URL_ATTRIBUTE
and if it was set, the specified map is used. Otherwise, it uses the default ditamap in Autor.- Parameters:
context
- The editing session context.- Returns:
- The key manager.
-
getClipboardFragmentProcessor
public ClipboardFragmentProcessor getClipboardFragmentProcessor()
Description copied from class:ExtensionsBundle
Get a processor for Author Document Fragments in the clipboard (which will be pasted, dropped, etc).- Overrides:
getClipboardFragmentProcessor
in classExtensionsBundle
- Returns:
- a processor for Author Document Fragments in the clipboard (which will be pasted, dropped, etc).
- See Also:
ExtensionsBundle.getClipboardFragmentProcessor()
-
createAuthorReferenceResolver
public AuthorReferenceResolver createAuthorReferenceResolver()
Description copied from class:ExtensionsBundle
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.- Overrides:
createAuthorReferenceResolver
in classExtensionsBundle
- Returns:
- A new
AuthorReferenceResolver
instance. - See Also:
ExtensionsBundle.createAuthorReferenceResolver()
-
createAuthorTableCellSpanProvider
public AuthorTableCellSpanProvider createAuthorTableCellSpanProvider()
Description copied from class:ExtensionsBundle
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.- Overrides:
createAuthorTableCellSpanProvider
in classExtensionsBundle
- Returns:
- A new
AuthorTableCellSpanProvider
instance. - See Also:
ExtensionsBundle.createAuthorTableCellSpanProvider()
-
createAuthorTableColumnWidthProvider
public AuthorTableColumnWidthProvider createAuthorTableColumnWidthProvider()
Description copied from class:ExtensionsBundle
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.- Overrides:
createAuthorTableColumnWidthProvider
in classExtensionsBundle
- Returns:
- A new
AuthorTableColumnWidthProvider
instance. - See Also:
ExtensionsBundle.createAuthorTableColumnWidthProvider()
-
createAuthorTableCellSepProvider
public AuthorTableCellSepProvider createAuthorTableCellSepProvider()
Description copied from class:ExtensionsBundle
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.- Overrides:
createAuthorTableCellSepProvider
in classExtensionsBundle
- Returns:
- A new
AuthorTableCellSepProvider
instance. - See Also:
ExtensionsBundle.createAuthorTableCellSepProvider()
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceExtension
- Returns:
- The description of the extension.
- See Also:
Extension.getDescription()
-
getDocumentTypeID
public java.lang.String getDocumentTypeID()
Description copied from class:ExtensionsBundle
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.- Specified by:
getDocumentTypeID
in classExtensionsBundle
- Returns:
- The unique identifier of the Document Type.
- See Also:
ExtensionsBundle.getDocumentTypeID()
-
getUniqueAttributesIdentifier
public UniqueAttributesRecognizer getUniqueAttributesIdentifier()
Description copied from class:ExtensionsBundle
Get an unique attributes creator and identifier.- Overrides:
getUniqueAttributesIdentifier
in classExtensionsBundle
- Returns:
- The unique attributes identifier
- See Also:
ExtensionsBundle.getUniqueAttributesIdentifier()
-
createElementLocatorProvider
public ElementLocatorProvider createElementLocatorProvider()
Description copied from class:ExtensionsBundle
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.- Overrides:
createElementLocatorProvider
in classExtensionsBundle
- Returns:
- A new
ElementLocatorProvider
instance. - See Also:
ExtensionsBundle.createElementLocatorProvider()
-
customizeLinkTooltipDescription
public java.lang.String customizeLinkTooltipDescription(java.net.URL currentEditorURL, AuthorNode contextNode, java.lang.String linkHref, AuthorAccess authorAccess, java.lang.String computedDescription)
Description copied from class:ExtensionsBundle
Customize the tooltip description when hovering over a link.- Overrides:
customizeLinkTooltipDescription
in classExtensionsBundle
- 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.
- See Also:
ExtensionsBundle.customizeLinkTooltipDescription(java.net.URL, ro.sync.ecss.extensions.api.node.AuthorNode, java.lang.String, ro.sync.ecss.extensions.api.AuthorAccess, java.lang.String)
-
resolveCustomHref
public java.net.URL resolveCustomHref(java.net.URL currentEditorURL, AuthorNode contextNode, java.lang.String linkHref, AuthorAccess authorAccess) throws java.io.IOException, CustomResolverException
Description copied from class:ExtensionsBundle
When clicking a href the bundle can custom solve the href to an URL.- Overrides:
resolveCustomHref
in classExtensionsBundle
- 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.- See Also:
ExtensionsBundle.resolveCustomHref(java.net.URL, ro.sync.ecss.extensions.api.node.AuthorNode, java.lang.String, ro.sync.ecss.extensions.api.AuthorAccess)
-
getAuthorSchemaAwareEditingHandler
public AuthorSchemaAwareEditingHandler getAuthorSchemaAwareEditingHandler()
Description copied from class:ExtensionsBundle
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
.- Overrides:
getAuthorSchemaAwareEditingHandler
in classExtensionsBundle
- Returns:
- A custom editing handler for schema aware actions, or null if there is no handler and the default processing should take place.
- See Also:
ExtensionsBundle.getAuthorSchemaAwareEditingHandler()
-
createSchemaManagerFilter
public SchemaManagerFilter createSchemaManagerFilter()
Description copied from class:ExtensionsBundle
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.- Overrides:
createSchemaManagerFilter
in classExtensionsBundle
- Returns:
- A new
SchemaManagerFilter
instance. - See Also:
ExtensionsBundle.createSchemaManagerFilter()
-
createExternalObjectInsertionHandler
public AuthorExternalObjectInsertionHandler createExternalObjectInsertionHandler()
Description copied from class:ExtensionsBundle
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.- Overrides:
createExternalObjectInsertionHandler
in classExtensionsBundle
- Returns:
- The External URLs handler
- See Also:
ExtensionsBundle.createExternalObjectInsertionHandler()
-
createTextPageExternalObjectInsertionHandler
public TextPageExternalObjectInsertionHandler createTextPageExternalObjectInsertionHandler()
Description copied from class:ExtensionsBundle
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.- Overrides:
createTextPageExternalObjectInsertionHandler
in classExtensionsBundle
- Returns:
- The External URLs handler
- See Also:
ExtensionsBundle.createTextPageExternalObjectInsertionHandler()
-
isContentReference
public boolean isContentReference(AuthorNode node)
Description copied from class:ExtensionsBundle
Check if this node references another node which should replace it entirely. This is used in the tables to replace conreffed table rows entirely- Overrides:
isContentReference
in classExtensionsBundle
- Parameters:
node
- The node- Returns:
true
if this node references another node which should replace it entirely.- See Also:
ExtensionsBundle.isContentReference(ro.sync.ecss.extensions.api.node.AuthorNode)
-
getProfilingConditionalTextProvider
public ProfilingConditionalTextProvider getProfilingConditionalTextProvider()
Description copied from class:ExtensionsBundle
Creates a newProfilingConditionalTextProvider
instance responsible for providing custom support regarding profiling and conditional text.- Overrides:
getProfilingConditionalTextProvider
in classExtensionsBundle
- Returns:
- A new
ProfilingConditionalTextProvider
instance. - See Also:
ExtensionsBundle.getProfilingConditionalTextProvider()
-
createXMLNodeCustomizer
public XMLNodeRendererCustomizer createXMLNodeCustomizer()
Description copied from class:ExtensionsBundle
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.- Overrides:
createXMLNodeCustomizer
in classExtensionsBundle
- Returns:
- The XML node customizer.
- See Also:
ExtensionsBundle.createXMLNodeCustomizer()
-
getAuthorTableOperationsHandler
public AuthorTableOperationsHandler getAuthorTableOperationsHandler()
Description copied from class:ExtensionsBundle
Get theAuthorTableOperationsHandler
instance responsible for handling table operations.- Overrides:
getAuthorTableOperationsHandler
in classExtensionsBundle
- Returns:
- Author table operations handler.
- See Also:
ExtensionsBundle.getAuthorTableOperationsHandler()
-
createLinkTextResolver
public LinkTextResolver createLinkTextResolver()
Description copied from class:ExtensionsBundle
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.- Overrides:
createLinkTextResolver
in classExtensionsBundle
- Returns:
- A new
LinkTextResolver
instance. - See Also:
ExtensionsBundle.createLinkTextResolver()
-
createIDTypeRecognizer
public IDTypeRecognizer createIDTypeRecognizer()
Description copied from class:ExtensionsBundle
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.- Overrides:
createIDTypeRecognizer
in classExtensionsBundle
- Returns:
- A new
IDTypeRecognizer
instance. - See Also:
ExtensionsBundle.createIDTypeRecognizer()
-
getKeyManager
public ContextKeyManager getKeyManager()
Returns the keys manager.- Returns:
- Returns the keys manager.
-
getAuthorActionEventHandler
public AuthorActionEventHandler getAuthorActionEventHandler()
Description copied from class:ExtensionsBundle
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.- Overrides:
getAuthorActionEventHandler
in classExtensionsBundle
- Returns:
- An event handler.
- See Also:
ExtensionsBundle.getAuthorActionEventHandler()
-
getAuthorImageDecorator
public AuthorImageDecorator getAuthorImageDecorator()
Description copied from class:ExtensionsBundle
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.- Overrides:
getAuthorImageDecorator
in classExtensionsBundle
- Returns:
- An
AuthorImageDecorator
, ornull
. - See Also:
ExtensionsBundle.getAuthorImageDecorator()
-
createEditPropertiesHandler
public EditPropertiesHandler createEditPropertiesHandler()
Description copied from class:ExtensionsBundle
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.- Overrides:
createEditPropertiesHandler
in classExtensionsBundle
- Returns:
- An implementation that can edit the properties of nodes.
- See Also:
ExtensionsBundle.createEditPropertiesHandler()
-
getHelpPageID
public java.lang.String getHelpPageID(java.lang.String currentEditorPage)
Description copied from class:ExtensionsBundle
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.- Overrides:
getHelpPageID
in classExtensionsBundle
- 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.
- See Also:
ExtensionsBundle.getHelpPageID(java.lang.String)
-
getContextKeyManager
public ContextKeyManager getContextKeyManager()
- Specified by:
getContextKeyManager
in interfaceContextKeyManagerProvider
- Returns:
- The context key manager.
- See Also:
ContextKeyManagerProvider.getContextKeyManager()
-
resolveCustomAttributeValue
public java.net.URL resolveCustomAttributeValue(CustomAttributeValueContext attributeValueEditingContext)
Description copied from class:ExtensionsBundle
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.- Overrides:
resolveCustomAttributeValue
in classExtensionsBundle
- 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.
- See Also:
ExtensionsBundle.resolveCustomAttributeValue(ro.sync.ecss.extensions.api.CustomAttributeValueContext)
-
getSpellCheckerHelper
public SpellCheckerHelper getSpellCheckerHelper()
Description copied from class:ExtensionsBundle
Get a helper for the spell checker.- Overrides:
getSpellCheckerHelper
in classExtensionsBundle
- Returns:
- Helper utilities implemented at framework level.
- See Also:
ExtensionsBundle.getSpellCheckerHelper()
-
-