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_DESCRIPTORFields 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 StringgetListTypeDescription(String listType) Obtain the name of every list type.protected StringBuildergetListXMLFragment(String listType, Map<String, String> attributes, int numberOfListItems, AuthorAccess authorAccess) Get list XML fragment.protected StringGet namespace.protected StringgetParentListType(AuthorNode node) Get the type of the list in which the new list will be inserted.protected StringgetXMLFragment(AuthorAccess authorAccess, String listType, String parentListType) Get XML fragment to be inserted when nothing is selected.protected voidinsertContent(AuthorAccess authorAccess, AuthorNode listNode, List<CommonsOperationsUtil.SelectedFragmentInfo> selectedFragmentsInfos) Insert content.protected booleanisList(AuthorNode node) Checks if the given node is a list.protected booleanisListElement(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
ArgumentDescriptorrepresenting the arguments this operation uses. - See Also:
-
getDescription
- Returns:
- The description of the extension.
- See Also:
-
getConversionElementsChecker
Description copied from class:InsertListOperationGet the conversion element checker.- Specified by:
getConversionElementsCheckerin classInsertListOperation- Returns:
- The conversion element checker.
- See Also:
-
insertContent
protected void insertContent(AuthorAccess authorAccess, AuthorNode listNode, List<CommonsOperationsUtil.SelectedFragmentInfo> selectedFragmentsInfos) Description copied from class:InsertListOperationInsert content.- Specified by:
insertContentin classInsertListOperation- Parameters:
authorAccess- The author access.listNode- The list node.selectedFragmentsInfos- The fragments to be inserted.- See Also:
-
getNamespace
Description copied from class:InsertListOperationGet namespace.- Specified by:
getNamespacein classInsertListOperation- Returns:
- The namespace to be used at insertion.
- See Also:
-
getXMLFragment
Description copied from class:InsertListOperationGet XML fragment to be inserted when nothing is selected.- Specified by:
getXMLFragmentin 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:InsertListOperationGet list XML fragment.- Specified by:
getListXMLFragmentin 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:InsertListOperationGet the type of the list in which the new list will be inserted. Can benull.- Specified by:
getParentListTypein 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:InsertListOperationChecks if the given node is a list element or list item.- Overrides:
isListElementin classInsertListOperation- Parameters:
node- The element to check.- Returns:
trueif the node is a list element.- See Also:
-
isList
Description copied from class:InsertListOperationChecks if the given node is a list.- Specified by:
isListin classInsertListOperation- Parameters:
node- The element to check.- Returns:
trueif the node is a list.- See Also:
-
getListTypeDescription
Description copied from class:InsertListOperationObtain the name of every list type.- Specified by:
getListTypeDescriptionin classInsertListOperation- Parameters:
listType- The list type.- Returns:
- A string representing the name of the given list type.
- See Also:
-