Package ro.sync.ecss.extensions.api
Class DocbookAuthorActionEventHandler
java.lang.Object
ro.sync.ecss.extensions.api.AuthorActionEventHandlerBase
ro.sync.ecss.extensions.api.DefaultAuthorActionEventHandler
ro.sync.ecss.extensions.api.DocbookAuthorActionEventHandler
- All Implemented Interfaces:
AuthorActionEventHandler
,Extension
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public class DocbookAuthorActionEventHandler
extends DefaultAuthorActionEventHandler
Author action event handler for DocBook.
IMPORTANT, THIS CLASS SHOULD HAVE BEEN CREATED IN THE FRAMEWORK SPECIFIC PACKAGE.
BUT IT WAS NOT, TOO LATE, WE KEEP IT HERE FOR BACKWARD COMPATIBILITY
-
Nested Class Summary
Nested classes/interfaces inherited from interface ro.sync.ecss.extensions.api.AuthorActionEventHandler
AuthorActionEventHandler.AuthorActionEventType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areCompatibleLists
(AuthorNode node1, AuthorNode node2) Check if two given nodes are compatible lists (i.e.getListItemAncestorToSplit
(AuthorNode node, AuthorAccess access) Return the list item ancestor of the current node that needs to be split on Enter.protected String
getParagraphElement
(AuthorAccess authorAccess) Get the preferred XML element content to be inserted.protected boolean
isList
(AuthorNode node) Check if the given node is a list.protected void
promoteSubListItems
(AuthorDocumentController controller, AuthorNode theDemotedCandidate, AuthorNode listElement) Sometimes, when we demote a list item, we want it to become the sibling of its children.Methods inherited from class ro.sync.ecss.extensions.api.DefaultAuthorActionEventHandler
canHandleEvent, getContentCompletionActions, getDescription, getPreferredXMLElementContent, handleEvent, isMovableListItem, promote
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ro.sync.ecss.extensions.api.AuthorActionEventHandler
canHandleEvent
-
Constructor Details
-
DocbookAuthorActionEventHandler
public DocbookAuthorActionEventHandler()
-
-
Method Details
-
promoteSubListItems
protected void promoteSubListItems(AuthorDocumentController controller, AuthorNode theDemotedCandidate, AuthorNode listElement) throws BadLocationException, AuthorOperationException Description copied from class:DefaultAuthorActionEventHandler
Sometimes, when we demote a list item, we want it to become the sibling of its children. To obtain this, after demoting the item along with its children, we promote the children. This method promotes the children.- Overrides:
promoteSubListItems
in classDefaultAuthorActionEventHandler
- Parameters:
controller
- The Author document controller.theDemotedCandidate
- The candidate which was demoted.listElement
- The parent list of the demoted item.- Throws:
BadLocationException
AuthorOperationException
- See Also:
-
isList
Description copied from class:DefaultAuthorActionEventHandler
Check if the given node is a list.- Overrides:
isList
in classDefaultAuthorActionEventHandler
- Parameters:
node
- The node.- Returns:
true
if the node is a list.- See Also:
-
areCompatibleLists
Description copied from class:DefaultAuthorActionEventHandler
Check if two given nodes are compatible lists (i.e. if we accept items from one list to migrate into the other one).- Overrides:
areCompatibleLists
in classDefaultAuthorActionEventHandler
- Returns:
true
if the two given nodes are compatible lists.- See Also:
-
getParagraphElement
Description copied from class:DefaultAuthorActionEventHandler
Get the preferred XML element content to be inserted. Can benull
.- Overrides:
getParagraphElement
in classDefaultAuthorActionEventHandler
- Parameters:
authorAccess
- The author access.- Returns:
- the preferred XML element content to be inserted.
-
getListItemAncestorToSplit
Description copied from interface:AuthorActionEventHandler
Return the list item ancestor of the current node that needs to be split on Enter.- Parameters:
node
- The node.access
- Access object to the Author API.- Returns:
- the list item ancestor of the current node that needs to be split on Enter, or
null
. - See Also:
-