org.netbeans.jemmy.operators
Class JLabelOperator

java.lang.Object
  extended by org.netbeans.jemmy.operators.Operator
      extended by org.netbeans.jemmy.operators.ComponentOperator
          extended by org.netbeans.jemmy.operators.ContainerOperator
              extended by org.netbeans.jemmy.operators.JComponentOperator
                  extended by org.netbeans.jemmy.operators.JLabelOperator
All Implemented Interfaces:
Outputable, Timeoutable

public class JLabelOperator
extends JComponentOperator



Timeouts used:
ComponentOperator.WaitComponentTimeout - time to wait component displayed
ComponentOperator.WaitStateTimeout - time to wait for text
.

Author:
Alexandre Iline (alexandre.iline@sun.com)
See Also:
Timeouts

Nested Class Summary
static class JLabelOperator.JLabelByLabelFinder
          Allows to find component by text.
static class JLabelOperator.JLabelFinder
          Checks component type.
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.JComponentOperator
JComponentOperator.JComponentByTipFinder, JComponentOperator.JComponentFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.ContainerOperator
ContainerOperator.ContainerFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.Operator
Operator.ComponentVisualizer, Operator.DefaultPathParser, Operator.DefaultStringComparator, Operator.Finder, Operator.MapAction, Operator.MapBooleanAction, Operator.MapByteAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapCharacterAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator
 
Field Summary
static java.lang.String TEXT_DPROP
          Identifier for a "text" property.
 
Fields inherited from class org.netbeans.jemmy.operators.JComponentOperator
A11Y_DATA, A11Y_DESCRIPTION_DPROP, A11Y_NAME_DPROP, TOOLTIP_TEXT_DPROP
 
Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP
 
Fields inherited from class org.netbeans.jemmy.operators.Operator
CLASS_DPROP, TO_STRING_DPROP
 
Constructor Summary
JLabelOperator(ContainerOperator cont)
          Constructor.
JLabelOperator(ContainerOperator cont, ComponentChooser chooser)
          Constructs a JLabelOperator object.
JLabelOperator(ContainerOperator cont, ComponentChooser chooser, int index)
          Constructs a JLabelOperator object.
JLabelOperator(ContainerOperator cont, int index)
          Constructor.
JLabelOperator(ContainerOperator cont, java.lang.String text)
          Constructor.
JLabelOperator(ContainerOperator cont, java.lang.String text, int index)
          Constructor.
JLabelOperator(javax.swing.JLabel b)
          Constructor.
 
Method Summary
static javax.swing.JLabel findJLabel(java.awt.Container cont, ComponentChooser chooser)
          Searches JLabel in container.
static javax.swing.JLabel findJLabel(java.awt.Container cont, ComponentChooser chooser, int index)
          Searches JLabel in container.
static javax.swing.JLabel findJLabel(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs)
          Searches JLabel by text.
static javax.swing.JLabel findJLabel(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int index)
          Searches JLabel by text.
 javax.swing.Icon getDisabledIcon()
          Maps JLabel.getDisabledIcon() through queue
 int getDisplayedMnemonic()
          Maps JLabel.getDisplayedMnemonic() through queue
 java.util.Hashtable getDump()
          Returns information about component.
 int getHorizontalAlignment()
          Maps JLabel.getHorizontalAlignment() through queue
 int getHorizontalTextPosition()
          Maps JLabel.getHorizontalTextPosition() through queue
 javax.swing.Icon getIcon()
          Maps JLabel.getIcon() through queue
 int getIconTextGap()
          Maps JLabel.getIconTextGap() through queue
 java.awt.Component getLabelFor()
          Maps JLabel.getLabelFor() through queue
 java.lang.String getText()
          Maps JLabel.getText() through queue
 javax.swing.plaf.LabelUI getUI()
          Maps JLabel.getUI() through queue
 int getVerticalAlignment()
          Maps JLabel.getVerticalAlignment() through queue
 int getVerticalTextPosition()
          Maps JLabel.getVerticalTextPosition() through queue
 void setDisabledIcon(javax.swing.Icon icon)
          Maps JLabel.setDisabledIcon(Icon) through queue
 void setDisplayedMnemonic(char c)
          Maps JLabel.setDisplayedMnemonic(char) through queue
 void setDisplayedMnemonic(int i)
          Maps JLabel.setDisplayedMnemonic(int) through queue
 void setHorizontalAlignment(int i)
          Maps JLabel.setHorizontalAlignment(int) through queue
 void setHorizontalTextPosition(int i)
          Maps JLabel.setHorizontalTextPosition(int) through queue
 void setIcon(javax.swing.Icon icon)
          Maps JLabel.setIcon(Icon) through queue
 void setIconTextGap(int i)
          Maps JLabel.setIconTextGap(int) through queue
 void setLabelFor(java.awt.Component component)
          Maps JLabel.setLabelFor(Component) through queue
 void setText(java.lang.String string)
          Maps JLabel.setText(String) through queue
 void setUI(javax.swing.plaf.LabelUI labelUI)
          Maps JLabel.setUI(LabelUI) through queue
 void setVerticalAlignment(int i)
          Maps JLabel.setVerticalAlignment(int) through queue
 void setVerticalTextPosition(int i)
          Maps JLabel.setVerticalTextPosition(int) through queue
