SPT Core API

com.sptci.epng.editabletree
Class Listener

java.lang.Object
  extended by com.sptci.epng.editabletree.Listener
All Implemented Interfaces:
Serializable, EventListener, ActionListener
Direct Known Subclasses:
DeleteListener, SaveListener

public abstract class Listener
extends Object
implements ActionListener

An abstract listener class used to provide common logic to the default save and delete actions associated with adding or deleting nodes.

&coopy; Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: Listener.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-05-13
See Also:
Serialized Form

Field Summary
protected  JDOApplication app
          A reference to the JDO specific application instance.
protected static Logger logger
          The logger to use to log errors or messages to.
 
Constructor Summary
Listener()
           
 
Method Summary
 void actionPerformed(ActionEvent event)
          The action listener implementation.
protected  Object getFactory(Node node)
          Fetch the repository object used to interact with the data store.
protected abstract  Treeable updateStore(Node node)
          The method that is used to update the data store.
protected abstract  void updateView(Node node, Treeable treeable)
          The method that is used ot update the tree once the data store has been updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Logger logger
The logger to use to log errors or messages to.


app

protected final JDOApplication app
A reference to the JDO specific application instance.

Constructor Detail

Listener

public Listener()
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
The action listener implementation. Find the parent Node of the event.getSource and perform the appropriate operations.

Specified by:
actionPerformed in interface ActionListener
See Also:
updateStore(com.sptci.epng.editabletree.Node), updateView(com.sptci.epng.editabletree.Node, com.sptci.jdo.Treeable)

getFactory

protected Object getFactory(Node node)
Fetch the repository object used to interact with the data store.

Parameters:
node - The parent node from which the action was triggered.
Returns:
The repository class.

updateStore

protected abstract Treeable updateStore(Node node)
The method that is used to update the data store.

Parameters:
node - The parent node object from which the action was initiated.
Returns:
The model object that was updated in the data store.

updateView

protected abstract void updateView(Node node,
                                   Treeable treeable)
The method that is used ot update the tree once the data store has been updated.

Parameters:
node - The parent node object from which the action was initiated.
treeable - The model object that has been updated in the data store.

SPT Core API