org.eclipse.jubula.rc.swing.swing.implclasses
Class JMenuBarImplClass

java.lang.Object
  extended by org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
      extended by org.eclipse.jubula.rc.swing.swing.implclasses.JMenuBarImplClass
All Implemented Interfaces:
org.eclipse.jubula.rc.common.implclasses.IBaseImplementationClass, IImplementationClass

public class JMenuBarImplClass
extends AbstractSwingImplClass

Implementation class for JMenuBar.

Created:
12.04.2005

Field Summary
 
Fields inherited from class org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
INDEX_LIST_SEP_CHAR, POS_UNI_PERCENT, POS_UNIT_PIXEL, RENDERER_FALLBACK_TEXT_GETTER_METHOD_1, RENDERER_FALLBACK_TEXT_GETTER_METHOD_2, VALUE_SEPARATOR
 
Constructor Summary
JMenuBarImplClass()
           
 
Method Summary
 javax.swing.JComponent getComponent()
          
protected  java.lang.String getText()
          Get a String representation of the "text" of the component.
 java.lang.String[] getTextArrayFromComponent()
          Returns a descriptive text array that represents the given gui component.
 void selectMenuItem(java.lang.String[] menuItem, java.lang.String operator)
          Tries to select a menu item in a menu.
 void selectMenuItem(java.lang.String menuItem, java.lang.String operator)
          Tries to select a menu item in a menu.
 void selectMenuItemByIndexpath(int[] path)
          Tries to select a menu item in a menu.
 void selectMenuItemByIndexpath(java.lang.String path)
          Tries to select a menu item in a menu.
 void setComponent(java.lang.Object graphicsComponent)
          Set the component the methods this implementation class implements have to work with.
 void verifyEnabled(java.lang.String[] menuItem, java.lang.String operator, boolean enabled)
          Checks if the specified menu item is enabled.
 void verifyEnabled(java.lang.String menuItem, java.lang.String operator, boolean enabled)
          Checks if the specified menu item is enabled.
 void verifyEnabledByIndexpath(int[] menuItem, boolean enabled)
          Checks if the specified menu item is enabled.
 void verifyEnabledByIndexpath(java.lang.String menuItem, boolean enabled)
          Checks if the specified menu item is enabled.
 void verifyExists(java.lang.String[] menuItem, java.lang.String operator, boolean exists)
          Verifies if the specified menu item exists
 void verifyExists(java.lang.String menuItem, java.lang.String operator, boolean exists)
          Verifies if the specified menu item exists
 void verifyExistsByIndexpath(int[] menuItem, boolean exists)
          Verifies if the specified menu item exists
 void verifyExistsByIndexpath(java.lang.String menuItem, boolean exists)
          Verifies if the specified menu item exists
 void verifySelected(java.lang.String[] menuItem, java.lang.String operator, boolean selected)
          Checks if the specified menu item is selected.
 void verifySelected(java.lang.String menuItem, java.lang.String operator, boolean selected)
          Checks if the specified menu item is selected.
 void verifySelectedByIndexpath(int[] menuItem, boolean selected)
          Checks if the specified menu item is selected.
 void verifySelectedByIndexpath(java.lang.String menuItem, boolean selected)
          Checks if the specified menu item is selected.
 void waitForComponent(int timeout, int delay)
          implementation for "wait for component"
 
Methods inherited from class org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
gdClick, gdClickDirect, gdDrag, gdDrop, gdPopupSelectByIndexPath, gdPopupSelectByIndexPath, gdPopupSelectByIndexPath, gdPopupSelectByIndexPath, gdPopupSelectByTextPath, gdPopupSelectByTextPath, gdPopupSelectByTextPath, gdPopupSelectByTextPath, gdPopupVerifyEnabledByIndexPath, gdPopupVerifyEnabledByIndexPath, gdPopupVerifyEnabledByTextPath, gdPopupVerifyEnabledByTextPath, gdPopupVerifyExistsByIndexPath, gdPopupVerifyExistsByIndexPath, gdPopupVerifyExistsByTextPath, gdPopupVerifyExistsByTextPath, gdPopupVerifySelectedByIndexPath, gdPopupVerifySelectedByIndexPath, gdPopupVerifySelectedByTextPath, gdPopupVerifySelectedByTextPath, gdShowText, gdStorePropertyValue, gdVerifyEnabled, gdVerifyExists, gdVerifyFocus, gdVerifyProperty, gdWaitForComponent, getClickModifier, getEventThreadQueuer, getRenderedText, getRenderedText, getRobot, getRobotFactory, hasFocus, highLight, lowLight, pressOrReleaseModifiers, resolveRenderedText, showPopup, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMenuBarImplClass

public JMenuBarImplClass()
Method Detail

setComponent

public void setComponent(java.lang.Object graphicsComponent)
Set the component the methods this implementation class implements have to work with.
The methods are declared by the configuration file for supported components.

Parameters:
graphicsComponent - the component from the AUT
Notice: Every changes made to control affects the AUT.

getComponent

public javax.swing.JComponent getComponent()

