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
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 -
Method Summary
Modifier and TypeMethodDescriptionGet the conversion element checker.protected String
getListTypeDescription
(String listType) Obtain the name of every list type.protected StringBuilder
getListXMLFragment
(String listType, Map<String, String> attributes, int numberOfListItems, AuthorAccess authorAccess) Get list XML fragment.protected String
Get namespace.protected String
getParentListType
(AuthorNode node) Get the type of the list in which the new list will be inserted.protected String
getXMLFragment
(AuthorAccess authorAccess, String listType, String parentListType) Get XML fragment to be inserted when nothing is selected.protected void
insertContent
(AuthorAccess authorAccess, AuthorNode listNode, 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
-
Constructor Details
-
DITAInsertListOperation
public DITAInsertListOperation()
-
-
Method Details
-
getArguments
- Returns:
- An array of
ArgumentDescriptor
representing the arguments this operation uses. - See Also:
-
getDescription
- Returns:
- The description of the extension.
- See Also:
-
getConversionElementsChecker
Description copied from class:InsertListOperation
Get the conversion element checker.- Specified by:
getConversionElementsChecker
in classInsertListOperation
- Returns:
- The conversion element checker.
- See Also:
-
insertContent
protected void insertContent(AuthorAccess authorAccess, AuthorNode listNode, 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:
-
getNamespace
Description copied from class:InsertListOperation
Get namespace.- Specified by:
getNamespace
in classInsertListOperation
- Returns:
- The namespace to be used at insertion.
- See Also:
-
getXMLFragment
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:
-
getListXMLFragment
protected StringBuilder getListXMLFragment(String listType, Map<String, 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:
-
getParentListType
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:
-
isListElement
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:
-
isList
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:
-
getListTypeDescription
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:
-