@API(type=INTERNAL, src=PUBLIC) public abstract class SortOperation extends java.lang.Object implements AuthorOperation
Modifier and Type | Field and Description |
---|---|
protected AuthorAccess |
authorAccess
The Author access.
|
protected static java.lang.String |
COLUMN
String used in the default name for the sorting criterion.
|
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
Constructor and Description |
---|
SortOperation(java.lang.String selElementsString,
java.lang.String allElementsString)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
canBeSorted(AuthorElement parent,
int[] selectedNonIgnoredChildrenInterval)
Check if the parent element selected children can be sorted.
|
void |
doOperation(AuthorAccess authorAccess,
ArgumentsMap args)
Perform the actual operation.
|
protected boolean |
forceSortAll() |
ArgumentDescriptor[] |
getArguments() |
java.lang.String |
getDescription() |
protected java.util.List<AuthorNode> |
getNonIgnoredChildren(AuthorElement parent)
Returns a list of non ignored children.
|
int[] |
getSelectedNonIgnoredChildrenInterval(AuthorElement parent)
Return the interval of sortable nodes indices covered by selection.
|
abstract java.util.List<CriterionInformation> |
getSortCriteria(AuthorElement parent)
Obtain the sort criterion.
|
abstract java.lang.String[] |
getSortKeysValues(AuthorNode node,
SortCriteriaInformation sortInfo)
Obtain the values of the keys that can be used for sorting.
|
abstract AuthorElement |
getSortParent(int offset,
AuthorAccess authorAccess)
Obtain the parent node of all the nodes which will be sorted.
|
protected java.lang.String |
getTextContentToSort(AuthorNode node)
Given a node obtain the content to be used during the sort operation.
|
abstract boolean |
isIgnored(AuthorNode node)
Checks if a given node is ignored when sorting.
|
protected static final java.lang.String COLUMN
protected AuthorAccess authorAccess
public SortOperation(java.lang.String selElementsString, java.lang.String allElementsString)
selElementsString
- The name of the "selected elements" radio combo.allElementsString
- The name of the "all elements" radio combo.public java.lang.String getDescription()
getDescription
in interface Extension
Extension.getDescription()
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args) throws java.lang.IllegalArgumentException, AuthorOperationException
AuthorOperation
Workspace.isStandalone()
.
To get to the Workspace
you may use: AuthorAccess.getWorkspaceAccess()
.doOperation
in interface AuthorOperation
authorAccess
- The author access.
Provides access to specific informations and actions for
editor, document, workspace, tables, change tracking, utility a.s.o.args
- The map of arguments. All the arguments defined by method
AuthorOperation.getArguments()
must be present in the map of arguments.java.lang.IllegalArgumentException
- Thrown when one or more arguments are illegal.AuthorOperationException
- Thrown when the operation fails.AuthorOperation.doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
public abstract void canBeSorted(AuthorElement parent, int[] selectedNonIgnoredChildrenInterval) throws AuthorOperationException
parent
- The parent of the elements which will be sorted.selectedNonIgnoredChildrenInterval
- The interval of selected children indices.AuthorOperationException
- When the given node is not sortable.
For example a table row containing a cell with multiple rowspan stops the operation.public int[] getSelectedNonIgnoredChildrenInterval(AuthorElement parent)
parent
- The parent node for the sortable nodes.null
.protected boolean forceSortAll()
true
if the sort operation should not use the selected
element and should always sort all elements.protected java.util.List<AuthorNode> getNonIgnoredChildren(AuthorElement parent)
parent
- The parent node.public abstract AuthorElement getSortParent(int offset, AuthorAccess authorAccess) throws AuthorOperationException
offset
- The offset where the operation was invoked.authorAccess
- The AuthorAccess
.AuthorOperationException
- When the offset is negative or greater than the content length.public abstract boolean isIgnored(AuthorNode node)
node
- The node to be checked.true
if the given node is ignored when sorting.public abstract java.lang.String[] getSortKeysValues(AuthorNode node, SortCriteriaInformation sortInfo) throws AuthorOperationException
node
- The element which will be sorted.sortInfo
- The sort information corresponding to the user choice.AuthorOperationException
- If the text content cannot be obtained.public abstract java.util.List<CriterionInformation> getSortCriteria(AuthorElement parent) throws AuthorOperationException
parent
- The parent node of the nodes which will be sorted.SortCriteriaInformation
containing the CriterionInformation
objects.AuthorOperationException
public ArgumentDescriptor[] getArguments()
getArguments
in interface AuthorOperation
ArgumentDescriptor
representing
the arguments this operation uses.AuthorOperation.getArguments()
protected java.lang.String getTextContentToSort(AuthorNode node)
node
- The node to get the value for.© Copyright SyncRO Soft SRL 2002 - 2014. All rights reserved.