jve.generated
Class SwingDataServiceAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byjve.generated.SwingDataServiceAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, IActionBinder, IActionBinder1, IBoundObject, IDataObject, IDataSourceService, java.io.Serializable

public class SwingDataServiceAction
extends javax.swing.AbstractAction
implements IActionBinder1, IDataSourceService, IDataObject

This action will execute a data source service with a single argument. The argument is specified by a ObjectReference.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class jve.generated.IActionBinder
IActionBinder.ActionBinderEvent, IActionBinder.ActionBinderListener
 
Field Summary
static boolean debug
           
 
Fields inherited from interface jve.generated.IActionBinder1
FLAGS_ACTION_PERFORMED, FLAGS_ACTION_PERFORMED_NULL_OBJECT, FLAGS_ACTION_PERFORMED_OBJECT, FLAGS_NONE, FLAGS_NULL_OBJECT_CHANGE, FLAGS_NULL_PROPERTY_CHANGE, FLAGS_OBJECT_CHANGE, FLAGS_PROPERTY_CHANGE
 
Fields inherited from interface jve.generated.IActionBinder
ENABLE_DISABLE_ACTION, ENABLE_ENABLE_ACTION, ENABLE_NO_ACTION
 
Fields inherited from interface jve.generated.IBoundObject
DELIMITER, PROPERTY_OBJ_CHANGED
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
SwingDataServiceAction()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Respond to an action, by invoking the data source service.
 void actionPerformed(IActionBinder action)
          Notify the bound object that an action was performed where the reference object was used to perform an action.
 void addActionBinderListener(IActionBinder.ActionBinderListener l)
          Add a new ActionBinderListner to the listener list.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 int getActionType()
          Get the type of the action
 IDataSource getDataSource()
          Get the Data Source associated with this action.
 int getDisableFlags()
           
 int getEnableFlags()
           
 java.lang.Object getObject()
          Get the bound object.
 java.lang.String getProperty()
          Get the property of the source object that will be used as the bound object.
 ObjectReference getServiceArgument()
          Get the argument used as the parameter for the service call.
 java.lang.String getServiceSignature()
          Get the service signature for this action.
 java.lang.Object getSourceObject()
          Get the source object that is used to reference the bound object.
 java.lang.Class getType()
          Get the class type of the referenced object.
 java.lang.Object getValue(java.lang.String property)
          Use the getter of an object to get a property
 boolean isPrimitive(java.lang.String property)
          Get to see if the type of the given property is a Java primitive type.
 boolean isReadOnly(java.lang.String property)
          Check if the given property has a setter method.
 void refresh()
          Refresh the referenced object.
 void removeActionBinderListener(IActionBinder.ActionBinderListener l)
          Remove an existing ActionBinderListener from the listener list.
 void setActionType(int type)
          Set the way the action binder will drive its enable state.
 void setDataSource(IDataSource datasource)
          Set the Data Source associated with this action.
 void setDisableFlags(int flags)
          This method is used to configure when the visual will disable itself.
 void setEnabled(boolean newValue)
          Set the enabled state of the action.
 void setEnableFlags(int flags)
          This method is used to configure when the visual will enable itself.
 void setProperty(java.lang.String property)
          Set the property of the source object that will be the bound object.
 void setServiceArgument(ObjectReference arg)
          Set the argument for the service call, according to the method signature set with the setService method.
 void setServiceSignature(java.lang.String signature)
          This is the service method signature that is to be use.
 void setSourceObject(java.lang.Object object)
          Set the source object that will be used as a reference for the bound object.
 void setSourceObject(java.lang.Object object, java.lang.String property)
          Set the source object and target property simultaneously.
 void setValue(java.lang.String property, java.lang.Object value)
          Use the setter of an object to set a property.
 java.lang.String toString()
           
 
Methods inherited from class javax.swing.AbstractAction
getKeys, getPropertyChangeListeners, isEnabled, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jve.generated.IActionBinder
isEnabled
 
Methods inherited from interface jve.generated.IBoundObject
removePropertyChangeListener
 

Field Detail

debug

