View Javadoc

1   /*
2    *  XNap - A P2P framework and client.
3    *
4    *  See the file AUTHORS for copyright information.
5    *
6    *  This program is free software; you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation.
9    *
10   *  This program is distributed in the hope that it will be useful,
11   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   *  GNU General Public License for more details.
14   *
15   *  You should have received a copy of the GNU General Public License
16   *  along with this program; if not, write to the Free Software
17   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   */
19  
20  package org.xnap.peer;
21  
22  import javax.swing.Action;
23  import javax.swing.Icon;
24  
25  import org.xnap.event.StateListener;
26  
27  /***
28   * Defines the requirements for a hotlist item. Hotlist item represent one or
29   * more favorite peers.
30   *
31   * @see HotlistManager
32   */
33  public interface HotlistItem
34  {
35  
36      //--- Method(s) ---
37  
38      /***
39       * Adds a state listener.
40       */
41      void addStateListener(StateListener listener);
42  
43      /***
44       * Returns the actions that can performed by the item.
45       */
46      Action[] getActions();
47  
48      /***
49       * Returns the category of the item.
50       */
51      String getCategory();
52  
53      /***
54       * Returns the user defined comment of the item.
55       */
56      String getComment();
57  
58  	/***
59  	 * Returns a 16x16 icon. The icon is displayed next to the name.
60  	 */
61  	Icon getIcon();
62  
63      /***
64       * Returns the name of the item.
65       */
66      String getName();
67  
68      /***
69       * Returns the status of the peers represented by this item. See the
70       * {@link xnap.peer.Peer#getStatus() getStatus()} method.
71       */
72      String getStatus();
73  
74      /***
75       * Remove a state listener.
76       */
77      void removeStateListener(StateListener listener);
78  
79  }
80