info.joseluismartin.gui.action
Class ViewSaveAction<T>

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by info.joseluismartin.gui.IconAction
          extended by info.joseluismartin.gui.action.DialogAction
              extended by info.joseluismartin.gui.action.ViewAction<T>
                  extended by info.joseluismartin.gui.action.ViewSaveAction<T>
All Implemented Interfaces:
PersistentServiceAware<T>, ActionListener, Serializable, Cloneable, EventListener, Action

public class ViewSaveAction<T>
extends ViewAction<T>
implements PersistentServiceAware<T>

Generic Save Action for ViewDialog.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)
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
ViewSaveAction()
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          
protected  void afterSave(boolean valid)
          Hook method to let subclases to do something before save the model
protected  void beforeSave()
          Hook method to let subclases to do something after save the model
 PersistentService<T,? extends Serializable> getService()
          Deprecated. 
protected  boolean onError()
          Hook method to let subclases to do something on validation errors.
 void setPersistentService(PersistentService<T,? extends Serializable> persistentService)
          
 void setService(PersistentService<T,? extends Serializable> service)
          Deprecated. 
 
Methods inherited from class info.joseluismartin.gui.action.ViewAction
getView, setView
 
Methods inherited from class info.joseluismartin.gui.action.DialogAction
getDialog, setDialog
 
Methods inherited from class info.joseluismartin.gui.IconAction
getIcon, getMessageSource, getMessageWrapper, getName, setIcon, setMessageSource, setName
 
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

ViewSaveAction

public ViewSaveAction()
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)

Specified by:
actionPerformed in interface ActionListener

onError

protected boolean onError()
Hook method to let subclases to do something on validation errors.

Returns:
true to show message error, false otherwise

afterSave

protected void afterSave(boolean valid)
Hook method to let subclases to do something before save the model

Parameters:
valid - true if validation success

beforeSave

protected void beforeSave()
Hook method to let subclases to do something after save the model


getService

@Deprecated
public PersistentService<T,? extends Serializable> getService()
Deprecated. 


setService

@Deprecated
public void setService(PersistentService<T,? extends Serializable> service)
Deprecated. 


setPersistentService

public void setPersistentService(PersistentService<T,? extends Serializable> persistentService)

Specified by:
setPersistentService in interface PersistentServiceAware<T>


Copyright © 2013 JDAL. All Rights Reserved.