comparison org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormsResources.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
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 org.eclipse.ui.internal.forms.widgets.FormsResources;
14
15 import java.lang.all;
16
17 import org.eclipse.swt.SWT;
18 import org.eclipse.swt.graphics.Cursor;
19 import org.eclipse.swt.widgets.Display;
20
21 /**
22 * Utility methods to access shared form-specific resources.
23 * <p>
24 * All methods declared on this class are static. This
25 * class cannot be instantiated.
26 * </p>
27 * <p>
28 * </p>
29 */
30 public class FormsResources {
31 private static Cursor busyCursor;
32 private static Cursor handCursor;
33 private static Cursor textCursor;
34
35 public static Cursor getBusyCursor() {
36 if (busyCursor is null)
37 busyCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_WAIT);
38 return busyCursor;
39 }
40 public static Cursor getHandCursor() {
41 if (handCursor is null)
42 handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
43 return handCursor;
44 }
45 public static Cursor getTextCursor() {
46 if (textCursor is null)
47 textCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_IBEAM);
48 return textCursor;
49 }
50
51 public static int getProgressDelay(int index) {
52 /*
53 if (progressDelays is null)
54 return 0;
55 return progressDelays[index];
56 */
57 return 100;
58 }
59
60 public static void shutdown() {
61 if (busyCursor !is null)
62 busyCursor.dispose();
63 if (handCursor !is null)
64 handCursor.dispose();
65 if (textCursor !is null)
66 textCursor.dispose();
67 busyCursor=null;
68 handCursor=null;
69 textCursor=null;
70 }
71 }