Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 152101 Details for
Bug 98302
[browser] add callback for handling errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
snippet that causes the stack overflow error
BrowserTest.java (text/plain), 1.49 KB, created by
Boris Bokowski
on 2009-11-12 15:12:26 EST
(
hide
)
Description:
snippet that causes the stack overflow error
Filename:
MIME Type:
Creator:
Boris Bokowski
Created:
2009-11-12 15:12:26 EST
Size:
1.49 KB
patch
obsolete
>package snip; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.browser.Browser; >import org.eclipse.swt.browser.BrowserFunction; >import org.eclipse.swt.browser.ProgressEvent; >import org.eclipse.swt.browser.ProgressListener; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class BrowserTest { > private static Browser browser; > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout(1, false)); > > browser = new Browser(shell, SWT.NONE); > new BrowserFunction(browser, "javaFoo") { > public Object function(Object[] arguments) { > Double i = (Double) arguments[0]; > if (i.intValue() <= 0) { > return 0; > } > return browser.evaluate("window.jsFoo(" + (i.intValue() - 1) > + ")"); > } > }; > browser.addProgressListener(new ProgressListener() { > public void completed(ProgressEvent event) { > for (int i = 0; i < 100; i++) { > System.out.println("Trying " + i); > browser.evaluate("window.jsFoo(" + i + ")"); > } > } > > public void changed(ProgressEvent event) { > } > }); > > browser > .setText("<html><head><script>function jsFoo(i) {if (i<= 0) {return 0;} return javaFoo(i-1);} </script></head><body></body></html>"); > > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 98302
:
22334
|
152100
| 152101 |
218815