org.uispec4j
Class AbstractButton

java.lang.Object
  extended by org.uispec4j.AbstractUIComponent
      extended by org.uispec4j.AbstractSwingUIComponent
          extended by org.uispec4j.AbstractButton
All Implemented Interfaces:
TooltipComponent, UIComponent
Direct Known Subclasses:
Button, CheckBox, RadioButton, ToggleButton

public abstract class AbstractButton
extends AbstractSwingUIComponent

Base class for button-like components (toggle buttons, check boxes, etc.)


Constructor Summary
protected AbstractButton(javax.swing.AbstractButton abstractButton)
           
 
Method Summary
 void click()
           
 java.lang.String getLabel()
          Returns the label displayed on this component, or null if this has no sense for this kind of components.
 Assertion iconEquals(javax.swing.Icon expected)
          Checks the icon displayed by the component.
 Assertion textEquals(java.lang.String text)
           
 Trigger triggerClick()
           
 
Methods inherited from class org.uispec4j.AbstractSwingUIComponent
getAwtComponent, tooltipContains, tooltipEquals
 
Methods inherited from class org.uispec4j.AbstractUIComponent
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, 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
 
Methods inherited from interface org.uispec4j.UIComponent
getDescriptionTypeName
 

Constructor Detail

AbstractButton

protected AbstractButton(javax.swing.AbstractButton abstractButton)
Method Detail

click

public void click()

textEquals

public Assertion textEquals(java.lang.String text)

iconEquals

public Assertion iconEquals(javax.swing.Icon expected)
Checks the icon displayed by the component. Please note that equals() not being defined for Icon implementations, you will have to provide a pointer to the actual Icon instance that is used in the production code. This make this method mostly suited to unit testing.


getLabel

public java.lang.String getLabel()
Description copied from interface: UIComponent
Returns the label displayed on this component, or null if this has no sense for this kind of components.

Specified by:
getLabel in interface UIComponent
Overrides:
getLabel in class AbstractUIComponent

triggerClick

public Trigger triggerClick()


Copyright © 2004-2010. All Rights Reserved.