Package org.jdesktop.swingx.action
Class ServerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.jdesktop.swingx.action.ServerAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class ServerAction extends javax.swing.AbstractAction
An action which will invoke an http POST operation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServerAction()
ServerAction(java.lang.String name)
ServerAction(java.lang.String name, java.lang.String command)
ServerAction(java.lang.String name, java.lang.String command, javax.swing.Icon icon)
ServerAction(java.lang.String name, javax.swing.Icon icon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent evt)
Invokes the server operation when the action has been invoked.void
addHeader(java.lang.String name, java.lang.String value)
Adds a name value pair which represents a url connection request property.void
addParam(java.lang.String name, java.lang.String value)
Adds a name value pair which represents a url parameter in an http POST request.java.util.Set
getHeaderNames()
Return a set of parameter names or null if there are no paramsjava.lang.String
getHeaderValue(java.lang.String name)
Return a header value corresponding to name or null if it doesn't exist.java.util.Set
getParamNames()
Return a set of parameter names or null if there are no paramsjava.lang.String
getParamValue(java.lang.String name)
Return a parameter value corresponding to name or null if it doesn't exist.java.lang.String
getURL()
void
setURL(java.lang.String url)
Set the url for the action.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
ServerAction
public ServerAction()
-
ServerAction
public ServerAction(java.lang.String name)
-
ServerAction
public ServerAction(java.lang.String name, java.lang.String command)
- Parameters:
name
- display name of the actioncommand
- the value of the action command key
-
ServerAction
public ServerAction(java.lang.String name, javax.swing.Icon icon)
-
ServerAction
public ServerAction(java.lang.String name, java.lang.String command, javax.swing.Icon icon)
- Parameters:
name
- display name of the actioncommand
- the value of the action command keyicon
- icon to display
-
-
Method Detail
-
setURL
public void setURL(java.lang.String url)
Set the url for the action.- Parameters:
url
- a string representation of the url
-
getURL
public java.lang.String getURL()
-
addParam
public void addParam(java.lang.String name, java.lang.String value)
Adds a name value pair which represents a url parameter in an http POST request.
-
getParamValue
public java.lang.String getParamValue(java.lang.String name)
Return a parameter value corresponding to name or null if it doesn't exist.
-
getParamNames
public java.util.Set getParamNames()
Return a set of parameter names or null if there are no params
-
addHeader
public void addHeader(java.lang.String name, java.lang.String value)
Adds a name value pair which represents a url connection request property. For example, name could be "Content-Type" and the value could be "application/x-www-form-urlencoded"
-
getHeaderValue
public java.lang.String getHeaderValue(java.lang.String name)
Return a header value corresponding to name or null if it doesn't exist.
-
getHeaderNames
public java.util.Set getHeaderNames()
Return a set of parameter names or null if there are no params
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent evt)
Invokes the server operation when the action has been invoked.
-
-