static javax.swing.JLabel waitJLabel(java.awt.Container cont, ComponentChooser chooser)
          Waits JLabel in container.
static javax.swing.JLabel waitJLabel(java.awt.Container cont, ComponentChooser chooser, int index)
          Waits JLabel in container.
static javax.swing.JLabel waitJLabel(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs)
          Waits JLabel by text.
static javax.swing.JLabel waitJLabel(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int index)
          Waits JLabel by text.
 void waitText(java.lang.String text)
          Waits for text.
 
Methods inherited from class org.netbeans.jemmy.operators.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, getOutput, getRegisteredKeyStrokes, getRootPane, getTimeouts, 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, setOutput, setPreferredSize, setRequestFocusEnabled, setTimeouts, setToolTipText, showToolTip, unregisterKeyboardAction, updateUI, waitJComponent, waitJComponent, waitJComponent, waitJComponent, waitToolTip
 
Methods inherited from class org.netbeans.jemmy.operators.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, waitSubComponent
 
Methods inherited from class org.netbeans.jemmy.operators.ComponentOperator
activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, clickForPopup, clickForPopup, clickForPopup, clickForPopup, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, contains, contains, copyEnvironment, 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, checkImage, checkImage, 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, wtComponentEnabled
 
Methods inherited from class org.netbeans.jemmy.operators.Operator
addOperatorPackage, addToDump, addToDump, createOperator, getComparator, getDefaultComponentVisualizer, getDefaultMouseButton, getDefaultPathParser, getDefaultStringComparator, getDefaultVerification, getEnvironmentOperator, getCharBindingMap, getCharKey, getCharModifiers, getCharsKeys, getCharsKeys, getCharsModifiers, getCharsModifiers, 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, setComparator, setDefaultComponentVisualizer, setDefaultPathParser, setDefaultStringComparator, setDefaultVerification, setCharBindingMap, setPathParser, setProperties, setVerification, setVisualizer, toStringSource, unlockAndThrow, unlockQueue, waitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_DPROP

public static final java.lang.String TEXT_DPROP
Identifier for a "text" property.

See Also:
getDump(), Constant Field Values
Constructor Detail

JLabelOperator

public JLabelOperator(javax.swing.JLabel b)
Constructor.

Parameters:
b - a component

JLabelOperator

public JLabelOperator(ContainerOperator cont,
                      ComponentChooser chooser,
                      int index)
Constructs a JLabelOperator object.

Parameters:
cont - a container
chooser - a component chooser specifying searching criteria.
index - an index between appropriate ones.

JLabelOperator

public JLabelOperator(ContainerOperator cont,
                      ComponentChooser chooser)
Constructs a JLabelOperator object.

Parameters:
cont - a container
chooser - a component chooser specifying searching criteria.

JLabelOperator

public JLabelOperator(ContainerOperator cont,
                      java.lang.String text,
                      int index)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
text - Button text.
index - Ordinal component index.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

JLabelOperator

public JLabelOperator(ContainerOperator cont,
                      java.lang.String text)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
text - Button text.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

JLabelOperator

public JLabelOperator(ContainerOperator cont,
                      int index)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
index - Ordinal component index.

JLabelOperator

public JLabelOperator(ContainerOperator cont)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
Method Detail

findJLabel

public static javax.swing.JLabel findJLabel(java.awt.Container cont,
                                            ComponentChooser chooser,
                                            int index)
Searches JLabel in container.

Parameters:
cont - Container to search component in.
chooser - a component chooser specifying searching criteria.
index - Ordinal component index.
Returns:
JLabel instance or null if component was not found.

findJLabel

public static javax.swing.JLabel findJLabel(java.awt.Container cont,
                                            ComponentChooser chooser)
Searches JLabel in container.

Parameters:
cont - Container to search component in.
chooser - a component chooser specifying searching criteria.
Returns:
JLabel instance or null if component was not found.

findJLabel

public static javax.swing.JLabel findJLabel(java.awt.Container cont,
                                            java.lang.String text,
                                            boolean ce,
                                            boolean ccs,
                                            int index)
