annotate dwt/browser.old/Browser.d @ 288:4ee8c4237614

old branches... commit by mistake
author John Reimer<terminal.node@gmail.com>
date Tue, 05 Aug 2008 18:00:50 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
288
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
1 /*******************************************************************************
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2003, 2007 IBM Corporation and others.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
7 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
8 * Contributors:
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
10 *******************************************************************************/
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
11 module dwt.browser.Browser;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
12
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
13 import dwt.dwthelper.utils;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
14
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
15 import dwt.DWT;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
16 import dwt.DWTError;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
17 import dwt.DWTException;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
18 import dwt.widgets.Composite;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
19 import dwt.widgets.Display;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
20 import dwt.widgets.Widget;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
21
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
22 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
23 * Instances of this class implement the browser user interface
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
24 * metaphor. It allows the user to visualize and navigate through
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
25 * HTML documents.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
26 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
27 * Note that although this class is a subclass of <code>Composite</code>,
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
28 * it does not make sense to set a layout on it.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
29 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
30 * <dl>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
31 * <dt><b>Styles:</b></dt>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
32 * <dd>MOZILLA</dd>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
33 * <dt><b>Events:</b></dt>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
34 * <dd>CloseWindowListener, LocationListener, OpenWindowListener, ProgressListener, StatusTextListener, TitleListener, VisibilityWindowListener</dd>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
35 * </dl>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
36 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
37 * IMPORTANT: This class is <em>not</em> intended to be subclassed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
38 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
39 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
40 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
41 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
42
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
43 public class Browser extends Composite {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
44 WebBrowser webBrowser;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
45 int userStyle;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
46
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
47 static final String PACKAGE_PREFIX = "dwt.browser."; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
48 static final String NO_INPUT_METHOD = "dwt.internal.gtk.noInputMethod"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
49
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
50 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
51 * Constructs a new instance of this class given its parent
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
52 * and a style value describing its behavior and appearance.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
53 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
54 * The style value is either one of the style constants defined in
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
55 * class <code>DWT</code> which is applicable to instances of this
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
56 * class, or must be built by <em>bitwise OR</em>'ing together
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
57 * (that is, using the <code>int</code> "|" operator) two or more
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
58 * of those <code>DWT</code> style constants. The class description
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
59 * lists the style constants that are applicable to the class.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
60 * Style bits are also inherited from superclasses.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
61 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
62 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
63 * @param parent a widget which will be the parent of the new instance (cannot be null)
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
64 * @param style the style of widget to construct
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
65 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
66 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
67 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
68 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
69 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
70 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
71 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
72 * @exception DWTError <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
73 * <li>ERROR_NO_HANDLES if a handle could not be obtained for browser creation</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
74 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
75 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
76 * @see Widget#getStyle
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
77 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
78 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
79 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
80 public Browser (Composite parent, int style) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
81 super (checkParent (parent), checkStyle (style));
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
82 userStyle = style;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
83
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
84 String platform = DWT.getPlatform ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
85 Display display = parent.getDisplay ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
86 if ("gtk".equals (platform)) display.setData (NO_INPUT_METHOD, null); //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
87 String className = null;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
88 if ((style & DWT.MOZILLA) !is 0) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
89 className = "dwt.browser.Mozilla"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
90 } else {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
91 if ("win32".equals (platform) || "wpf".equals (platform)) { //$NON-NLS-1$ $NON-NLS-2$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
92 className = "dwt.browser.IE"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
93 } else if ("motif".equals (platform)) { //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
94 className = "dwt.browser.Mozilla"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
95 } else if ("gtk".equals (platform)) { //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
96 className = "dwt.browser.Mozilla"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
97 } else if ("carbon".equals (platform) || "cocoa".equals (platform)) { //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
98 className = "dwt.browser.Safari"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
99 } else if ("photon".equals (platform)) { //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
100 className = "dwt.browser.Voyager"; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
101 } else {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
102 dispose ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
103 DWT.error (DWT.ERROR_NO_HANDLES);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
104 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
105 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
106
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
107 try {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
108 Class clazz = Class.forName (className);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
109 webBrowser = (WebBrowser)clazz.newInstance ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
110 } catch (ClassNotFoundException e) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
111 } catch (IllegalAccessException e) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
112 } catch (InstantiationException e) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
113 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
114 if (webBrowser is null) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
115 dispose ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
116 DWT.error (DWT.ERROR_NO_HANDLES);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
117 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
118
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
119 webBrowser.setBrowser (this);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
120 webBrowser.create (parent, style);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
121 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
122
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
123 static Composite checkParent (Composite parent) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
124 String platform = DWT.getPlatform ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
125 if (!"gtk".equals (platform)) return parent; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
126
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
127 /*
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
128 * Note. Mozilla provides all IM support needed for text input in web pages.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
129 * If DWT creates another input method context for the widget it will cause
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
130 * indeterminate results to happen (hangs and crashes). The fix is to prevent
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
131 * DWT from creating an input method context for the Browser widget.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
132 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
133 if (parent !is null && !parent.isDisposed ()) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
134 Display display = parent.getDisplay ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
135 if (display !is null) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
136 if (display.getThread () is Thread.currentThread ()) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
137 display.setData (NO_INPUT_METHOD, "true"); //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
138 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
139 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
140 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
141 return parent;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
142 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
143
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
144 static int checkStyle(int style) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
145 String platform = DWT.getPlatform ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
146 if ((style & DWT.MOZILLA) !is 0) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
147 if ("carbon".equals (platform)) return style | DWT.EMBEDDED; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
148 if ("motif".equals (platform)) return style | DWT.EMBEDDED; //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
149 return style;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
150 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
151
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
152 if ("win32".equals (platform)) { //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
153 /*
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
154 * For IE on win32 the border is supplied by the embedded browser, so remove
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
155 * the style so that the parent Composite will not draw a second border.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
156 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
157 return style & ~DWT.BORDER;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
158 } else if ("motif".equals (platform)) { //$NON-NLS-1$
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
159 return style | DWT.EMBEDDED;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
160 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
161 return style;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
162 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
163
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
164 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
165 * Clears all session cookies from all current Browser instances.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
166 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
167 * @since 3.2
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
168 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
169 public static void clearSessions () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
170 WebBrowser.clearSessions ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
171 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
172
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
173 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
174 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
175 * notified when the window hosting the receiver should be closed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
176 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
177 * This notification occurs when a javascript command such as
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
178 * <code>window.close</code> gets executed by a <code>Browser</code>.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
179 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
180 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
181 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
182 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
183 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
184 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
185 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
186 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
187 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
188 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
189 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
190 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
191 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
192 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
193 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
194 public void addCloseWindowListener (CloseWindowListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
195 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
196 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
197 webBrowser.addCloseWindowListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
198 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
199
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
200 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
201 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
202 * notified when the current location has changed or is about to change.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
203 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
204 * This notification typically occurs when the application navigates
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
205 * to a new location with {@link #setUrl(String)} or when the user
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
206 * activates a hyperlink.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
207 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
208 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
209 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
210 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
211 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
212 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
213 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
214 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
215 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
216 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
217 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
218 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
219 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
220 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
221 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
222 public void addLocationListener (LocationListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
223 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
224 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
225 webBrowser.addLocationListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
226 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
227
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
228 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
229 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
230 * notified when a new window needs to be created.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
231 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
232 * This notification occurs when a javascript command such as
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
233 * <code>window.open</code> gets executed by a <code>Browser</code>.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
234 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
235 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
236 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
237 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
238 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
239 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
240 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
241 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
242 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
243 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
244 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
245 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
246 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
247 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
248 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
249 public void addOpenWindowListener (OpenWindowListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
250 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
251 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
252 webBrowser.addOpenWindowListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
253 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
254
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
255 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
256 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
257 * notified when a progress is made during the loading of the current
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
258 * URL or when the loading of the current URL has been completed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
259 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
260 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
261 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
262 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
263 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
264 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
265 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
266 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
267 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
268 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
269 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
270 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
271 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
272 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
273 public void addProgressListener (ProgressListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
274 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
275 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
276 webBrowser.addProgressListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
277 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
278
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
279 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
280 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
281 * notified when the status text is changed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
282 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
283 * The status text is typically displayed in the status bar of
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
284 * a browser application.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
285 * </p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
286 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
287 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
288 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
289 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
290 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
291 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
292 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
293 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
294 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
295 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
296 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
297 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
298 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
299 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
300 public void addStatusTextListener (StatusTextListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
301 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
302 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
303 webBrowser.addStatusTextListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
304 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
305
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
306 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
307 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
308 * notified when the title of the current document is available
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
309 * or has changed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
310 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
311 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
312 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
313 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
314 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
315 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
316 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
317 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
318 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
319 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
320 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
321 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
322 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
323 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
324 public void addTitleListener (TitleListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
325 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
326 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
327 webBrowser.addTitleListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
328 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
329
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
330 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
331 * Adds the listener to the collection of listeners who will be
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
332 * notified when a window hosting the receiver needs to be displayed
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
333 * or hidden.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
334 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
335 * @param listener the listener which should be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
336 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
337 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
338 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
339 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
340 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
341 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
342 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
343 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
344 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
345 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
346 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
347 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
348 public void addVisibilityWindowListener (VisibilityWindowListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
349 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
350 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
351 webBrowser.addVisibilityWindowListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
352 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
353
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
354 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
355 * Navigate to the previous session history item.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
356 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
357 * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
358 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
359 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
360 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
361 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
362 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
363 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
364 * @see #forward
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
365 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
366 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
367 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
368 public bool back () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
369 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
370 return webBrowser.back ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
371 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
372
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
373 protected void checkSubclass () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
374 String name = getClass ().getName ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
375 int index = name.lastIndexOf ('.');
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
376 if (!name.substring (0, index + 1).equals (PACKAGE_PREFIX)) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
377 DWT.error (DWT.ERROR_INVALID_SUBCLASS);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
378 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
379 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
380
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
381 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
382 * Execute the specified script.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
383 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
384 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
385 * Execute a script containing javascript commands in the context of the current document.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
386 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
387 * @param script the script with javascript commands
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
388 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
389 * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
390 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
391 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
392 * <li>ERROR_NULL_ARGUMENT - if the script is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
393 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
394 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
395 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
396 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
397 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
398 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
399 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
400 * @since 3.1
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
401 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
402 public bool execute (String script) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
403 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
404 if (script is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
405 return webBrowser.execute (script);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
406 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
407
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
408 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
409 * Navigate to the next session history item.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
410 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
411 * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
412 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
413 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
414 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
415 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
416 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
417 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
418 * @see #back
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
419 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
420 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
421 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
422 public bool forward () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
423 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
424 return webBrowser.forward ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
425 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
426
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
427 public int getStyle () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
428 /*
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
429 * If DWT.BORDER was specified at creation time then getStyle() should answer
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
430 * it even though it is removed for IE on win32 in checkStyle().
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
431 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
432 return super.getStyle () | (userStyle & DWT.BORDER);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
433 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
434
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
435 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
436 * Returns a string with HTML that represents the content of the current page.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
437 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
438 * @return HTML representing the current page or an empty <code>String</code>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
439 * if this is empty
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
440 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
441 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
442 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
443 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
444 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
445 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
446 * @since 3.4
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
447 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
448 public String getText () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
449 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
450 return webBrowser.getText ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
451 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
452
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
453 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
454 * Returns the current URL.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
455 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
456 * @return the current URL or an empty <code>String</code> if there is no current URL
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
457 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
458 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
459 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
460 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
461 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
462 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
463 * @see #setUrl
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
464 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
465 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
466 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
467 public String getUrl () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
468 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
469 return webBrowser.getUrl ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
470 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
471
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
472 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
473 * Returns the JavaXPCOM <code>nsIWebBrowser</code> for the receiver, or <code>null</code>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
474 * if it is not available. In order for an <code>nsIWebBrowser</code> to be returned all
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
475 * of the following must be true: <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
476 * <li>the receiver's style must be <code>DWT.MOZILLA</code></li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
477 * <li>the classes from JavaXPCOM &gt;= 1.8.1.2 must be resolvable at runtime</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
478 * <li>the version of the underlying XULRunner must be &gt;= 1.8.1.2</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
479 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
480 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
481 * @return the receiver's JavaXPCOM <code>nsIWebBrowser</code> or <code>null</code>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
482 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
483 * @since 3.3
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
484 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
485 public Object getWebBrowser () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
486 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
487 return webBrowser.getWebBrowser ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
488 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
489
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
490 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
491 * Returns <code>true</code> if the receiver can navigate to the
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
492 * previous session history item, and <code>false</code> otherwise.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
493 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
494 * @return the receiver's back command enabled state
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
495 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
496 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
497 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
498 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
499 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
500 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
501 * @see #back
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
502 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
503 public bool isBackEnabled () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
504 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
505 return webBrowser.isBackEnabled ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
506 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
507
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
508 public bool isFocusControl () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
509 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
510 if (webBrowser.isFocusControl ()) return true;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
511 return super.isFocusControl ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
512 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
513
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
514 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
515 * Returns <code>true</code> if the receiver can navigate to the
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
516 * next session history item, and <code>false</code> otherwise.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
517 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
518 * @return the receiver's forward command enabled state
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
519 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
520 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
521 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
522 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
523 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
524 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
525 * @see #forward
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
526 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
527 public bool isForwardEnabled () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
528 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
529 return webBrowser.isForwardEnabled ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
530 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
531
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
532 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
533 * Refresh the current page.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
534 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
535 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
536 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
537 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
538 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
539 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
540 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
541 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
542 public void refresh () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
543 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
544 webBrowser.refresh ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
545 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
546
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
547 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
548 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
549 * be notified when the window hosting the receiver should be closed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
550 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
551 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
552 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
553 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
554 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
555 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
556 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
557 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
558 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
559 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
560 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
561 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
562 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
563 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
564 public void removeCloseWindowListener (CloseWindowListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
565 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
566 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
567 webBrowser.removeCloseWindowListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
568 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
569
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
570 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
571 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
572 * be notified when the current location is changed or about to be changed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
573 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
574 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
575 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
576 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
577 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
578 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
579 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
580 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
581 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
582 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
583 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
584 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
585 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
586 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
587 public void removeLocationListener (LocationListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
588 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
589 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
590 webBrowser.removeLocationListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
591 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
592
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
593 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
594 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
595 * be notified when a new window needs to be created.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
596 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
597 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
598 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
599 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
600 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
601 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
602 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
603 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
604 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
605 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
606 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
607 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
608 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
609 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
610 public void removeOpenWindowListener (OpenWindowListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
611 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
612 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
613 webBrowser.removeOpenWindowListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
614 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
615
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
616 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
617 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
618 * be notified when a progress is made during the loading of the current
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
619 * URL or when the loading of the current URL has been completed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
620 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
621 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
622 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
623 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
624 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
625 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
626 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
627 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
628 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
629 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
630 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
631 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
632 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
633 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
634 public void removeProgressListener (ProgressListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
635 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
636 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
637 webBrowser.removeProgressListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
638 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
639
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
640 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
641 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
642 * be notified when the status text is changed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
643 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
644 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
645 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
646 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
647 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
648 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
649 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
650 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
651 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
652 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
653 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
654 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
655 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
656 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
657 public void removeStatusTextListener (StatusTextListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
658 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
659 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
660 webBrowser.removeStatusTextListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
661 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
662
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
663 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
664 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
665 * be notified when the title of the current document is available
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
666 * or has changed.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
667 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
668 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
669 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
670 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
671 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
672 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
673 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
674 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
675 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
676 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
677 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
678 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
679 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
680 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
681 public void removeTitleListener (TitleListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
682 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
683 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
684 webBrowser.removeTitleListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
685 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
686
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
687 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
688 * Removes the listener from the collection of listeners who will
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
689 * be notified when a window hosting the receiver needs to be displayed
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
690 * or hidden.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
691 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
692 * @param listener the listener which should no longer be notified
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
693 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
694 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
695 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
696 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
697 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
698 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
699 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
700 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
701 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
702 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
703 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
704 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
705 public void removeVisibilityWindowListener (VisibilityWindowListener listener) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
706 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
707 if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
708 webBrowser.removeVisibilityWindowListener (listener);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
709 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
710
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
711 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
712 * Renders HTML.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
713 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
714 * <p>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
715 * The html parameter is Unicode encoded since it is a java <code>String</code>.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
716 * As a result, the HTML meta tag charset should not be set. The charset is implied
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
717 * by the <code>String</code> itself.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
718 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
719 * @param html the HTML content to be rendered
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
720 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
721 * @return true if the operation was successful and false otherwise.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
722 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
723 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
724 * <li>ERROR_NULL_ARGUMENT - if the html is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
725 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
726 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
727 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
728 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
729 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
730 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
731 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
732 * @see #setUrl
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
733 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
734 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
735 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
736 public bool setText (String html) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
737 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
738 if (html is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
739 return webBrowser.setText (html);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
740 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
741
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
742 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
743 * Loads a URL.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
744 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
745 * @param url the URL to be loaded
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
746 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
747 * @return true if the operation was successful and false otherwise.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
748 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
749 * @exception IllegalArgumentException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
750 * <li>ERROR_NULL_ARGUMENT - if the url is null</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
751 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
752 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
753 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
754 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
755 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
756 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
757 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
758 * @see #getUrl
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
759 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
760 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
761 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
762 public bool setUrl (String url) {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
763 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
764 if (url is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
765 return webBrowser.setUrl (url);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
766 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
767
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
768 /**
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
769 * Stop any loading and rendering activity.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
770 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
771 * @exception DWTException <ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
772 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
773 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
774 * </ul>
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
775 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
776 * @since 3.0
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
777 */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
778 public void stop () {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
779 checkWidget();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
780 webBrowser.stop ();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
781 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
782 }