public static boolean debug
Constructor Detail

SwingDataServiceAction

public SwingDataServiceAction()
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Respond to an action, by invoking the data source service. Before the service is invoked, the registered ActionBinderListners will be notified by the beforeActionPerformed event. After the service call is complete, the registered listeners will be notified by the afterActionPerformed event.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getServiceSignature

public java.lang.String getServiceSignature()
Description copied from interface: IDataSourceService
Get the service signature for this action.

Specified by:
getServiceSignature in interface IDataSourceService
Returns:
service signature

setServiceSignature

public void setServiceSignature(java.lang.String signature)
Description copied from interface: IDataSourceService
This is the service method signature that is to be use. It has to be complete including parameter types e.g. getUserRecord(Integer id);

Specified by:
setServiceSignature in interface IDataSourceService
Parameters:
signature - signature

getDataSource

public IDataSource getDataSource()
Description copied from interface: IDataSourceService
Get the Data Source associated with this action.

Specified by:
getDataSource in interface IDataSourceService
Returns:
The Data Source used for this service

setDataSource

public void setDataSource(IDataSource datasource)
Description copied from interface: IDataSourceService
Set the Data Source associated with this action.

Specified by:
setDataSource in interface IDataSourceService
Parameters:
datasource - DataSource to use for this service

getActionType

public int getActionType()
Deprecated. - use setEnableFlags or setDisableFlags

Description copied from interface: IActionBinder
Get the type of the action

Specified by:
getActionType in interface IActionBinder
Returns:
the action type. Will be ENABLE_ENABLE_ACTION, ENABLE_DISABLE_ACTION or ENABLE_NO_ACTION

setActionType

public void setActionType(int type)
Deprecated. - use setEnableFlags or setDisableFlags

Description copied from interface: IActionBinder
Set the way the action binder will drive its enable state. On ENABLE_ENABLE_ACTION it will be enabled when an its argument property has changed, and vice versa when the actionType is ENABLE_DISABLE_ACTION.

Specified by:
setActionType in interface IActionBinder
Parameters:
type - the action type.

setServiceArgument

public void setServiceArgument(ObjectReference arg)
Description copied from interface: IDataSourceService
Set the argument for the service call, according to the method signature set with the setService method.

Specified by:
setServiceArgument in interface IDataSourceService
Parameters:
arg - the service argument

getServiceArgument

public ObjectReference getServiceArgument()
Description copied from interface: IDataSourceService
Get the argument used as the parameter for the service call.

Specified by:
getServiceArgument in interface IDataSourceService
Returns:
argument used for the service

setEnabled

public void setEnabled(boolean newValue)
Description copied from interface: IActionBinder
Set the enabled state of the action.

Specified by:
setEnabled in interface IActionBinder

removeActionBinderListener

public void removeActionBinderListener(IActionBinder.ActionBinderListener l)
Description copied from interface: IActionBinder
Remove an existing ActionBinderListener from the listener list.

Specified by:
removeActionBinderListener in interface IActionBinder
Parameters:
l - the listener to remove

setDisableFlags

public void setDisableFlags(int flags)
Description copied from interface: IActionBinder1
This method is used to configure when the visual will disable itself.

Specified by:
setDisableFlags in interface IActionBinder1
Parameters:
flags -

getDisableFlags

public int getDisableFlags()

setEnableFlags

public void setEnableFlags(int flags)
Description copied from interface: IActionBinder1
This method is used to configure when the visual will enable itself.

Specified by:
setEnableFlags in interface IActionBinder1
Parameters:
flags -

getEnableFlags

public int getEnableFlags()

toString

public java.lang.String toString()

setValue

public void setValue(java.lang.String property,
                     java.lang.Object value)
Description copied from interface: IDataObject
Use the setter of an object to set a property. Using this method will fire a single PropertyChange event to registered PropertyChangeListeners.

Specified by:
setValue in interface IDataObject
Parameters:
property - property to set on the target object
value - the value to set

isReadOnly

public boolean isReadOnly(java.lang.String property)
                   throws java.lang.IllegalArgumentException
