it.amattioli.applicate.commands.tree
Class DefaultTreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

Show UML class diagram
java.lang.Object
  extended by it.amattioli.applicate.commands.tree.DefaultTreeEditor<I,T>
All Implemented Interfaces:
TreeEditor<I,T>, Selector<T>, it.amattioli.dominate.util.PropertyChangeEmitter

public class DefaultTreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
extends Object
implements TreeEditor<I,T>, it.amattioli.dominate.util.PropertyChangeEmitter


Constructor Summary
DefaultTreeEditor()
           
 
Method Summary
 T addChild()
           
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void addSelectionListener(SelectionListener listener)
          Register a listener for the object selection.
 T addSibling()
           
 void addTreeListener(TreeEventListener listener)
           
 void deselect()
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
protected  void fireTreeEvent(TreeEvent.Type type, TreePath path)
           
 List<T> getChildrenOf(T target)
           
 BeanEditor<T> getNodeEditor(T node)
           
 BeanEditor<T> getNodeEditor(TreePath path)
           
 T getParentOf(T target)
           
 TreePath getPathOf(T target)
           
 T getRoot()
           
 T getSelectedObject()
          Retrieves the object currently selected.
 TreePath getSelectedPath()
           
 T getTargetOf(TreePath path)
           
 TreeManager<T> getTreeManager()
           
protected  void initEditors()
           
 void moveDown()
           
 void moveTo(T newParent)
           
 void moveUp()
           
 T remove()
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void removeSelectionListener(SelectionListener listener)
          Remove a listener from the collection of the listeners that will be notified when an object is slected in this browser.
 void removeTreeListener(TreeEventListener listener)
           
 void select(T selected)
           
 void select(TreePath path)
           
 void setRoot(T root)
           
 void setTreeManager(TreeManager<T> treeManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTreeEditor

public DefaultTreeEditor()
Method Detail

getTreeManager

public TreeManager<T> getTreeManager()

setTreeManager

public void setTreeManager(TreeManager<T> treeManager)

initEditors

protected void initEditors()

getRoot

public T getRoot()
Specified by:
getRoot in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

setRoot

public void setRoot(T root)
Specified by:
setRoot in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getChildrenOf

public List<T> getChildrenOf(T target)
Specified by:
getChildrenOf in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getParentOf

public T getParentOf(T target)
Specified by:
getParentOf in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getPathOf

public TreePath getPathOf(T target)
Specified by:
getPathOf in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getTargetOf

public T getTargetOf(TreePath path)
Specified by:
getTargetOf in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

select

public void select(TreePath path)
Specified by:
select in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

select

public void select(T selected)
Specified by:
select in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

deselect

public void deselect()
Specified by:
deselect in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getSelectedObject

public T getSelectedObject()
Description copied from interface: Selector
Retrieves the object currently selected.

Specified by:
getSelectedObject in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Specified by:
getSelectedObject in interface Selector<T extends it.amattioli.dominate.Entity<I>>
Returns:
the object currently selected or null if no object is selected

getSelectedPath

public TreePath getSelectedPath()
Specified by:
getSelectedPath in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

addChild

public T addChild()
Specified by:
addChild in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

addSibling

public T addSibling()
Specified by:
addSibling in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

remove

public T remove()
Specified by:
remove in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

moveTo

public void moveTo(T newParent)

moveDown

public void moveDown()
Specified by:
moveDown in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

moveUp

public void moveUp()
Specified by:
moveUp in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getNodeEditor

public BeanEditor<T> getNodeEditor(TreePath path)
Specified by:
getNodeEditor in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getNodeEditor

public BeanEditor<T> getNodeEditor(T node)
Specified by:
getNodeEditor in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

addTreeListener

public void addTreeListener(TreeEventListener listener)
Specified by:
addTreeListener in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

removeTreeListener

public void removeTreeListener(TreeEventListener listener)
Specified by:
removeTreeListener in interface TreeEditor<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

fireTreeEvent

protected void fireTreeEvent(TreeEvent.Type type,
                             TreePath path)

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Description copied from interface: Selector
Register a listener for the object selection. Every time an object is selected in this browser all the registered objects will be notified.

Specified by:
addSelectionListener in interface Selector<T extends it.amattioli.dominate.Entity<I>>
Parameters:
listener - the listener to be registered

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Description copied from interface: Selector
Remove a listener from the collection of the listeners that will be notified when an object is slected in this browser.

Specified by:
removeSelectionListener in interface Selector<T extends it.amattioli.dominate.Entity<I>>
Parameters:
listener - the listener to be removed

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface it.amattioli.dominate.util.PropertyChangeEmitter

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface it.amattioli.dominate.util.PropertyChangeEmitter


Copyright © 2011. All Rights Reserved.