Changeset 4324
- Timestamp:
- 2003-05-23T17:03:11+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/PreviewPane.java
r4311 r4324 135 135 public void gainFocus() { 136 136 if(Gatherer.c_man.ready() && Gatherer.c_man.built()) { 137 String url = Gatherer.config.exec_path + "?a=p&p=about&c=" + Gatherer.c_man.getCollection().getName(); 138 if(page_showing != null && page_showing.equals(url)) { 139 view.reloadDocument(); 140 } 141 else { 142 String url = Gatherer.config.exec_address + "?a=config&cmd=add-collection&c=" + Gatherer.c_man.getCollection().getName(); 143 144 Gatherer.println("Loading " + url); 145 args = new String[1]; 146 args[0] = url; 147 status.setText(get("Loading", args)); 148 args = null; 149 view.showHTMLDocument((new GURL(url)).getURL()); 150 page_showing = url; 151 homepage = (new GURL(url)).getURL(); 152 } 137 // First we ask the server to register our collection, just in case its changed. Wait until the 'page' has loaded to be safe. 138 String url = Gatherer.config.exec_address + "?a=config&cmd=add-collection&c=" + Gatherer.c_man.getCollection().getName(); 139 view.setLoadSynchronously(true); 140 view.showHTMLDocument((new GURL(url)).getURL()); 141 view.setLoadSynchronously(false); 142 // Now load the collection 143 url = Gatherer.config.exec_path + "?a=p&p=about&c=" + Gatherer.c_man.getCollection().getName(); 144 Gatherer.println("Loading " + url); 145 args = new String[1]; 146 args[0] = url; 147 status.setText(get("Loading", args)); 148 args = null; 149 view.showHTMLDocument((new GURL(url)).getURL()); 150 page_showing = url; 151 homepage = (new GURL(url)).getURL(); 153 152 } 154 153 validate(); … … 188 187 } 189 188 reload.setEnabled(true); 190 }191 192 /** This method performs nominally the same as a showHTMLDocument call expect that it blocks until some final loading state is reached, good or bad. */193 private void showAndWait(URL url) {194 try {195 // Send url to CalPane196 197 // Wait until state is preconnect198 while(observer.state != CalCons.PRE_CONNECT) {199 wait(100); // 10th of a second200 }201 // Now wait until state is final state202 while(observer.state != CalCons.DOC_LOADED) {203 wait(100); // 10th of a second204 }205 }206 catch (InterruptedException error) {207 }208 189 } 209 190
Note:
See TracChangeset
for help on using the changeset viewer.