org.uispec4j
Class MenuItem

java.lang.Object
  extended by org.uispec4j.AbstractUIComponent
      extended by org.uispec4j.MenuItem
All Implemented Interfaces:
UIComponent

public class MenuItem
extends AbstractUIComponent

Wrapper for menu items (commands or sub-menus) such as JMenu, JMenuItem or JPopupMenu.

A given MenuItem can be either a command, or a sub-menu containing other MenuItem components.


Field Summary
static java.lang.Class[] SWING_CLASSES
           
static java.lang.String TYPE_NAME
           
 
Constructor Summary
MenuItem(javax.swing.JMenuItem menu)
           
MenuItem(javax.swing.JPopupMenu menu)
           
 
Method Summary
 void click()
           
 Assertion contentEquals(java.lang.String... expectedNames)
           
 Assertion contentEquals(java.lang.String xmlContent)
           
 java.awt.Component getAwtComponent()
          Returns the Java GUI component represented by this object.
 java.lang.String getDescriptionTypeName()
          Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription().
 MenuItem getSubMenu(java.lang.String subMenuItem)
          Returns a submenu given its name, or raises an exception if it was not found.
 Trigger triggerClick()
           
 
Methods inherited from class org.uispec4j.AbstractUIComponent
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, getLabel, getName, getSubDescription, isEnabled, isVisible, pressKey, releaseKey, typeKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

SWING_CLASSES

public static final java.lang.Class[] SWING_CLASSES
Constructor Detail

MenuItem

public MenuItem(javax.swing.JMenuItem menu)

MenuItem

public MenuItem(javax.swing.JPopupMenu menu)
Method Detail

getDescriptionTypeName

public java.lang.String getDescriptionTypeName()
Description copied from interface: UIComponent
Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription().


getAwtComponent

public java.awt.Component getAwtComponent()
Description copied from interface: UIComponent
Returns the Java GUI component represented by this object.


click

public void click()

triggerClick

public Trigger triggerClick()

getSubMenu

public MenuItem getSubMenu(java.lang.String subMenuItem)
Returns a submenu given its name, or raises an exception if it was not found.


contentEquals

public Assertion contentEquals(java.lang.String... expectedNames)

contentEquals

public Assertion contentEquals(java.lang.String xmlContent)


Copyright © 2004-2010. All Rights Reserved.