24.08.2015 Views

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Author</strong> Developer Guide | 208The styles and general layout of the copied content like: sections with headings, tables, list items, bold, and italic text,hyperlinks, are preserved by the paste operation by transforming them to the equivalent <strong>XML</strong> markup of the targetdocument type. This is available by default in the following predefined document types: DITA, DocBook 4, DocBook5, TEI 4, TEI 5, XHTML.For other document types the default behavior of the paste operation is to keep only the text content without the stylingbut it can be customized by setting an XSLT stylesheet in that document type. The XSLT stylesheet must accept as inputan XHTML flavor of the copied content and transform it to the equivalent <strong>XML</strong> markup that is appropriate for the targetdocument type of the paste operation. The stylesheet is set up by implementing thegetImporterStylesheetFileName method of an instance object of the<strong>Author</strong>ExternalObjectInsertionHandler class which is returned by thecreateExternalObjectInsertionHandler method of the ExtensionsBundle instance of the targetdocument type.Implementing an <strong>Author</strong> Extension State ListenerThe ro.sync.ecss.extensions.api.<strong>Author</strong>ExtensionStateListener implementation is notifiedwhen the <strong>Author</strong> extension where the listener is defined is activated or deactivated in the Document Type detectionprocess.Note: The Javadoc documentation of the <strong>Author</strong> API used in the example files is available on the <strong>Oxygen</strong> <strong>XML</strong><strong>Author</strong> <strong>plugin</strong> website. Also it can be downloaded as a zip archive from the website.import ro.sync.ecss.extensions.api.<strong>Author</strong>Access;import ro.sync.ecss.extensions.api.<strong>Author</strong>ExtensionStateListener;public class SDF<strong>Author</strong>ExtensionStateListener implements<strong>Author</strong>ExtensionStateListener {private <strong>Author</strong>Listener sdf<strong>Author</strong>DocumentListener;private <strong>Author</strong>MouseListener sdfMouseListener;private <strong>Author</strong>CaretListener sdfCaretListener;private OptionListener sdfOptionListener;The activation event received by this listener when the rules of the Document Type Association match a documentopened in the <strong>Author</strong> editor mode, should be used to perform custom initializations and to register listeners likero.sync.ecss.extensions.api.<strong>Author</strong>Listener,ro.sync.ecss.extensions.api.<strong>Author</strong>MouseListener orro.sync.ecss.extensions.api.<strong>Author</strong>CaretListener.public void activated(<strong>Author</strong>Access authorAccess) {// Get the value of the option.String option = authorAccess.getOptionsStorage().getOption("sdf.custom.option.key", "");// Use the option for some initializations...// Add an option listener.authorAccess.getOptionsStorage().addOptionListener(sdfOptionListener);// Add author document listeners.sdf<strong>Author</strong>DocumentListener = new SDF<strong>Author</strong>Listener();authorAccess.getDocumentController().add<strong>Author</strong>Listener(sdf<strong>Author</strong>DocumentListener);// Add mouse listener.sdfMouseListener = new SDF<strong>Author</strong>MouseListener();authorAccess.getEditorAccess().add<strong>Author</strong>MouseListener(sdfMouseListener);// Add caret listener.sdfCaretListener = new SDF<strong>Author</strong>CaretListener();authorAccess.getEditorAccess().add<strong>Author</strong>CaretListener(sdfCaretListener);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!