|
From: <tre...@us...> - 2007-08-30 00:59:00
|
Revision: 293
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=293&view=rev
Author: trevorolio
Date: 2007-08-29 17:59:03 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
Added the path from a template script to the info panel.
Cannot send information in the other direction, yet.
Modified Paths:
--------------
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java
Modified: maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java 2007-08-30 00:58:59 UTC (rev 292)
+++ maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java 2007-08-30 00:59:03 UTC (rev 293)
@@ -208,10 +208,30 @@
String[] args = { displayName, link };
win.call("displayLink", args); // Call a JavaScript function
} catch (Exception e) {
- e.printStackTrace();
+ if(!printedLiveConnectErrorMessage) {
+ System.err.println("Could not use LiveConnect (ignoring future errors): " + e);
+ printedLiveConnectErrorMessage = true;
+ }
}
}
-
+
+ private void showInfoPanel(long sourceThingID, String panelHTML) {
+ try {
+ JSObject win = JSObject.getWindow(this); // get handle to a window.
+ if (win == null) {
+ System.err.println("Could not do live connect. Check that mayscript is true in the applet tag.");
+ return;
+ }
+ String[] args = { sourceThingID + "", panelHTML };
+ win.call("addInfoPanel", args); // Call a JavaScript function
+ } catch (Exception e) {
+ if(!printedLiveConnectErrorMessage) {
+ System.err.println("Could not use LiveConnect (ignoring future errors): " + e);
+ printedLiveConnectErrorMessage = true;
+ }
+ }
+ }
+
boolean printedLiveConnectErrorMessage = false;
private void messageBrowser(long sourceThingID, String message) {
try {
@@ -310,8 +330,10 @@
public void contextItemChosen(Thing thing, long nonce, String id) {
}
-
-
+
+ public void receivedInfoPanel(long sourceThingID, String panelHTML) {
+ showInfoPanel(sourceThingID, panelHTML);
+ }
}
private class ThingGeneratedPopup extends JPopupMenu {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|