org.scopemvc.view.swing
Class SAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.scopemvc.view.swing.SAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable, SwingSubView, View
Direct Known Subclasses:
SModelAction

public class SAction
extends javax.swing.AbstractAction
implements SwingSubView

A swing Action that issues a Control on action performed.

SAction uses the control ID and the resources in UIStrings to initialise itself.
The following properties in SAction are initialised from UIStrings as follow (replace [Control ID] by the actual value of the controlID property):

Version:
1.0
Author:
for more explanation on own to load custom icons, 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, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
SAction()
          Constructor for the object
SAction(java.lang.String inControlID)
          Constructor for the object
SAction(java.lang.String inControlID, SwingView inView)
          Sets text by looking up ControlID in UIStrings.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent inEvent)
          Description of the Method
protected  Control createControl()
          Override this to create something other than a simple no-parameter Control.
 java.lang.String getAcceleratorKey()
          Gets the accelerator key
 java.lang.Object getBoundModel()
          Gets the bound model
 java.lang.String getControlID()
          Gets the control ID
 Controller getController()
          Don't assign a Controller to SAction, instead delegate to the containing SwingView that has a parent Controller.
 java.lang.String getLongDescription()
          Gets the long description
 java.lang.Integer getMnemonicKey()
          Gets the mnemonic key
 java.lang.String getName()
          Gets the name
 SwingView getOwner()
          Gets the owner
 java.lang.String getShortDescription()
          Gets the short description
 javax.swing.Icon getSmallIcon()
          Gets the small icon
 void issueControl(Control inControl)
          Don't assign a Controller to SAction, instead delegate to the containing SwingView that has a parent Controller.
 void setAcceleratorKey(java.lang.String value)
          Sets the accelerator key
 void setBoundModel(java.lang.Object inModel)
          Sets the bound model
 void setControlID(java.lang.String inControlID)
          Sets the control ID
 void setController(Controller inController)
          Don't assign a Controller to this component, instead delegate to the containing SwingView that has a parent Controller.
 void setLongDescription(java.lang.String value)
          Sets the long description
 void setMnemonicKey(java.lang.Integer value)
          Sets the mnemonic key
 void setName(java.lang.String value)
          Sets the name
 void setOwner(SwingView inView)
          Sets the owner
 void setShortDescription(java.lang.String value)
          Sets the short description
 void setSmallIcon(javax.swing.Icon value)
          Sets the small icon
 void unsetOwner(SwingView inView)
          Description of the Method
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAction

public SAction()
Constructor for the object


SAction

public SAction(java.lang.String inControlID)
Constructor for the object

Parameters:
inControlID - Description of the Parameter

SAction

public SAction(java.lang.String inControlID,
               SwingView inView)
Sets text by looking up ControlID in UIStrings.

Parameters:
inControlID - issue this Control when user chooses menuitem.
inView - the parent View that owns this menuitem. This is the view that will issue a Control when the menuitem is actioned.
Method Detail

getControlID

public java.lang.String getControlID()
Gets the control ID

Returns:
The controlID value

getName

public java.lang.String getName()
Gets the name

Returns:
The name value

getSmallIcon

public javax.swing.Icon getSmallIcon()
Gets the small icon

Returns:
The smallIcon value

getAcceleratorKey

public java.lang.String getAcceleratorKey()
Gets the accelerator key

Returns:
The acceleratorKey value

getLongDescription

public java.lang.String getLongDescription()
Gets the long description

Returns:
The longDescription value

getShortDescription

public java.lang.String getShortDescription()
Gets the short description

Returns:
The shortDescription value

getMnemonicKey

public java.lang.Integer getMnemonicKey()
Gets the mnemonic key

Returns:
The mnemonicKey value

getOwner

public SwingView getOwner()
Gets the owner

Specified by:
getOwner in interface SwingSubView
Returns:
The owner value

issueControl

public void issueControl(Control inControl)
Don't assign a Controller to SAction, instead delegate to the containing SwingView that has a parent Controller.

Specified by:
issueControl in interface View
Parameters:
inControl - Description of the Parameter

getController

public Controller getController()
Don't assign a Controller to SAction, instead delegate to the containing SwingView that has a parent Controller.

Specified by:
getController in interface View
Returns:
The controller value

getBoundModel

public java.lang.Object getBoundModel()
Gets the bound model

Specified by:
getBoundModel in interface View
Returns:
The boundModel value

setControlID

public void setControlID(java.lang.String inControlID)
Sets the control ID

Parameters:
inControlID - The new controlID value

setOwner

public void setOwner(SwingView inView)
Sets the owner

Specified by:
setOwner in interface SwingSubView
Parameters:
inView - The new owner value

setName

public void setName(java.lang.String value)
Sets the name

Parameters:
value - The new name value

setSmallIcon

public void setSmallIcon(javax.swing.Icon value)
Sets the small icon

Parameters:
value - The new smallIcon value

setAcceleratorKey

public void setAcceleratorKey(java.lang.String value)
Sets the accelerator key

Parameters:
value - The new acceleratorKey value

setLongDescription

public void setLongDescription(java.lang.String value)
Sets the long description

Parameters:
value - The new longDescription value

setShortDescription

public void setShortDescription(java.lang.String value)
Sets the short description

Parameters:
value - The new shortDescription value

setMnemonicKey

public void setMnemonicKey(java.lang.Integer value)
Sets the mnemonic key

Parameters:
value - The new mnemonicKey value

setController

public void setController(Controller inController)
Don't assign a Controller to this component, instead delegate to the containing SwingView that has a parent Controller.

Specified by:
setController in interface View
Parameters:
inController - The new controller value

setBoundModel

public void setBoundModel(java.lang.Object inModel)
Sets the bound model

Specified by:
setBoundModel in interface View
Parameters:
inModel - The new boundModel value

unsetOwner

public void unsetOwner(SwingView inView)
Description of the Method

Specified by:
unsetOwner in interface SwingSubView
Parameters:
inView - Description of the Parameter

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent inEvent)
Description of the Method

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
inEvent - Description of the Parameter

createControl

protected Control createControl()
Override this to create something other than a simple no-parameter Control.

Returns:
Control issued when button pressed: here a simple no-parameter Control


Copyright © 2000-2002 The Scope Team. All Rights Reserved.