Class JTextAreaOperator
- All Implemented Interfaces:
Outputable, Timeoutable
Class provides basic functions to operate with JTextArea
(selection, typing, deleting)
Timeouts used:
JTextComponentOperator.PushKeyTimeout - time between key pressing and releasing during text typing
JTextComponentOperator.BetweenKeysTimeout - time to sleep between two chars typing
JTextComponentOperator.ChangeCaretPositionTimeout - maximum time to chenge caret position
JTextComponentOperator.TypeTextTimeout - maximum time to type text
ComponentOperator.WaitComponentTimeout - time to wait component displayed
ComponentOperator.WaitFocusTimeout - time to wait component focus
JScrollBarOperator.OneScrollClickTimeout - time for one scroll click
JScrollBarOperator.WholeScrollTimeout - time for the whole scrolling
.
Timeouts used:
JTextComponentOperator.PushKeyTimeout - time between key pressing and releasing during text typing
JTextComponentOperator.BetweenKeysTimeout - time to sleep between two chars typing
JTextComponentOperator.ChangeCaretPositionTimeout - maximum time to chenge caret position
JTextComponentOperator.TypeTextTimeout - maximum time to type text
ComponentOperator.WaitComponentTimeout - time to wait component displayed
ComponentOperator.WaitFocusTimeout - time to wait component focus
JScrollBarOperator.OneScrollClickTimeout - time for one scroll click
JScrollBarOperator.WholeScrollTimeout - time for the whole scrolling
.
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classChecks component type.Nested classes/interfaces inherited from class JTextComponentOperator
JTextComponentOperator.JTextComponentByTextFinder, JTextComponentOperator.JTextComponentFinder, JTextComponentOperator.NoSuchTextException, JTextComponentOperator.TextChooserNested classes/interfaces inherited from class JComponentOperator
JComponentOperator.JComponentByTipFinder, JComponentOperator.JComponentFinderNested classes/interfaces inherited from class ContainerOperator
ContainerOperator.ContainerFinderNested classes/interfaces inherited from class Operator
Operator.ComponentVisualizer, Operator.DefaultPathParser, Operator.DefaultStringComparator, Operator.Finder, Operator.MapAction, Operator.MapBooleanAction, Operator.MapByteAction, Operator.MapCharacterAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for a "column count" property.static final StringIdentifier for a "row count" property.Fields inherited from class JTextComponentOperator
IS_EDITABLE_DPROP, modifiersPressed, SELECTED_TEXT_DPROP, TEXT_DPROPFields inherited from class JComponentOperator
A11Y_DATA, A11Y_DESCRIPTION_DPROP, A11Y_NAME_DPROP, TOOLTIP_TEXT_DPROPFields inherited from class ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROPFields inherited from class Operator
CLASS_DPROP, TO_STRING_DPROP -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.JTextAreaOperator(ContainerOperator cont, int index) Constructor.JTextAreaOperator(ContainerOperator cont, String text) Constructor.JTextAreaOperator(ContainerOperator cont, String text, int index) Constructor.JTextAreaOperator(ContainerOperator cont, ComponentChooser chooser) Constructs a JTextAreaOperator object.JTextAreaOperator(ContainerOperator cont, ComponentChooser chooser, int index) Constructs a JTextAreaOperator object. -
Method Summary
Modifier and TypeMethodDescriptionvoidMapsJTextArea.append(String)through queuevoidchangeCaretPosition(int row, int column) Moves caret.voidchangeCaretRow(int row) Moves caret to line.static JTextAreafindJTextArea(Container cont, String text, boolean ce, boolean ccs) Searches JTextArea by text.static JTextAreafindJTextArea(Container cont, String text, boolean ce, boolean ccs, int index) Searches JTextArea by text.static JTextAreafindJTextArea(Container cont, ComponentChooser chooser) Searches JTextArea in container.static JTextAreafindJTextArea(Container cont, ComponentChooser chooser, int index) Searches JTextArea in container.intMapsJTextArea.getColumns()through queuegetDump()Returns information about component.intMapsJTextArea.getLineCount()through queueintgetLineEndOffset(int i) MapsJTextArea.getLineEndOffset(int)through queueintgetLineOfOffset(int i) MapsJTextArea.getLineOfOffset(int)through queueintgetLineStartOffset(int i) MapsJTextArea.getLineStartOffset(int)through queuebooleanMapsJTextArea.getLineWrap()through queueReturns print output streams or writers.intgetRows()MapsJTextArea.getRows()through queueintMapsJTextArea.getTabSize()through queueReturn current timeouts.booleanMapsJTextArea.getWrapStyleWord()through queuevoidMapsJTextArea.insert(String, int)through queuevoidreplaceRange(String string, int i, int i1) MapsJTextArea.replaceRange(String, int, int)through queuevoidselectLines(int startLine, int endLine) Select some text lines.voidselectText(int startRow, int startColumn, int endRow, int endColumn) Select a part of text.voidsetColumns(int i) MapsJTextArea.setColumns(int)through queuevoidsetLineWrap(boolean b) MapsJTextArea.setLineWrap(boolean)through queuevoid/////////////////////////////////////////////////////voidsetRows(int i) MapsJTextArea.setRows(int)through queuevoidsetTabSize(int i) MapsJTextArea.setTabSize(int)through queuevoidsetTimeouts(Timeouts times) Defines current timeouts.voidsetWrapStyleWord(boolean b) MapsJTextArea.setWrapStyleWord(boolean)through queuevoidTypes text.voidusePageNavigationKeys(boolean yesOrNo) Deprecated.All text operations are performed by TextDriver regitered for this operator type.static JTextAreawaitJTextArea(Container cont, String text, boolean ce, boolean ccs) Waits JTextArea by text.static JTextAreawaitJTextArea(Container cont, String text, boolean ce, boolean ccs, int index) Waits JTextArea by text.static JTextAreawaitJTextArea(Container cont, ComponentChooser chooser) Waits JTextArea in container.static JTextAreawaitJTextArea(Container cont, ComponentChooser chooser, int index) Waits JTextArea in container.Methods inherited from class JTextComponentOperator
addCaretListener, changeCaretPosition, changeCaretPosition, changeCaretPosition, clearText, copy, copyEnvironment, cut, enterText, findJTextComponent, findJTextComponent, findJTextComponent, findJTextComponent, getActions, getCaret, getCaretColor, getCaretPosition, getDisabledTextColor, getDisplayedText, getDocument, getFocusAccelerator, getHighlighter, getKeymap, getMargin, getPositionByText, getPositionByText, getPositionByText, getPositionByText, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, modelToView, moveCaretPosition, paste, read, removeCaretListener, replaceSelection, scrollToPosition, select, selectAll, selectText, selectText, selectText, setCaret, setCaretColor, setCaretPosition, setDisabledTextColor, setDocument, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, typeText, typeText, viewToModel, waitCaretPosition, waitJTextComponent, waitJTextComponent, waitJTextComponent, waitJTextComponent, waitText, waitText, writeMethods inherited from class JComponentOperator
addAncestorListener, addVetoableChangeListener, computeVisibleRect, createToolTip, findJComponent, findJComponent, findJComponent, findJComponent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getAutoscrolls, getBorder, getCenterXForClick, getCenterYForClick, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getInsets, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWindowContainerOperator, grabFocus, isFocusCycleRoot, isManagingFocus, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, requestDefaultFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, showToolTip, unregisterKeyboardAction, updateUI, waitJComponent, waitJComponent, waitJComponent, waitJComponent, waitToolTipMethods inherited from class ContainerOperator
add, add, add, add, add, addContainerListener, createSubOperator, createSubOperator, findComponentAt, findComponentAt, findContainer, findContainer, findContainer, findContainer, findContainerUnder, findContainerUnder, findSubComponent, findSubComponent, getComponent, getComponentCount, getComponents, getInsets, getLayout, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, waitContainer, waitContainer, waitContainer, waitContainer, waitSubComponent, waitSubComponentMethods inherited from class ComponentOperator
activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, checkImage, checkImage, clickForPopup, clickForPopup, clickForPopup, clickForPopup, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, contains, contains, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterY, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getContainer, getContainers, getCursor, getDropTarget, getEventDispatcher, getFocus, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getSize, getSource, getToolkit, getTreeLock, getWidth, getWindow, getX, getY, hasFocus, imageUpdate, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, list, list, list, list, list, makeComponentVisible, moveMouse, paint, paintAll, prepareImage, prepareImage, pressKey, pressKey, pressMouse, pressMouse, print, printAll, pushKey, pushKey, releaseKey, releaseKey, releaseMouse, releaseMouse, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, transferFocus, typeKey, typeKey, typeKey, update, validate, waitComponent, waitComponent, waitComponent, waitComponent, waitComponentEnabled, waitComponentShowing, waitComponentVisible, waitHasFocus, wtComponentEnabledMethods inherited from class Operator
addOperatorPackage, addToDump, addToDump, createOperator, getCharBindingMap, getCharKey, getCharModifiers, getCharsKeys, getCharsKeys, getCharsModifiers, getCharsModifiers, getComparator, getDefaultComponentVisualizer, getDefaultMouseButton, getDefaultPathParser, getDefaultStringComparator, getDefaultVerification, getEnvironmentOperator, getParentPath, getParentPath, getPathParser, getPopupMouseButton, getProperties, getQueueTool, getVerification, getVisualizer, isCaptionEqual, isCaptionEqual, isCaptionEqual, lockQueue, parseString, parseString, printDump, produceNoBlocking, produceNoBlocking, produceTimeRestricted, produceTimeRestricted, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, setCharBindingMap, setComparator, setDefaultComponentVisualizer, setDefaultPathParser, setDefaultStringComparator, setDefaultVerification, setPathParser, setProperties, setVerification, setVisualizer, toStringSource, unlockAndThrow, unlockQueue, waitState
-
Field Details
-
COLUMN_COUNT_DPROP
-
ROW_COUNT_DPROP
-
-
Constructor Details
-
JTextAreaOperator
-
JTextAreaOperator
Constructs a JTextAreaOperator object.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.index- an index between appropriate ones.
-
JTextAreaOperator
Constructs a JTextAreaOperator object.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.
-
JTextAreaOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont- a containertext- Button text.index- Ordinal component index.- Throws:
TimeoutExpiredException- See Also:
-
JTextAreaOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont- a containertext- Button text.- Throws:
TimeoutExpiredException- See Also:
-
JTextAreaOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont- a containerindex- Ordinal component index.- Throws:
TimeoutExpiredException
-
JTextAreaOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont- a container- Throws:
TimeoutExpiredException
-
-
Method Details
-
findJTextArea
Searches JTextArea in container.- Parameters:
cont- Container to search component in.chooser- a component chooser specifying searching criteria.index- Ordinal component index.- Returns:
- JTextArea instance or null if component was not found.
-
findJTextArea
Searches JTextArea in container.- Parameters:
cont- Container to search component in.chooser- a component chooser specifying searching criteria.- Returns:
- JTextArea instance or null if component was not found.
-
findJTextArea
public static JTextArea findJTextArea(Container cont, String text, boolean ce, boolean ccs, int index) Searches JTextArea by text.- Parameters:
cont- Container to search component in.text- Component text.ce- Compare text exactly.ccs- Compare text case sensitively.index- Ordinal component index.- Returns:
- JTextArea instance or null if component was not found.
- See Also:
-
findJTextArea
Searches JTextArea by text.- Parameters:
cont- Container to search component in.text- Component text.ce- Compare text exactly.ccs- Compare text case sensitively.- Returns:
- JTextArea instance or null if component was not found.
- See Also:
-
waitJTextArea
Waits JTextArea in container.- Parameters:
cont- Container to search component in.chooser- a component chooser specifying searching criteria.index- Ordinal component index.- Returns:
- JTextArea instance.
- Throws:
TimeoutExpiredException
-
waitJTextArea
Waits JTextArea in container.- Parameters:
cont- Container to search component in.chooser- a component chooser specifying searching criteria.- Returns:
- JTextArea instance.
- Throws:
TimeoutExpiredException
-
waitJTextArea
public static JTextArea waitJTextArea(Container cont, String text, boolean ce, boolean ccs, int index) Waits JTextArea by text.- Parameters:
cont- Container to search component in.text- Component text.ce- Compare text exactly.ccs- Compare text case sensitively.index- Ordinal component index.- Returns:
- JTextArea instance.
- Throws:
TimeoutExpiredException- See Also:
-
waitJTextArea
Waits JTextArea by text.- Parameters:
cont- Container to search component in.text- Component text.ce- Compare text exactly.ccs- Compare text case sensitively.- Returns:
- JTextArea instance.
- Throws:
TimeoutExpiredException- See Also:
-
setTimeouts
Description copied from interface:TimeoutableDefines current timeouts.- Specified by:
setTimeoutsin interfaceTimeoutable- Overrides:
setTimeoutsin classJTextComponentOperator- Parameters:
times- A collection of timeout assignments.- See Also:
-
getTimeouts
Description copied from interface:TimeoutableReturn current timeouts.- Specified by:
getTimeoutsin interfaceTimeoutable- Overrides:
getTimeoutsin classJTextComponentOperator- Returns:
- the collection of current timeout assignments.
- See Also:
-
setOutput
Description copied from class:ComponentOperator/////////////////////////////////////////////////////- Specified by:
setOutputin interfaceOutputable- Overrides:
setOutputin classJTextComponentOperator- Parameters:
out- Identify the streams or writers used for print output.- See Also:
-
getOutput
Description copied from interface:OutputableReturns print output streams or writers.- Specified by:
getOutputin interfaceOutputable- Overrides:
getOutputin classJTextComponentOperator- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
-
changeCaretRow
public void changeCaretRow(int row) Moves caret to line.- Parameters:
row- Line to move caret to.- Throws:
TimeoutExpiredException- See Also:
-
changeCaretPosition
public void changeCaretPosition(int row, int column) Moves caret.- Parameters:
row- Line to move caret to.column- Column to move caret to.- Throws:
TimeoutExpiredException- See Also:
-
typeText
Types text.- Parameters:
text- Text to be typed.row- Line to type text in.column- Column to type text from.- Throws:
TimeoutExpiredException- See Also:
-
selectText
public void selectText(int startRow, int startColumn, int endRow, int endColumn) Select a part of text.- Parameters:
startRow- Start position row.startColumn- Start position column.endRow- End position row.endColumn- End position column.- Throws:
TimeoutExpiredException- See Also:
-
selectLines
public void selectLines(int startLine, int endLine) Select some text lines.- Parameters:
startLine- start selectionendLine- end selection- Throws:
TimeoutExpiredException- See Also:
-
getDump
Returns information about component.- Overrides:
getDumpin classJTextComponentOperator- Returns:
- a Hashtable containing name-value pairs.
-
append
MapsJTextArea.append(String)through queue -
getColumns
public int getColumns()MapsJTextArea.getColumns()through queue -
getLineCount
public int getLineCount()MapsJTextArea.getLineCount()through queue -
getLineEndOffset
public int getLineEndOffset(int i) MapsJTextArea.getLineEndOffset(int)through queue -
getLineOfOffset
public int getLineOfOffset(int i) MapsJTextArea.getLineOfOffset(int)through queue -
getLineStartOffset
public int getLineStartOffset(int i) MapsJTextArea.getLineStartOffset(int)through queue -
getLineWrap
public boolean getLineWrap()MapsJTextArea.getLineWrap()through queue -
getRows
public int getRows()MapsJTextArea.getRows()through queue -
getTabSize
public int getTabSize()MapsJTextArea.getTabSize()through queue -
getWrapStyleWord
public boolean getWrapStyleWord()MapsJTextArea.getWrapStyleWord()through queue -
insert
MapsJTextArea.insert(String, int)through queue -
replaceRange
MapsJTextArea.replaceRange(String, int, int)through queue -
setColumns
public void setColumns(int i) MapsJTextArea.setColumns(int)through queue -
setLineWrap
public void setLineWrap(boolean b) MapsJTextArea.setLineWrap(boolean)through queue -
setRows
public void setRows(int i) MapsJTextArea.setRows(int)through queue -
setTabSize
public void setTabSize(int i) MapsJTextArea.setTabSize(int)through queue -
setWrapStyleWord
public void setWrapStyleWord(boolean b) MapsJTextArea.setWrapStyleWord(boolean)through queue
-