echopoint
Class JavaScriptButton
java.lang.Object
nextapp.echo.AbstractComponent
nextapp.echo.AbstractButton
nextapp.echo.Button
echopoint.PushButton
echopoint.JavaScriptButton
- All Implemented Interfaces:
- Borderable, MouseCursorable, ToolTipPopUpSupport, ReflectionSetter, ValidationSubmitter, java.io.Serializable, Component, ToolTipSupport
public class JavaScriptButton
- extends PushButton
The JavaScriptButton
class is derived from
the PushButton
class.
This class will execute a supplied client side script when pressed.
If no script is provided, then this component acts exactly likes its base
PushButton class.
This component is useful for "running" any abitary client side scipt. For example
you could show an alert dialog "alert('What the story?')" or even open
disconnected client window "window.open('http://echopoint.sf.net')"
The script code itself is wrapped in a function, then this function is executed.
Therefore any javascript you provide must have "function scope".
Dont forget the quote the script if appropriate, using
echopoint.util.QuoterKit
- See Also:
- Serialized Form
Fields inherited from class nextapp.echo.AbstractButton |
ACTION_COMMAND_CHANGED_PROPERTY, CSS_CLASS_CHANGED_PROPERTY, DISABLED_CSS_CLASS_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, ICON_TEXT_MARGIN_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, NOTABSTOP_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 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 nextapp.echo.Component |
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY |
Method Summary |
java.lang.String |
getScript()
Returns the client side script to execute on the client. |
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 |
setScript(java.lang.String newValue)
Sets the client side scipt to be executed on the client. |
Methods inherited from class echopoint.PushButton |
applyStyle, getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getHeight, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getMouseCursor, getMouseCursorURI, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getRunOptions, getToolTipPopUp, getToolTipText, getTopBorderColor, getTopBorderSize, getTopBorderStyle, getWidth, isAsync, isComplexRendering, isValidationEnabled, setAsync, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setComplexRendering, setHeight, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setMouseCursor, setMouseCursorURI, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setRunOptions, setToolTipText, setTopBorderColor, setTopBorderSize, setTopBorderStyle, setValidationEnabled, setWidth, validate |
Methods inherited from class nextapp.echo.AbstractButton |
addActionListener, addChangeListener, addItemListener, doAction, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getCssClass, getCssClassDisabled, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextMargin, getModel, getRolloverBackground, getRolloverFont, getRolloverForeground, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getText, getVerticalAlignment, getVerticalTextPosition, hasActionListeners, isNoTabStop, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setCssClass, setCssClassDisabled, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextMargin, setModel, setNoTabStop, setRolloverBackground, setRolloverEnabled, setRolloverFont, setRolloverForeground, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setVerticalAlignment, setVerticalTextPosition |
Methods inherited from class nextapp.echo.AbstractComponent |
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setFocused, setFont, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCRIPT_CHANGED_PROPERTY
public static final java.lang.String SCRIPT_CHANGED_PROPERTY
- Property Names
- See Also:
- Constant Field Values
JavaScriptButton
public JavaScriptButton()
- See Also:
PushButton.PushButton()
JavaScriptButton
public JavaScriptButton(java.lang.String text)
- See Also:
PushButton.PushButton(String)
JavaScriptButton
public JavaScriptButton(java.lang.String text,
ImageReference icon)
- See Also:
PushButton.PushButton(String, ImageReference)
JavaScriptButton
public JavaScriptButton(ImageReference icon)
- See Also:
PushButton.PushButton(ImageReference)
getScript
public java.lang.String getScript()
- Returns the client side script to execute on the client.
- Returns:
- String
setScript
public void setScript(java.lang.String newValue)
- Sets the client side scipt to be executed on the client.
- Parameters:
newValue
- String
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
- Parameters:
field
- - the field to be setnewValue
- - the new value to be set
- Returns:
- the oldValue of the field
- Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.Exception
- See Also:
ReflectionSetter.set(Field, Object)