Package ro.sync.ecss.extensions.api
Class DITAAuthorActionEventHandler
- java.lang.Object
-
- ro.sync.ecss.extensions.api.AuthorActionEventHandlerBase
-
- ro.sync.ecss.extensions.api.DefaultAuthorActionEventHandler
-
- ro.sync.ecss.extensions.api.DITAAuthorActionEventHandler
-
- All Implemented Interfaces:
AuthorActionEventHandler
,Extension
@API(type=NOT_EXTENDABLE, src=PUBLIC) public class DITAAuthorActionEventHandler extends DefaultAuthorActionEventHandler
Author action event handler for DITA. 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 Constructor Description DITAAuthorActionEventHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
areCompatibleLists(AuthorNode node1, AuthorNode node2)
Check if two given nodes are compatible lists (i.e.boolean
canHandleEvent(AuthorAccess authorAccess, AuthorActionEventDetails eventDetails)
Check if an Author action event can be handled.AuthorElement
getListItemAncestorToSplit(AuthorNode node, AuthorAccess access)
Return the list item ancestor of the current node that needs to be split on Enter.protected java.lang.String
getParagraphElement(AuthorAccess authorAccess)
Get the preferred XML element content to be inserted.boolean
handleEvent(AuthorAccess authorAccess, AuthorActionEventHandler.AuthorActionEventType eventType)
An event was generated.protected boolean
isList(AuthorNode node)
Check if the given node is a list.protected boolean
isMovableListItem(AuthorAccess authorAccess, AuthorNode candidate)
Checks if this node represents a list item that can be promoted/demoted.-
Methods inherited from class ro.sync.ecss.extensions.api.DefaultAuthorActionEventHandler
canHandleEvent, getContentCompletionActions, getDescription, getPreferredXMLElementContent, promote, promoteSubListItems
-
-
-
-
Method Detail
-
isMovableListItem
protected boolean isMovableListItem(AuthorAccess authorAccess, AuthorNode candidate)
Description copied from class:DefaultAuthorActionEventHandler
Checks if this node represents a list item that can be promoted/demoted.- Overrides:
isMovableListItem
in classDefaultAuthorActionEventHandler
- Parameters:
authorAccess
- The Author access.candidate
- The node that candidates for promotion/demotion.- Returns:
true
if the list item can be promoted/demoted.- See Also:
DefaultAuthorActionEventHandler.isMovableListItem(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.node.AuthorNode)
-
isList
protected boolean isList(AuthorNode node)
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:
DefaultAuthorActionEventHandler.isList(ro.sync.ecss.extensions.api.node.AuthorNode)
-
getParagraphElement
protected java.lang.String getParagraphElement(AuthorAccess authorAccess)
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.
-
areCompatibleLists
protected boolean areCompatibleLists(AuthorNode node1, AuthorNode node2)
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:
DefaultAuthorActionEventHandler.areCompatibleLists(ro.sync.ecss.extensions.api.node.AuthorNode, ro.sync.ecss.extensions.api.node.AuthorNode)
-
getListItemAncestorToSplit
public AuthorElement getListItemAncestorToSplit(AuthorNode node, AuthorAccess access)
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:
AuthorActionEventHandler.getListItemAncestorToSplit(ro.sync.ecss.extensions.api.node.AuthorNode, ro.sync.ecss.extensions.api.AuthorAccess)
-
handleEvent
public boolean handleEvent(AuthorAccess authorAccess, AuthorActionEventHandler.AuthorActionEventType eventType)
Description copied from interface:AuthorActionEventHandler
An event was generated.- Specified by:
handleEvent
in interfaceAuthorActionEventHandler
- Overrides:
handleEvent
in classDefaultAuthorActionEventHandler
- Parameters:
authorAccess
- Author access.eventType
- The type of the generated event.- Returns:
true
if the event was handled and the default operation should be skipped,false
to let the default operation execute.- See Also:
DefaultAuthorActionEventHandler.handleEvent(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.AuthorActionEventHandler.AuthorActionEventType)
-
canHandleEvent
public boolean canHandleEvent(AuthorAccess authorAccess, AuthorActionEventDetails eventDetails)
Description copied from interface:AuthorActionEventHandler
Check if an Author action event can be handled.- Parameters:
authorAccess
- Access to the Author API.eventDetails
- The details of the event generated.- Returns:
true
if the Author action event can be handled.- See Also:
AuthorActionEventHandler.canHandleEvent(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.AuthorActionEventDetails)
-
-