org.wings
Class SButton

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.SAbstractIconTextCompound
          extended by org.wings.SAbstractButton
              extended by org.wings.SButton
All Implemented Interfaces:
ItemSelectable, Serializable, Cloneable, LowLevelEventListener, Renderable
Direct Known Subclasses:
SMenuItem

public class SButton
extends SAbstractButton

Simple Button widget.

This is also a button for usage in a renderer (e.g STableCellRenderer). This button implementation encodes its action command into the low level event and fires the encoded action command and not the actual action command, if an low level event triggers a button press.

Author:
Armin Haaf
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.wings.SAbstractButton
actionCommand, CHECKBOX, IMAGE_BUTTON, RADIOBUTTON, RESET_BUTTON, SUBMIT_BUTTON
 
Fields inherited from class org.wings.SAbstractIconTextCompound
changeEvent, changeListener, DISABLED_ICON, DISABLED_SELECTED_ICON, ENABLED_ICON, ICON_COUNT, PRESSED_ICON, ROLLOVER_ICON, ROLLOVER_SELECTED_ICON, SELECTED_ICON, SELECTOR_SELECTED
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
SButton()
          Creates a button with no set text or icon.
SButton(Action action)
          Creates a button where properties are taken from the Action supplied.
SButton(SIcon i)
          Creates a button with a icon
SButton(String text)
          Creates a button with text.
SButton(String text, SIcon i)
          Creates a button with initial text and an icon.
 
Method Summary
 void fireFinalEvents()
          Internal event trigger used by CGs.
 String getSelectionParameter()
           
 boolean isSelected()
          Returns the state of the button.
 void processLowLevelEvent(String action, String[] values)
          Deliver low level/http events (parameters).
protected  void setGroup(SButtonGroup g)
          Add this button to a button group.
 
Methods inherited from class org.wings.SAbstractButton
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, doClick, fireActionPerformed, fireIntermediateEvents, getAction, getActionCommand, getActionListeners, getDeselectionParameter, getEventTarget, getGroup, getMnemonic, getToggleSelectionParameter, getType, isEpochCheckEnabled, isWordWrap, parseSelectionToggle, removeActionListener, setAction, setActionCommand, setCG, setEpochCheckEnabled, setEventTarget, setMnemonic, setParentFrame, setSelected, setType, setWordWrap
 
Methods inherited from class org.wings.SAbstractIconTextCompound
addChangeListener, addItemListener, delayEvents, fireItemStateChanged, fireStateChanged, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getSelectionBackground, getSelectionFont, getSelectionForeground, getText, getVerticalTextPosition, removeChangeListener, removeItemListener, setDisabledIcon, setDisabledSelectedIcon, setHorizontalTextPosition, setIcon, setIcons, setIconTextGap, setModel, setPressedIcon, setRolloverIcon, setRolloverSelectedIcon, setSelectedIcon, setSelectionBackground, setSelectionFont, setSelectionForeground, setText, setVerticalTextPosition, shouldDelayEvents
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addNotify, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, clone, fireComponentChangeEvent, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getCG, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getRequestURL, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, invite, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeNotify, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFocusTraversalIndex, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setPreferredSize, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, setVisible, toString, update, updateCG, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.wings.LowLevelEventListener
getLowLevelEventId, getName, isEnabled
 

Constructor Detail

SButton

public SButton(String text)
Creates a button with text.

Parameters:
text - the text of the button

SButton

public SButton(Action action)
Creates a button where properties are taken from the Action supplied.

Parameters:
action - the Action used to specify the new button

SButton

public SButton()
Creates a button with no set text or icon.


SButton

public SButton(SIcon i)
Creates a button with a icon

Parameters:
i - the Icon image to display on the button

SButton

public SButton(String text,
               SIcon i)
Creates a button with initial text and an icon.

Parameters:
text - the text of the button
i - the Icon image to display on the button
Method Detail

setGroup

protected void setGroup(SButtonGroup g)
Description copied from class: SAbstractButton
Add this button to a button group. This influences the event-prefix this button reports to the request dispatcher: it will change to the button group's prefix.

Overrides:
setGroup in class SAbstractButton

isSelected

public boolean isSelected()
Returns the state of the button. This can be true if the button is selected, otherwise false.

Overrides:
isSelected in class SAbstractIconTextCompound
Returns:
true if the button is selected, false if not

processLowLevelEvent

public void processLowLevelEvent(String action,
                                 String[] values)
Description copied from interface: LowLevelEventListener
Deliver low level/http events (parameters). The name-value-pairs of the HTTPRequest are considered low level events.

Specified by:
processLowLevelEvent in interface LowLevelEventListener
Overrides:
processLowLevelEvent in class SAbstractButton
Parameters:
action - the name-value-pair's name
values - the name-value-pair's values

fireFinalEvents

public void fireFinalEvents()
Description copied from class: SComponent
Internal event trigger used by CGs. This Method is called internal and should not be called directly

Specified by:
fireFinalEvents in interface LowLevelEventListener
Overrides:
fireFinalEvents in class SAbstractButton

getSelectionParameter

public String getSelectionParameter()
Overrides:
getSelectionParameter in class SAbstractButton


wingS Swings ;-)