Oxygen XML Editor 11.2 Author API

ro.sync.ecss.extensions.api
Interface AuthorSchemaAwareEditingHandler

All Known Implementing Classes:
AuthorSchemaAwareEditingHandlerAdapter, DITASchemaAwareEditingHandler, Docbook5SchemaAwareEditingHandler, DocbookSchemaAwareEditingHandler, TEISchemaAwareEditingHandler

public interface AuthorSchemaAwareEditingHandler

If Schema Aware mode is active in Oxygen, all actions that can generate invalid content will be redirected toward this handler. The handler 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.


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


Field Summary
static int ACTION_ID_BACKSPACE
          Delete action through backspace key.
static int ACTION_ID_CUT
          Cut action.
static int ACTION_ID_DELETE
          Delete action through delete key.
static int ACTION_ID_DND
          DND action.
static int ACTION_ID_INSERT_FRAGMENT
          Insert document fragment action by an action other than PASTE or DND.
static int ACTION_ID_PASTE
          Paste action.
static int ACTION_ID_TYPING
          Typing action.
 
Method Summary
 boolean handleDelete(int offset, int deleteType, AuthorAccess authorAccess, boolean wordLevel)
          Handle a keyboard delete event at the given offset (using Delete or Backspace keys).
 boolean handleDeleteElementTags(AuthorNode nodeToUnwrap, AuthorAccess authorAccess)
          Handle delete element tags event.
 boolean handleDeleteSelection(int selectionStart, int selectionEnd, int generatedByActionId, AuthorAccess authorAccess)
          Handle a delete selection event.
 boolean handleJoinElements(AuthorNode targetNode, List<AuthorNode> nodesToJoin, AuthorAccess authorAccess)
          Handle a join event between the given nodes.
 boolean handlePasteFragment(int offset, AuthorDocumentFragment[] fragmentsToInsert, int actionId, AuthorAccess authorAccess)
          Handle an insert fragment event generated by: a Paste action.
 boolean handleTyping(int offset, char ch, AuthorAccess authorAccess)
          Handle a typing event.
 

Field Detail

ACTION_ID_TYPING

static final int ACTION_ID_TYPING
Typing action.

See Also:
Constant Field Values

ACTION_ID_DELETE

static final int ACTION_ID_DELETE
Delete action through delete key.

See Also:
Constant Field Values

ACTION_ID_BACKSPACE

static final int ACTION_ID_BACKSPACE
Delete action through backspace key.

See Also:
Constant Field Values

ACTION_ID_PASTE

static final int ACTION_ID_PASTE
Paste action.

See Also:
Constant Field Values

ACTION_ID_CUT

static final int ACTION_ID_CUT
Cut action.

See Also:
Constant Field Values

ACTION_ID_DND

static final int ACTION_ID_DND
DND action.

See Also:
Constant Field Values

ACTION_ID_INSERT_FRAGMENT

static final int ACTION_ID_INSERT_FRAGMENT
Insert document fragment action by an action other than PASTE or DND.

See Also:
Constant Field Values
Method Detail

handleDelete

boolean handleDelete(int offset,
                     int deleteType,
                     AuthorAccess authorAccess,
                     boolean wordLevel)
                     throws InvalidEditException
Handle a keyboard delete event at the given offset (using Delete or Backspace keys).

Parameters:
offset - Offset where the delete event happened.
deleteType - ACTION_ID_DELETE if Delete key was used or ACTION_ID_BACKSPACE for Backspace.
authorAccess - Access class to the author functions.
wordLevel - true if the user requested a delete for a whole word.
Returns:
true if the event was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.

handleDeleteSelection

boolean handleDeleteSelection(int selectionStart,
                              int selectionEnd,
                              int generatedByActionId,
                              AuthorAccess authorAccess)
                              throws InvalidEditException
Handle a delete selection event. The event is generated when a selection exists inside the document and one of following actions takes place:

Parameters:
selectionStart - Selection start offset.
selectionEnd - Selection end offset.
generatedByActionId - An id identifying the action that generated this event. One of the following constants are possible: ACTION_ID_TYPING, ACTION_ID_DELETE, ACTION_ID_PASTE, ACTION_ID_CUT, ACTION_ID_DND, ACTION_ID_INSERT_FRAGMENT.
authorAccess - Access class to the author functions.
Returns:
true if the event was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.

handlePasteFragment

boolean handlePasteFragment(int offset,
                            AuthorDocumentFragment[] fragmentsToInsert,
                            int actionId,
                            AuthorAccess authorAccess)
                            throws InvalidEditException
Handle an insert fragment event generated by:

Parameters:
offset - Offset where the event occurred.
fragmentsToInsert - Fragments to be inserted.
actionId - ACTION_ID_PASTE if event was generated by paste action, ACTION_ID_DND if it was generated by a DND event or ACTION_ID_INSERT_FRAGMENT if the event was generated by an AuthorDocumentController schema aware insert method.
authorAccess - Access class to the author functions.
Returns:
true if the insertion was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.

handleTyping

boolean handleTyping(int offset,
                     char ch,
                     AuthorAccess authorAccess)
                     throws InvalidEditException
Handle a typing event.

Parameters:
offset - Offset where the typing occurred.
ch - The typed character.
authorAccess - Access class to the author functions.
Returns:
code>true if the typing was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.

handleDeleteElementTags

boolean handleDeleteElementTags(AuthorNode nodeToUnwrap,
                                AuthorAccess authorAccess)
                                throws InvalidEditException
Handle delete element tags event. (Unwrapping)

Parameters:
nodeToUnwrap - The node to delete element tags.
authorAccess - Access class to the author functions.
Returns:
code>true if the event was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.

handleJoinElements

boolean handleJoinElements(AuthorNode targetNode,
                           List<AuthorNode> nodesToJoin,
                           AuthorAccess authorAccess)
                           throws InvalidEditException
Handle a join event between the given nodes.

Parameters:
targetNode - The node where the content of the other nodes must migrate.
nodesToJoin - The nodes that must be joined in the target node.
authorAccess - Access class to the author functions.
Returns:
true if the event was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.