Description copied from interface: IDataObject
Check if the given property has a setter method.

Specified by:
isReadOnly in interface IDataObject
Parameters:
property - the property to check
Returns:
true, if the property does not have a setter method, false otherwise
Throws:
java.lang.IllegalArgumentException - if the target property is invalid

isPrimitive

public boolean isPrimitive(java.lang.String property)
                    throws java.lang.IllegalArgumentException
Description copied from interface: IDataObject
Get to see if the type of the given property is a Java primitive type.

Specified by:
isPrimitive in interface IDataObject
Parameters:
property - the property to check
Returns:
true if the property is a primitive type, false otherwise
Throws:
java.lang.IllegalArgumentException - if the target property is invalid

setProperty

public void setProperty(java.lang.String property)
Description copied from interface: IBoundObject
Set the property of the source object that will be the bound object. This value may be null.

Specified by:
setProperty in interface IBoundObject
Parameters:
property - the property of the source object

getProperty

public java.lang.String getProperty()
Description copied from interface: IBoundObject
Get the property of the source object that will be used as the bound object.

Specified by:
getProperty in interface IBoundObject
Returns:
the property

setSourceObject

public void setSourceObject(java.lang.Object object)
Description copied from interface: IBoundObject
Set the source object that will be used as a reference for the bound object.

Specified by:
setSourceObject in interface IBoundObject
Parameters:
object - the source object

setSourceObject

public void setSourceObject(java.lang.Object object,
                            java.lang.String property)
Description copied from interface: IBoundObject
Set the source object and target property simultaneously. Using this method will prevent multiple event firings of changing both the sourceObject and property separately.

Specified by:
setSourceObject in interface IBoundObject
Parameters:
object - the source object
property - the target property

getSourceObject

public java.lang.Object getSourceObject()
Description copied from interface: IBoundObject
Get the source object that is used to reference the bound object.

Specified by:
getSourceObject in interface IBoundObject
Returns:
the source object

getObject

public java.lang.Object getObject()
Description copied from interface: IBoundObject
Get the bound object. Depending on the implementation this may be the same as the sourceObject.

Specified by:
getObject in interface IBoundObject
Returns:
referenced object

actionPerformed

public void actionPerformed(IActionBinder action)
Description copied from interface: IBoundObject
Notify the bound object that an action was performed where the reference object was used to perform an action. Typically a binder can choose the manner of reaction, if any.

Specified by:
actionPerformed in interface IBoundObject
Parameters:
action - the action that used the referenced object

refresh

public void refresh()
Description copied from interface: IBoundObject
Refresh the referenced object. A call to this method denotes to the reference object that any cached information should be discarted, or that the referenced object has changed. If the referenced object is dynamic (such as the result of a method invocation) the object will be refreshed.

Specified by:
refresh in interface IBoundObject

getType

public java.lang.Class getType()
                        throws java.lang.IllegalStateException
Description copied from interface: IBoundObject
Get the class type of the referenced object. This is necessary to enable design time visual support through introspection.

Specified by:
getType in interface IBoundObject
Returns:
the Class type of the configured object. If it is an array or a List, it will return the type of the elements that comprises the array or List rather than the type array or List type.
Throws:
java.lang.IllegalStateException - if the target object can not be determined due to a miss-configuration. The exception includes a message denoting the reason.

addActionBinderListener

public void addActionBinderListener(IActionBinder.ActionBinderListener l)
Description copied from interface: IActionBinder
Add a new ActionBinderListner to the listener list.

Specified by:
addActionBinderListener in interface IActionBinder
Parameters:
l - the new listener

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: IBoundObject
Adds a PropertyChangeListener to the listener list. The listner will be notified of any changes to bound properties on the referenced object. The listener will also be fired when the entire object is changed, with PROPERTY_OBJ_CHANGED as the property type.

Specified by:
addPropertyChangeListener in interface IBoundObject

getValue

public java.lang.Object getValue(java.lang.String property)
Description copied from interface: IDataObject
Use the getter of an object to get a property

Specified by:
getValue in interface IDataObject