Oxygen XML Editor 12.2 Author API

ro.sync.ecss.extensions.api
Class ExtensionsBundle

java.lang.Object
  extended by ro.sync.ecss.extensions.api.ExtensionsBundle
All Implemented Interfaces:
Extension
Direct Known Subclasses:
DITAExtensionsBundle, DocBookExtensionsBundleBase, TEIExtensionsBundleBase, XHTMLExtensionsBundle

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
ExtensionsBundle()
           
 
Method Summary
 AttributesValueEditor createAttributesValueEditor(boolean forEclipsePlugin)
          Creates a new AttributesValueEditor instance used to get values for the current attribute.
 AuthorDnDListener createAuthorAWTDndListener()
          Creates a new AuthorDnDListener 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 the AuthorExtensionStateListener 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.
 AuthorReferenceResolver createAuthorReferenceResolver()
          Creates a new AuthorReferenceResolver instance used to expand content references.
 StylesFilter createAuthorStylesFilter()
          Creates a new StylesFilter instance for the CSS styles filtering.
 AuthorDnDListener createAuthorSWTDndListener()
          Creates a new AuthorDnDListener instance responsible for handling SWT author drag and drop events.
 AuthorTableCellSpanProvider createAuthorTableCellSpanProvider()
          Creates a new AuthorTableCellSpanProvider instance responsible for providing information about the table cells spanning.
 AuthorTableColumnWidthProvider createAuthorTableColumnWidthProvider()
          Creates a new AuthorTableColumnWidthProvider instance responsible for providing information and for handling modifications regarding table width and column widths.
 ElementLocatorProvider createElementLocatorProvider()
          Creates a new ElementLocatorProvider instance responsible for providing an implementation of an ElementLocator 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.
 SchemaManagerFilter createSchemaManagerFilter()
          Creates a new SchemaManagerFilter instance used to filter the content completion proposals from the schema manager.
 TextDnDListener createTextSWTDndListener()
          Creates a new TextDnDListener instance responsible for handling SWT text drag and drop events.
 AuthorSchemaAwareEditingHandler getAuthorSchemaAwareEditingHandler()
          If Schema Aware mode is active in Oxygen, all actions that can generate invalid content will be redirected toward this support.
 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 return null if the OptionsStorage 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.
 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 resolveCustomHref(java.lang.String linkHref)
          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
 

Constructor Detail

ExtensionsBundle

public ExtensionsBundle()
Method Detail

createAuthorReferenceResolver

public AuthorReferenceResolver createAuthorReferenceResolver()
Creates a new AuthorReferenceResolver 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. 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.

createAuthorTableCellSpanProvider

public AuthorTableCellSpanProvider createAuthorTableCellSpanProvider()
Creates a new AuthorTableCellSpanProvider 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 new AuthorTableColumnWidthProvider 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.

createAuthorExtensionStateListener

public AuthorExtensionStateListener createAuthorExtensionStateListener()
Returns the AuthorExtensionStateListener 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.

createAuthorAWTDndListener

public AuthorDnDListener createAuthorAWTDndListener()
Creates a new AuthorDnDListener 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 new AuthorDnDListener 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 new TextDnDListener 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 new ElementLocatorProvider instance responsible for providing an implementation of an ElementLocator based on the structure of a link. The ElementLocator 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.

createSchemaManagerFilter

public SchemaManagerFilter createSchemaManagerFilter()
Creates a new SchemaManagerFilter 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 new AttributesValueEditor 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 - If true the code is called from the Eclipse plugin.
Returns:
A new AttributesValueEditor instance.

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

*********************************
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.


getDocumentTypeID

public abstract java.lang.String getDocumentTypeID()
This should never return null if the OptionsStorage support it is intended to be used. If this returns null you will not be able to add OptionListener or store and retrieve any options at all.

Returns:
The unique identifier of the Document Type.

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.

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 an InvalidEditException. It is recommended to extend class AuthorSchemaAwareEditingHandlerAdapter in order to be protected from any API additions that may occur in interface AuthorSchemaAwareEditingHandler.

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

getDocumentTypeName

public final 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.

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.