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 70533 Details for
Bug 191523
FileDialog crashes JVM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Java class demonstrating the problem
BugPopupDialog.java (text/plain), 1.42 KB, created by
Ed Snible
on 2007-06-07 13:22:40 EDT
(
hide
)
Description:
Java class demonstrating the problem
Filename:
MIME Type:
Creator:
Ed Snible
Created:
2007-06-07 13:22:40 EDT
Size:
1.42 KB
patch
obsolete
>package pip1034; > >import org.eclipse.jface.dialogs.PopupDialog; >import org.eclipse.jface.viewers.LabelProvider; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Control; >import org.eclipse.swt.widgets.FileDialog; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.ui.dialogs.ElementListSelectionDialog; > >public class BugPopupDialog extends PopupDialog { > > public BugPopupDialog(Shell parent) { > super(parent, SWT.POP_UP|SWT.RESIZE, false, false, false, false, null, null); > } > > protected Control createDialogArea(Composite parent) { > Composite composite = (Composite) super.createDialogArea(parent); > Button buttonBrowse = new Button(composite, SWT.PUSH); > buttonBrowse.setText("Browse..."); > buttonBrowse.addSelectionListener(new SelectionAdapter() { > > public void widgetSelected(SelectionEvent e) { > // No problem opening other dialog types > ElementListSelectionDialog elsd = new ElementListSelectionDialog(getShell(), > new LabelProvider()); > elsd.open(); > > // The problem is the 'getShell()'. Using 'new Shell()' fixes the problem. > FileDialog fsd = new FileDialog(getShell(), SWT.SINGLE); > String fname = fsd.open(); > System.out.println(fname); > } > }); > > return composite; > } >}
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 191523
: 70533 |
172161