This fix was contributed by
* Jason Mawdsley <jason@macadamian.com> * Louis-Philippe Gagnon <louisphilippe@macadamian.com> It enables webclient to be built and run under JDK1.1.x. Note that JavaDOM does not work under jdk1.1.x. The fix consists of two elements: On the Java side, replace all JDK1.2 specific calls with JDK1.1.x equivalents. On the native side use pre-processer macro for JNI_VERSION, like this: #ifdef JNI_VERSION_1_2 #ifndef JNI_VERSION #define JNI_VERSION JNI_VERSION_1_2 #endif #else #ifndef JNI_VERSION_1_1 #define JNI_VERSION_1_1 0x00010001 #endif #ifndef JNI_VERSION #define JNI_VERSION JNI_VERSION_1_1 #endif #endif // END: JNI_VERSION_1_2 This fix has been tested on win32, solaris, and linux. The following files are in this fix: M webclient/classes_spec/org/mozilla/webclient/test/DOMTreeModel.java M webclient/classes_spec/org/mozilla/webclient/test/DOMViewerFrame.java M webclient/classes_spec/org/mozilla/webclient/test/EMWindow.java M webclient/classes_spec/org/mozilla/webclient/wrapper_native/BookmarksImpl.java M webclient/classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java M webclient/src_moz/CBrowserContainer.cpp M webclient/src_moz/nsActions.cpp M webclient/src_share/jni_util.cpp M webclient/src_share/jni_util.h M webclient/src_share/jni_util_export.cpp git-svn-id: svn://10.0.0.236/trunk@79490 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
* Inc. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Igor Kushnirskiy <idk@eng.sun.com>
|
||||
* Ed Burns <edburns@acm.org>
|
||||
* Jason Mawdsley <jason@macadamian.com>
|
||||
* Louis-Philippe Gagnon <louisphilippe@macadamian.com>
|
||||
*/
|
||||
|
||||
package org.mozilla.webclient.test;
|
||||
@@ -35,7 +38,8 @@ class DOMTreeModel implements TreeModel, DOMTreeNotifier {
|
||||
rootNode = node;
|
||||
}
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
treeModelListeners.add(l);
|
||||
// use addElement instead of add for jdk1.1.x compatibility.
|
||||
treeModelListeners.addElement(l);
|
||||
}
|
||||
public void removeTreeModelListener(TreeModelListener l) {
|
||||
treeModelListeners.removeElement(l);
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
* Ian Wilkinson <iw@ennoble.com>
|
||||
* Mark Goddard
|
||||
* Ed Burns <edburns@acm.org>
|
||||
* Jason Mawdsley <jason@macadamian.com>
|
||||
* Louis-Philippe Gagnon <louisphilippe@macadamian.com>
|
||||
*/
|
||||
|
||||
package org.mozilla.webclient.test;
|
||||
@@ -55,7 +57,7 @@ import java.util.Stack;
|
||||
* A dom viewer Frame
|
||||
|
||||
*
|
||||
* @version $Id: DOMViewerFrame.java,v 1.4 2000-07-15 18:56:30 edburns%acm.org Exp $
|
||||
* @version $Id: DOMViewerFrame.java,v 1.5 2000-09-19 00:18:13 edburns%acm.org Exp $
|
||||
*
|
||||
* @see org.mozilla.webclient.BrowserControlFactory
|
||||
|
||||
@@ -188,7 +190,8 @@ protected void selectNodeInTree(Node node)
|
||||
}
|
||||
|
||||
if (null != pathStack) {
|
||||
pathStack.clear();
|
||||
// use removeAllElements instead of clear for jdk1.1.x compatibility.
|
||||
pathStack.removeAllElements();
|
||||
}
|
||||
populatePathStackFromNode(node);
|
||||
if (null == pathStack || pathStack.isEmpty()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.w3c.dom.Document;
|
||||
* This is a test application for using the BrowserControl.
|
||||
|
||||
*
|
||||
* @version $Id: EMWindow.java,v 1.19 2000-09-15 00:15:01 ashuk%eng.sun.com Exp $
|
||||
* @version $Id: EMWindow.java,v 1.20 2000-09-19 00:18:13 edburns%acm.org Exp $
|
||||
*
|
||||
* @see org.mozilla.webclient.BrowserControlFactory
|
||||
|
||||
@@ -220,7 +220,6 @@ public class EMWindow extends Frame implements DialogClient, ActionListener, Doc
|
||||
}
|
||||
});
|
||||
|
||||
// pack();
|
||||
show();
|
||||
toFront();
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Ed Burns <edburns@acm.org>
|
||||
* Jason Mawdsley <jason@macadamian.com>
|
||||
* Louis-Philippe Gagnon <louisphilippe@macadamian.com>
|
||||
*/
|
||||
|
||||
package org.mozilla.webclient.wrapper_native;
|
||||
@@ -177,7 +179,8 @@ public BookmarkEntry newBookmarkEntry(String url)
|
||||
System.out.println("debug: edburns: BookmarksImpl.newBookmarkEntry: url:" + url);
|
||||
if (-1 != (newNode = nativeNewRDFNode(url, false))) {
|
||||
result = new BookmarkEntryImpl(newNode, null);
|
||||
result.getProperties().setProperty(BookmarkEntry.URL, url);
|
||||
// use put instead of setProperty for jdk1.1.x compatibility.
|
||||
result.getProperties().put(BookmarkEntry.URL, url);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -193,7 +196,7 @@ public BookmarkEntry newBookmarkFolder(String name)
|
||||
System.out.println("debug: edburns: BookmarksImpl.newBookmarkFolder: name:" + name);
|
||||
if (-1 != (newNode = nativeNewRDFNode(name, true))) {
|
||||
result = new BookmarkEntryImpl(newNode, null);
|
||||
result.getProperties().setProperty(BookmarkEntry.NAME, name);
|
||||
result.getProperties().put(BookmarkEntry.NAME, name);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -225,7 +228,7 @@ public static void main(String [] args)
|
||||
|
||||
Log.setApplicationName("BookmarksImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: BookmarksImpl.java,v 1.5 2000-07-22 02:48:25 edburns%acm.org Exp $");
|
||||
Log.setApplicationVersionDate("$Id: BookmarksImpl.java,v 1.6 2000-09-19 00:18:14 edburns%acm.org Exp $");
|
||||
|
||||
try {
|
||||
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*
|
||||
* Contributor(s): Ed Burns <edburns@acm.org>
|
||||
* Ashutosh Kulkarni <ashuk@eng.sun.com>
|
||||
* Jason Mawdsley <jason@macadamian.com>
|
||||
* Louis-Philippe Gagnon <louisphilippe@macadamian.com>
|
||||
*/
|
||||
|
||||
package org.mozilla.webclient.wrapper_native;
|
||||
@@ -233,7 +235,9 @@ public void run()
|
||||
nativeAddListener(nativeWebShell,tempListener.listener,
|
||||
tempListener.listenerClassName);
|
||||
}
|
||||
listenersToAdd.clear();
|
||||
// use removeAllElements instead of clear for jdk1.1.x
|
||||
// compatibility.
|
||||
listenersToAdd.removeAllElements();
|
||||
}
|
||||
doRemoveListeners();
|
||||
|
||||
@@ -278,7 +282,9 @@ private void doRemoveListeners()
|
||||
|
||||
}
|
||||
}
|
||||
listenersToRemove.clear();
|
||||
// use removeAllElements instead of clear for jdk1.1.x
|
||||
// compatibility.
|
||||
listenersToRemove.removeAllElements();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +316,9 @@ void addListener(WCEventListenerWrapper newListener)
|
||||
if (null == listenersToAdd) {
|
||||
listenersToAdd = new Vector();
|
||||
}
|
||||
listenersToAdd.add(newListener);
|
||||
// use addElement instead of add for jdk1.1.x
|
||||
// compatibility.
|
||||
listenersToAdd.addElement(newListener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,10 +341,14 @@ void removeListener(WCEventListenerWrapper newListener)
|
||||
}
|
||||
if (null == newListener) {
|
||||
String all = "all";
|
||||
listenersToRemove.add(all);
|
||||
// use addElement instead of add for jdk1.1.x
|
||||
// compatibility.
|
||||
listenersToRemove.addElement(all);
|
||||
}
|
||||
else {
|
||||
listenersToRemove.add(newListener);
|
||||
// use addElement instead of add for jdk1.1.x
|
||||
// compatibility.
|
||||
listenersToRemove.addElement(newListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user