EchoPoint
1.0

echopoint
Class SubmitButton

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.AbstractButton
          extended bynextapp.echo.Button
              extended byechopoint.PushButton
                  extended byechopoint.SubmitButton
All Implemented Interfaces:
Borderable, MouseCursorable, ReflectionSetter, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport, ValidationSubmitter

public class SubmitButton
extends PushButton

The SubmitButton class is an implementation of PushButton component that allows posting data to another web URI.

Author:
Brad Baker
See Also:
Serialized Form

Nested Class Summary
static class SubmitButton.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String METHOD_CHANGED_PROPERTY
           
static int METHOD_GET
          Use HTTP GET when submitting the data
static int METHOD_POST
          Use HTTP POST when submitting the data
static java.lang.String PARAMETER_CHANGED_PROPERTY
           
static java.lang.String STYLE_METHOD
          A style constant for the Method property.
static java.lang.String STYLE_URI
          A style constant for the URI property.
static java.lang.String URI_CHANGED_PROPERTY
           
 
Fields inherited from class echopoint.PushButton
RENDERING_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo.AbstractButton
ACTION_COMMAND_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, ICON_TEXT_MARGIN_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, ROLLOVER_BACKGROUND_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_FONT_CHANGED_PROPERTY, ROLLOVER_FOREGROUND_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_HORIZONTAL_TEXT_POSITION, STYLE_ICON_TEXT_MARGIN, STYLE_ROLLOVER_BACKGROUND, STYLE_ROLLOVER_ENABLED, STYLE_ROLLOVER_FONT, STYLE_ROLLOVER_FOREGROUND, STYLE_VERTICAL_ALIGNMENT, STYLE_VERTICAL_TEXT_POSITION, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface nextapp.echo.ToolTipSupport
TOOL_TIP_TEXT_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Borderable
BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_GROOVE, BORDER_INSET, BORDER_NONE, BORDER_OUTSET, BORDER_RIDGE, BORDER_SOLID, borderStyleSymbolics, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_BORDER_STYLE, STYLE_BOTTOM_BORDER_COLOR, STYLE_BOTTOM_BORDER_SIZE, STYLE_BOTTOM_BORDER_STYLE, STYLE_LEFT_BORDER_COLOR, STYLE_LEFT_BORDER_SIZE, STYLE_LEFT_BORDER_STYLE, STYLE_RIGHT_BORDER_COLOR, STYLE_RIGHT_BORDER_SIZE, STYLE_RIGHT_BORDER_STYLE, STYLE_TOP_BORDER_COLOR, STYLE_TOP_BORDER_SIZE, STYLE_TOP_BORDER_STYLE
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Fields inherited from interface echopoint.validation.ValidationSubmitter
RULESETS_RUN_ALL, RULESETS_RUN_DEFAULT
 
Constructor Summary
SubmitButton()
          Creates an SubmitButton with no text or icon.
SubmitButton(java.lang.String uri, nextapp.echo.ImageReference icon)
          Creates an SubmitButton with an icon.
SubmitButton(java.lang.String uri, java.lang.String text)
          Creates an SubmitButton with text.
SubmitButton(java.lang.String uri, java.lang.String text, nextapp.echo.ImageReference icon)
          Creates an SubmitButton with text and an icon.
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String value)
          Adds a parameters (name=value pair) that will be submited to the web URI.
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 int getMethod()
          Returns the method in action.
 java.lang.String getParameter(java.lang.String name)
          Returns the a single parameter value, keyed by name.
 java.lang.String[] getParameterNames()
          Returns the names of the parameters added to the component
 java.util.Map getParameters()
          Returns the Map of parameters, keyed by name.
 java.lang.String getURI()
          Returns the URI that will be submitted to if the button is pressed
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setMethod(int newValue)
          Sets the method to be used when submitting data.
 void setURI(java.lang.String newURI)
          Sets the web URI that will be submitted to if the button is pressed
 
Methods inherited from class echopoint.PushButton
getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getMouseCursor, getMouseCursorURI, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getRunOptions, getToolTipPopUp, getToolTipText, getTopBorderColor, getTopBorderSize, getTopBorderStyle, isComplexRendering, isValidationEnabled, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setComplexRendering, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setMouseCursor, setMouseCursorURI, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setRunOptions, setToolTipText, setTopBorderColor, setTopBorderSize, setTopBorderStyle, setValidationEnabled, validate
 
Methods inherited from class nextapp.echo.AbstractButton
addActionListener, addChangeListener, addItemListener, doAction, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextMargin, getModel, getRolloverBackground, getRolloverFont, getRolloverForeground, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getText, getVerticalAlignment, getVerticalTextPosition, hasActionListeners, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextMargin, setModel, setRolloverBackground, setRolloverEnabled, setRolloverFont, setRolloverForeground, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_METHOD

public static final java.lang.String STYLE_METHOD
A style constant for the Method property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_URI

public static final java.lang.String STYLE_URI
A style constant for the URI property. Values of this key must be of type String

See Also:
Constant Field Values

URI_CHANGED_PROPERTY

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

METHOD_CHANGED_PROPERTY

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

PARAMETER_CHANGED_PROPERTY

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

METHOD_POST

public static final int METHOD_POST
Use HTTP POST when submitting the data

See Also:
Constant Field Values

METHOD_GET

public static final int METHOD_GET
Use HTTP GET when submitting the data

See Also:
Constant Field Values
Constructor Detail

SubmitButton

public SubmitButton()
Creates an SubmitButton with no text or icon.


SubmitButton

public SubmitButton(java.lang.String uri,
                    nextapp.echo.ImageReference icon)
Creates an SubmitButton with an icon.


SubmitButton

public SubmitButton(java.lang.String uri,
                    java.lang.String text)
Creates an SubmitButton with text.


SubmitButton

public SubmitButton(java.lang.String uri,
                    java.lang.String text,
                    nextapp.echo.ImageReference icon)
Creates an SubmitButton with text and an icon.

Method Detail

applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Specified by:
applyStyle in interface Borderable
Overrides:
applyStyle in class PushButton
See Also:
Borderable.applyStyle(nextapp.echo.Style)

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Adds a parameters (name=value pair) that will be submited to the web URI.


getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the a single parameter value, keyed by name.


getParameterNames

public java.lang.String[] getParameterNames()
Returns the names of the parameters added to the component


getParameters

public java.util.Map getParameters()
Returns the Map of parameters, keyed by name.


getURI

public java.lang.String getURI()
Returns the URI that will be submitted to if the button is pressed


setURI

public void setURI(java.lang.String newURI)
Sets the web URI that will be submitted to if the button is pressed


getMethod

public int getMethod()
Returns the method in action. This will be either METHOD_POST or METHOD_GET


setMethod

public void setMethod(int newValue)
Sets the method to be used when submitting data. This can be either METHOD_POST or METHOD_GET

Parameters:
newValue - - can be either METHOD_POST or METHOD_GET

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Overrides:
set in class PushButton
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0