NextApp Echo
App Container 1.1.4

nextapp.echoservlet.ui
Class AbstractButtonUI

java.lang.Object
  extended bynextapp.echoservlet.ComponentPeer
      extended bynextapp.echoservlet.ui.AbstractButtonUI
All Implemented Interfaces:
Alignment, ClientActionProducer, java.util.EventListener, nextapp.echo.event.ImageUpdateListener, java.beans.PropertyChangeListener, java.io.Serializable
Direct Known Subclasses:
ButtonUI, ToggleButtonUI

public abstract class AbstractButtonUI
extends ComponentPeer
implements Alignment, ClientActionProducer, nextapp.echo.event.ImageUpdateListener, java.beans.PropertyChangeListener

A base peer class for components derived from AbstractButton.

See Also:
Serialized Form

Field Summary
protected static java.lang.String ICON_IMAGE
          A constant used to identify the default icon for the in the ImageManager.
protected  ImageManager imageManager
          The image manager that will handle images for the button, including custom state images for toggle buttons.
protected  boolean renderedActive
          Indicates whether the button was most recently rendered enabled.
protected static java.lang.String ROLLOVER_ICON_IMAGE
          A constant used to identify the rollover icon for the in the ImageManager.
 
Constructor Summary
AbstractButtonUI()
          Default constructor.
 
Method Summary
 void clientAction(java.lang.String action)
          Called when the user causes an action from the client.
 int getHorizontalAlignment()
          Returns the horizontal alignment of a represented component.
abstract  java.lang.String getScriptAction(RenderingContext rc)
          Returns JavaScript code that will be executed when the button is clicked.
 int getVerticalAlignment()
          Returns the vertical alignment of a represented component.
 void imageUpdate(nextapp.echo.event.ImageUpdateEvent e)
          Invoked when an image update change occurs.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void registered()
          Called when the component is registered.
 void render(RenderingContext rc, Element parent)
          A method that should be overridden for the ComponentPeer to produce HTML output.
 void unregistered()
          Called when the component is unregistered.
 
Methods inherited from class nextapp.echoservlet.ComponentPeer
addAncillaryService, generateId, getBackground, getChildCount, getChildren, getComponent, getFocusedElementId, getFont, getForeground, getId, getInstancePeer, getParent, getPeer, getTabIndex, redraw, removeAncillaryService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renderedActive

protected boolean renderedActive
Indicates whether the button was most recently rendered enabled.


imageManager

protected ImageManager imageManager
The image manager that will handle images for the button, including custom state images for toggle buttons.


ICON_IMAGE

protected static final java.lang.String ICON_IMAGE
A constant used to identify the default icon for the in the ImageManager.

See Also:
Constant Field Values

ROLLOVER_ICON_IMAGE

protected static final java.lang.String ROLLOVER_ICON_IMAGE
A constant used to identify the rollover icon for the in the ImageManager.

See Also:
Constant Field Values
Constructor Detail

AbstractButtonUI

public AbstractButtonUI()
Default constructor.

Method Detail

clientAction

public void clientAction(java.lang.String action)
Description copied from interface: ClientActionProducer
Called when the user causes an action from the client.

Specified by:
clientAction in interface ClientActionProducer
Parameters:
action - The action command generated by the client.
See Also:
ClientActionProducer.clientAction(java.lang.String)

getScriptAction

public abstract java.lang.String getScriptAction(RenderingContext rc)
Returns JavaScript code that will be executed when the button is clicked. On plain Buttons, this will normally send input to the server. On ToggleButtons, the selection state will change and input may also be sent to the server if desired by the application.

Parameters:
rc - The RenderingContext being used for the rendering of the button.
Returns:
A JavaScript method call that will be executed when the button is clicked. The returned string must be valid HTML.

getHorizontalAlignment

public int getHorizontalAlignment()
Description copied from interface: Alignment
Returns the horizontal alignment of a represented component.

Specified by:
getHorizontalAlignment in interface Alignment
Returns:
The horizontal alignment of a represented component, one of the following values:
  • EchoConstants.LEFT
  • EchoConstants.CENTER
  • EchoConstants.RIGHT
  • 0 (use default)
See Also:
Alignment.getHorizontalAlignment()

getVerticalAlignment

public int getVerticalAlignment()
Description copied from interface: Alignment
Returns the vertical alignment of a represented component.

Specified by:
getVerticalAlignment in interface Alignment
Returns:
The vertical alignment of a represented component, one of the following values:
  • EchoConstants.TOP
  • EchoConstants.CENTER
  • EchoConstants.BOTTOM
  • 0 (use default)
See Also:
Alignment.getVerticalAlignment()

imageUpdate

public void imageUpdate(nextapp.echo.event.ImageUpdateEvent e)
Description copied from interface: nextapp.echo.event.ImageUpdateListener
Invoked when an image update change occurs.

Specified by:
imageUpdate in interface nextapp.echo.event.ImageUpdateListener
Parameters:
e - The event describing the image update.
See Also:
ImageUpdateListener.imageUpdate(ImageUpdateEvent)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(PropertyChangeEvent)

registered

public void registered()
Description copied from class: ComponentPeer
Called when the component is registered. This method should be overridden if necessary.

Overrides:
registered in class ComponentPeer
See Also:
ComponentPeer.registered()

render

public void render(RenderingContext rc,
                   Element parent)
Description copied from class: ComponentPeer
A method that should be overridden for the ComponentPeer to produce HTML output.

Overrides:
render in class ComponentPeer
Parameters:
rc - A rendering context provided by the Connection.
parent - The element that will contain content rendered by this ComponentPeer.
See Also:
ComponentPeer.render(RenderingContext, Element)

unregistered

public void unregistered()
Description copied from class: ComponentPeer
Called when the component is unregistered. This method should be overridden if necessary.

Overrides:
unregistered in class ComponentPeer
See Also:
ComponentPeer.unregistered()

NextApp Echo
App Container 1.1.4