@API(type=INTERNAL, src=PUBLIC) public class DocbookSchemaAwareEditingHandler extends AuthorSchemaAwareEditingHandlerAdapter
AuthorSchemaAwareEditingHandlerAdapter.WrapInAncestorsOptions
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
documentNamespace
For Docbook 5 http://docbook.org/ns/docbook, for Docbook 4 an empty string.
|
protected static java.lang.String |
INFO_SUFIX
Docbook info element name suffix.
|
protected static java.lang.String |
PARA
Docbook HTML para element name.
|
protected static java.lang.String |
TITLE
Docbook HTML title element name.
|
lastHandlerResult
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 and Description |
---|
DocbookSchemaAwareEditingHandler(java.lang.String documentNamespace)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
changeElementsToMoveUpDown(java.util.List<AuthorNode> selectedElements)
Determine the elements that should be moved by the Move Up/Down operation.
|
AuthorSchemaAwareEditingHandlerAdapter.WrapInAncestorsOptions |
getAncestorDetectionOptions()
One of the default smart paste strategies involves detecting an path o ancestors
from the context element to the inserted one.
|
protected java.lang.String |
getInfoElementChildOfSect(java.lang.String sectElementName)
Get the info child element name of to the given sect element name.
|
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.
|
protected boolean |
isElementWithNameAndNamespace(AuthorNode node,
java.lang.String elementLocalName) |
protected void |
pushContextElement(WhatElementsCanGoHereContext context,
java.lang.String elementName)
Derive the given context by adding the given element.
|
canBeReplaced, getLastResult, handleCreateDocumentFragment, handleDelete, handleDeleteElementTags, handleDeleteNodes, handleDeleteSelection, handleJoinElements
protected final java.lang.String documentNamespace
protected static final java.lang.String PARA
protected static final java.lang.String TITLE
protected static final java.lang.String INFO_SUFIX
public DocbookSchemaAwareEditingHandler(java.lang.String documentNamespace)
documentNamespace
- The document namespace, for different versions of Docbook.public boolean handleTyping(int offset, char ch, AuthorAccess authorAccess) throws InvalidEditException
AuthorSchemaAwareEditingHandler
AuthorSchemaAwareEditingHandler.handleTypingFallback(int, char, AuthorAccess)
will get called.handleTyping
in interface AuthorSchemaAwareEditingHandler
handleTyping
in class AuthorSchemaAwareEditingHandlerAdapter
offset
- Offset where the typing occurred.ch
- The typed character.authorAccess
- Access class to the author functions.true
if the typing was handled.InvalidEditException
- This is an invalid edit and must be rejected.AuthorSchemaAwareEditingHandlerAdapter.handleTyping(int, char, ro.sync.ecss.extensions.api.AuthorAccess)
public boolean handleTypingFallback(int offset, char ch, AuthorAccess authorAccess) throws InvalidEditException
AuthorSchemaAwareEditingHandler
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.
handleTypingFallback
in interface AuthorSchemaAwareEditingHandler
handleTypingFallback
in class AuthorSchemaAwareEditingHandlerAdapter
offset
- Offset where the typing occurred.ch
- The typed character.authorAccess
- Access class to the author functions.true
if the typing was handled.InvalidEditException
- This is an invalid edit and must be rejected.AuthorSchemaAwareEditingHandlerAdapter.handleTypingFallback(int, char, ro.sync.ecss.extensions.api.AuthorAccess)
public boolean handlePasteFragment(int offset, AuthorDocumentFragment[] fragmentsToInsert, int actionId, AuthorAccess authorAccess) throws InvalidEditException
AuthorSchemaAwareEditingHandler
AuthorDocumentController.insertXMLFragmentSchemaAware(String, int)
. Selection removal is handled
before calling this method.handlePasteFragment
in interface AuthorSchemaAwareEditingHandler
handlePasteFragment
in class AuthorSchemaAwareEditingHandlerAdapter
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.true
if the insertion was handled.InvalidEditException
- This is an invalid edit and must be rejected.AuthorSchemaAwareEditingHandlerAdapter.handlePasteFragment(int, ro.sync.ecss.extensions.api.node.AuthorDocumentFragment[], int, ro.sync.ecss.extensions.api.AuthorAccess)
protected java.lang.String getInfoElementChildOfSect(java.lang.String sectElementName)
sectElementName
- The sect element name.protected void pushContextElement(WhatElementsCanGoHereContext context, java.lang.String elementName)
protected boolean isElementWithNameAndNamespace(AuthorNode node, java.lang.String elementLocalName)
true
if the given node is an element with the given local name and from the Docbook namespace.public boolean changeElementsToMoveUpDown(java.util.List<AuthorNode> selectedElements)
AuthorSchemaAwareEditingHandlerAdapter
title
then the element
that should actually be moved is its parent (e.g. section
for DocBook).changeElementsToMoveUpDown
in class AuthorSchemaAwareEditingHandlerAdapter
selectedElements
- the selected elements in the author page. This list should be altered
depending on the framework specific structure.
title
then the element
that should actually be present in this list is its parent (e.g. section
for DocBook).true
if the list of elements to be moved was altered by the framework specific handler.AuthorSchemaAwareEditingHandlerAdapter.changeElementsToMoveUpDown(java.util.List)
public AuthorSchemaAwareEditingHandlerAdapter.WrapInAncestorsOptions getAncestorDetectionOptions()
AuthorSchemaAwareEditingHandlerAdapter
getAncestorDetectionOptions
in class AuthorSchemaAwareEditingHandlerAdapter
AuthorSchemaAwareEditingHandlerAdapter.getAncestorDetectionOptions()
© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.