|
Lines 31-36
public class ShellTab extends ExampleTab {
Link Here
|
| 31 |
private final java.util.List shells; |
31 |
private final java.util.List shells; |
| 32 |
private int shellCounter; |
32 |
private int shellCounter; |
| 33 |
private final ShellAdapter confirmCloseListener; |
33 |
private final ShellAdapter confirmCloseListener; |
|
|
34 |
private final ShellAdapter shellActivatedListener; |
| 35 |
private final ShellAdapter shellDeactivatedListener; |
| 34 |
private Image shellImage; |
36 |
private Image shellImage; |
| 35 |
private Button createInvisibleButton; |
37 |
private Button createInvisibleButton; |
| 36 |
private Button createAsDialogButton; |
38 |
private Button createAsDialogButton; |
|
Lines 52-57
public class ShellTab extends ExampleTab {
Link Here
|
| 52 |
event.doit = canClose; |
54 |
event.doit = canClose; |
| 53 |
} |
55 |
} |
| 54 |
}; |
56 |
}; |
|
|
57 |
shellActivatedListener = new ShellAdapter() { |
| 58 |
public void shellActivated( ShellEvent e ) { |
| 59 |
((Shell)e.getSource()).getData(); |
| 60 |
} |
| 61 |
}; |
| 62 |
shellDeactivatedListener = new ShellAdapter() { |
| 63 |
public void shellDeactivated( ShellEvent e ) { |
| 64 |
((Shell)e.getSource()).close(); |
| 65 |
} |
| 66 |
}; |
| 55 |
setDefaultStyle( SWT.SHELL_TRIM ); |
67 |
setDefaultStyle( SWT.SHELL_TRIM ); |
| 56 |
} |
68 |
} |
| 57 |
|
69 |
|
|
Lines 188-198
public class ShellTab extends ExampleTab {
Link Here
|
| 188 |
|
200 |
|
| 189 |
private void createShell() { |
201 |
private void createShell() { |
| 190 |
Shell shell; |
202 |
Shell shell; |
| 191 |
if( createAsDialogButton.getSelection() ) { |
203 |
shell = new Shell( getShell(), getStyle() ); |
| 192 |
shell = new Shell( getShell(), getStyle() ); |
|
|
| 193 |
} else { |
| 194 |
shell = new Shell( getShell().getDisplay(), getStyle() ); |
| 195 |
} |
| 196 |
// if( customBgColorButton.getSelection() ) { |
204 |
// if( customBgColorButton.getSelection() ) { |
| 197 |
// shell.setBackground( BG_COLOR_BROWN ); |
205 |
// shell.setBackground( BG_COLOR_BROWN ); |
| 198 |
// } |
206 |
// } |
|
Lines 206-211
public class ShellTab extends ExampleTab {
Link Here
|
| 206 |
shell.setText( "Test Shell " + shellCounter ); |
214 |
shell.setText( "Test Shell " + shellCounter ); |
| 207 |
shell.setAlpha( alpha ); |
215 |
shell.setAlpha( alpha ); |
| 208 |
shell.setImage( shellImage ); |
216 |
shell.setImage( shellImage ); |
|
|
217 |
shell.addShellListener( shellActivatedListener ); |
| 218 |
shell.addShellListener( shellDeactivatedListener ); |
| 209 |
if( confirmCloseButton.getSelection() ) { |
219 |
if( confirmCloseButton.getSelection() ) { |
| 210 |
shell.addShellListener( confirmCloseListener ); |
220 |
shell.addShellListener( confirmCloseListener ); |
| 211 |
} |
221 |
} |
|
Lines 348-354
public class ShellTab extends ExampleTab {
Link Here
|
| 348 |
private Point getNextShellLocation() { |
358 |
private Point getNextShellLocation() { |
| 349 |
Point result = getShell().getLocation(); |
359 |
Point result = getShell().getLocation(); |
| 350 |
int count = getShells().length % 12; |
360 |
int count = getShells().length % 12; |
| 351 |
result.x += 50 + count * 10; |
361 |
result.x += 200 + count * 10; |
| 352 |
result.y += 50 + count * 10; |
362 |
result.y += 50 + count * 10; |
| 353 |
return result ; |
363 |
return result ; |
| 354 |
} |
364 |
} |