KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > misc > Policy


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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  *******************************************************************************/

11 package org.eclipse.ui.internal.misc;
12
13 import org.eclipse.core.runtime.Platform;
14 import org.eclipse.ui.ISourceProvider;
15 import org.eclipse.ui.PlatformUI;
16
17 /**
18  * A common facility for parsing the <code>org.eclipse.ui/.options</code>
19  * file.
20  *
21  * @since 2.1
22  */

23 public class Policy {
24     public static boolean DEFAULT = false;
25
26     public static boolean DEBUG_SWT_GRAPHICS = DEFAULT;
27
28     public static boolean DEBUG_SWT_DEBUG = DEFAULT;
29
30     public static boolean DEBUG_DRAG_DROP = DEFAULT;
31
32     /**
33      * Flag to log stale jobs
34      */

35     public static boolean DEBUG_STALE_JOBS = DEFAULT;
36
37     /**
38      * Whether to report all events entering through the common event framework
39      * used by the commands architecture.
40      *
41      * @see ISourceProvider
42      * @since 3.2
43      */

44     public static boolean DEBUG_SOURCES = DEFAULT;
45
46     /**
47      * Whether to print information about key bindings that are successfully
48      * recognized within the system (as the keys are pressed).
49      */

50     public static boolean DEBUG_KEY_BINDINGS = DEFAULT;
51
52     /**
53      * Whether to print information about every key seen by the system.
54      */

55     public static boolean DEBUG_KEY_BINDINGS_VERBOSE = DEFAULT;
56
57     /**
58      * Whether to print extra information about error conditions dealing with
59      * cool bars in the workbench, and their disposal.
60      */

61     public static boolean DEBUG_TOOLBAR_DISPOSAL = DEFAULT;
62
63     /**
64      * Whether to print debugging information about the execution of commands
65      */

66     public static boolean DEBUG_COMMANDS = DEFAULT;
67
68     /**
69      * Whether to print debugging information about the internal state of the
70      * context support within the workbench.
71      */

72     public static boolean DEBUG_CONTEXTS = DEFAULT;
73
74     /**
75      * Whether to print debugging information about the performance of context
76      * computations.
77      */

78     public static boolean DEBUG_CONTEXTS_PERFORMANCE = DEFAULT;
79
80     /**
81      * Whether to print even more debugging information about the internal state
82      * of the context support within the workbench.
83      */

84     public static boolean DEBUG_CONTEXTS_VERBOSE = DEFAULT;
85
86     /**
87      * Whether to print debugging information about the internal state of the
88      * command support (in relation to handlers) within the workbench.
89      */

90     public static boolean DEBUG_HANDLERS = DEFAULT;
91
92     /**
93      * Whether to print debugging information about the performance of handler
94      * computations.
95      */

96     public static boolean DEBUG_HANDLERS_PERFORMANCE = DEFAULT;
97
98     /**
99      * Whether to print out verbose information about changing handlers in the
100      * workbench.
101      */

102     public static boolean DEBUG_HANDLERS_VERBOSE = DEFAULT;
103     
104     /**
105      * Whether to print debugging information about unexpected occurrences and
106      * important state changes in the operation history.
107      */

108     public static boolean DEBUG_OPERATIONS = DEFAULT;
109
110     /**
111      * Whether to print out verbose information about the operation histories,
112      * including all notifications sent.
113      */

114     public static boolean DEBUG_OPERATIONS_VERBOSE = DEFAULT;
115
116
117     /**
118      * Whether or not to show system jobs at all times.
119      */

120     public static boolean DEBUG_SHOW_ALL_JOBS = DEFAULT;
121     
122     /**
123      * Whether or not to resolve images as they are declared.
124      *
125      * @since 3.1
126      */

127     public static boolean DEBUG_DECLARED_IMAGES = DEFAULT;
128     
129     /**
130      * Whether or not to print contribution-related issues.
131      *
132      * @since 3.1
133      */

134     public static boolean DEBUG_CONTRIBUTIONS = DEFAULT;
135
136     /**
137      * Which command identifier to print handler information for. This
138      * restricts the debugging output, so a developer can focus on one command
139      * at a time.
140      */

141     public static String JavaDoc DEBUG_HANDLERS_VERBOSE_COMMAND_ID = null;
142     
143     /**
144      * Whether experimental features in the rendering of commands into menus
145      * and toolbars should be enabled. This is not guaranteed to provide a
146      * working workbench.
147      */

148     public static boolean EXPERIMENTAL_MENU = DEFAULT;
149     
150     public static boolean DEBUG_MPE = DEFAULT;
151
152     static {
153         if (getDebugOption("/debug")) { //$NON-NLS-1$
154
DEBUG_SWT_GRAPHICS = getDebugOption("/trace/graphics"); //$NON-NLS-1$
155
DEBUG_SWT_DEBUG = getDebugOption("/debug/swtdebug"); //$NON-NLS-1$
156
DEBUG_DRAG_DROP = getDebugOption("/trace/dragDrop"); //$NON-NLS-1$
157
DEBUG_SOURCES = getDebugOption("/trace/sources"); //$NON-NLS-1$
158
DEBUG_KEY_BINDINGS = getDebugOption("/trace/keyBindings"); //$NON-NLS-1$
159
DEBUG_KEY_BINDINGS_VERBOSE = getDebugOption("/trace/keyBindings.verbose"); //$NON-NLS-1$
160
DEBUG_TOOLBAR_DISPOSAL = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface/trace/toolbarDisposal")); //$NON-NLS-1$ //$NON-NLS-2$
161
DEBUG_COMMANDS = getDebugOption("/trace/commands"); //$NON-NLS-1$
162
DEBUG_CONTEXTS = getDebugOption("/trace/contexts"); //$NON-NLS-1$
163
DEBUG_CONTEXTS_PERFORMANCE = getDebugOption("/trace/contexts.performance"); //$NON-NLS-1$
164
DEBUG_CONTEXTS_VERBOSE = getDebugOption("/trace/contexts.verbose"); //$NON-NLS-1$
165
DEBUG_HANDLERS = getDebugOption("/trace/handlers"); //$NON-NLS-1$
166
DEBUG_HANDLERS_PERFORMANCE = getDebugOption("/trace/handlers.performance"); //$NON-NLS-1$
167
DEBUG_HANDLERS_VERBOSE = getDebugOption("/trace/handlers.verbose"); //$NON-NLS-1$
168
DEBUG_OPERATIONS = getDebugOption("/trace/operations"); //$NON-NLS-1$
169
DEBUG_OPERATIONS_VERBOSE = getDebugOption("/trace/operations.verbose"); //$NON-NLS-1$
170
DEBUG_SHOW_ALL_JOBS = getDebugOption("/debug/showAllJobs"); //$NON-NLS-1$
171
DEBUG_STALE_JOBS = getDebugOption("/debug/job.stale"); //$NON-NLS-1$
172
DEBUG_HANDLERS_VERBOSE_COMMAND_ID = Platform
173                     .getDebugOption(PlatformUI.PLUGIN_ID
174                             + "/trace/handlers.verbose.commandId"); //$NON-NLS-1$
175
if ("".equals(DEBUG_HANDLERS_VERBOSE_COMMAND_ID)) { //$NON-NLS-1$
176
DEBUG_HANDLERS_VERBOSE_COMMAND_ID = null;
177             }
178             DEBUG_DECLARED_IMAGES = getDebugOption("/debug/declaredImages"); //$NON-NLS-1$
179
DEBUG_CONTRIBUTIONS = getDebugOption("/debug/contributions"); //$NON-NLS-1$
180
EXPERIMENTAL_MENU = getDebugOption("/experimental/menus"); //$NON-NLS-1$
181
DEBUG_MPE = getDebugOption("/trace/multipageeditor"); //$NON-NLS-1$
182
}
183     }
184
185     private static boolean getDebugOption(String JavaDoc option) {
186         return "true".equalsIgnoreCase(Platform.getDebugOption(PlatformUI.PLUGIN_ID + option)); //$NON-NLS-1$
187
}
188 }
189
Popular Tags