KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > gui > AbstractCollectionItemView


1 /*
2   Copyright (C) 2002 Julien van Malderen <julien@aopsys.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

17
18 package org.objectweb.jac.aspects.gui;
19
20 import org.objectweb.jac.core.rtti.CollectionItem;
21
22 /**
23  * Interface for the component used to display elements of a
24  * collection, with "prev" and "next" buttons to go to the previous or
25  * next element of the collection easily.
26  */

27
28 public interface AbstractCollectionItemView
29 {
30    View getView();
31
32    /**
33     * Sets the collection item associated with the view
34     * @param coll a collection item
35     */

36    void setCollection(CollectionItem coll);
37    
38    /**
39     * Gets the collection item associated with the view
40     * @return collection item
41     */

42    CollectionItem getCollection();
43    
44    /**
45     * Sets the position in the collection of the current item
46     * @param index position in collection (from 0 to collection size-1)
47     */

48    void setCurrent(int index);
49
50    /**
51     * Gets the position in the collection of the current item
52     * @return position in collection
53     */

54    int getCurrent();
55
56    /**
57     * Displays next object in collection
58     */

59    void onNextInCollection();
60    
61    /**
62     * Displays previous object in collection
63     */

64    void onPreviousInCollection();
65
66    /**
67     * Displays the collection instead of the current item
68     */

69    void onBackToCollection();
70    
71    /**
72     * Remove current object from collection
73     */

74    void onRemoveInCollection();
75 }
76
77
Popular Tags