Package org.netbeans.jemmy.operators
Class ContainerOperator<T extends Container>
- java.lang.Object
-
- org.netbeans.jemmy.operators.Operator
-
- org.netbeans.jemmy.operators.ComponentOperator
-
- org.netbeans.jemmy.operators.ContainerOperator<T>
-
- All Implemented Interfaces:
Outputable
,Timeoutable
- Direct Known Subclasses:
JComponentOperator
,ScrollPaneOperator
,WindowOperator
public class ContainerOperator<T extends Container> extends ComponentOperator implements Timeoutable, Outputable
Timeouts used:
ComponentOperator.WaitComponentTimeout - time to wait container displayed
.- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
Timeouts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContainerOperator.ContainerFinder
Checks component type.-
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.MapCharacterAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator
-
-
Field Summary
-
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
Constructors Constructor Description ContainerOperator(Container b)
Constructor.ContainerOperator(ContainerOperator cont)
Constructor.ContainerOperator(ContainerOperator cont, int index)
Constructor.ContainerOperator(ContainerOperator cont, ComponentChooser chooser)
Constructs a ContainerOperator object.ContainerOperator(ContainerOperator cont, ComponentChooser chooser, int index)
Constructs a ContainerOperator object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Component
add(Component component)
MapsContainer.add(Component)
through queueComponent
add(Component component, int i)
MapsContainer.add(Component, int)
through queuevoid
add(Component component, Object object)
MapsContainer.add(Component, Object)
through queuevoid
add(Component component, Object object, int i)
MapsContainer.add(Component, Object, int)
through queueComponent
add(String string, Component component)
MapsContainer.add(String, Component)
through queuevoid
addContainerListener(ContainerListener containerListener)
MapsContainer.addContainerListener(ContainerListener)
through queueComponentOperator
createSubOperator(ComponentChooser chooser)
Waits for a subcomponent and creates an operator.ComponentOperator
createSubOperator(ComponentChooser chooser, int index)
Waits for a subcomponent and creates an operator.Component
findComponentAt(int i, int i1)
MapsContainer.findComponentAt(int, int)
through queueComponent
findComponentAt(Point point)
MapsContainer.findComponentAt(Point)
through queuestatic Container
findContainer(Container cont)
Searches 0'th Container in container.static Container
findContainer(Container cont, int index)
Searches Container in container.static Container
findContainer(Container cont, ComponentChooser chooser)
Searches 0'th Container in container.static Container
findContainer(Container cont, ComponentChooser chooser, int index)
Searches Container in container.static Container
findContainerUnder(Component comp)
Searches Container object which component lies on.static Container
findContainerUnder(Component comp, ComponentChooser chooser)
Searches Container object which component lies on.Component
findSubComponent(ComponentChooser chooser)
Searches for a subcomponent.Component
findSubComponent(ComponentChooser chooser, int index)
Searches for a subcomponent.Component
getComponent(int i)
MapsContainer.getComponent(int)
through queueint
getComponentCount()
MapsContainer.getComponentCount()
through queueComponent[]
getComponents()
MapsContainer.getComponents()
through queueInsets
getInsets()
MapsContainer.getInsets()
through queueLayoutManager
getLayout()
MapsContainer.getLayout()
through queueTestOut
getOutput()
Returns print output streams or writers.Timeouts
getTimeouts()
Return current timeouts.boolean
isAncestorOf(Component component)
MapsContainer.isAncestorOf(Component)
through queuevoid
paintComponents(Graphics graphics)
MapsContainer.paintComponents(Graphics)
through queuevoid
printComponents(Graphics graphics)
MapsContainer.printComponents(Graphics)
through queuevoid
remove(int i)
MapsContainer.remove(int)
through queuevoid
remove(Component component)
MapsContainer.remove(Component)
through queuevoid
removeAll()
MapsContainer.removeAll()
through queuevoid
removeContainerListener(ContainerListener containerListener)
MapsContainer.removeContainerListener(ContainerListener)
through queuevoid
setLayout(LayoutManager layoutManager)
MapsContainer.setLayout(LayoutManager)
through queuevoid
setOutput(TestOut out)
Defines print output streams or writers.void
setTimeouts(Timeouts timeouts)
Defines current timeouts.static Container
waitContainer(Container cont)
Waits 0'th Container in container.static Container
waitContainer(Container cont, int index)
Waits Container in container.static Container
waitContainer(Container cont, ComponentChooser chooser)
Waits 0'th Container in container.static Container
waitContainer(Container cont, ComponentChooser chooser, int index)
Waits Container in container.Component
waitSubComponent(ComponentChooser chooser)
Waits for a subcomponent.Component
waitSubComponent(ComponentChooser chooser, int index)
Waits for a subcomponent.-
Methods inherited from class org.netbeans.jemmy.operators.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, copyEnvironment, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterXForClick, getCenterY, getCenterYForClick, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getContainer, getContainers, getCursor, getDropTarget, getDump, 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, wtComponentEnabled
-
Methods inherited from class org.netbeans.jemmy.operators.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
-
-
-
-
Constructor Detail
-
ContainerOperator
public ContainerOperator(Container b)
Constructor.- Parameters:
b
- Container component.
-
ContainerOperator
public ContainerOperator(ContainerOperator cont, ComponentChooser chooser, int index)
Constructs a ContainerOperator object.- Parameters:
cont
- containerchooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
ContainerOperator
public ContainerOperator(ContainerOperator cont, ComponentChooser chooser)
Constructs a ContainerOperator object.- Parameters:
cont
- containerchooser
- a component chooser specifying searching criteria.
-
ContainerOperator
public ContainerOperator(ContainerOperator cont, int index)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- Operator pointing a container to search component in.index
- Ordinal component index.- Throws:
TimeoutExpiredException
-
ContainerOperator
public ContainerOperator(ContainerOperator cont)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- Operator pointing a container to search component in.- Throws:
TimeoutExpiredException
-
-
Method Detail
-
findContainer
public static Container findContainer(Container cont, ComponentChooser chooser, int index)
Searches Container in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- Container instance or null if component was not found.
-
findContainer
public static Container findContainer(Container cont, ComponentChooser chooser)
Searches 0'th Container in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- Container instance or null if component was not found.
-
findContainer
public static Container findContainer(Container cont, int index)
Searches Container in container.- Parameters:
cont
- Container to search component in.index
- Ordinal component index.- Returns:
- Container instance or null if component was not found.
-
findContainer
public static Container findContainer(Container cont)
Searches 0'th Container in container.- Parameters:
cont
- Container to search component in.- Returns:
- Container instance or null if component was not found.
-
findContainerUnder
public static Container findContainerUnder(Component comp, ComponentChooser chooser)
Searches Container object which component lies on.- Parameters:
comp
- Component to find Container under.chooser
- a chooser specifying searching criteria.- Returns:
- Container instance or null if component was not found.
-
findContainerUnder
public static Container findContainerUnder(Component comp)
Searches Container object which component lies on.- Parameters:
comp
- Component to find Container under.- Returns:
- Container instance or null if component was not found.
-
waitContainer
public static Container waitContainer(Container cont, ComponentChooser chooser, int index)
Waits Container in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- Container instance.
- Throws:
TimeoutExpiredException
-
waitContainer
public static Container waitContainer(Container cont, ComponentChooser chooser)
Waits 0'th Container in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- Container instance.
- Throws:
TimeoutExpiredException
-
waitContainer
public static Container waitContainer(Container cont, int index)
Waits Container in container.- Parameters:
cont
- Container to search component in.index
- Ordinal component index.- Returns:
- Container instance.
- Throws:
TimeoutExpiredException
-
waitContainer
public static Container waitContainer(Container cont)
Waits 0'th Container in container.- Parameters:
cont
- Container to search component in.- Returns:
- Container instance.
- Throws:
TimeoutExpiredException
-
setTimeouts
public void setTimeouts(Timeouts timeouts)
Description copied from interface:Timeoutable
Defines current timeouts.- Specified by:
setTimeouts
in interfaceTimeoutable
- Overrides:
setTimeouts
in classComponentOperator
- Parameters:
timeouts
- A collection of timeout assignments.- See Also:
Timeoutable.getTimeouts()
-
getTimeouts
public Timeouts getTimeouts()
Description copied from interface:Timeoutable
Return current timeouts.- Specified by:
getTimeouts
in interfaceTimeoutable
- Overrides:
getTimeouts
in classComponentOperator
- Returns:
- the collection of current timeout assignments.
- See Also:
Timeoutable.setTimeouts(org.netbeans.jemmy.Timeouts)
-
setOutput
public void setOutput(TestOut out)
Description copied from interface:Outputable
Defines print output streams or writers.- Specified by:
setOutput
in interfaceOutputable
- Overrides:
setOutput
in classComponentOperator
- Parameters:
out
- Identify the streams or writers used for print output.- See Also:
Outputable.getOutput()
-
getOutput
public TestOut getOutput()
Description copied from interface:Outputable
Returns print output streams or writers.- Specified by:
getOutput
in interfaceOutputable
- Overrides:
getOutput
in classComponentOperator
- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
Outputable.setOutput(org.netbeans.jemmy.TestOut)
-
findSubComponent
public Component findSubComponent(ComponentChooser chooser, int index)
Searches for a subcomponent.- Parameters:
chooser
- a chooser specifying searching criteria.index
- Ordinal component index.- Returns:
- Component instance.
-
findSubComponent
public Component findSubComponent(ComponentChooser chooser)
Searches for a subcomponent.- Parameters:
chooser
- a chooser specifying searching criteria.- Returns:
- Component instance.
-
waitSubComponent
public Component waitSubComponent(ComponentChooser chooser, int index)
Waits for a subcomponent.- Parameters:
chooser
- a chooser specifying searching criteria.index
- Ordinal component index.- Returns:
- Component instance.
-
waitSubComponent
public Component waitSubComponent(ComponentChooser chooser)
Waits for a subcomponent.- Parameters:
chooser
- a chooser specifying searching criteria.- Returns:
- Component instance.
-
createSubOperator
public ComponentOperator createSubOperator(ComponentChooser chooser, int index)
Waits for a subcomponent and creates an operator.- Parameters:
chooser
- a chooser specifying searching criteria.index
- Ordinal component index.- Returns:
- Component instance.
-
createSubOperator
public ComponentOperator createSubOperator(ComponentChooser chooser)
Waits for a subcomponent and creates an operator.- Parameters:
chooser
- a chooser specifying searching criteria.- Returns:
- Component instance.
-
add
public Component add(Component component, int i)
MapsContainer.add(Component, int)
through queue
-
add
public void add(Component component, Object object)
MapsContainer.add(Component, Object)
through queue
-
add
public void add(Component component, Object object, int i)
MapsContainer.add(Component, Object, int)
through queue
-
add
public Component add(String string, Component component)
MapsContainer.add(String, Component)
through queue
-
addContainerListener
public void addContainerListener(ContainerListener containerListener)
MapsContainer.addContainerListener(ContainerListener)
through queue
-
findComponentAt
public Component findComponentAt(int i, int i1)
MapsContainer.findComponentAt(int, int)
through queue
-
findComponentAt
public Component findComponentAt(Point point)
MapsContainer.findComponentAt(Point)
through queue
-
getComponent
public Component getComponent(int i)
MapsContainer.getComponent(int)
through queue
-
getComponentCount
public int getComponentCount()
MapsContainer.getComponentCount()
through queue
-
getComponents
public Component[] getComponents()
MapsContainer.getComponents()
through queue
-
getInsets
public Insets getInsets()
MapsContainer.getInsets()
through queue
-
getLayout
public LayoutManager getLayout()
MapsContainer.getLayout()
through queue
-
isAncestorOf
public boolean isAncestorOf(Component component)
MapsContainer.isAncestorOf(Component)
through queue
-
paintComponents
public void paintComponents(Graphics graphics)
MapsContainer.paintComponents(Graphics)
through queue
-
printComponents
public void printComponents(Graphics graphics)
MapsContainer.printComponents(Graphics)
through queue
-
remove
public void remove(int i)
MapsContainer.remove(int)
through queue
-
remove
public void remove(Component component)
MapsContainer.remove(Component)
through queue
-
removeAll
public void removeAll()
MapsContainer.removeAll()
through queue
-
removeContainerListener
public void removeContainerListener(ContainerListener containerListener)
MapsContainer.removeContainerListener(ContainerListener)
through queue
-
setLayout
public void setLayout(LayoutManager layoutManager)
MapsContainer.setLayout(LayoutManager)
through queue
-
-