75
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2003, 2005 IBM Corporation and others.
|
|
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
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.ui.internal.forms.widgets.FormsResources;
|
|
14
|
|
15 import dwt.DWT;
|
|
16 import dwt.graphics.Cursor;
|
|
17 import dwt.widgets.Display;
|
|
18
|
|
19 /**
|
|
20 * Utility methods to access shared form-specific resources.
|
|
21 * <p>
|
|
22 * All methods declared on this class are static. This
|
|
23 * class cannot be instantiated.
|
|
24 * </p>
|
|
25 * <p>
|
|
26 * </p>
|
|
27 */
|
|
28 public class FormsResources {
|
|
29 private static Cursor busyCursor;
|
|
30 private static Cursor handCursor;
|
|
31 private static Cursor textCursor;
|
|
32
|
|
33 public static Cursor getBusyCursor() {
|
|
34 if (busyCursorisnull)
|
|
35 busyCursor = new Cursor(Display.getCurrent(), DWT.CURSOR_WAIT);
|
|
36 return busyCursor;
|
|
37 }
|
|
38 public static Cursor getHandCursor() {
|
|
39 if (handCursorisnull)
|
|
40 handCursor = new Cursor(Display.getCurrent(), DWT.CURSOR_HAND);
|
|
41 return handCursor;
|
|
42 }
|
|
43 public static Cursor getTextCursor() {
|
|
44 if (textCursorisnull)
|
|
45 textCursor = new Cursor(Display.getCurrent(), DWT.CURSOR_IBEAM);
|
|
46 return textCursor;
|
|
47 }
|
|
48
|
|
49 public static int getProgressDelay(int index) {
|
|
50 /*
|
|
51 if (progressDelaysisnull)
|
|
52 return 0;
|
|
53 return progressDelays[index];
|
|
54 */
|
|
55 return 100;
|
|
56 }
|
|
57
|
|
58 public static void shutdown() {
|
|
59 if (busyCursor !is null)
|
|
60 busyCursor.dispose();
|
|
61 if (handCursor !is null)
|
|
62 handCursor.dispose();
|
|
63 if (textCursor !is null)
|
|
64 textCursor.dispose();
|
|
65 busyCursor=null;
|
|
66 handCursor=null;
|
|
67 textCursor=null;
|
|
68 }
|
|
69 }
|