001 /* 002 Copyright (C) 2002 Julien van Malderen <julien@aopsys.com> 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; 019 020 import org.objectweb.jac.core.rtti.CollectionItem; 021 022 /** 023 * Interface for the component used to display elements of a 024 * collection, with "prev" and "next" buttons to go to the previous or 025 * next element of the collection easily. 026 */ 027 028 public interface AbstractCollectionItemView 029 { 030 View getView(); 031 032 /** 033 * Sets the collection item associated with the view 034 * @param coll a collection item 035 */ 036 void setCollection(CollectionItem coll); 037 038 /** 039 * Gets the collection item associated with the view 040 * @return collection item 041 */ 042 CollectionItem getCollection(); 043 044 /** 045 * Sets the position in the collection of the current item 046 * @param index position in collection (from 0 to collection size-1) 047 */ 048 void setCurrent(int index); 049 050 /** 051 * Gets the position in the collection of the current item 052 * @return position in collection 053 */ 054 int getCurrent(); 055 056 /** 057 * Displays next object in collection 058 */ 059 void onNextInCollection(); 060 061 /** 062 * Displays previous object in collection 063 */ 064 void onPreviousInCollection(); 065 066 /** 067 * Displays the collection instead of the current item 068 */ 069 void onBackToCollection(); 070 071 /** 072 * Remove current object from collection 073 */ 074 void onRemoveInCollection(); 075 } 076