KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > changeorder > ChangeOrderModel


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.changeorder;
14
15
16 /**
17  * Model for ChangeOrderMgr
18  *
19  * @author av
20  */

21 public interface ChangeOrderModel {
22   
23   /**
24    * returns true, if node may be moved
25    */

26   boolean mayMove(Object JavaDoc scope, Object JavaDoc node);
27   
28   /**
29    * called after the user has clicked on an item to move it.
30    * The element at <code>oldIndex</code> is removed from the array, so the size
31    * of the array is reduced by one. After that, the element is inserted at the
32    * index <code>newIndex</code>. A valid implementation would be:
33    * <pre>
34    * ArrayList al = ...
35    * Object o = al.remove(oldIndex);
36    * al.add(newIndex, o);
37    * </pre>
38    *
39    * @param scope the scope for the node to move (for convenience).
40    * @param item the node to move (for convenience), which lives at position oldIndex
41    * @param oldIndex the index of <code>item</code> before it was moved
42    * @param newIndex the index of <code>item</code> after it has been moved
43    *
44    * @see ChangeOrderUtils
45    */

46   void move(Object JavaDoc scope, Object JavaDoc item, int oldIndex, int newIndex);
47 }
48
Popular Tags