KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2   Copyright (C) 2002 Laurent Martelli <laurent@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, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17   USA */

18
19 package org.objectweb.jac.aspects.gui;
20
21 import org.objectweb.jac.core.rtti.CollectionItem;
22
23 /**
24  * This interface defines callback methods used to notify that a
25  * collection was updated (that is, an object was added to it or
26  * removed from it).
27  */

28 public interface CollectionUpdate {
29
30    /**
31     * Upcalled when the collection is changed (with a set or other
32     * methods such as clear, removeAll, addAll, ...).
33     *
34     * @param substance the object of which a field was updated
35     * @param collection the updated collection
36     * @param value the new collection
37     * @param param extra data
38     *
39     * @see ViewControlWrapper#registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)
40     */

41    void onChange(Object JavaDoc substance, CollectionItem collection, Object JavaDoc value,
42                  Object JavaDoc param);
43
44    /**
45     * Upcalled when an item is added in a collection.
46     *
47     * @param substance the object of which a collection was updated
48     * @param collection the updated collection
49     * @param value the collection's value
50     * @param added the value added to the collection
51     * @param param extra data (e.g. index)
52     *
53     * @see ViewControlWrapper#registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)
54     */

55    void onAdd(Object JavaDoc substance, CollectionItem collection, Object JavaDoc value,
56               Object JavaDoc added, Object JavaDoc param);
57
58    /**
59     * Upcalled when an item is removed from a collection.
60     *
61     * @param substance the object of which a collection was updated
62     * @param collection the updated collection
63     * @param value the collection's value
64     * @param removed the removed item
65     * @param param extra data (e.g. index)
66     *
67     * @see ViewControlWrapper#registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)
68     */

69    void onRemove(Object JavaDoc substance, CollectionItem collection, Object JavaDoc value,
70                  Object JavaDoc removed, Object JavaDoc param);
71 }
72
Popular Tags