jaxx.runtime.swing.navigation
Class NavigationTreeHandler

java.lang.Object
  extended by javax.swing.tree.DefaultTreeSelectionModel
      extended by jaxx.runtime.swing.navigation.NavigationTreeHandler
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.TreeSelectionModel
Direct Known Subclasses:
NavigationTreeHandlerWithCardLayout

public abstract class NavigationTreeHandler
extends javax.swing.tree.DefaultTreeSelectionModel

The handler of a navigation tree. This is also the selection model to use, since we must check before moving from a node we can not just listen selection model changed, we must control it.

Since:
1.7.2
Author:
tony
See Also:
Serialized Form

Nested Class Summary
static class NavigationTreeHandler.Strategy
          Strategy of instanciation of ui.
 
Field Summary
protected  JAXXContext context
          UI which contains navigation tree
protected  NavigationTreeContextHelper contextHelper
          JAXXContext access helper.
protected  NavigationTreeHandler.Strategy strategy
          UI Instanciation strategy
 
Fields inherited from class javax.swing.tree.DefaultTreeSelectionModel
changeSupport, leadIndex, leadPath, leadRow, listenerList, listSelectionModel, rowMapper, selection, SELECTION_MODE_PROPERTY, selectionMode
 
Fields inherited from interface javax.swing.tree.TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION
 
Constructor Summary
protected NavigationTreeHandler(java.lang.String contextPrefix, JAXXObject context, NavigationTreeHandler.Strategy strategy)
           
 
Method Summary
protected  void addSelectedBeanInContext(NavigationTreeNode node, java.lang.Object data)
           
protected abstract  boolean closeUI(java.awt.Component component)
           
protected abstract  java.awt.Component createUI(NavigationTreeNode node)
          Instancie une nouvelle ui associé à un noeud de l'arbre de navigation
protected  JAXXContext createUIContext(NavigationTreeNode node)
          Prepare le context a utiliser pour initialiser une nouvelle ui.
 JAXXContext getContext()
           
 NavigationTreeContextHelper getContextHelper()
           
protected abstract  java.awt.Component getCurrentUI()
           
protected abstract  NavigationTreeModel getNavigationTreeModel()
           
protected abstract  java.awt.Component getUI(NavigationTreeNode node)
           
protected abstract  void openUI(java.awt.Component newUI, NavigationTreeNode node)
          Ouvre l'ui associée au noeud sélectionné dans l'arbre de navigation.
protected  void selectNodeUI(NavigationTreeNode node)
           
 void setSelectionPath(javax.swing.tree.TreePath path)
           
protected abstract  void treateError(java.lang.Exception e)
          Traitement des exceptions.
 
Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addPropertyChangeListener, addSelectionPath, addSelectionPaths, addTreeSelectionListener, arePathsContiguous, canPathsBeAdded, canPathsBeRemoved, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPaths, toString, updateLeadIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

protected JAXXContext context
UI which contains navigation tree


strategy

protected NavigationTreeHandler.Strategy strategy
UI Instanciation strategy


contextHelper

protected NavigationTreeContextHelper contextHelper
JAXXContext access helper.

Since:
1.7.2
Constructor Detail

NavigationTreeHandler

protected NavigationTreeHandler(java.lang.String contextPrefix,
                                JAXXObject context,
                                NavigationTreeHandler.Strategy strategy)
Method Detail

getNavigationTreeModel

protected abstract NavigationTreeModel getNavigationTreeModel()
Returns:
le modèle de navigation associé

getCurrentUI

protected abstract java.awt.Component getCurrentUI()
Returns:
le composent actuellement visible associé au noeud courant ou au noeud précédent lors d'un changement de noeud.

getUI

protected abstract java.awt.Component getUI(NavigationTreeNode node)
Parameters:
node - le noeud associé à l'ui à retrouver
Returns:
l'ui associé au novueau noeud sélectionné

closeUI

protected abstract boolean closeUI(java.awt.Component component)
                            throws java.lang.Exception
Parameters:
component - le composent actuellement visible
Returns:
true si le composent a bien été fermé, false sinon
Throws:
java.lang.Exception - if any

createUI

protected abstract java.awt.Component createUI(NavigationTreeNode node)
                                        throws java.lang.Exception
Instancie une nouvelle ui associé à un noeud de l'arbre de navigation

Parameters:
node - le noeud associé à l'ui à créer
Returns:
la nouvelle ui associée au noeud
Throws:
java.lang.Exception - if any

openUI

protected abstract void openUI(java.awt.Component newUI,
                               NavigationTreeNode node)
                        throws java.lang.Exception
Ouvre l'ui associée au noeud sélectionné dans l'arbre de navigation.

Parameters:
newUI - l'ui associé au noeud sélectionné à ouvrir
node - le node de l'ui a ouvrir
Throws:
java.lang.Exception - if any

treateError

protected abstract void treateError(java.lang.Exception e)
Traitement des exceptions.

Parameters:
e - l'erreur recontrée (ou null si pas d"erreur)

getContext

public JAXXContext getContext()

getContextHelper

public NavigationTreeContextHelper getContextHelper()

setSelectionPath

public void setSelectionPath(javax.swing.tree.TreePath path)
Specified by:
setSelectionPath in interface javax.swing.tree.TreeSelectionModel
Overrides:
setSelectionPath in class javax.swing.tree.DefaultTreeSelectionModel

selectNodeUI

protected void selectNodeUI(NavigationTreeNode node)

createUIContext

protected JAXXContext createUIContext(NavigationTreeNode node)
                               throws java.lang.Exception
Prepare le context a utiliser pour initialiser une nouvelle ui.

Parameters:
node - le noeud associé à l'ui à créer
Returns:
le context à utiliser pour instancier l'ui
Throws:
java.lang.Exception - if any

addSelectedBeanInContext

protected void addSelectedBeanInContext(NavigationTreeNode node,
                                        java.lang.Object data)


Copyright © 2008-2009 CodeLutin. All Rights Reserved.