Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java90
1 files changed, 45 insertions, 45 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java
index c14b52da29..896e076b85 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java
@@ -25,61 +25,61 @@ import org.eclipse.swt.widgets.*;
*/
public class Bug496639_DialogFullScreenShell {
- public static void main(String[] args) {
- Display display = new Display();
+ public static void main(String[] args) {
+ Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
- Menu menuBar = new Menu(shell, SWT.BAR);
- MenuItem fileMenuItem = new MenuItem(menuBar, SWT.CASCADE);
- fileMenuItem.setText("File");
- Menu fileMenu = new Menu(fileMenuItem);
- fileMenuItem.setMenu(fileMenu);
+ Menu menuBar = new Menu(shell, SWT.BAR);
+ MenuItem fileMenuItem = new MenuItem(menuBar, SWT.CASCADE);
+ fileMenuItem.setText("File");
+ Menu fileMenu = new Menu(fileMenuItem);
+ fileMenuItem.setMenu(fileMenu);
- MenuItem toggleFullScreenMenuItem = new MenuItem(fileMenu, SWT.CHECK);
- toggleFullScreenMenuItem.setText("Toggle full screen");
- toggleFullScreenMenuItem.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event event) {
- shell.setFullScreen(toggleFullScreenMenuItem.getSelection());
- }
- });
+ MenuItem toggleFullScreenMenuItem = new MenuItem(fileMenu, SWT.CHECK);
+ toggleFullScreenMenuItem.setText("Toggle full screen");
+ toggleFullScreenMenuItem.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ shell.setFullScreen(toggleFullScreenMenuItem.getSelection());
+ }
+ });
- MenuItem showDialogMenuItem = new MenuItem(fileMenu, SWT.PUSH);
- showDialogMenuItem.setText("Show dialog");
- showDialogMenuItem.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event event) {
- Shell dialogShell = new Shell(shell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
- dialogShell.setLayout(new FillLayout());
+ MenuItem showDialogMenuItem = new MenuItem(fileMenu, SWT.PUSH);
+ showDialogMenuItem.setText("Show dialog");
+ showDialogMenuItem.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ Shell dialogShell = new Shell(shell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
+ dialogShell.setLayout(new FillLayout());
- Text text = new Text(dialogShell, SWT.BORDER);
- text.setText("Hello world!");
+ Text text = new Text(dialogShell, SWT.BORDER);
+ text.setText("Hello world!");
- // center on top of parent widget.shell
- Point size = dialogShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle bounds = shell.getBounds();
- dialogShell.setBounds(bounds.x + (bounds.width - size.x) / 2,
- bounds.y + (bounds.height - size.y) / 2,
- size.x, size.y);
- dialogShell.open();
+ // center on top of parent widget.shell
+ Point size = dialogShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Rectangle bounds = shell.getBounds();
+ dialogShell.setBounds(bounds.x + (bounds.width - size.x) / 2,
+ bounds.y + (bounds.height - size.y) / 2,
+ size.x, size.y);
+ dialogShell.open();
// dialogShell.forceActive();
// dialogShell.moveAbove(widget.shell);
- }
- });
+ }
+ });
- shell.setMenuBar(menuBar);
+ shell.setMenuBar(menuBar);
- shell.setSize(300, 200);
- shell.open();
+ shell.setSize(300, 200);
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
- display.dispose();
- }
+ display.dispose();
+ }
}

Back to the top