The extensions bundle is represented by the ro.sync.ecss.extensions.api.ExtensionsBundle class. The provided
implementation of the ExtensionsBundle is instantiated when the Document Type
Association rules defined for the custom framework matches a document opened in the editor. Therefore,
references to objects that need to be persistent throughout the application running session
must not be kept in the bundle because the next detection event can result in creating
another ExtensionsBundle instance.
To configure an extensions bundle, follow this procedure:
public class SDFExtensionsBundle extends ExtensionsBundle {
Document Type ID and a short description should be defined by
implementing the getDocumentTypeID and getDescription methods.
The Document Type ID is used to uniquely identify the current
framework. Such an ID must be provided especially if options related to the
framework need to be persistently stored and retrieved between
sessions.
public String getDocumentTypeID() {
return "Simple.Document.Framework.document.type";
}
public String getDescription() {
return "A custom extensions bundle used for the Simple Document" +
"Framework document type";
}public AuthorExtensionStateListener createAuthorExtensionStateListener() {
return new SDFAuthorExtensionStateListener();
}
The AuthorExtensionStateListener is
instantiated and notified about the activation of the framework when the
rules of the Document Type Association match a document opened in the
Author editing mode. The listener is notified about the
deactivation when another framework is activated for the same document, the
user switches to another mode or the editor is closed. A complete description and
implementation of ro.sync.ecss.extensions.api.AuthorExtensionStateListener
can be found in Implementing an
Author Extension State Listener.
If Schema-Aware mode is active in Oxygen XML Author Eclipse plugin, all actions that can generate invalid content will be redirected toward the ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandler. The handler can resolve a specific case, let the default implementation take place, or reject the edit entirely by throwing ro.sync.ecss.extensions.api.InvalidEditException. The actions that are forwarded to this handler include typing, delete, or paste.
For more details about this handler, see Handling Schema-Aware Editing Events.
SchemaManagerFilter will be created each time a
document matches the rules defined by the Document Type Association that
contains the filter declaration.
public SchemaManagerFilter createSchemaManagerFilter() {
return new SDFSchemaManagerFilter();
}A detailed presentation of the schema manager filter can be found in the Configuring a Content Completion Handler section.
@id
attributes), the extension should provide the means to find the referenced content. To do
this, an implementation of the ro.sync.ecss.extensions.api.link.ElementLocatorProvider interface
should be returned by the createElementLocatorProvider method. Each time an
element pointed by a link needs to be located, the method is invoked.
public ElementLocatorProvider createElementLocatorProvider() {
return new DefaultElementLocatorProvider();
}
For more information on how to implement an element locator provider, see the Configuring a Link Target Element Finder section.
DropTargetEvent containing information about the drag and drop
operation. The drag and drop extensions are available in Author
mode for both Oxygen XML Author Eclipse plugin Eclipse plugin and standalone application. The
Text mode corresponding listener is available only for Oxygen XML Author Eclipse plugin Eclipse plugin. The methods corresponding to each implementation are:
createAuthorAWTDndListener, createTextSWTDndListener, and
createAuthorSWTDndListener.
public AuthorDnDListener createAuthorAWTDndListener() {
return new SDFAuthorDndListener();
}
For more details about the Author mode drag and drop listeners, see the Configuring a custom Drag and Drop Listener section.
public AuthorReferenceResolver createAuthorReferenceResolver() {
return new ReferencesResolver();
}
A more detailed description of the references resolver can be found in the Configuring a References Resolver section.
StylesFilter is
createAuthorStylesFilter. The method is called each time a document opened
in an Author editing mode matches the Document Type
Association where the extensions bundle is defined. The instantiated filter
object is kept and used until another extensions bundle corresponding to another document
type is activated as a result of the detection process.
public StylesFilter createAuthorStylesFilter() {
return new SDFStylesFilter();
}
See the Configuring CSS Styles Filter section for more details about the styles filter extension.
ExtensionsBundle
specifying these two extension points are createAuthorTableCellSpanProvider
and createAuthorTableColumnWidthProvider.
public AuthorTableCellSpanProvider createAuthorTableCellSpanProvider() {
return new TableCellSpanProvider();
}
public AuthorTableColumnWidthProvider
createAuthorTableColumnWidthProvider() {
return new TableColumnWidthProvider();
}
The two table information providers are not reused for different tables. The methods are called for each table in the document so new instances should be provided every time. Read more about the cell span and column width information providers in Configuring a Table Cell Span Provider and Configuring a Table Column Width Provider sections.
If the functionality related to one of the previous extension points does not need to be modified, then the developed ro.sync.ecss.extensions.api.ExtensionsBundle should not override the corresponding method and leave the default base implementation to return null.
public LinkTextResolver createLinkTextResolver() {
return new DitaLinkTextResolver();
}
Oxygen XML Author Eclipse plugin offers built-in implementations for DITA and DocBook: ro.sync.ecss.extensions.dita.link.DitaLinkTextResolver and ro.sync.ecss.extensions.docbook.link.DocbookLinkTextResolver respectively.
Add button. In the
displayed dialog box, enter the location of the JAR file relative to the Oxygen XML Author Eclipse plugin
frameworks folder.