Skip to content

Commit 998dac9

Browse files
committed
Use OSGI tracing and debug options handling in org.eclipse.ui.workbench
Moved debug option handling from Policy to WorkbenchPlugin, adjusted it to use OSGI debug option handling. Replaced standard out and log tracing in org.eclipse.ui.workbench with OSGI tracing. Fixes: #4033
1 parent de45bf4 commit 998dac9

6 files changed

Lines changed: 143 additions & 61 deletions

File tree

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/ObjectActionContributor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public boolean contributeObjectActions(final IWorkbenchPart part, IMenuManager m
118118
IStructuredSelection newSelection = LegacyResourceSupport.adaptSelection(ssel, getObjectClass());
119119
if (newSelection.size() != ssel.size()) {
120120
if (Policy.DEBUG_CONTRIBUTIONS) {
121-
WorkbenchPlugin.log("Error adapting selection to " + getObjectClass() + //$NON-NLS-1$
121+
WorkbenchPlugin.getDefault().getTrace().trace(Policy.DEBUG_CONTRIBUTIONS_FLAG, "Error adapting selection to " + getObjectClass() + //$NON-NLS-1$
122122
". Contribution " + getID(config) + " is being ignored"); //$NON-NLS-1$ //$NON-NLS-2$
123123
}
124124
return false;
@@ -208,7 +208,7 @@ public boolean isApplicableTo(Object object) {
208208
Object adapted = LegacyResourceSupport.getAdapter(object, getObjectClass());
209209
if (adapted == null) {
210210
if (Policy.DEBUG_CONTRIBUTIONS) {
211-
WorkbenchPlugin.log("Error adapting " + object.getClass().getName() + //$NON-NLS-1$
211+
WorkbenchPlugin.getDefault().getTrace().trace(Policy.DEBUG_CONTRIBUTIONS_FLAG, "Error adapting " + object.getClass().getName() + //$NON-NLS-1$
212212
" to " //$NON-NLS-1$
213213
+ getObjectClass() + ". Contribution " + getID(config) + " is being ignored"); //$NON-NLS-1$ //$NON-NLS-2$
214214
}

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkbenchImages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public static void declareImage(String symbolicName, ImageDescriptor descriptor,
309309
if (Policy.DEBUG_DECLARED_IMAGES) {
310310
Image image = descriptor.createImage(false);
311311
if (image == null) {
312-
WorkbenchPlugin.log("Image not found in WorkbenchImages.declaredImage(). symbolicName=" + symbolicName //$NON-NLS-1$
312+
WorkbenchPlugin.getDefault().getTrace().trace(Policy.DEBUG_DECLARED_IMAGES_FLAG, "Image not found in WorkbenchImages.declaredImage(). symbolicName=" + symbolicName //$NON-NLS-1$
313313
+ " descriptor=" + descriptor, new Exception("stack dump")); //$NON-NLS-1$//$NON-NLS-2$
314314
} else {
315315
image.dispose();

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkbenchPlugin.java

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2025 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,11 +16,63 @@
1616

1717
package org.eclipse.ui.internal;
1818

19+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_COMMANDS;
20+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_COMMANDS_FLAG;
21+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTEXTS;
22+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTEXTS_FLAG;
23+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTEXTS_PERFORMANCE;
24+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTEXTS_PERFORMANCE_FLAG;
25+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTEXTS_VERBOSE;
26+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTEXTS_VERBOSE_FLAG;
27+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTRIBUTIONS;
28+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_CONTRIBUTIONS_FLAG;
29+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_DECLARED_IMAGES;
30+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_DECLARED_IMAGES_FLAG;
31+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_DRAG_DROP;
32+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_DRAG_DROP_FLAG;
33+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS;
34+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_FLAG;
35+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_PERFORMANCE;
36+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_PERFORMANCE_FLAG;
37+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_VERBOSE;
38+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_VERBOSE_COMMAND_ID;
39+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_VERBOSE_COMMAND_ID_FLAG;
40+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_HANDLERS_VERBOSE_FLAG;
41+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_KEY_BINDINGS;
42+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_KEY_BINDINGS_FLAG;
43+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_KEY_BINDINGS_VERBOSE;
44+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_KEY_BINDINGS_VERBOSE_FLAG;
45+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_MPE;
46+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_MPE_FLAG;
47+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_OPERATIONS;
48+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_OPERATIONS_FLAG;
49+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_OPERATIONS_VERBOSE;
50+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_OPERATIONS_VERBOSE_FLAG;
51+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SHOW_ALL_JOBS;
52+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SHOW_ALL_JOBS_FLAG;
53+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SOURCES;
54+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SOURCES_FLAG;
55+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_STALE_JOBS;
56+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_STALE_JOBS_FLAG;
57+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_DEBUG;
58+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_DEBUG_FLAG;
59+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_DEBUG_GLOBAL;
60+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_DEBUG_GLOBAL_FLAG;
61+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_GRAPHICS;
62+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_GRAPHICS_FLAG;
63+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_TOOLBAR_DISPOSAL;
64+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_TOOLBAR_DISPOSAL_FLAG;
65+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_WORKING_SETS;
66+
import static org.eclipse.ui.internal.misc.Policy.DEBUG_WORKING_SETS_FLAG;
67+
import static org.eclipse.ui.internal.misc.Policy.DEFAULT;
68+
import static org.eclipse.ui.internal.misc.Policy.EXPERIMENTAL_MENU;
69+
1970
import java.text.Bidi;
2071
import java.text.MessageFormat;
2172
import java.util.Collection;
2273
import java.util.Collections;
2374
import java.util.HashSet;
75+
import java.util.Hashtable;
2476
import java.util.Locale;
2577
import org.eclipse.core.runtime.CoreException;
2678
import org.eclipse.core.runtime.IConfigurationElement;
@@ -41,8 +93,11 @@
4193
import org.eclipse.jface.util.BidiUtils;
4294
import org.eclipse.jface.window.Window;
4395
import org.eclipse.osgi.service.debug.DebugOptions;
96+
import org.eclipse.osgi.service.debug.DebugOptionsListener;
97+
import org.eclipse.osgi.service.debug.DebugTrace;
4498
import org.eclipse.swt.SWT;
4599
import org.eclipse.swt.custom.BusyIndicator;
100+
import org.eclipse.swt.graphics.Device;
46101
import org.eclipse.swt.widgets.Display;
47102
import org.eclipse.swt.widgets.Shell;
48103
import org.eclipse.ui.IDecoratorManager;
@@ -58,6 +113,7 @@
58113
import org.eclipse.ui.internal.help.HelpServiceImpl;
59114
import org.eclipse.ui.internal.intro.IIntroRegistry;
60115
import org.eclipse.ui.internal.intro.IntroRegistry;
116+
import org.eclipse.ui.internal.misc.Policy;
61117
import org.eclipse.ui.internal.misc.StatusUtil;
62118
import org.eclipse.ui.internal.operations.WorkbenchOperationSupport;
63119
import org.eclipse.ui.internal.progress.ProgressManager;
@@ -85,6 +141,7 @@
85141
import org.osgi.framework.BundleEvent;
86142
import org.osgi.framework.BundleException;
87143
import org.osgi.framework.BundleListener;
144+
import org.osgi.framework.ServiceRegistration;
88145
import org.osgi.util.tracker.ServiceTracker;
89146

90147
/**
@@ -103,7 +160,7 @@
103160
* createExecutableExtension to create an executable instance of our workbench
104161
* class.
105162
*/
106-
public class WorkbenchPlugin extends AbstractUIPlugin {
163+
public class WorkbenchPlugin extends AbstractUIPlugin implements DebugOptionsListener {
107164

108165
/**
109166
* Splash shell constant.
@@ -163,6 +220,8 @@ public class WorkbenchPlugin extends AbstractUIPlugin {
163220
// TODO we should just drop this constant and use PlatformUI.PLUGIN_ID instead
164221
public static String PI_WORKBENCH = PlatformUI.PLUGIN_ID;
165222

223+
private static final String JFACE = "org.eclipse.jface"; //$NON-NLS-1$
224+
166225
/**
167226
* The character used to separate preference page category ids
168227
*/
@@ -202,6 +261,10 @@ public class WorkbenchPlugin extends AbstractUIPlugin {
202261

203262
private ICommandHelpService commandHelpService;
204263

264+
private ServiceRegistration<DebugOptionsListener> debugRegistration;
265+
266+
private DebugTrace trace;
267+
205268
/**
206269
* Create an instance of the WorkbenchPlugin. The workbench plugin is
207270
* effectively the "application" for the workbench UI. The entire UI operates as
@@ -762,6 +825,10 @@ public void start(BundleContext context) throws Exception {
762825
parseBidiArguments();
763826
Window.setDefaultOrientation(getDefaultOrientation());
764827

828+
Hashtable<String, String> properties = new Hashtable<>(2);
829+
properties.put(DebugOptions.LISTENER_SYMBOLICNAME, PlatformUI.PLUGIN_ID);
830+
debugRegistration = context.registerService(DebugOptionsListener.class, this, properties);
831+
765832
// The UI plugin needs to be initialized so that it can install the callback in
766833
// PrefUtil,
767834
// which needs to be done as early as possible, before the workbench
@@ -1061,6 +1128,10 @@ public void stop(BundleContext context) throws Exception {
10611128
testableTracker.close();
10621129
testableTracker = null;
10631130
}
1131+
if (debugRegistration != null) {
1132+
debugRegistration.unregister();
1133+
debugRegistration = null;
1134+
}
10641135
super.stop(context);
10651136
}
10661137

@@ -1436,4 +1507,41 @@ public TestableObject getTestableObject() {
14361507
}
14371508
return (TestableObject) testableTracker.getService();
14381509
}
1510+
1511+
@Override
1512+
public void optionsChanged(DebugOptions options) {
1513+
trace = options.newDebugTrace(PlatformUI.PLUGIN_ID);
1514+
DEBUG_SWT_GRAPHICS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_SWT_GRAPHICS_FLAG, DEFAULT);
1515+
DEBUG_SWT_DEBUG = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_SWT_DEBUG_FLAG, DEFAULT);
1516+
DEBUG_SWT_DEBUG_GLOBAL = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_SWT_DEBUG_GLOBAL_FLAG, DEFAULT);
1517+
DEBUG_DRAG_DROP = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_DRAG_DROP_FLAG, DEFAULT);
1518+
DEBUG_SOURCES = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_SOURCES_FLAG, DEFAULT);
1519+
DEBUG_KEY_BINDINGS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_KEY_BINDINGS_FLAG, DEFAULT);
1520+
DEBUG_KEY_BINDINGS_VERBOSE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_KEY_BINDINGS_VERBOSE_FLAG, DEFAULT);
1521+
DEBUG_TOOLBAR_DISPOSAL = options.getBooleanOption(JFACE + DEBUG_TOOLBAR_DISPOSAL_FLAG, DEFAULT);
1522+
DEBUG_COMMANDS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_COMMANDS_FLAG, DEFAULT);
1523+
DEBUG_CONTEXTS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_CONTEXTS_FLAG, DEFAULT);
1524+
DEBUG_CONTEXTS_PERFORMANCE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_CONTEXTS_PERFORMANCE_FLAG, DEFAULT);
1525+
DEBUG_CONTEXTS_VERBOSE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_CONTEXTS_VERBOSE_FLAG, DEFAULT);
1526+
DEBUG_HANDLERS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_HANDLERS_FLAG, DEFAULT);
1527+
DEBUG_HANDLERS_PERFORMANCE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_HANDLERS_PERFORMANCE_FLAG, DEFAULT);
1528+
DEBUG_HANDLERS_VERBOSE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_HANDLERS_VERBOSE_FLAG, DEFAULT);
1529+
DEBUG_OPERATIONS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_OPERATIONS_FLAG, DEFAULT);
1530+
DEBUG_OPERATIONS_VERBOSE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_OPERATIONS_VERBOSE_FLAG, DEFAULT);
1531+
DEBUG_SHOW_ALL_JOBS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_SHOW_ALL_JOBS_FLAG, DEFAULT);
1532+
DEBUG_STALE_JOBS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_STALE_JOBS_FLAG, DEFAULT);
1533+
DEBUG_DECLARED_IMAGES = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_DECLARED_IMAGES_FLAG, DEFAULT);
1534+
DEBUG_CONTRIBUTIONS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_CONTRIBUTIONS_FLAG, DEFAULT);
1535+
DEBUG_HANDLERS_VERBOSE_COMMAND_ID = options.getOption(PlatformUI.PLUGIN_ID + DEBUG_HANDLERS_VERBOSE_COMMAND_ID_FLAG, ""); //$NON-NLS-1$
1536+
EXPERIMENTAL_MENU = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_CONTRIBUTIONS_FLAG, DEFAULT);
1537+
DEBUG_MPE = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_MPE_FLAG, DEFAULT);
1538+
DEBUG_WORKING_SETS = options.getBooleanOption(PlatformUI.PLUGIN_ID + DEBUG_WORKING_SETS_FLAG, DEFAULT);
1539+
if (Policy.DEBUG_SWT_DEBUG_GLOBAL) {
1540+
Device.DEBUG = true;
1541+
}
1542+
}
1543+
1544+
public DebugTrace getTrace() {
1545+
return trace;
1546+
}
14391547
}

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkingSet.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ public void run() throws Exception {
180180
IAdaptable item = factory.createElement(itemMemento);
181181
if (item == null) {
182182
if (Policy.DEBUG_WORKING_SETS) {
183-
WorkbenchPlugin
184-
.log("Unable to restore working set item - cannot instantiate item: " + factoryID); //$NON-NLS-1$
183+
WorkbenchPlugin.getDefault().getTrace().trace(Policy.DEBUG_WORKING_SETS_FLAG, "Unable to restore working set item - cannot instantiate item: " + factoryID); //$NON-NLS-1$
185184
}
186185
} else {
187186
items.add(item);

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/misc/Policy.java

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2015 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,17 +13,41 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.internal.misc;
1515

16-
import org.eclipse.core.runtime.Platform;
17-
import org.eclipse.swt.graphics.Device;
1816
import org.eclipse.ui.ISourceProvider;
19-
import org.eclipse.ui.PlatformUI;
2017

2118
/**
2219
* A common facility for parsing the <code>org.eclipse.ui/.options</code> file.
2320
*
2421
* @since 2.1
2522
*/
2623
public class Policy {
24+
25+
public static final String DEBUG_SWT_GRAPHICS_FLAG = "/trace/graphics"; //$NON-NLS-1$
26+
public static final String DEBUG_SWT_DEBUG_FLAG = "/debug/swtdebug"; //$NON-NLS-1$
27+
public static final String DEBUG_SWT_DEBUG_GLOBAL_FLAG = "/debug/swtdebugglobal"; //$NON-NLS-1$
28+
public static final String DEBUG_DRAG_DROP_FLAG = "/trace/dragDrop"; //$NON-NLS-1$
29+
public static final String DEBUG_SOURCES_FLAG = "/trace/sources"; //$NON-NLS-1$
30+
public static final String DEBUG_KEY_BINDINGS_FLAG = "/trace/keyBindings"; //$NON-NLS-1$
31+
public static final String DEBUG_KEY_BINDINGS_VERBOSE_FLAG = "/trace/keyBindings.verbose"; //$NON-NLS-1$
32+
public static final String DEBUG_TOOLBAR_DISPOSAL_FLAG = "/trace/toolbarDisposal"; //$NON-NLS-1$
33+
public static final String DEBUG_COMMANDS_FLAG = "/trace/commands"; //$NON-NLS-1$
34+
public static final String DEBUG_CONTEXTS_FLAG = "/trace/contexts"; //$NON-NLS-1$
35+
public static final String DEBUG_CONTEXTS_PERFORMANCE_FLAG = "/trace/contexts.performance"; //$NON-NLS-1$
36+
public static final String DEBUG_CONTEXTS_VERBOSE_FLAG = "/trace/contexts.verbose"; //$NON-NLS-1$
37+
public static final String DEBUG_HANDLERS_FLAG = "/trace/handlers"; //$NON-NLS-1$
38+
public static final String DEBUG_HANDLERS_PERFORMANCE_FLAG = "/trace/handlers.performance"; //$NON-NLS-1$
39+
public static final String DEBUG_HANDLERS_VERBOSE_FLAG = "/trace/handlers.verbose"; //$NON-NLS-1$
40+
public static final String DEBUG_OPERATIONS_FLAG = "/trace/operations"; //$NON-NLS-1$
41+
public static final String DEBUG_OPERATIONS_VERBOSE_FLAG = "/trace/operations.verbose"; //$NON-NLS-1$
42+
public static final String DEBUG_SHOW_ALL_JOBS_FLAG = "/debug/showAllJobs"; //$NON-NLS-1$
43+
public static final String DEBUG_STALE_JOBS_FLAG = "/debug/job.stale"; //$NON-NLS-1$
44+
public static final String DEBUG_DECLARED_IMAGES_FLAG = "/debug/declaredImages"; //$NON-NLS-1$
45+
public static final String DEBUG_CONTRIBUTIONS_FLAG = "/debug/contributions"; //$NON-NLS-1$
46+
public static final String DEBUG_HANDLERS_VERBOSE_COMMAND_ID_FLAG = ""; //$NON-NLS-1$
47+
public static final String EXPERIMENTAL_MENU_FLAG = "/experimental/menus"; //$NON-NLS-1$
48+
public static final String DEBUG_MPE_FLAG = "/trace/multipageeditor"; //$NON-NLS-1$
49+
public static final String DEBUG_WORKING_SETS_FLAG = "/debug/workingSets"; //$NON-NLS-1$
50+
2751
public static boolean DEFAULT = false;
2852

2953
public static boolean DEBUG_SWT_GRAPHICS = DEFAULT;
@@ -158,47 +182,4 @@ public class Policy {
158182
* @since 3.4
159183
*/
160184
public static boolean DEBUG_WORKING_SETS = DEFAULT;
161-
162-
static {
163-
if (getDebugOption("/debug")) { //$NON-NLS-1$
164-
DEBUG_SWT_GRAPHICS = getDebugOption("/trace/graphics"); //$NON-NLS-1$
165-
DEBUG_SWT_DEBUG = getDebugOption("/debug/swtdebug"); //$NON-NLS-1$
166-
DEBUG_SWT_DEBUG_GLOBAL = getDebugOption("/debug/swtdebugglobal"); //$NON-NLS-1$
167-
DEBUG_DRAG_DROP = getDebugOption("/trace/dragDrop"); //$NON-NLS-1$
168-
DEBUG_SOURCES = getDebugOption("/trace/sources"); //$NON-NLS-1$
169-
DEBUG_KEY_BINDINGS = getDebugOption("/trace/keyBindings"); //$NON-NLS-1$
170-
DEBUG_KEY_BINDINGS_VERBOSE = getDebugOption("/trace/keyBindings.verbose"); //$NON-NLS-1$
171-
DEBUG_TOOLBAR_DISPOSAL = "true" //$NON-NLS-1$
172-
.equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface/trace/toolbarDisposal")); //$NON-NLS-1$
173-
DEBUG_COMMANDS = getDebugOption("/trace/commands"); //$NON-NLS-1$
174-
DEBUG_CONTEXTS = getDebugOption("/trace/contexts"); //$NON-NLS-1$
175-
DEBUG_CONTEXTS_PERFORMANCE = getDebugOption("/trace/contexts.performance"); //$NON-NLS-1$
176-
DEBUG_CONTEXTS_VERBOSE = getDebugOption("/trace/contexts.verbose"); //$NON-NLS-1$
177-
DEBUG_HANDLERS = getDebugOption("/trace/handlers"); //$NON-NLS-1$
178-
DEBUG_HANDLERS_PERFORMANCE = getDebugOption("/trace/handlers.performance"); //$NON-NLS-1$
179-
DEBUG_HANDLERS_VERBOSE = getDebugOption("/trace/handlers.verbose"); //$NON-NLS-1$
180-
DEBUG_OPERATIONS = getDebugOption("/trace/operations"); //$NON-NLS-1$
181-
DEBUG_OPERATIONS_VERBOSE = getDebugOption("/trace/operations.verbose"); //$NON-NLS-1$
182-
DEBUG_SHOW_ALL_JOBS = getDebugOption("/debug/showAllJobs"); //$NON-NLS-1$
183-
DEBUG_STALE_JOBS = getDebugOption("/debug/job.stale"); //$NON-NLS-1$
184-
DEBUG_HANDLERS_VERBOSE_COMMAND_ID = Platform
185-
.getDebugOption(PlatformUI.PLUGIN_ID + "/trace/handlers.verbose.commandId"); //$NON-NLS-1$
186-
if ("".equals(DEBUG_HANDLERS_VERBOSE_COMMAND_ID)) { //$NON-NLS-1$
187-
DEBUG_HANDLERS_VERBOSE_COMMAND_ID = null;
188-
}
189-
DEBUG_DECLARED_IMAGES = getDebugOption("/debug/declaredImages"); //$NON-NLS-1$
190-
DEBUG_CONTRIBUTIONS = getDebugOption("/debug/contributions"); //$NON-NLS-1$
191-
EXPERIMENTAL_MENU = getDebugOption("/experimental/menus"); //$NON-NLS-1$
192-
DEBUG_MPE = getDebugOption("/trace/multipageeditor"); //$NON-NLS-1$
193-
DEBUG_WORKING_SETS = getDebugOption("/debug/workingSets"); //$NON-NLS-1$
194-
195-
if (DEBUG_SWT_DEBUG_GLOBAL) {
196-
Device.DEBUG = true;
197-
}
198-
}
199-
}
200-
201-
private static boolean getDebugOption(String option) {
202-
return "true".equalsIgnoreCase(Platform.getDebugOption(PlatformUI.PLUGIN_ID + option)); //$NON-NLS-1$
203-
}
204185
}

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/part/MultiPageEditorPart.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.eclipse.core.commands.AbstractHandler;
2424
import org.eclipse.core.commands.ExecutionEvent;
2525
import org.eclipse.core.commands.ExecutionException;
26-
import org.eclipse.core.commands.internal.util.Tracing;
2726
import org.eclipse.core.runtime.Adapters;
2827
import org.eclipse.core.runtime.Assert;
2928
import org.eclipse.core.runtime.ISafeRunnable;
@@ -124,11 +123,6 @@ public abstract class MultiPageEditorPart extends EditorPart implements IPageCha
124123
*/
125124
protected static final int PAGE_CONTAINER_SITE = 65535;
126125

127-
/**
128-
* Private tracing output.
129-
*/
130-
private static final String TRACING_COMPONENT = "MPE"; //$NON-NLS-1$
131-
132126
/**
133127
* The active service locator. This value may be <code>null</code> if there is
134128
* no selected page, or if the selected page is a control with no site.
@@ -879,7 +873,7 @@ protected void pageChange(int newPageIndex) {
879873
provider.fireSelectionChanged(event);
880874
provider.firePostSelectionChanged(event);
881875
} else if (Policy.DEBUG_MPE) {
882-
Tracing.printTrace(TRACING_COMPONENT, "MultiPageEditorPart " + getTitle() //$NON-NLS-1$
876+
WorkbenchPlugin.getDefault().getTrace().trace(Policy.DEBUG_MPE_FLAG, "MultiPageEditorPart " + getTitle() //$NON-NLS-1$
883877
+ " did not propogate selection for " //$NON-NLS-1$
884878
+ activeEditor.getTitle());
885879
}

0 commit comments

Comments
 (0)