View Javadoc

1   /***
2    * 
3    */
4   package org.telscenter.pas.ui.browser.mozswing;
5   
6   import org.mozilla.browser.MozillaPanel;
7   import org.mozilla.browser.MozillaWindow;
8   import org.telscenter.pas.ui.browser.BrowserFactory;
9   import org.telscenter.pas.ui.browser.IBrowser;
10  
11  /***
12   * Factory for creating the MozillaSwingBrowser
13   * 
14   * @author aperritano
15   * 
16   */
17  public class MozSwingBrowserFactory extends BrowserFactory {
18  	public final static String NO_BROWSER = "no_browser";
19  	private MozillaPanel webBrowser;
20  	private String browserType = NO_BROWSER;
21  	
22  	/***
23  	 * Gets the current browser
24  	 * 
25  	 * @return IBrowser
26  	 */
27  	public IBrowser getBrowser() {
28  		
29              try {
30  				webBrowser = (MozillaPanel)Class.forName("org.mozilla.browser.MozillaPanel").newInstance();
31  			} catch (InstantiationException e) {
32  				// TODO Auto-generated catch block
33  				e.printStackTrace();
34  			} catch (IllegalAccessException e) {
35  				// TODO Auto-generated catch block
36  				e.printStackTrace();
37  			} catch (ClassNotFoundException e) {
38  				// TODO Auto-generated catch block
39  				e.printStackTrace();
40  			}
41  		
42  			//this needs params
43  //			webBrowser = new MozillaPanel(MozillaWindow.VisibilityMode.FORCED_HIDDEN, MozillaWindow.VisibilityMode.FORCED_HIDDEN);
44  //			browserType = IBrowser.MOZILLA;        	
45  
46  		IBrowser mozSwingBrowser = new MozSwingBrowser(webBrowser,browserType);
47  		return mozSwingBrowser;
48  	}
49  
50  	/***
51  	 * @param args
52  	 */
53  	public static void main(String[] args) {
54  		// TODO Auto-generated method stub
55  
56  	}
57  
58  }