EchoPoint API - 3.0.0b5
App Webcontainer

echopoint
Class PushButton

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by echopoint.internal.AbstractContainer
          extended by echopoint.PushButton
All Implemented Interfaces:
Serializable, RenderIdSupport

public class PushButton
extends AbstractContainer

A button component that by default appears like the system and browser default. Style configuration allows it to appear more like a Button (although without supporting a background image).

The following code shows sample usage of this component.

   import echopoint.PushButton;

     ...
     final PushButton button = new PushButton( "Push Button" );
     button.setToolTipText( "Push button to see effect." );
     button.setWidth( 200 );
     button.setActionCommand( "buttonClicked" );
     button.addActionListener( ... );

     final Column column = new Columnn();
     column.add( button );
 

Version:
$Id: PushButton.java 125 2009-02-27 18:51:23Z sptrakesh $
Author:
Rakesh 2009-02-24
See Also:
Serialized Form

Field Summary
static String PROPERTY_ACTION_COMMAND
          The property for storing the action command associated with an action event for the image.
static String PROPERTY_TEXT
          The property for the text displayed in the button.
static String PROPERTY_TOOL_TIP_TEXT
          The property for the tooltip displayed when hovering over the button.
 
Fields inherited from class echopoint.internal.AbstractContainer
ACTION_COMMAND_PROPERTY, ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_ACTION, PROPERTY_ALIGNMENT, PROPERTY_BACKGROUND_IMAGE, PROPERTY_BORDER, PROPERTY_HEIGHT, PROPERTY_INSETS, PROPERTY_WIDTH
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
PushButton()
          Default constructor.
PushButton(String text)
          Create a new button instance with the specified text.
 
Method Summary
 void addActionListener(ActionListener listener)
          Add the specified action listener to this component.
 String getActionCommand()
          Return the value of PROPERTY_ACTION_COMMAND property.
 ImageReference getBackgroundImage()
          Over-ridden to always return null since this component does not support background images.
 String getText()
          Return the value of PROPERTY_TEXT property used to display text in the button.
 String getToolTipText()
          Return the value of PROPERTY_TOOL_TIP_TEXT property used to display text in the button.
 boolean isValidChild(Component component)
          Always returns false since push button does not allow child components.
 void processInput(String inputName, Object inputValue)
          
 void removeActionListener(ActionListener listener)
          Remove the specified action listener from the component.
 void setActionCommand(String command)
          Set the value of PROPERTY_ACTION_COMMAND property.
 void setBackgroundImage(ImageReference backgroundImage)
          Over-ridden to not do anything since this component does not support background images.
 void setText(String command)
          Set the value of PROPERTY_TEXT property.
 void setToolTipText(String command)
          Set the value of PROPERTY_TOOL_TIP_TEXT property.
 
Methods inherited from class echopoint.internal.AbstractContainer
fireActionPerformed, getAlignment, getBorder, getHeight, getInsets, getWidth, hasActionListeners, setAlignment, setBorder, setHeight, setInsets, setWidth
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_ACTION_COMMAND

public static final String PROPERTY_ACTION_COMMAND
The property for storing the action command associated with an action event for the image.

See Also:
Constant Field Values

PROPERTY_TEXT

public static final String PROPERTY_TEXT
The property for the text displayed in the button.

See Also:
Constant Field Values

PROPERTY_TOOL_TIP_TEXT

public static final String PROPERTY_TOOL_TIP_TEXT
The property for the tooltip displayed when hovering over the button.

See Also:
Constant Field Values
Constructor Detail

PushButton

public PushButton()
Default constructor. No special actions needed.


PushButton

public PushButton(String text)
Create a new button instance with the specified text.

Parameters:
text - The text to display in the button.
Method Detail

getActionCommand

public String getActionCommand()
Return the value of PROPERTY_ACTION_COMMAND property.

Returns:
The action command value.

setActionCommand

public void setActionCommand(String command)
Set the value of PROPERTY_ACTION_COMMAND property.

Parameters:
command - The action command value to set.

getText

public String getText()
Return the value of PROPERTY_TEXT property used to display text in the button.

Returns:
The action command value.

setText

public void setText(String command)
Set the value of PROPERTY_TEXT property.

Parameters:
command - The action command value to set.

getToolTipText

public String getToolTipText()
Return the value of PROPERTY_TOOL_TIP_TEXT property used to display text in the button.

Returns:
The action command value.

setToolTipText

public void setToolTipText(String command)
Set the value of PROPERTY_TOOL_TIP_TEXT property.

Parameters:
command - The action command value to set.

getBackgroundImage

public ImageReference getBackgroundImage()
Over-ridden to always return null since this component does not support background images.

Overrides:
getBackgroundImage in class AbstractContainer
Returns:
Returns null.

setBackgroundImage

public void setBackgroundImage(ImageReference backgroundImage)
Over-ridden to not do anything since this component does not support background images.

Overrides:
setBackgroundImage in class AbstractContainer
Parameters:
backgroundImage - The backgroundImage style to apply.

isValidChild

public boolean isValidChild(Component component)
Always returns false since push button does not allow child components.

Overrides:
isValidChild in class Component
Parameters:
component - The component to check.
Returns:
Returns false.

addActionListener

public void addActionListener(ActionListener listener)
Add the specified action listener to this component.

Overrides:
addActionListener in class AbstractContainer
Parameters:
listener - The action listener to add.
See Also:
Component.firePropertyChange(String, Object, Object)

removeActionListener

public void removeActionListener(ActionListener listener)
Remove the specified action listener from the component.

Overrides:
removeActionListener in class AbstractContainer
Parameters:
listener - The listener that is to be removed.
See Also:
Component.firePropertyChange(String, Object, Object)

processInput

public void processInput(String inputName,
                         Object inputValue)

Overrides:
processInput in class Component

EchoPoint API - 3.0.0b5
App Webcontainer