Package org.netbeans.jemmy.operators
Class ContainerOperator<T extends java.awt.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 java.awt.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(java.awt.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 java.awt.Component
add(java.awt.Component component)
MapsContainer.add(Component)
through queuejava.awt.Component
add(java.awt.Component component, int i)
MapsContainer.add(Component, int)
through queuevoid
add(java.awt.Component component, java.lang.Object object)
MapsContainer.add(Component, Object)
through queuevoid
add(java.awt.Component component, java.lang.Object object, int i)
MapsContainer.add(Component, Object, int)
through queuejava.awt.Component
add(java.lang.String string, java.awt.Component component)
MapsContainer.add(String, Component)
through queuevoid
addContainerListener(java.awt.event.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.java.awt.Component
findComponentAt(int i, int i1)
MapsContainer.findComponentAt(int, int)
through queuejava.awt.Component
findComponentAt(java.awt.Point point)
MapsContainer.findComponentAt(Point)
through queuestatic java.awt.Container
findContainer(java.awt.Container cont)
Searches 0'th Container in container.static java.awt.Container
findContainer(java.awt.Container cont, int index)
Searches Container in container.static java.awt.Container
findContainer(java.awt.Container cont, ComponentChooser chooser)
Searches 0'th Container in container.static java.awt.Container
findContainer(java.awt.Container cont, ComponentChooser chooser, int index)
Searches Container in container.static java.awt.Container
findContainerUnder(java.awt.Component comp)
Searches Container object which component lies on.static java.awt.Container
findContainerUnder(java.awt.Component comp, ComponentChooser chooser)
Searches Container object which component lies on.java.awt.Component
findSubComponent(ComponentChooser chooser)
Searches for a subcomponent.java.awt.Component
findSubComponent(ComponentChooser chooser, int index)
Searches for a subcomponent.java.awt.Component
getComponent(int i)
MapsContainer.getComponent(int)
through queueint
getComponentCount()
MapsContainer.getComponentCount()
through queuejava.awt.Component[]
getComponents()
MapsContainer.getComponents()
through queuejava.awt.Insets
getInsets()
MapsContainer.getInsets()
through queuejava.awt.LayoutManager
getLayout()
MapsContainer.getLayout()
through queueTestOut
getOutput()
Returns print output streams or writers.Timeouts
getTimeouts()
Return current timeouts.boolean
isAncestorOf(java.awt.Component component)
MapsContainer.isAncestorOf(Component)
through queuevoid
paintComponents(java.awt.Graphics graphics)
MapsContainer.paintComponents(Graphics)
through queuevoid
printComponents(java.awt.Graphics graphics)
MapsContainer.printComponents(Graphics)
through queuevoid
remove(int i)
MapsContainer.remove(int)
through queuevoid
remove(java.awt.Component component)
MapsContainer.remove(Component)
through queuevoid
removeAll()
MapsContainer.removeAll()
through queuevoid
removeContainerListener(java.awt.event.ContainerListener containerListener)
MapsContainer.removeContainerListener(ContainerListener)
through queuevoid
setLayout(java.awt.LayoutManager layoutManager)
MapsContainer.setLayout(LayoutManager)
through queuevoid
setOutput(TestOut out)
Defines print output streams or writers.void
setTimeouts(Timeouts timeouts)
Defines current timeouts.static java.awt.Container
waitContainer(java.awt.Container cont)
Waits 0'th Container in container.static java.awt.Container
waitContainer(java.awt.Container cont, int index)
Waits Container in container.static java.awt.Container
waitContainer(java.awt.Container cont, ComponentChooser chooser)
Waits 0'th Container in container.static java.awt.Container
waitContainer(java.awt.Container cont, ComponentChooser chooser, int index)
Waits Container in container.java.awt.Component
waitSubComponent(ComponentChooser chooser)
Waits for a subcomponent.java.awt.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(java.awt.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 java.awt.Container findContainer(java.awt.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 java.awt.Container findContainer(java.awt.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 java.awt.Container findContainer(java.awt.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 java.awt.Container findContainer(java.awt.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 java.awt.Container findContainerUnder(java.awt.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 java.awt.Container findContainerUnder(java.awt.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 java.awt.Container waitContainer(java.awt.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 java.awt.Container waitContainer(java.awt.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 java.awt.Container waitContainer(java.awt.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 java.awt.Container waitContainer(java.awt.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 java.awt.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 java.awt.Component findSubComponent(ComponentChooser chooser)
Searches for a subcomponent.- Parameters:
chooser
- a chooser specifying searching criteria.- Returns:
- Component instance.
-
waitSubComponent
public java.awt.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 java.awt.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 java.awt.Component add(java.awt.Component component)
MapsContainer.add(Component)
through queue
-
add
public java.awt.Component add(java.awt.Component component, int i)
MapsContainer.add(Component, int)
through queue
-
add
public void add(java.awt.Component component, java.lang.Object object)
MapsContainer.add(Component, Object)
through queue
-
add
public void add(java.awt.Component component, java.lang.Object object, int i)
MapsContainer.add(Component, Object, int)
through queue
-
add
public java.awt.Component add(java.lang.String string, java.awt.Component component)
MapsContainer.add(String, Component)
through queue
-
addContainerListener
public void addContainerListener(java.awt.event.ContainerListener containerListener)
MapsContainer.addContainerListener(ContainerListener)
through queue
-
findComponentAt
public java.awt.Component findComponentAt(int i, int i1)
MapsContainer.findComponentAt(int, int)
through queue
-
findComponentAt
public java.awt.Component findComponentAt(java.awt.Point point)
MapsContainer.findComponentAt(Point)
through queue
-
getComponent
public java.awt.Component getComponent(int i)
MapsContainer.getComponent(int)
through queue
-
getComponentCount
public int getComponentCount()
MapsContainer.getComponentCount()
through queue
-
getComponents
public java.awt.Component[] getComponents()
MapsContainer.getComponents()
through queue
-
getInsets
public java.awt.Insets getInsets()
MapsContainer.getInsets()
through queue
-
getLayout
public java.awt.LayoutManager getLayout()
MapsContainer.getLayout()
through queue
-
isAncestorOf
public boolean isAncestorOf(java.awt.Component component)
MapsContainer.isAncestorOf(Component)
through queue
-
paintComponents
public void paintComponents(java.awt.Graphics graphics)
MapsContainer.paintComponents(Graphics)
through queue
-
printComponents
public void printComponents(java.awt.Graphics graphics)
MapsContainer.printComponents(Graphics)
through queue
-
remove
public void remove(int i)
MapsContainer.remove(int)
through queue
-
remove
public void remove(java.awt.Component component)
MapsContainer.remove(Component)
through queue
-
removeAll
public void removeAll()
MapsContainer.removeAll()
through queue
-
removeContainerListener
public void removeContainerListener(java.awt.event.ContainerListener containerListener)
MapsContainer.removeContainerListener(ContainerListener)
through queue
-
setLayout
public void setLayout(java.awt.LayoutManager layoutManager)
MapsContainer.setLayout(LayoutManager)
through queue
-
-