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 192076 Details for
Bug 284712
[Browser] Browser component loses ExternalInterface-registered methods from flash.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Updated test/bug snippet
ExternalInterfaceBug.java (text/x-java), 2.42 KB, created by
Dawid Weiss
on 2011-03-29 06:47:47 EDT
(
hide
)
Description:
Updated test/bug snippet
Filename:
MIME Type:
Creator:
Dawid Weiss
Created:
2011-03-29 06:47:47 EDT
Size:
2.42 KB
patch
obsolete
> >import org.eclipse.swt.SWT; >import org.eclipse.swt.browser.*; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.*; > >public class ExternalInterfaceBug >{ > private static Browser browser; > private static Shell shell; > > public final static String URL = "http://download.carrotsearch.com/circles/demo/"; > > public static void main(String [] args) > { > Display display = new Display(); > shell = new Shell(display); > shell.setLayout(new FillLayout(SWT.HORIZONTAL | SWT.VERTICAL)); > > // Load the first browser instance, set its URL to > // the HTML loading a flash application that registers "selectGroupById" method. > browser = createBrowser(shell, URL); > > shell.setSize(400, 300); > shell.open(); > while (!shell.isDisposed()) > { > if (!display.readAndDispatch()) display.sleep(); > } > display.dispose(); > } > > static Runnable method = new Runnable() > { > public void run() > { > System.out.println("Executing ExternalInterface-registered method."); > browser.evaluate("javascript:alert('EI method: ' + document.getElementById('swf').selectGroupById);"); > > browser.dispose(); > browser = createBrowser(shell, URL); > shell.layout(true); > }; > }; > > private static Browser createBrowser(Composite shell, String uri) > { > final Browser b = new Browser(shell, SWT.NONE); > b.addProgressListener(new ProgressAdapter() > { > public void completed(ProgressEvent progressevent) > { > new Thread() > { > public void run() > { > // When URL loading is completed, wait a bit so that > // flash can initialize and register ExternalInterface methods. Then > // display the ExternalInterface method, dispose the browser and > // repeat the same procedure again -- for any subsequent instance, the > // function will be undefined. > try { Thread.sleep(3000); } catch (InterruptedException e) {} > Display.getDefault().asyncExec(method); > } > }.start(); > } > }); > b.setUrl(uri); > return b; > } >}
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 284712
:
142635
| 192076