Mercurial > projects > dwt-linux
annotate dwt/events/ShellAdapter.d @ 259:c0d810de7093
Update SWT 3.4M7 to 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 29 Jun 2008 14:33:38 +0200 |
parents | c8f6e8dc0fcf |
children |
rev | line source |
---|---|
3 | 1 /******************************************************************************* |
259 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
72 | 10 * Port to the D programming language: |
11 * Frank Benoit <benoit@tionex.de> | |
3 | 12 *******************************************************************************/ |
10
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
13 module dwt.events.ShellAdapter; |
3 | 14 |
10
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
15 import dwt.events.ShellListener; |
3 | 16 |
17 /** | |
18 * This adapter class provides default implementations for the | |
19 * methods described by the <code>ShellListener</code> interface. | |
20 * <p> | |
21 * Classes that wish to deal with <code>ShellEvent</code>s can | |
22 * extend this class and override only the methods which they are | |
23 * interested in. | |
24 * </p> | |
25 * | |
26 * @see ShellListener | |
27 * @see ShellEvent | |
259 | 28 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> |
3 | 29 */ |
30 public abstract class ShellAdapter : ShellListener { | |
31 | |
32 /** | |
33 * Sent when a shell becomes the active window. | |
34 * The default behavior is to do nothing. | |
35 * | |
36 * @param e an event containing information about the activation | |
37 */ | |
38 public void shellActivated(ShellEvent e) { | |
39 } | |
40 | |
41 /** | |
42 * Sent when a shell is closed. | |
43 * The default behavior is to do nothing. | |
44 * | |
45 * @param e an event containing information about the close | |
46 */ | |
47 public void shellClosed(ShellEvent e) { | |
48 } | |
49 | |
50 /** | |
51 * Sent when a shell stops being the active window. | |
52 * The default behavior is to do nothing. | |
53 * | |
54 * @param e an event containing information about the deactivation | |
55 */ | |
56 public void shellDeactivated(ShellEvent e) { | |
57 } | |
58 | |
59 /** | |
60 * Sent when a shell is un-minimized. | |
61 * The default behavior is to do nothing. | |
62 * | |
63 * @param e an event containing information about the un-minimization | |
64 */ | |
65 public void shellDeiconified(ShellEvent e) { | |
66 } | |
67 | |
68 /** | |
69 * Sent when a shell is minimized. | |
70 * The default behavior is to do nothing. | |
71 * | |
72 * @param e an event containing information about the minimization | |
73 */ | |
74 public void shellIconified(ShellEvent e) { | |
75 } | |
76 } | |
121
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
77 |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
78 class ShellDelegator : ShellAdapter { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
79 alias void delegate(ShellEvent) DFunc; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
80 DFunc delShellActivated; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
81 DFunc delShellClosed; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
82 DFunc delShellDeactivated; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
83 DFunc delShellDeiconified; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
84 DFunc delShellIconified; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
85 |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
86 private this( |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
87 DFunc delShellActivated, |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
88 DFunc delShellClosed, |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
89 DFunc delShellDeactivated, |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
90 DFunc delShellDeiconified, |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
91 DFunc delShellIconified ) |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
92 { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
93 this.delShellActivated = delShellActivated; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
94 this.delShellClosed = delShellClosed; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
95 this.delShellDeactivated = delShellDeactivated; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
96 this.delShellDeiconified = delShellDeiconified; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
97 this.delShellIconified = delShellIconified; |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
98 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
99 |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
100 static ShellDelegator createShellActivated( DFunc del ){ |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
101 return new ShellDelegator( del, null, null, null, null ); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
102 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
103 static ShellDelegator createShellClosed( DFunc del ){ |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
104 return new ShellDelegator( null, del, null, null, null ); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
105 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
106 |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
107 public void shellActivated(ShellEvent e) { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
108 if( delShellActivated !is null ) delShellActivated(e); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
109 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
110 public void shellClosed(ShellEvent e) { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
111 if( delShellClosed !is null ) delShellClosed(e); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
112 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
113 public void shellDeactivated(ShellEvent e) { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
114 if( delShellDeactivated !is null ) delShellDeactivated(e); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
115 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
116 public void shellDeiconified(ShellEvent e) { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
117 if( delShellDeiconified !is null ) delShellDeiconified(e); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
118 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
119 public void shellIconified(ShellEvent e) { |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
120 if( delShellIconified !is null ) delShellIconified(e); |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
121 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
122 } |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
123 |
c8f6e8dc0fcf
Possibly way for delegate integration
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
124 |