annotate dwt/browser/Browser.d @ 156:969e7de37c3d default tip

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