com.tonbeller.wcf.changeorder
Interface ChangeOrderModel

All Known Implementing Classes:
CategoryEditor, DefaultChangeOrderModel, MutableTreeModelDecorator

public interface ChangeOrderModel

Model for ChangeOrderMgr

Author:
av

Method Summary
 boolean mayMove(java.lang.Object scope, java.lang.Object node)
          returns true, if node may be moved
 void move(java.lang.Object scope, java.lang.Object item, int oldIndex, int newIndex)
          called after the user has clicked on an item to move it.
 

Method Detail

mayMove

public boolean mayMove(java.lang.Object scope,
                       java.lang.Object node)
returns true, if node may be moved


move

public void move(java.lang.Object scope,
                 java.lang.Object item,
                 int oldIndex,
                 int newIndex)
called after the user has clicked on an item to move it. The element at oldIndex is removed from the array, so the size of the array is reduced by one. After that, the element is inserted at the index newIndex. A valid implementation would be:
   ArrayList al = ...
   Object o = al.remove(oldIndex);
   al.add(newIndex, o);
 

Parameters:
scope - the scope for the node to move (for convenience).
item - the node to move (for convenience), which lives at position oldIndex
oldIndex - the index of item before it was moved
newIndex - the index of item after it has been moved
See Also:
ChangeOrderUtils