Package org.jdesktop.swingx.action
Class ServerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.jdesktop.swingx.action.ServerAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class ServerAction extends AbstractAction
An action which will invoke an http POST operation.- Author:
- Mark Davidson
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Constructor Description ServerAction()
ServerAction(String name)
ServerAction(String name, String command)
ServerAction(String name, String command, Icon icon)
ServerAction(String name, Icon icon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent evt)
Invokes the server operation when the action has been invoked.void
addHeader(String name, String value)
Adds a name value pair which represents a url connection request property.void
addParam(String name, String value)
Adds a name value pair which represents a url parameter in an http POST request.Set<String>
getHeaderNames()
Return a set of parameter names or null if there are no paramsString
getHeaderValue(String name)
Return a header value corresponding to name or null if it doesn't exist.Set<String>
getParamNames()
Return a set of parameter names or null if there are no paramsString
getParamValue(String name)
Return a parameter value corresponding to name or null if it doesn't exist.String
getURL()
void
setURL(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
-
-
-
-
Method Detail
-
setURL
public void setURL(String url)
Set the url for the action.- Parameters:
url
- a string representation of the url
-
getURL
public String getURL()
-
addParam
public void addParam(String name, String value)
Adds a name value pair which represents a url parameter in an http POST request.
-
getParamValue
public String getParamValue(String name)
Return a parameter value corresponding to name or null if it doesn't exist.
-
getParamNames
public Set<String> getParamNames()
Return a set of parameter names or null if there are no params
-
addHeader
public void addHeader(String name, 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 String getHeaderValue(String name)
Return a header value corresponding to name or null if it doesn't exist.
-
getHeaderNames
public Set<String> getHeaderNames()
Return a set of parameter names or null if there are no params
-
actionPerformed
public void actionPerformed(ActionEvent evt)
Invokes the server operation when the action has been invoked.
-
-