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 196850 Details for
Bug 347579
Metacity-Hack in Shell breaks things instead of fixing them
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 to test the behaviour.
ShellActivationTests.java (text/x-java), 2.50 KB, created by
Daniel Migowski
on 2011-05-29 11:32:10 EDT
(
hide
)
Description:
Snippet to test the behaviour.
Filename:
MIME Type:
Creator:
Daniel Migowski
Created:
2011-05-29 11:32:10 EDT
Size:
2.50 KB
patch
obsolete
>package de.ikoffice.gui; > >import java.io.BufferedReader; >import java.io.IOException; >import java.io.InputStreamReader; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Tree; >import org.eclipse.swt.widgets.TreeItem; > >/** > * Here we test why it is not possible to bring a shell to front > * during GUI tests. For this test we use a simple Composite with > * just a textfield, and try to work with it. > * <p> > * RESULT: Using forceActive() is enought and works, at least on > * Linux. Why doesn't it work with our mainform in our app? > * See ShellActivationTests2 for more testing. > * > * @author $Author$ > * @version $Revidsion$ $Date$ > */ >public class ShellActivationTests { > > public static class GuiThread extends Thread { > > public GuiThread() { > super("GuiThread"); > } > > @Override > public void run() { > Display display = new Display (); > Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > Tree tree = new Tree(shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); > TreeItem item = new TreeItem(tree,SWT.NONE); > item.setText("sdfsdf"); > item = new TreeItem(tree,SWT.NONE); > item.setText("AAsdfsdf"); > item = new TreeItem(item,SWT.NONE); > item.setText("AAsdfsdf"); > > shell.open (); > > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > > display.dispose (); > } > > } > > public static void main(String[] args) { > GuiThread gt = new GuiThread(); > gt.start(); > BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); > while( true ) { > System.out.println("Press [Enter] to bring the window to front."); > try { > reader.readLine(); > } catch (IOException e) { > e.printStackTrace(); > } > Display.getDefault().syncExec(new Runnable() { > @Override > public void run() { > Display d = Display.getCurrent(); > Shell s = d.getShells()[0]; > s.forceActive(); > s.forceFocus(); > } > > }); > } > } > >}
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 347579
: 196850