Changeset 38848 for main/trunk/greenstone3/src
- Timestamp:
- 2024-03-18T20:37:34+13:00 (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/applet/phind/JPhind.java
r38817 r38848 92 92 package org.greenstone.applet.phind; 93 93 94 import org.webswing.toolkit.api.WebswingUtil; 95 94 96 import javax.swing.JApplet; 95 97 import javax.swing.JComponent; … … 136 138 implements ActionListener { 137 139 140 boolean isWebswingApplication = false; // if run as webswing *and* application (not applet) 141 138 142 boolean isRunAsApplet = true; 139 143 // set only if JPhind object is run as an application … … 215 219 // 1. The search button is easy to disable, and is disabled when a 216 220 // socket connection is in progress. 217 // 2. ResutCanvas widgets can' rbe similarly disabled because the221 // 2. ResutCanvas widgets can't be similarly disabled because the 218 222 // browser hides or wipes them, which looks very bad. 219 223 // 3. I cannot just ignore clicks on canvasses because the browser … … 280 284 } 281 285 286 isWebswingApplication = appParams.getOrDefault("webswing", "0").equals("1") ? true : false; 287 282 288 // manually calling (J)Applet method init() 283 289 init(); … … 716 722 try { 717 723 URL url= new URL(address); 718 if (window.length() > 0) { 719 getAppletContext().showDocument(url, window); 720 } else { 721 getAppletContext().showDocument(url); 724 if(isRunAsApplet) { 725 if (window.length() > 0) { 726 getAppletContext().showDocument(url, window); 727 } else { 728 getAppletContext().showDocument(url); 729 } 730 } else if(isWebswingApplication) { 731 if (window.length() > 0) { 732 WebswingUtil.getWebswingApi().sendActionEvent("openURL", 733 url.toString() + " - " +window, 734 null); 735 } else { 736 WebswingUtil.getWebswingApi().sendActionEvent("openURL", url.toString(), null); 737 } 738 } else { // else application, but not webswing, TODO: open browser at the URL 739 System.err.println("Phind.displayWebPage() for non-applet and non-webswing application is not yet implemented."); 722 740 } 723 741 } catch (Exception e) { … … 1130 1148 public static void main(String args[]) { 1131 1149 if(args.length < 9) { 1132 System.err.println("Need minimum --params: <baseURL> --collection <collection> --classifier <classifier> --phindcgi <URL> --library <libURL> [-- backdrop <ImgURL>] [--xtraParams <key1=value1&key2=value2&...]");1150 System.err.println("Need minimum --params: <baseURL> --collection <collection> --classifier <classifier> --phindcgi <URL> --library <libURL> [--webswing <1/0>] [--backdrop <ImgURL>] [--xtraParams <key1=value1&key2=value2&...]"); 1133 1151 } 1134 1152 else { // collection fao.org, classifier 1, phindcgi url, library url, backdrop imgurl
Note:
See TracChangeset
for help on using the changeset viewer.