1 19 20 package org.netbeans.modules.webclient; 21 22 import java.beans.*; 23 24 import org.openide.awt.HtmlBrowser; 25 26 32 public class WebclientBrowser implements HtmlBrowser.Factory, java.io.Serializable { 33 34 private static final long serialVersionUID = -3926191994353231536L; 35 36 37 private static final String PROP_APP_DATA_PATH = "MOZILLA_FIVE_HOME"; 39 40 private java.io.File appData; 41 42 private PropertyChangeSupport pcs; 43 44 public WebclientBrowser () { 45 init (); 46 } 47 48 private void init () { 49 pcs = new PropertyChangeSupport (this); 50 } 51 52 55 public HtmlBrowser.Impl createHtmlBrowserImpl () { 56 try { 57 return new WebclientBrowserImpl (this); 58 } 59 catch (Error e) { 60 e.printStackTrace (); 61 throw e; 62 } 63 } 64 65 68 public java.io.File getAppData () { 69 if (appData == null) { 70 if (System.getProperty (PROP_APP_DATA_PATH) != null) 71 return new java.io.File (System.getProperty (PROP_APP_DATA_PATH)); 72 } 73 return appData; 74 } 75 76 79 public void setAppData (java.io.File appData) { 80 java.io.File old = this.appData; 81 this.appData = appData; 82 pcs.firePropertyChange (PROP_APP_DATA_PATH, old, appData); 83 } 84 85 87 public void addPropertyChangeListener (PropertyChangeListener l) { 88 pcs.addPropertyChangeListener (l); 89 } 90 91 93 public void removePropertyChangeListener (PropertyChangeListener l) { 94 pcs.removePropertyChangeListener (l); 95 } 96 97 private void readObject (java.io.ObjectInputStream ois) 98 throws java.io.IOException , ClassNotFoundException { 99 ois.defaultReadObject (); 100 init (); 101 } 102 103 } 104 | Popular Tags |