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 183785 Details for
Bug 331048
[Browser] BrowserFunction called in "execute" crashes browser
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.
snippet
BrowserFunctionTest.java (text/x-java), 1.61 KB, created by
Tim Buschtoens
on 2010-11-24 12:34:32 EST
(
hide
)
Description:
snippet
Filename:
MIME Type:
Creator:
Tim Buschtoens
Created:
2010-11-24 12:34:32 EST
Size:
1.61 KB
patch
obsolete
>package testsnip; > >import org.eclipse.rwt.lifecycle.IEntryPoint; >import org.eclipse.swt.SWT; >import org.eclipse.swt.SWTError; >import org.eclipse.swt.browser.Browser; >import org.eclipse.swt.browser.BrowserFunction; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class BrowserFunctionTest implements IEntryPoint { > >Browser browser; > > public int createUI() { > Display display = new Display(); > final Shell shell = new Shell(display); > shell.setLayout(new GridLayout()); > try { > browser = new Browser(shell, SWT.NONE ); > } catch (SWTError e) { > System.out.println("Could not instantiate Browser: " + e.getMessage()); > display.dispose(); > return 0; > } > browser.setText( "<html><head></head><body></body></html>" ); > new BrowserFunction(browser, "bla" ) { > public Object function( Object[] arguments ) { > System.out.println( arguments.length ); > return super.function(arguments); > } > }; > Button b = new Button( shell, SWT.PUSH ); > b.setText("Exe"); > b.addSelectionListener(new SelectionAdapter() { > public void widgetSelected( SelectionEvent e ) { > browser.execute( "bla( );" ); > } > }); > > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > return 0; > } >}
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 331048
: 183785