jaxx.runtime.swing.navigation.handler
Class AbstractNavigationHandler<E extends NavigationNode<E>>

java.lang.Object
  extended by javax.swing.tree.DefaultTreeSelectionModel
      extended by jaxx.runtime.swing.navigation.handler.AbstractNavigationHandler<E>
All Implemented Interfaces:
Serializable, Cloneable, EventListener, TreeSelectionListener, TreeSelectionModel, NavigationHandler<E>
Direct Known Subclasses:
NavigationMultiTreeHandler, NavigationTreeHandlerWithCardLayout

public abstract class AbstractNavigationHandler<E extends NavigationNode<E>>
extends DefaultTreeSelectionModel
implements NavigationHandler<E>

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:
tchemit
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jaxx.runtime.swing.navigation.handler.NavigationHandler
NavigationHandler.Strategy
 
Field Summary
protected  JAXXContext context
          UI which contains navigation tree
protected  NavigationContextHelper<E> contextHelper
          JAXXContext access helper.
protected  NavigationHandler.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 AbstractNavigationHandler(String contextPrefix, JAXXObject context, NavigationHandler.Strategy strategy)
           
 
Method Summary
protected  void addSelectedBeanInContext(E node, Object data)
           
protected  JAXXContext createUIContext(E node)
          Prepare le context a utiliser pour initialiser une nouvelle ui.
 JAXXContext getContext()
           
 NavigationContextHelper<E> getContextHelper()
           
protected  void selectNodeUI(E node)
           
 void setSelectionPath(TreePath path)
           
 void setSelectionPaths(TreePath[] paths)
           
 void valueChanged(TreeSelectionEvent event)
           
 
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, toString, updateLeadIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jaxx.runtime.swing.navigation.handler.NavigationHandler
closeUI, createUI, getCurrentUI, getNavigationTreeModel, getUI, openUI, treateError
 
Methods inherited from interface javax.swing.tree.TreeSelectionModel
addPropertyChangeListener, addSelectionPath, addSelectionPaths, addTreeSelectionListener, clearSelection, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, isPathSelected, isRowSelected, isSelectionEmpty, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode
 

Field Detail

context

protected JAXXContext context
UI which contains navigation tree


strategy

protected NavigationHandler.Strategy strategy
UI Instanciation strategy


contextHelper

protected NavigationContextHelper<E extends NavigationNode<E>> contextHelper
JAXXContext access helper.

Since:
1.7.2
Constructor Detail

AbstractNavigationHandler

protected AbstractNavigationHandler(String contextPrefix,
                                    JAXXObject context,
                                    NavigationHandler.Strategy strategy)
Method Detail

valueChanged

public void valueChanged(TreeSelectionEvent event)
Specified by:
valueChanged in interface TreeSelectionListener
Specified by:
valueChanged in interface NavigationHandler<E extends NavigationNode<E>>

getContext

public JAXXContext getContext()
Specified by:
getContext in interface NavigationHandler<E extends NavigationNode<E>>

getContextHelper

public NavigationContextHelper<E> getContextHelper()
Specified by:
getContextHelper in interface NavigationHandler<E extends NavigationNode<E>>

setSelectionPath

public void setSelectionPath(TreePath path)
Specified by:
setSelectionPath in interface TreeSelectionModel
Specified by:
setSelectionPath in interface NavigationHandler<E extends NavigationNode<E>>
Overrides:
setSelectionPath in class DefaultTreeSelectionModel

setSelectionPaths

public void setSelectionPaths(TreePath[] paths)
Specified by:
setSelectionPaths in interface TreeSelectionModel
Specified by:
setSelectionPaths in interface NavigationHandler<E extends NavigationNode<E>>
Overrides:
setSelectionPaths in class DefaultTreeSelectionModel

selectNodeUI

protected void selectNodeUI(E node)

createUIContext

protected JAXXContext createUIContext(E node)
                               throws 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:
Exception - if any

addSelectedBeanInContext

protected void addSelectedBeanInContext(E node,
                                        Object data)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.