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 138690 Details for
Bug 279656
Missing keystroke in Windows XP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Main Class
TestMissingKeyMain.java (text/plain), 3.28 KB, created by
Andy Tsoi
on 2009-06-09 12:45:08 EDT
(
hide
)
Description:
Main Class
Filename:
MIME Type:
Creator:
Andy Tsoi
Created:
2009-06-09 12:45:08 EDT
Size:
3.28 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Text; > >public class TestMissingKeyMain extends Shell >{ > > /** > * Launch the application > * @param args > */ > public static void main(String args[]) > { > try > { > > final Display display = Display.getDefault(); > > final TestMissingKeyMain shell = new TestMissingKeyMain(display, SWT.SHELL_TRIM); > shell.open(); > shell.layout(); > > dialogShell = new DialogShell(display, SWT.SHELL_TRIM); > > display.addFilter(SWT.KeyDown, new Listener() > { > > public void handleEvent(Event event) > { > if (event.keyCode == SWT.ESC) > { > > dialogShell.setLocation(10000, 10000); > > try > { > shell.setActive(); > } > catch (Exception e) > { > e.printStackTrace(); > } > > } > } > > }); > > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > creates(); > > while (!shell.isDisposed()) > { > > if (!display.readAndDispatch()) > display.sleep(); > } > } > catch (Exception e) > { > e.printStackTrace(); > } > } > > /** > * Create UI task in separate thread > */ > private static void creates() > { > Thread thread = new Thread(new Runnable() > { > > public void run() > { > while (true) > { > > Display.getDefault().asyncExec(new Runnable() > { > > public void run() > { > > } > > }); > > } > } > > }); > thread.start(); > } > > /** > * Create the shell > * @param display > * @param style > */ > public TestMissingKeyMain(Display display, int style) > { > super(display, style); > createContents(); > } > > static DialogShell dialogShell; > > /** > * Create contents of the window > */ > protected void createContents() > { > setText("SWT Application"); > setSize(500, 375); > > Display.getDefault().addFilter(SWT.KeyUp, new Listener() > { > public void handleEvent(Event event) > { > System.out.println("up ---- --------------------" + event); > } > }); > > Display.getDefault().addFilter(SWT.KeyDown, new Listener() > { > public void handleEvent(Event event) > { > System.out.println("Down ++++++++++++++++++++++++ " + event); > } > }); > > Display.getDefault().addFilter(SWT.KeyDown, new Listener() > { > > public void handleEvent(Event event) > { > > if (event.keyCode == SWT.F1) > { > > dialogShell.setActive(); > dialogShell.clearText(); > > if (!dialogShell.isVisible()) > dialogShell.open(); > else > { > dialogShell.setTextFocus(); > } > > dialogShell.setLocation(100, 100); > > } > else if (event.keyCode == SWT.ESC) > { > > dialogShell.setLocation(10000, 10000); > > TestMissingKeyMain.this.setActive(); > } > } > > }); > final Text button = new Text(this, SWT.NONE); > > button.setBounds(90, 60, 195, 65); > // > } > > @Override > protected void checkSubclass() > { > // Disable the check that prevents subclassing of SWT components > } > >}
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 279656
: 138690 |
138691
|
138773
|
139013
|
139014