Class FormSelectedTextOperation
java.lang.Object
ro.sync.ecss.extensions.commons.operations.text.FormSelectedTextOperation
- All Implemented Interfaces:
AuthorOperation
,Extension
- Direct Known Subclasses:
CapitalizeSentencesOperation
,CapitalizeWordsOperation
@API(type=INTERNAL,
src=PUBLIC)
public abstract class FormSelectedTextOperation
extends Object
implements AuthorOperation
The class provides form word and form sentence operations over a selected text.
-
Field Summary
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doOperation
(AuthorAccess authorAccess, ArgumentsMap arguments) Form sentences.protected abstract boolean
isDelimiterBeforeTextNode
(AuthorAccess authorAccess, int contentOffset) Decides if there is a sentence delimiter before the text node.protected boolean
isWordDelimiter
(char ch) Decides if the character is a sentence delimiter or not.protected abstract char[]
processTextContent
(char[] charArray, boolean isDelimiterBefore) Process char array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ro.sync.ecss.extensions.api.Extension
getDescription
-
Constructor Details
-
FormSelectedTextOperation
public FormSelectedTextOperation()
-
-
Method Details
-
getArguments
- Specified by:
getArguments
in interfaceAuthorOperation
- Returns:
- An array of
ArgumentDescriptor
representing the arguments this operation uses. - See Also:
-
isDelimiterBeforeTextNode
protected abstract boolean isDelimiterBeforeTextNode(AuthorAccess authorAccess, int contentOffset) throws BadLocationException, AuthorOperationException Decides if there is a sentence delimiter before the text node.- Parameters:
contentOffset
- The offset where search is started.authorAccess
-- Returns:
true
if the there is a sentence delimiter before the text node orfalse
if a non-delimiter character was found.- Throws:
BadLocationException
AuthorOperationException
-
isWordDelimiter
protected boolean isWordDelimiter(char ch) Decides if the character is a sentence delimiter or not.- Parameters:
ch
- The character that must be evaluated.- Returns:
true
if the character is a sentence delimiter orfalse
otherwise.
-
doOperation
public void doOperation(AuthorAccess authorAccess, ArgumentsMap arguments) throws AuthorOperationException Form sentences.- Specified by:
doOperation
in interfaceAuthorOperation
- Parameters:
authorAccess
- The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.arguments
- The map of arguments. All the arguments defined by methodAuthorOperation.getArguments()
must be present in the map of arguments.- Throws:
AuthorOperationException
- Thrown when the operation fails.- See Also:
-
processTextContent
protected abstract char[] processTextContent(char[] charArray, boolean isDelimiterBefore) Process char array.- Parameters:
charArray
- The character array that must be processed.isDelimiterBefore
-true
if we have a delimiter before the given char array,false
otherwise.
-