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 124212 Details for
Bug 262974
[SWT_AWT][Browser] On Linux, Browser dialogs are not modal
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.
Sample test case.
AWTXULRunnerModalDialog.java (text/x-java), 2.34 KB, created by
Christopher Deckers
on 2009-01-29 17:00:24 EST
(
hide
)
Description:
Sample test case.
Filename:
MIME Type:
Creator:
Christopher Deckers
Created:
2009-01-29 17:00:24 EST
Size:
2.34 KB
patch
obsolete
>package test; > >import java.awt.BorderLayout; >import java.awt.Canvas; >import java.awt.Container; > >import javax.swing.JButton; >import javax.swing.JFrame; >import javax.swing.SwingUtilities; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.awt.SWT_AWT; >import org.eclipse.swt.browser.Browser; >import org.eclipse.swt.browser.LocationAdapter; >import org.eclipse.swt.browser.LocationEvent; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class AWTXULRunnerModalDialog extends JFrame { > > public AWTXULRunnerModalDialog() { > setDefaultCloseOperation(EXIT_ON_CLOSE); > Canvas canvas = new Canvas() { > @Override > public void addNotify() { > super.addNotify(); > final Canvas canvas_ = this; > display.asyncExec(new Runnable() { > public void run() { > final Shell shell = SWT_AWT.new_Shell(display, canvas_); > shell.setLayout(new FillLayout()); > final Browser browser = new Browser(shell, SWT.NONE); > browser.setUrl("http://www.google.com"); > browser.addLocationListener(new LocationAdapter() { > @Override > public void changed(LocationEvent e) { > display.asyncExec(new Runnable() { > public void run() { > browser.execute("alert('some dialog');"); > } > }); > } > }); > // The initial size is wrong on Windows so we have to force it > shell.setSize(canvas_.getWidth(), canvas_.getHeight()); > } > }); > } > }; > Container contentPane = getContentPane(); > contentPane.add(canvas, BorderLayout.CENTER); > contentPane.add(new JButton("Some Swing Button"), BorderLayout.SOUTH); > setSize(400, 300); > } > > private static Display display; > > public static void main(String[] args) { > System.setProperty("sun.awt.noerasebackground", "true"); > System.setProperty("sun.awt.xembedserver", "true"); > display = new Display(); > SwingUtilities.invokeLater(new Runnable() { > public void run() { > new AWTXULRunnerModalDialog().setVisible(true); > } > }); > while(true) { > if(!display.readAndDispatch()) { > display.sleep(); > } > } > } > >}
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 262974
: 124212 |
135018