Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.dita
Class DITASchemaAwareEditingHandler

java.lang.Object
  extended by ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandlerAdapter
      extended by ro.sync.ecss.extensions.dita.DITASchemaAwareEditingHandler
All Implemented Interfaces:
AuthorSchemaAwareEditingHandler

@API(type=INTERNAL,
     src=PUBLIC)
public class DITASchemaAwareEditingHandler
extends AuthorSchemaAwareEditingHandlerAdapter

Specific editing support for DITA documents. Handles typing and paste events inside steps, steps-unordered (a new step with a cmd will be created and the typing/paste content be put inside it) and tables (CALS and simple).


Field Summary
 
Fields inherited from class ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandlerAdapter
lastHandlerResult
 
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandler
ACTION_ID_BACKSPACE, ACTION_ID_CUT, ACTION_ID_DELETE, ACTION_ID_DND, ACTION_ID_INSERT_FRAGMENT, ACTION_ID_PASTE, ACTION_ID_TYPING, CREATE_FRAGMENT_PURPOSE_COPY, CREATE_FRAGMENT_PURPOSE_CUT, CREATE_FRAGMENT_PURPOSE_DND_COPY, CREATE_FRAGMENT_PURPOSE_DND_MOVE
 
Constructor Summary
DITASchemaAwareEditingHandler()
           
 
Method Summary
 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.
 boolean handleTypingFallback(int offset, char ch, AuthorAccess authorAccess)
          Give a fallback solution for a typing event.
 
Methods inherited from class ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandlerAdapter
getLastResult, handleCreateDocumentFragment, handleDelete, handleDeleteElementTags, handleDeleteNodes, handleDeleteSelection, handleJoinElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DITASchemaAwareEditingHandler

public DITASchemaAwareEditingHandler()
Method Detail

handleTyping

public boolean handleTyping(int offset,
                            char ch,
                            AuthorAccess authorAccess)
                     throws InvalidEditException
Description copied from interface: AuthorSchemaAwareEditingHandler
Handle a typing event. If the event is not handled, the default implementation of a handler will be given a chance to handle the event. If that fails to provide a solution, AuthorSchemaAwareEditingHandler.handleTypingFallback(int, char, AuthorAccess) will get called.

Specified by:
handleTyping in interface AuthorSchemaAwareEditingHandler
Overrides:
handleTyping in class AuthorSchemaAwareEditingHandlerAdapter
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.
See Also:
AuthorSchemaAwareEditingHandlerAdapter.handleTyping(int, char, ro.sync.ecss.extensions.api.AuthorAccess)

handleTypingFallback

public boolean handleTypingFallback(int offset,
                                    char ch,
                                    AuthorAccess authorAccess)
                             throws InvalidEditException
Description copied from interface: AuthorSchemaAwareEditingHandler
Give a fallback solution for a typing event. This call comes when this object's AuthorSchemaAwareEditingHandler.handleTyping(int, char, AuthorAccess) method did not handle the typing event and neither did the AuthorSchemaAwareEditingHandler.handleTyping(int, char, AuthorAccess) from the default implementation.

As a fallback solution, a paragraph can be inserted at the given offset (if allowed) and then the typed character can be inserted inside it.

Specified by:
handleTypingFallback in interface AuthorSchemaAwareEditingHandler
Overrides:
handleTypingFallback in class AuthorSchemaAwareEditingHandlerAdapter
Parameters:
offset - Offset where the typing occurred.
ch - The typed character.
authorAccess - Access class to the author functions.
Returns:
true if the typing was handled.
Throws:
InvalidEditException - This is an invalid edit and must be rejected.
See Also:
AuthorSchemaAwareEditingHandlerAdapter.handleTypingFallback(int, char, ro.sync.ecss.extensions.api.AuthorAccess)

handlePasteFragment

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

Specified by:
handlePasteFragment in interface AuthorSchemaAwareEditingHandler
Overrides:
handlePasteFragment in class AuthorSchemaAwareEditingHandlerAdapter
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.
See Also:
AuthorSchemaAwareEditingHandlerAdapter.handlePasteFragment(int, ro.sync.ecss.extensions.api.node.AuthorDocumentFragment[], int, ro.sync.ecss.extensions.api.AuthorAccess)

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.