Package ro.sync.ecss.extensions.dita
Class DITAInsertListOperation
- java.lang.Object
-
- ro.sync.ecss.extensions.commons.operations.InsertListOperation
-
- ro.sync.ecss.extensions.dita.DITAInsertListOperation
-
- All Implemented Interfaces:
AuthorOperation
,Extension
@API(type=INTERNAL, src=PUBLIC) public class DITAInsertListOperation extends InsertListOperation
Insert List operation for DITA.
-
-
Field Summary
-
Fields inherited from class ro.sync.ecss.extensions.commons.operations.InsertListOperation
authorAccess, CONVERT_ELEMENT_AT_CARET_ARGUMENT, CONVERT_ELEMENT_AT_CARET_ARGUMENT_DESCRIPTOR, LIST_TYPE_ARGUMENT, listType, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
-
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT
-
-
Constructor Summary
Constructors Constructor Description DITAInsertListOperation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArgumentDescriptor[]
getArguments()
protected CommonsOperationsUtil.ConversionElementHelper
getConversionElementsChecker()
Get the conversion element checker.java.lang.String
getDescription()
protected java.lang.String
getListTypeDescription(java.lang.String listType)
Obtain the name of every list type.protected java.lang.StringBuilder
getListXMLFragment(java.lang.String listType, java.util.Map<java.lang.String,java.lang.String> attributes, int numberOfListItems, AuthorAccess authorAccess)
Get list XML fragment.protected java.lang.String
getNamespace()
Get namespace.protected java.lang.String
getParentListType(AuthorNode node)
Get the type of the list in which the new list will be inserted.protected java.lang.String
getXMLFragment(AuthorAccess authorAccess, java.lang.String listType, java.lang.String parentListType)
Get XML fragment to be inserted when nothing is selected.protected void
insertContent(AuthorAccess authorAccess, AuthorNode listNode, java.util.List<CommonsOperationsUtil.SelectedFragmentInfo> selectedFragmentsInfos)
Insert content.protected boolean
isList(AuthorNode node)
Checks if the given node is a list.protected boolean
isListElement(AuthorNode node)
Checks if the given node is a list element or list item.-
Methods inherited from class ro.sync.ecss.extensions.commons.operations.InsertListOperation
doOperation, getElementAtCaretToConvert
-
-
-
-
Method Detail
-
getArguments
public ArgumentDescriptor[] getArguments()
- Returns:
- An array of
ArgumentDescriptor
representing the arguments this operation uses. - See Also:
AuthorOperation.getArguments()
-
getDescription
public java.lang.String getDescription()
- Returns:
- The description of the extension.
- See Also:
Extension.getDescription()
-
getConversionElementsChecker
protected CommonsOperationsUtil.ConversionElementHelper getConversionElementsChecker()
Description copied from class:InsertListOperation
Get the conversion element checker.- Specified by:
getConversionElementsChecker
in classInsertListOperation
- Returns:
- The conversion element checker.
- See Also:
InsertListOperation.getConversionElementsChecker()
-
insertContent
protected void insertContent(AuthorAccess authorAccess, AuthorNode listNode, java.util.List<CommonsOperationsUtil.SelectedFragmentInfo> selectedFragmentsInfos)
Description copied from class:InsertListOperation
Insert content.- Specified by:
insertContent
in classInsertListOperation
- Parameters:
authorAccess
- The author access.listNode
- The list node.selectedFragmentsInfos
- The fragments to be inserted.- See Also:
InsertListOperation.insertContent(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.node.AuthorNode, java.util.List)
-
getNamespace
protected java.lang.String getNamespace()
Description copied from class:InsertListOperation
Get namespace.- Specified by:
getNamespace
in classInsertListOperation
- Returns:
- The namespace to be used at insertion.
- See Also:
InsertListOperation.getNamespace()
-
getXMLFragment
protected java.lang.String getXMLFragment(AuthorAccess authorAccess, java.lang.String listType, java.lang.String parentListType)
Description copied from class:InsertListOperation
Get XML fragment to be inserted when nothing is selected.- Specified by:
getXMLFragment
in classInsertListOperation
- Parameters:
authorAccess
- The author access.listType
- The type of the list to be inserted.parentListType
- The type of the parent list, can benull
- Returns:
- the fragment to be inserted.
- See Also:
InsertListOperation.getXMLFragment(ro.sync.ecss.extensions.api.AuthorAccess, java.lang.String, java.lang.String)
-
getListXMLFragment
protected java.lang.StringBuilder getListXMLFragment(java.lang.String listType, java.util.Map<java.lang.String,java.lang.String> attributes, int numberOfListItems, AuthorAccess authorAccess)
Description copied from class:InsertListOperation
Get list XML fragment.- Specified by:
getListXMLFragment
in classInsertListOperation
- Parameters:
listType
- The list type.attributes
- The attributes to add to list items.numberOfListItems
- The number of list items.authorAccess
- The author access.- Returns:
- The list XML fragment.
- See Also:
InsertListOperation.getListXMLFragment(java.lang.String, java.util.Map, int, ro.sync.ecss.extensions.api.AuthorAccess)
-
getParentListType
protected java.lang.String getParentListType(AuthorNode node)
Description copied from class:InsertListOperation
Get the type of the list in which the new list will be inserted. Can benull
.- Specified by:
getParentListType
in classInsertListOperation
- Parameters:
node
- The node at offset.- Returns:
- the type of the list in which the new list will be inserted. Can be
null
. - See Also:
InsertListOperation.getParentListType(ro.sync.ecss.extensions.api.node.AuthorNode)
-
isListElement
protected boolean isListElement(AuthorNode node)
Description copied from class:InsertListOperation
Checks if the given node is a list element or list item.- Overrides:
isListElement
in classInsertListOperation
- Parameters:
node
- The element to check.- Returns:
true
if the node is a list element.- See Also:
InsertListOperation.isListElement(ro.sync.ecss.extensions.api.node.AuthorNode)
-
isList
protected boolean isList(AuthorNode node)
Description copied from class:InsertListOperation
Checks if the given node is a list.- Specified by:
isList
in classInsertListOperation
- Parameters:
node
- The element to check.- Returns:
true
if the node is a list.- See Also:
InsertListOperation.isList(ro.sync.ecss.extensions.api.node.AuthorNode)
-
getListTypeDescription
protected java.lang.String getListTypeDescription(java.lang.String listType)
Description copied from class:InsertListOperation
Obtain the name of every list type.- Specified by:
getListTypeDescription
in classInsertListOperation
- Parameters:
listType
- The list type.- Returns:
- A string representing the name of the given list type.
- See Also:
InsertListOperation.getListTypeDescription(java.lang.String)
-
-