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.plugin.calpahtml;
21  
22  
23  import org.apache.log4j.Logger;
24  
25  import org.xnap.XNap;
26  import org.xnap.gui.XNapFrame;
27  import org.xnap.gui.util.IconHelper;
28  import org.xnap.plugin.AbstractPlugin;
29  
30  /***
31   * Provides a simple web browsing panel
32   */
33  public class CalpaHtmlPlugin extends AbstractPlugin 
34  {
35  	//--- Constant(s) ---
36  
37      public static String ICON_FILENAME = "world.png";
38  
39  	//--- Data field(s) ---
40  
41      private static Logger logger = Logger.getLogger(CalpaHtmlPlugin.class);
42      private static CalpaHtmlPlugin instance;	
43  	private static CalpaHtmlPanel htmlPane;
44  
45  	//--- Constructor(s) ---
46  
47      public CalpaHtmlPlugin()
48  	{
49  		
50  	}
51  
52      //--- Method(s) ---
53  
54      public static CalpaHtmlPlugin getInstance()
55      {
56  		return instance;
57      }
58  
59      /***
60       * Starts the plugin.
61       */
62      public void start() 
63      {
64  		instance = this;
65      }
66  
67      /***
68       * Starts the GUI of the plugin.
69       */
70      public void startGUI()
71      {
72  
73  		htmlPane = new CalpaHtmlPanel();
74  		XNapFrame.getInstance().insertTab
75  			//(getInfo().getName(), IconHelper.getListIcon(ICON_FILENAME), 
76  			(XNap.tr("Web"), IconHelper.getListIcon(ICON_FILENAME), 
77  			 htmlPane);
78      }
79  
80  	/***
81       * Stops the plugin. Disposes all singletons.
82       */
83      public void stop()
84      {
85      }
86  
87      /***
88       * Stops the GUI of the plugin.
89       */
90      public void stopGUI()
91      {
92  		// dispose gui
93  		XNapFrame.getInstance().removeTab(htmlPane);
94  		htmlPane = null;
95      }
96  
97      // --- Inner Class(es) ---
98  
99  }
100 
101 
102