comparison dwt/widgets/Widget.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 5a30aa9820f3
children 827aebee255f
comparison
equal deleted inserted replaced
257:cc1d3de0e80b 259:c0d810de7093
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
56 * hierarchy. No support is provided for user-written classes which are 56 * hierarchy. No support is provided for user-written classes which are
57 * implemented as subclasses of this class. 57 * implemented as subclasses of this class.
58 * </p> 58 * </p>
59 * 59 *
60 * @see #checkSubclass 60 * @see #checkSubclass
61 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
61 */ 62 */
62 public abstract class Widget { 63 public abstract class Widget {
63 /** 64 /**
64 * the handle to the OS resource 65 * the handle to the OS resource
65 * (Warning: This field is platform dependent) 66 * (Warning: This field is platform dependent)
311 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 312 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
312 * </ul> 313 * </ul>
313 * 314 *
314 * @see Listener 315 * @see Listener
315 * @see DWT 316 * @see DWT
317 * @see #getListeners(int)
316 * @see #removeListener(int, Listener) 318 * @see #removeListener(int, Listener)
317 * @see #notifyListeners 319 * @see #notifyListeners
318 */ 320 */
319 public void addListener (int eventType, Listener listener) { 321 public void addListener (int eventType, Listener listener) {
320 checkWidget (); 322 checkWidget ();
1085 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1087 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1086 * </ul> 1088 * </ul>
1087 * 1089 *
1088 * @see DWT 1090 * @see DWT
1089 * @see #addListener 1091 * @see #addListener
1092 * @see #getListeners(int)
1090 * @see #removeListener(int, Listener) 1093 * @see #removeListener(int, Listener)
1091 */ 1094 */
1092 public void notifyListeners (int eventType, Event event) { 1095 public void notifyListeners (int eventType, Event event) {
1093 checkWidget(); 1096 checkWidget();
1094 if (event is null) event = new Event (); 1097 if (event is null) event = new Event ();
1152 * Removes the listener from the collection of listeners who will 1155 * Removes the listener from the collection of listeners who will
1153 * be notified when an event of the given type occurs. The event 1156 * be notified when an event of the given type occurs. The event
1154 * type is one of the event constants defined in class <code>DWT</code>. 1157 * type is one of the event constants defined in class <code>DWT</code>.
1155 * 1158 *
1156 * @param eventType the type of event to listen for 1159 * @param eventType the type of event to listen for
1157 * @param listener the listener which should no longer be notified when the event occurs 1160 * @param listener the listener which should no longer be notified
1158 * 1161 *
1159 * @exception IllegalArgumentException <ul> 1162 * @exception IllegalArgumentException <ul>
1160 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> 1163 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
1161 * </ul> 1164 * </ul>
1162 * @exception DWTException <ul> 1165 * @exception DWTException <ul>
1165 * </ul> 1168 * </ul>
1166 * 1169 *
1167 * @see Listener 1170 * @see Listener
1168 * @see DWT 1171 * @see DWT
1169 * @see #addListener 1172 * @see #addListener
1173 * @see #getListeners(int)
1170 * @see #notifyListeners 1174 * @see #notifyListeners
1171 */ 1175 */
1172 public void removeListener (int eventType, Listener handler) { 1176 public void removeListener (int eventType, Listener handler) {
1173 checkWidget (); 1177 checkWidget ();
1174 if (handler is null) error (DWT.ERROR_NULL_ARGUMENT); 1178 if (handler is null) error (DWT.ERROR_NULL_ARGUMENT);
1185 * within the packages provided by DWT. It should never be 1189 * within the packages provided by DWT. It should never be
1186 * referenced from application code. 1190 * referenced from application code.
1187 * </p> 1191 * </p>
1188 * 1192 *
1189 * @param eventType the type of event to listen for 1193 * @param eventType the type of event to listen for
1190 * @param listener the listener which should no longer be notified when the event occurs 1194 * @param listener the listener which should no longer be notified
1191 * 1195 *
1192 * @exception IllegalArgumentException <ul> 1196 * @exception IllegalArgumentException <ul>
1193 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> 1197 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
1194 * </ul> 1198 * </ul>
1195 * @exception DWTException <ul> 1199 * @exception DWTException <ul>
1231 1235
1232 /** 1236 /**
1233 * Removes the listener from the collection of listeners who will 1237 * Removes the listener from the collection of listeners who will
1234 * be notified when the widget is disposed. 1238 * be notified when the widget is disposed.
1235 * 1239 *
1236 * @param listener the listener which should no longer be notified when the receiver is disposed 1240 * @param listener the listener which should no longer be notified
1237 * 1241 *
1238 * @exception IllegalArgumentException <ul> 1242 * @exception IllegalArgumentException <ul>
1239 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> 1243 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
1240 * </ul> 1244 * </ul>
1241 * @exception DWTException <ul> 1245 * @exception DWTException <ul>