java.lang.Object
org.scopemvc.view.swing.SActionListener
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener
- public class SActionListener
- extends java.lang.Object
- implements java.awt.event.ActionListener
Connects component action event to a method in a model.
Let's have button Save and method void saveData()
in model object, which should be called, when button is pressed. The connection
can be done in following way:
JButton button = new JButton("Save");
SActionListener action = new SActionListener();
action.setModelActionString("saveData");
button.addActionListener(action);
...
action.setBoundModel(myModel);
- Version:
- $Revision: 1.3 $ $Date: 2002/01/26 09:46:20 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
private static final org.apache.commons.logging.Log LOG
model
private java.lang.Object model
modelAction
private org.scopemvc.core.ModelAction modelAction
SActionListener
public SActionListener()
- Creates new SActionListener
setModelActionString
public final void setModelActionString(java.lang.String s)
- Sets name of method to call on model. The name is case sensitive.
setModelAction
private void setModelAction(org.scopemvc.core.ModelAction inAction)
setBoundModel
public final void setBoundModel(java.lang.Object inModel)
- Sets model object on which the method will be called.
getBoundModel
public final java.lang.Object getBoundModel()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ev)
- Called by component to notify, that user performed action on
the component. Specified method is called on the model.
- Specified by:
actionPerformed in interface java.awt.event.ActionListener