Specified by:
getComponent in class AbstractSwingImplClass
Returns:
The component passed to the implementation class by calling IBaseImplementationClass.setComponent(Object)

waitForComponent

public void waitForComponent(int timeout,
                             int delay)
implementation for "wait for component"

Parameters:
timeout - the maximum amount of time to wait for the component
delay - the time to wait after the component is found

selectMenuItem

public void selectMenuItem(java.lang.String menuItem,
                           java.lang.String operator)
Tries to select a menu item in a menu.

Parameters:
menuItem - the menu item to select
operator - operator used for matching

selectMenuItem

public void selectMenuItem(java.lang.String[] menuItem,
                           java.lang.String operator)
Tries to select a menu item in a menu.

Parameters:
menuItem - the menu item to select
operator - operator used for matching

selectMenuItemByIndexpath

public void selectMenuItemByIndexpath(java.lang.String path)
Tries to select a menu item in a menu.

Parameters:
path - path to the menu item

selectMenuItemByIndexpath

public void selectMenuItemByIndexpath(int[] path)
Tries to select a menu item in a menu.

Parameters:
path - path to the menu item

verifyExists

public void verifyExists(java.lang.String menuItem,
                         java.lang.String operator,
                         boolean exists)
Verifies if the specified menu item exists

Parameters:
menuItem - the menu item to verifiy against
operator - operator used for matching
exists - should the menu item exist?

verifyExists

public void verifyExists(java.lang.String[] menuItem,
                         java.lang.String operator,
                         boolean exists)
Verifies if the specified menu item exists

Parameters:
menuItem - the menu item to verify against
operator - operator used for matching
exists - should the menu item exist?

verifyExistsByIndexpath

public void verifyExistsByIndexpath(java.lang.String menuItem,
                                    boolean exists)
Verifies if the specified menu item exists

Parameters:
menuItem - the menu item to verifiy against
exists - should the menu item exist?

verifyExistsByIndexpath

public void verifyExistsByIndexpath(int[] menuItem,
                                    boolean exists)
Verifies if the specified menu item exists

Parameters:
menuItem - the menu item to verify against
exists - should the menu item exist?

verifyEnabled

public void verifyEnabled(java.lang.String menuItem,
                          java.lang.String operator,
                          boolean enabled)
Checks if the specified menu item is enabled.

Parameters:
menuItem - the menu item as a text path to verify against
operator - operator used for matching
enabled - is the specified menu item enabled?

verifyEnabled

public void verifyEnabled(java.lang.String[] menuItem,
                          java.lang.String operator,
                          boolean enabled)
Checks if the specified menu item is enabled.

Parameters:
menuItem - the menu item to verify against
operator - operator used for matching
enabled - is the specified menu item enabled?

verifyEnabledByIndexpath

public void verifyEnabledByIndexpath(java.lang.String menuItem,
                                     boolean enabled)
Checks if the specified menu item is enabled.

Parameters:
menuItem - the menu item as a text path to verify against
enabled - is the specified menu item enabled?

verifyEnabledByIndexpath

public void verifyEnabledByIndexpath(int[] menuItem,
                                     boolean enabled)
Checks if the specified menu item is enabled.

Parameters:
menuItem - the menu item to verify against
enabled - is the specified menu item enabled?

verifySelected

public void verifySelected(java.lang.String menuItem,
                           java.lang.String operator,
                           boolean selected)
Checks if the specified menu item is selected.

Parameters:
menuItem - the menu item to verify against
operator - operator used for matching
selected - is the specified menu item selected?

verifySelected

public void verifySelected(java.lang.String[] menuItem,
                           java.lang.String operator,
                           boolean selected)
Checks if the specified menu item is selected.

Parameters:
menuItem - the menu item to verify against
operator - operator used for matching
selected - is the specified menu item selected?

verifySelectedByIndexpath

public void verifySelectedByIndexpath(java.lang.String menuItem,
                                      boolean selected)
Checks if the specified menu item is selected.

Parameters:
menuItem - the menu item to verify against
selected - is the specified menu item selected?

verifySelectedByIndexpath

public void verifySelectedByIndexpath(int[] menuItem,
                                      boolean selected)
Checks if the specified menu item is selected.

Parameters:
menuItem - the menu item to verify against
selected - is the specified menu item selected?

getTextArrayFromComponent

public java.lang.String[] getTextArrayFromComponent()
Returns a descriptive text array that represents the given gui component.
Descriptive texts can be received for example from buttons, labels and table headers. If text is obviously data (for example in text input components) then it is not considered a descriptive text.
If the component has no descriptive text then null, an empty array or an array with length one and null or an empty string as content has to be returned.

Returns:
array containing none, one or many texts representing the
gui component or null

getText

protected java.lang.String getText()
Description copied from class: AbstractSwingImplClass
Get a String representation of the "text" of the component. This String is used in all compare actions and all other places where a simple "as text" view is needed. This has to be replaced either with simple getText() calls on the components or by calls to the cell (or other) renderers of the component using getRenderedText()

Specified by:
getText in class AbstractSwingImplClass
Returns:
always null
See Also:
AbstractSwingImplClass.getText()