Searches JLabel 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:
JLabel instance or null if component was not found.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

findJLabel

public static javax.swing.JLabel findJLabel(java.awt.Container cont,
                                            java.lang.String text,
                                            boolean ce,
                                            boolean ccs)
Searches JLabel by text.

Parameters:
cont - Container to search component in.
text - Component text.
ce - Compare text exactly.
ccs - Compare text case sensitively.
Returns:
JLabel instance or null if component was not found.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

waitJLabel

public static javax.swing.JLabel waitJLabel(java.awt.Container cont,
                                            ComponentChooser chooser,
                                            int index)
Waits JLabel in container.

Parameters:
cont - Container to search component in.
chooser - a component chooser specifying searching criteria.
index - Ordinal component index.
Returns:
JLabel instance.

waitJLabel

public static javax.swing.JLabel waitJLabel(java.awt.Container cont,
                                            ComponentChooser chooser)
Waits JLabel in container.

Parameters:
cont - Container to search component in.
chooser - a component chooser specifying searching criteria.
Returns:
JLabel instance.

waitJLabel

public static javax.swing.JLabel waitJLabel(java.awt.Container cont,
                                            java.lang.String text,
                                            boolean ce,
                                            boolean ccs,
                                            int index)
Waits JLabel 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:
JLabel instance.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

waitJLabel

public static javax.swing.JLabel waitJLabel(java.awt.Container cont,
                                            java.lang.String text,
                                            boolean ce,
                                            boolean ccs)
Waits JLabel by text.

Parameters:
cont - Container to search component in.
text - Component text.
ce - Compare text exactly.
ccs - Compare text case sensitively.
Returns:
JLabel instance.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

waitText

public void waitText(java.lang.String text)
Waits for text. Uses getComparator() comparator.

Parameters:
text - Text to wait for.

getDump

public java.util.Hashtable getDump()
Returns information about component.

Overrides:
getDump in class JComponentOperator
Returns:
a Hashtable containing name-value pairs.

getDisabledIcon

public javax.swing.Icon getDisabledIcon()
Maps JLabel.getDisabledIcon() through queue


getDisplayedMnemonic

public int getDisplayedMnemonic()
Maps JLabel.getDisplayedMnemonic() through queue


getHorizontalAlignment

public int getHorizontalAlignment()
Maps JLabel.getHorizontalAlignment() through queue


getHorizontalTextPosition

public int getHorizontalTextPosition()
Maps JLabel.getHorizontalTextPosition() through queue


getIcon

public javax.swing.Icon getIcon()
Maps JLabel.getIcon() through queue


getIconTextGap

public int getIconTextGap()
Maps JLabel.getIconTextGap() through queue


getLabelFor

public java.awt.Component getLabelFor()
Maps JLabel.getLabelFor() through queue


getText

public java.lang.String getText()
Maps JLabel.getText() through queue


getUI

public javax.swing.plaf.LabelUI getUI()
Maps JLabel.getUI() through queue


getVerticalAlignment

public int getVerticalAlignment()
Maps JLabel.getVerticalAlignment() through queue


getVerticalTextPosition

public int getVerticalTextPosition()
Maps JLabel.getVerticalTextPosition() through queue


setDisabledIcon

public void setDisabledIcon(javax.swing.Icon icon)
Maps JLabel.setDisabledIcon(Icon) through queue


setDisplayedMnemonic

public void setDisplayedMnemonic(char c)
Maps JLabel.setDisplayedMnemonic(char) through queue


setDisplayedMnemonic

public void setDisplayedMnemonic(int i)
Maps JLabel.setDisplayedMnemonic(int) through queue


setHorizontalAlignment

public void setHorizontalAlignment(int i)
Maps JLabel.setHorizontalAlignment(int) through queue


setHorizontalTextPosition

public void setHorizontalTextPosition(int i)
Maps JLabel.setHorizontalTextPosition(int) through queue


setIcon

public void setIcon(javax.swing.Icon icon)
Maps JLabel.setIcon(Icon) through queue


setIconTextGap

public void setIconTextGap(int i)
Maps JLabel.setIconTextGap(int) through queue


setLabelFor

public void setLabelFor(java.awt.Component component)
Maps JLabel.setLabelFor(Component) through queue


setText

public void setText(java.lang.String string)
Maps JLabel.setText(String) through queue


setUI

public void setUI(javax.swing.plaf.LabelUI labelUI)
Maps JLabel.setUI(LabelUI) through queue


setVerticalAlignment

public void setVerticalAlignment(int i)
Maps JLabel.setVerticalAlignment(int) through queue


setVerticalTextPosition

public void setVerticalTextPosition(int i)
Maps JLabel.setVerticalTextPosition(int) through queue