001    /*
002      Copyright (C) 2001 Laurent Martelli
003      
004      This program is free software; you can redistribute it and/or modify
005      it under the terms of the GNU Lesser General Public License as
006      published by the Free Software Foundation; either version 2 of the
007      License, or (at your option) any later version.
008    
009      This program is distributed in the hope that it will be useful,
010      but WITHOUT ANY WARRANTY; without even the implied warranty of
011      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012      GNU Lesser General Public License for more details.
013    
014      You should have received a copy of the GNU Lesser General Public License
015      along with this program; if not, write to the Free Software
016      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
017    
018    package org.objectweb.jac.aspects.gui.web;
019    
020    /**
021     * This interface defines a callbacks used when events occur on a collection.
022     */
023    
024    public interface CollectionListener {
025        /**
026         * Called when the user selects an item to view it.
027         *
028         * @param index the index of the element to view
029         */
030        void onView(int index);
031    
032        /**
033         * Called when the user selects an item to view it.
034         *
035         * @param name the name of the object to view
036         *
037         * @see #onView(int)
038         */
039        void onViewObject(String name);
040    
041        /**
042         * Called when the user selects an item to remove it.
043         *
044         * @param index the index of the element to remove
045         */
046        void onRemove(int index);
047    
048        /**
049         * Called when a method is called on an object belonging to the
050         * collection.
051         * @param index the index of the element to view
052         * @param methodName the name of the method to invoke */
053        void onTableInvoke(int index,String methodName);
054    
055        /**
056         * Called when the user wants to add an object to the collection.
057         * @see #onAddExistingToCollection()
058         */
059        void onAddToCollection();
060    
061        /**
062         * Called when the user wants to add an object to the collection,
063         * without creating a new one even if the collection is "autocreate".
064         * @see #onAddToCollection() */
065        void onAddExistingToCollection();
066    
067        /**
068         * Called when the user wants to remove an object to the collection.
069         */
070        void onRemoveFromCollection();
071    
072        /**
073         * Display the next page of items
074         */
075        void onNext();
076    
077        /**
078         * Display the previous page of items
079         */
080        void onPrevious();
081       
082        /**
083         * Display to the first page of items
084         */
085        void onFirst();
086    
087        /**
088         * Display to the last page of items
089         */
090        void onLast();
091    
092        /**
093         * Call when a parameter of the view has changed and the view
094         * should be refresh to take it into account.
095         */
096        void onRefreshCollection();
097    }
098