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 164153 Details for
Bug 308422
Shell trim buttons stay active when Close event of Shell is vetoed
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
Snippet99.java (text/plain), 1.96 KB, created by
Markus Keller
on 2010-04-07 19:34:41 EDT
(
hide
)
Description:
Snippet
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2010-04-07 19:34:41 EDT
Size:
1.96 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2004 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.swt.snippets; > >/* > * Shell example snippet: prevent a shell from closing (prompt the user) > * > * For a list of all SWT example snippets see > * http://www.eclipse.org/swt/snippets/ > */ >import org.eclipse.swt.SWT; >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.Event; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; > >public class Snippet99 { > >public static void main (String [] args) { > final Display display = new Display (); > final Shell shell = new Shell (display); > shell.addListener (SWT.Close, new Listener () { > public void handleEvent (Event event) { > > final Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); > dialog.setLayout(new GridLayout()); > Button cont = new Button(dialog, SWT.PUSH); > cont.setText("Continue"); > cont.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { > dialog.dispose(); > } > }); > dialog.pack(); > dialog.open(); > while (!dialog.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > > event.doit = false; > } > }); > 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 308422
: 164153