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 TypeMethodDescriptionvoiddoOperation(AuthorAccess authorAccess, ArgumentsMap arguments) Form sentences.protected abstract booleanisDelimiterBeforeTextNode(AuthorAccess authorAccess, int contentOffset) Decides if there is a sentence delimiter before the text node.protected booleanisWordDelimiter(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, waitMethods inherited from interface ro.sync.ecss.extensions.api.Extension
getDescription
-
Constructor Details
-
FormSelectedTextOperation
public FormSelectedTextOperation()
-
-
Method Details
-
getArguments
- Specified by:
getArgumentsin interfaceAuthorOperation- Returns:
- An array of
ArgumentDescriptorrepresenting 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:
trueif the there is a sentence delimiter before the text node orfalseif a non-delimiter character was found.- Throws:
BadLocationExceptionAuthorOperationException
-
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:
trueif the character is a sentence delimiter orfalseotherwise.
-
doOperation
public void doOperation(AuthorAccess authorAccess, ArgumentsMap arguments) throws AuthorOperationException Form sentences.- Specified by:
doOperationin 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-trueif we have a delimiter before the given char array,falseotherwise.
-