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 | 209// Other custom initializations...}The authorAccess parameter received by the activated method can be used to gain access to <strong>Author</strong> specific actionsand informations related to components like the editor, document, workspace, tables, or the change tracking manager.If options specific to the custom developed <strong>Author</strong> extension need to be stored or retrieved, a reference to thero.sync.ecss.extensions.api.OptionsStorage can be obtained by calling the getOptionsStoragemethod from the author access. The same object can be used to registerro.sync.ecss.extensions.api.OptionListener listeners. An option listener is registered in relation withan option key and will be notified about the value changes of that option.An <strong>Author</strong>Listener can be used if events related to the <strong>Author</strong> document modifications are of interest. The listenercan be added to the ro.sync.ecss.extensions.api.<strong>Author</strong>DocumentController. A reference to thedocument controller is returned by the getDocumentController method from the author access. The documentcontroller can also be used to perform operations involving document modifications.To provide access to <strong>Author</strong> editor component related functionality and information, the author access has a referenceto the ro.sync.ecss.extensions.api.access.<strong>Author</strong>EditorAccess that can be obtained when callingthe getEditorAccess method. At this level <strong>Author</strong>MouseListener and <strong>Author</strong>CaretListener can beadded which will be notified about mouse and caret events occurring in the <strong>Author</strong> editor mode.The deactivation event is received when another framework is activated for the same document, the user switches toanother editor mode or the editor is closed. The deactivate method is typically used to unregister the listenerspreviously added on the activate method and to perform other actions. For example, options related to the deactivatedauthor extension can be saved at this point.public void deactivated(<strong>Author</strong>Access authorAccess) {// Store the option.authorAccess.getOptionsStorage().setOption("sdf.custom.option.key", optionValue);// Remove the option listener.authorAccess.getOptionsStorage().removeOptionListener(sdfOptionListener);// Remove document listeners.authorAccess.getDocumentController().remove<strong>Author</strong>Listener(sdf<strong>Author</strong>DocumentListener);// Remove mouse listener.authorAccess.getEditorAccess().remove<strong>Author</strong>MouseListener(sdfMouseListener);// Remove caret listener.authorAccess.getEditorAccess().remove<strong>Author</strong>CaretListener(sdfCaretListener);}// Other actions...Implementing an <strong>Author</strong> Schema Aware Editing HandlerYou can implement your own handler for actions like typing, delete or paste by providing an implementation ofro.sync.ecss.extensions.api.<strong>Author</strong>SchemaAwareEditingHandler. The Schema Aware Editingmust be On or Custom in order for this handler to be called. The handler can either resolve a specific case, let the defaultimplementation take place or reject the edit entirely by throwing an InvalidEditException.

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

Saved successfully!

Ooh no, something went wrong!