ro.sync.ecss.extensions.tei
Class TEISchemaAwareEditingHandler
java.lang.Object
ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandlerAdapter
ro.sync.ecss.extensions.tei.TEISchemaAwareEditingHandler
- All Implemented Interfaces:
- AuthorSchemaAwareEditingHandler
public class TEISchemaAwareEditingHandler
- extends AuthorSchemaAwareEditingHandlerAdapter
Specific editing support for TEI documents. Handles typing and paste events inside list (a item with a para will be
created and the typing/paste content be put inside it) and tables.
Field Summary |
protected java.lang.String |
documentNamespace
For TEI P5 http://www.tei-c.org/ns/1.0, for TEI P4 an empty string. |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
documentNamespace
protected final java.lang.String documentNamespace
- For TEI P5 http://www.tei-c.org/ns/1.0, for TEI P4 an empty string.
TEISchemaAwareEditingHandler
public TEISchemaAwareEditingHandler(java.lang.String documentNamespace)
- Constructor.
- Parameters:
documentNamespace
- The document namespace, for different versions of TEI.
handleTyping
public boolean handleTyping(int offset,
char ch,
AuthorAccess authorAccess)
throws InvalidEditException
- Description copied from interface:
AuthorSchemaAwareEditingHandler
- Handle a typing event.
- 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)
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:
- a Paste action. In this case, selection removal is handled before calling this method.
- a DND action. In this case source removal is handled after calling this method (unless an exception was thrown).
- an insert fragment event occurred as a result of an schema aware insert event,
like
AuthorDocumentController.insertXMLFragmentSchemaAware(String, int)
. Selection removal is handled
before calling this method.
- 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)
pushContextElement
protected void pushContextElement(WhatElementsCanGoHereContext context,
java.lang.String elementName)
- Derive the given context by adding the given element.
isElementWithNameAndNamespace
protected boolean isElementWithNameAndNamespace(AuthorNode node,
java.lang.String elementLocalName)
- Returns:
true
if the given node is an element with the given local name and from the TEI namespace.
© Copyright SyncRO Soft SRL 2002 - 2010.