|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.scopemvc.view.swing.SActionListener
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);
| Constructor Summary | |
SActionListener()
Creates new SActionListener |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent ev)
Called by component to notify, that user performed action on the component. |
java.lang.Object |
getBoundModel()
Gets the bound model |
void |
setBoundModel(java.lang.Object inModel)
Sets model object on which the method will be called. |
void |
setModelActionString(java.lang.String s)
Sets name of method to call on model. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SActionListener()
| Method Detail |
public final java.lang.Object getBoundModel()
public final void setModelActionString(java.lang.String s)
s - The new modelActionString valuepublic final void setBoundModel(java.lang.Object inModel)
inModel - The new boundModel valuepublic void actionPerformed(java.awt.event.ActionEvent ev)
actionPerformed in interface java.awt.event.ActionListenerev - TODO: Describe the Parameter
java.lang.IllegalStateException - if model action (method) is not setsetModelActionString(java.lang.String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||