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.gui;
21  
22  import javax.swing.Icon;
23  import javax.swing.JComponent;
24  
25  /***
26   * Defines the requirements for panels that are shown in the wizard or
27   * preferences dialog.
28   *
29   * @see PreferencesDialog
30   * @see xnap.gui.component.DefaultWizardDialog 
31   */
32  public interface SettingsPanel {
33      
34      //--- Method(s) ---
35  
36      /*** 
37       * Invoked when the dialog is closed or the apply button is pressed. 
38       *
39       * @exception IllegalArgumentException thrown when settings could not 
40       *            be applied
41       */
42      void apply() throws Exception;
43  
44      /***
45       * Returns a short description of the panel.
46       */
47      String getDescription();
48  
49      /***
50       * Returns an icon.
51       *
52       * @see xnap.gui.component.DefaultWizardDialog
53       */
54      Icon getIcon();
55  
56  	/***
57  	 * Returns the panel.
58  	 */
59      JComponent getPanel();
60  
61      /***
62       * Returns the title of the panel.
63       */
64      String getTitle();
65  
66  }
67