diff options
author | Mike Rennie | 2012-03-19 18:45:35 +0000 |
---|---|---|
committer | Mike Rennie | 2012-03-19 18:45:35 +0000 |
commit | 90b44ce35ecdfbe54c20e2f2efb2a766a308e2a5 (patch) | |
tree | 7f59edfe86eb24b323199137dea522638dbd30a7 | |
parent | 9ab20e2ccd28123e2a275ddb8340a65f2e7ba6fd (diff) | |
download | eclipse.platform.debug-90b44ce35ecdfbe54c20e2f2efb2a766a308e2a5.tar.gz eclipse.platform.debug-90b44ce35ecdfbe54c20e2f2efb2a766a308e2a5.tar.xz eclipse.platform.debug-90b44ce35ecdfbe54c20e2f2efb2a766a308e2a5.zip |
Bug 374268 - Use the DebugTrace object to print to trace filesv20120319-1845
21 files changed, 339 insertions, 290 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java index 138e35d2b..50a9cea30 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java @@ -1138,7 +1138,7 @@ public class DebugPlugin extends Plugin { Object[] listeners= getEventListeners(); if (DebugOptions.DEBUG_EVENTS) { for (int i = 0; i < fEvents.length; i++) { - System.out.println(fEvents[i]); + DebugOptions.trace(fEvents[i].toString()); } } for (int i= 0; i < listeners.length; i++) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java index 82addc5ab..2d2128b7d 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -68,11 +68,11 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { protected IStatus run(IProgressMonitor monitor) { run = true; if (DebugOptions.DEBUG_COMMANDS) { - System.out.print("can execute command: " + AbstractDebugCommand.this); //$NON-NLS-1$ + DebugOptions.trace("can execute command: " + AbstractDebugCommand.this); //$NON-NLS-1$ } if (monitor.isCanceled()) { if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> *CANCELED* <<"); //$NON-NLS-1$ + DebugOptions.trace(" >> *CANCELED* <<"); //$NON-NLS-1$ } request.cancel(); } @@ -85,7 +85,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { request.setEnabled(false); request.cancel(); if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> false (no adapter)"); //$NON-NLS-1$ + DebugOptions.trace(" >> false (no adapter)"); //$NON-NLS-1$ } } } @@ -99,15 +99,15 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { try { boolean executable = isExecutable(targets, monitor, request); if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> " + executable); //$NON-NLS-1$ + DebugOptions.trace(" >> " + executable); //$NON-NLS-1$ } request.setEnabled(executable); } catch (CoreException e) { request.setStatus(e.getStatus()); request.setEnabled(false); if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> ABORTED"); //$NON-NLS-1$ - System.out.println("\t" + e.getStatus().getMessage()); //$NON-NLS-1$ + DebugOptions.trace(" >> ABORTED"); //$NON-NLS-1$ + DebugOptions.trace("\t" + e.getStatus().getMessage()); //$NON-NLS-1$ } } } @@ -140,7 +140,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { request.cancel(); request.done(); if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> *CANCELED* <<" + AbstractDebugCommand.this); //$NON-NLS-1$ + DebugOptions.trace(" >> *CANCELED* <<" + AbstractDebugCommand.this); //$NON-NLS-1$ } } getJobManager().removeJobChangeListener(this); @@ -200,7 +200,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { Job job = new Job(getExecuteTaskName()) { protected IStatus run(IProgressMonitor monitor) { if (DebugOptions.DEBUG_COMMANDS) { - System.out.println("execute: " + AbstractDebugCommand.this); //$NON-NLS-1$ + DebugOptions.trace("execute: " + AbstractDebugCommand.this); //$NON-NLS-1$ } Object[] elements = request.getElements(); Object[] targets = new Object[elements.length]; @@ -214,7 +214,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { } catch (CoreException e) { request.setStatus(e.getStatus()); if (DebugOptions.DEBUG_COMMANDS) { - System.out.println("\t" + e.getStatus().getMessage()); //$NON-NLS-1$ + DebugOptions.trace("\t" + e.getStatus().getMessage()); //$NON-NLS-1$ } } request.done(); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java index 3449f607a..f92e8b263 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java @@ -14,6 +14,7 @@ import java.util.Hashtable; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.osgi.service.debug.DebugOptionsListener; +import org.eclipse.osgi.service.debug.DebugTrace; import org.osgi.framework.BundleContext; /** @@ -33,6 +34,12 @@ public class DebugOptions implements DebugOptionsListener { static final String DEBUG_FLAG_EVENTS = "org.eclipse.debug.core/debug/events"; //$NON-NLS-1$ /** + * The {@link DebugTrace} object to print to OSGi tracing + * @since 3.8 + */ + private static DebugTrace fgDebugTrace; + + /** * Constructor * @param context the bundle context */ @@ -46,8 +53,33 @@ public class DebugOptions implements DebugOptionsListener { * @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions) */ public void optionsChanged(org.eclipse.osgi.service.debug.DebugOptions options) { + fgDebugTrace = options.newDebugTrace(DebugPlugin.getUniqueIdentifier()); DEBUG = options.getBooleanOption(DEBUG_FLAG, false); DEBUG_COMMANDS = DEBUG & options.getBooleanOption(DEBUG_FLAG_COMMANDS, false); DEBUG_EVENTS = DEBUG & options.getBooleanOption(DEBUG_FLAG_EVENTS, false); } + + /** + * Prints the given message to System.out and to the OSGi tracing (if started) + * @param option the option or <code>null</code> + * @param message the message to print or <code>null</code> + * @param throwable the {@link Throwable} or <code>null</code> + * @since 3.8 + */ + public static void trace(String option, String message, Throwable throwable) { + System.out.println(message); + if(fgDebugTrace != null) { + fgDebugTrace.trace(option, message, throwable); + } + } + + /** + * Prints the given message to System.out and to the OSGi tracing (if enabled) + * + * @param message the message or <code>null</code> + * @since 3.8 + */ + public static void trace(String message) { + trace(null, message, null); + } } diff --git a/org.eclipse.debug.ui/.options b/org.eclipse.debug.ui/.options index 6932029b6..1b586a599 100644 --- a/org.eclipse.debug.ui/.options +++ b/org.eclipse.debug.ui/.options @@ -10,3 +10,4 @@ org.eclipse.debug.ui/debug/launchhistory = false org.eclipse.debug.ui/debug/viewers/stateSaveRestore = false org.eclipse.debug.ui/debug/viewers/presentationId = org.eclipse.debug.ui/debug/breadcrumb = false +org.eclipse.debug.ui/debug/memory/dynamicLoading = false diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java index 7129afc04..2404300b8 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java @@ -24,26 +24,12 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import com.ibm.icu.text.MessageFormat; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.service.packageadmin.PackageAdmin; -import org.osgi.service.prefs.BackingStoreException; -import org.osgi.util.tracker.ServiceTracker; - -import org.w3c.dom.Document; - -import org.eclipse.osgi.service.debug.DebugOptions; -import org.eclipse.osgi.service.debug.DebugOptionsListener; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - import org.eclipse.core.expressions.EvaluationContext; import org.eclipse.core.expressions.IEvaluationContext; - +import org.eclipse.core.resources.ISaveContext; +import org.eclipse.core.resources.ISaveParticipant; +import org.eclipse.core.resources.IncrementalProjectBuilder; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IConfigurationElement; @@ -59,36 +45,6 @@ import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; - -import org.eclipse.core.resources.ISaveContext; -import org.eclipse.core.resources.ISaveParticipant; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; - -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialogWithToggle; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; - -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.ui.progress.IProgressConstants2; -import org.eclipse.ui.progress.IProgressService; -import org.eclipse.ui.services.IEvaluationService; -import org.eclipse.ui.themes.IThemeManager; - import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; @@ -118,11 +74,47 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationCont import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointOrganizerManager; import org.eclipse.debug.internal.ui.views.console.ProcessConsoleManager; import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper; - import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialogWithToggle; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.PreferenceConverter; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.osgi.service.debug.DebugOptions; +import org.eclipse.osgi.service.debug.DebugOptionsListener; +import org.eclipse.osgi.service.debug.DebugTrace; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.ui.progress.IProgressConstants2; +import org.eclipse.ui.progress.IProgressService; +import org.eclipse.ui.services.IEvaluationService; +import org.eclipse.ui.themes.IThemeManager; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.service.packageadmin.PackageAdmin; +import org.osgi.service.prefs.BackingStoreException; +import org.osgi.util.tracker.ServiceTracker; +import org.w3c.dom.Document; + +import com.ibm.icu.text.MessageFormat; /** * The Debug UI Plug-in. @@ -148,6 +140,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener, public static boolean DEBUG_DELTAS = false; public static boolean DEBUG_STATE_SAVE_RESTORE = false; public static String DEBUG_PRESENTATION_ID = null; + public static boolean DEBUG_DYNAMIC_LOADING = false; static final String DEBUG_FLAG = "org.eclipse.debug.ui/debug"; static final String DEBUG_BREAKPOINT_DELTAS_FLAG = "org.eclipse.debug.ui/debug/viewers/breakpointDeltas"; @@ -160,6 +153,12 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener, static final String DEBUG_DELTAS_FLAG ="org.eclipse.debug.ui/debug/viewers/deltas"; static final String DEBUG_STATE_SAVE_RESTORE_FLAG = "org.eclipse.debug.ui/debug/viewers/stateSaveRestore"; static final String DEBUG_PRESENTATION_ID_FLAG ="org.eclipse.debug.ui/debug/viewers/presentationId"; + static final String DEBUG_DYNAMIC_LOADING_FLAG = "org.eclipse.debug.ui/debug/memory/dynamicLoading"; + /** + * The {@link DebugTrace} object to print to OSGi tracing + * @since 3.8 + */ + private static DebugTrace fgDebugTrace; /** * The singleton debug plug-in instance @@ -280,15 +279,29 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener, } /** - * If the debug flag is set the specified message is printed to the console - * @param message the message to print the {@link System#out} + * Prints the given message to System.out and to the OSGi tracing (if started) + * @param option the option or <code>null</code> + * @param message the message to print or <code>null</code> + * @param throwable the {@link Throwable} or <code>null</code> + * @since 3.8 */ - public static void debug(String message) { - if (DEBUG) { - System.out.println(message); + public static void trace(String option, String message, Throwable throwable) { + System.out.println(message); + if(fgDebugTrace != null) { + fgDebugTrace.trace(option, message, throwable); } } - + + /** + * Prints the given message to System.out and to the OSGi tracing (if enabled) + * + * @param message the message or <code>null</code> + * @since 3.8 + */ + public static void trace(String message) { + trace(null, message, null); + } + /** * Returns the singleton instance of the debug plug-in. * @return the singleton {@link DebugUIPlugin} @@ -601,16 +614,18 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener, * @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions) */ public void optionsChanged(DebugOptions options) { + fgDebugTrace = options.newDebugTrace(getUniqueIdentifier()); DEBUG = options.getBooleanOption(DEBUG_FLAG, false); - DEBUG_BREAKPOINT_DELTAS = DEBUG & options.getBooleanOption(DEBUG_BREAKPOINT_DELTAS_FLAG, false); - DEBUG_MODEL = DEBUG & options.getBooleanOption(DEBUG_MODEL_FLAG, false); - DEBUG_VIEWER = DEBUG & options.getBooleanOption(DEBUG_VIEWER_FLAG, false); - DEBUG_BREADCRUMB = DEBUG & options.getBooleanOption(DEBUG_BREADCRUMB_FLAG, false); - DEBUG_TREE_VIEWER_DROPDOWN = DEBUG & options.getBooleanOption(DEBUG_TREE_VIEWER_DROPDOWN_FLAG, false); - DEBUG_CONTENT_PROVIDER = DEBUG & options.getBooleanOption(DEBUG_CONTENT_PROVIDER_FLAG, false); - DEBUG_UPDATE_SEQUENCE = DEBUG & options.getBooleanOption(DEBUG_UPDATE_SEQUENCE_FLAG, false); - DEBUG_DELTAS = DEBUG & options.getBooleanOption(DEBUG_DELTAS_FLAG, false); - DEBUG_STATE_SAVE_RESTORE = DEBUG & options.getBooleanOption(DEBUG_STATE_SAVE_RESTORE_FLAG, false); + DEBUG_BREAKPOINT_DELTAS = DEBUG && options.getBooleanOption(DEBUG_BREAKPOINT_DELTAS_FLAG, false); + DEBUG_MODEL = DEBUG && options.getBooleanOption(DEBUG_MODEL_FLAG, false); + DEBUG_VIEWER = DEBUG && options.getBooleanOption(DEBUG_VIEWER_FLAG, false); + DEBUG_BREADCRUMB = DEBUG && options.getBooleanOption(DEBUG_BREADCRUMB_FLAG, false); + DEBUG_TREE_VIEWER_DROPDOWN = DEBUG && options.getBooleanOption(DEBUG_TREE_VIEWER_DROPDOWN_FLAG, false); + DEBUG_CONTENT_PROVIDER = DEBUG && options.getBooleanOption(DEBUG_CONTENT_PROVIDER_FLAG, false); + DEBUG_UPDATE_SEQUENCE = DEBUG && options.getBooleanOption(DEBUG_UPDATE_SEQUENCE_FLAG, false); + DEBUG_DELTAS = DEBUG && options.getBooleanOption(DEBUG_DELTAS_FLAG, false); + DEBUG_STATE_SAVE_RESTORE = DEBUG && options.getBooleanOption(DEBUG_STATE_SAVE_RESTORE_FLAG, false); + DEBUG_DYNAMIC_LOADING = DEBUG && options.getBooleanOption(DEBUG_DYNAMIC_LOADING_FLAG, false); if(DEBUG) { DEBUG_PRESENTATION_ID = options.getOption(DEBUG_PRESENTATION_ID_FLAG, IInternalDebugCoreConstants.EMPTY_STRING); if(IInternalDebugCoreConstants.EMPTY_STRING.equals(DEBUG_PRESENTATION_ID)) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java index 5f0cfb96b..b9ef8cb9f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,7 +50,6 @@ import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncCopyTableRende import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncPrintTableRenderingAction; import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncTableRenderingCellModifier; import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncTableRenderingViewer; -import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncVirtualContentTableViewer; import org.eclipse.debug.internal.ui.views.memory.renderings.CopyTableRenderingToClipboardAction; import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingAction; import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingDialog; @@ -1675,9 +1674,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende private synchronized void reloadTable(final BigInteger topAddress) { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(this + " reload at: " + topAddress.toString(16)); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(this + " reload at: " + topAddress.toString(16)); //$NON-NLS-1$ + } fContentDescriptor.setLoadAddress(topAddress); fContentDescriptor.setNumLines(getNumLinesToLoad()); fTableViewer.setTopIndex(topAddress); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java index 24fc12d1c..63de96058 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java @@ -110,7 +110,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider private IPropertyChangeListener fOrganizersListener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { - // For any property changes in breakpiont organizers, refresh the containers. + // For any property changes in breakpoint organizers, refresh the containers. updateContainers(); } }; @@ -194,7 +194,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider buildInstallDelta(rootDelta, fContainer); if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("PROXY INSTALLED (" + proxy + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("PROXY INSTALLED (" + proxy + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ } proxy.postModelChanged(rootDelta, false); @@ -204,7 +204,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider synchronized void proxyDisposed(BreakpointManagerProxy proxy) { fProxies.remove(proxy); if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("PROXY DISPOSED (" + proxy + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("PROXY DISPOSED (" + proxy + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ } } @@ -265,7 +265,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider appendModelDeltaToElement(delta, newBreakpoint, IModelDelta.SELECT); } if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("POST BREAKPOINT DELTA (setOrganizers)\n"); //$NON-NLS-1$ + DebugUIPlugin.trace("POST BREAKPOINT DELTA (setOrganizers)\n"); //$NON-NLS-1$ } postModelChanged(delta, false); } @@ -362,7 +362,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider if (changed) { if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("POST BREAKPOINT DELTA (setFilterSelection)\n"); //$NON-NLS-1$ + DebugUIPlugin.trace("POST BREAKPOINT DELTA (setFilterSelection)\n"); //$NON-NLS-1$ } postModelChanged(delta, false); } @@ -399,7 +399,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider synchronized (this) { if (buildTrackSelectionDelta(delta, fContainer, bpsSet)) { if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("POST BREAKPOINT DELTA (trackSelection)\n"); //$NON-NLS-1$ + DebugUIPlugin.trace("POST BREAKPOINT DELTA (trackSelection)\n"); //$NON-NLS-1$ } BreakpointManagerProxy[] proxies = getProxies(); for (int i = 0; i < proxies.length; i++) { @@ -477,7 +477,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider } if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("POST BREAKPOINT DELTA (breakpointsAddedInput)\n"); //$NON-NLS-1$ + DebugUIPlugin.trace("POST BREAKPOINT DELTA (breakpointsAddedInput)\n"); //$NON-NLS-1$ } postModelChanged(delta, false); } @@ -499,7 +499,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider if (removed) { if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("POST BREAKPOINT DELTA (breakpointsRemovedInput)\n"); //$NON-NLS-1$ + DebugUIPlugin.trace("POST BREAKPOINT DELTA (breakpointsRemovedInput)\n"); //$NON-NLS-1$ } postModelChanged(delta, false); } @@ -539,7 +539,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider appendModelDelta(fContainer, delta, IModelDelta.STATE | IModelDelta.CONTENT, filteredBreakpoints[i]); // content flag triggers detail refresh if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) { - System.out.println("POST BREAKPOINT DELTA (breakpointsChanged)\n"); //$NON-NLS-1$ + DebugUIPlugin.trace("POST BREAKPOINT DELTA (breakpointsChanged)\n"); //$NON-NLS-1$ } postModelChanged(delta, false); } @@ -849,10 +849,10 @@ public class BreakpointManagerContentProvider extends ElementContentProvider } /** - * Handles the event when a presentation context is dispoed. + * Handles the event when a presentation context is disposed. * Sub-classes may override to perform additional cleanup. * - * @param context Presetnation context that was disposed. + * @param context Presentation context that was disposed. */ protected void contextDisposed(IPresentationContext context) { List removed = new ArrayList(1); @@ -867,7 +867,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider } } - // Dispose the removed input datas + // Dispose the removed input data for (int i = 0; i < removed.size(); i++) { ((InputData)removed.get(i)).dispose(); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java index 6513c5719..55ad863d4 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java @@ -99,7 +99,7 @@ public abstract class AsynchronousModel { buffer.append(" ("); //$NON-NLS-1$ buffer.append(this); buffer.append(")"); //$NON-NLS-1$ - DebugUIPlugin.debug(buffer.toString()); + DebugUIPlugin.trace(buffer.toString()); } } @@ -130,7 +130,7 @@ public abstract class AsynchronousModel { buffer.append(" ("); //$NON-NLS-1$ buffer.append(this); buffer.append(")"); //$NON-NLS-1$ - DebugUIPlugin.debug(buffer.toString()); + DebugUIPlugin.trace(buffer.toString()); } fDisposed = true; cancelPendingUpdates(); @@ -585,8 +585,8 @@ public abstract class AsynchronousModel { parentNode.setChildren(newChildren); } if (DebugUIPlugin.DEBUG_MODEL) { - DebugUIPlugin.debug("CHILDREN CHANGED: " + parentNode); //$NON-NLS-1$ - DebugUIPlugin.debug(toString()); + DebugUIPlugin.trace("CHILDREN CHANGED: " + parentNode); //$NON-NLS-1$ + DebugUIPlugin.trace(toString()); } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java index 5a7888b48..d81bc33a3 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java @@ -1057,7 +1057,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis Widget parentItem = getParentWidget(item); if (DebugUIPlugin.DEBUG_VIEWER) { - DebugUIPlugin.debug("SET DATA [" + index + "]: " + parentItem); //$NON-NLS-1$//$NON-NLS-2$ + DebugUIPlugin.trace("SET DATA [" + index + "]: " + parentItem); //$NON-NLS-1$//$NON-NLS-2$ } ModelNode node = null; // first, see if the parent element is in the model @@ -1095,7 +1095,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis node = getModel().getRootNode(); if (node == null) { if (DebugUIPlugin.DEBUG_VIEWER) { - DebugUIPlugin.debug("\tFAILED - root model node is null"); //$NON-NLS-1$ + DebugUIPlugin.trace("\tFAILED - root model node is null"); //$NON-NLS-1$ } return; } @@ -1103,7 +1103,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis ModelNode[] childrenNodes = node.getChildrenNodes(); if (childrenNodes == null) { if (DebugUIPlugin.DEBUG_VIEWER) { - DebugUIPlugin.debug("\tFAILED - no children nodes for " + node); //$NON-NLS-1$ + DebugUIPlugin.trace("\tFAILED - no children nodes for " + node); //$NON-NLS-1$ } return; } @@ -1112,7 +1112,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis node = childrenNodes[pindex]; } else { if (DebugUIPlugin.DEBUG_VIEWER) { - DebugUIPlugin.debug("\tFAILED - no children nodes for " + node); //$NON-NLS-1$ + DebugUIPlugin.trace("\tFAILED - no children nodes for " + node); //$NON-NLS-1$ } return; } @@ -1125,12 +1125,12 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis mapElement(node, item); item.setData(node.getElement()); if (DebugUIPlugin.DEBUG_VIEWER) { - DebugUIPlugin.debug("\titem mapped: " + node); //$NON-NLS-1$ + DebugUIPlugin.trace("\titem mapped: " + node); //$NON-NLS-1$ } internalRefresh(node); } else { if (DebugUIPlugin.DEBUG_VIEWER) { - DebugUIPlugin.debug("\tFAILED - unable to find corresponding node"); //$NON-NLS-1$ + DebugUIPlugin.trace("\tFAILED - unable to find corresponding node"); //$NON-NLS-1$ } } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java index 3fbe3410a..d52b86b73 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java @@ -258,8 +258,9 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite { * Opens the drop down menu. */ public void showMenu() { - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("BreadcrumbItemDropDown.showMenu()"); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()"); //$NON-NLS-1$ + } if (!fEnabled || fMenuIsShown) return; @@ -267,9 +268,9 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite { fMenuIsShown= true; fShell= new Shell(fToolBar.getShell(), SWT.RESIZE | SWT.TOOL | SWT.ON_TOP); - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println(" creating new shell"); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace(" creating new shell"); //$NON-NLS-1$ + } fShell.addControlListener(new ControlAdapter() { /* @@ -321,23 +322,26 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite { switch (event.type) { case SWT.FocusIn: - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("focusIn - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("focusIn - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$ + } if (!isFocusBreadcrumbTreeFocusWidget && !isFocusWidgetParentShell) { - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("==> closing shell since focus in other widget"); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("==> closing shell since focus in other widget"); //$NON-NLS-1$ + } shell.close(); } break; case SWT.FocusOut: - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("focusOut - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("focusOut - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$ + } if (event.display.getActiveShell() == null) { - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("==> closing shell since event.display.getActiveShell() != shell"); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("==> closing shell since event.display.getActiveShell() != shell"); //$NON-NLS-1$ + } shell.close(); } break; @@ -369,8 +373,9 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite { shell.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("==> shell disposed"); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("==> shell disposed"); //$NON-NLS-1$ + } display.removeFilter(SWT.FocusIn, focusListener); display.removeFilter(SWT.FocusOut, focusListener); @@ -385,9 +390,9 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite { } public void shellClosed(ShellEvent e) { - if (DebugUIPlugin.DEBUG_BREADCRUMB) - System.out.println("==> shellClosed"); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_BREADCRUMB) { + DebugUIPlugin.trace("==> shellClosed"); //$NON-NLS-1$ + } if (!fMenuIsShown) return; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java index 792ebacf7..ddd13cd96 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Wind River Systems and others. + * Copyright (c) 2009, 2012 Wind River Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -85,9 +85,9 @@ public abstract class TreeViewerDropDown { fDropDownViewer.addOpenListener(new IOpenListener() { public void open(OpenEvent event) { - if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) - System.out.println("BreadcrumbItemDropDown.showMenu()$treeViewer>open"); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) { + DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()$treeViewer>open"); //$NON-NLS-1$ + } openElement(event.getSelection()); } }); @@ -96,9 +96,9 @@ public abstract class TreeViewerDropDown { tree.addMouseListener(new MouseListener() { public void mouseUp(MouseEvent e) { - if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) - System.out.println("BreadcrumbItemDropDown.showMenu()$treeViewer>mouseUp"); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) { + DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()$treeViewer>mouseUp"); //$NON-NLS-1$ + } if (e.button != 1) return; @@ -271,9 +271,9 @@ public abstract class TreeViewerDropDown { boolean treeHasFocus= !tree.isDisposed() && tree.isFocusControl(); if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) { - System.out.println(" isDisposed: " + tree.isDisposed()); //$NON-NLS-1$ - System.out.println(" shell hasFocus: " + (!tree.isDisposed() && tree.isFocusControl())); //$NON-NLS-1$ - System.out.println(" tree hasFocus: " + treeHasFocus); //$NON-NLS-1$ + DebugUIPlugin.trace(" isDisposed: " + tree.isDisposed()); //$NON-NLS-1$ + DebugUIPlugin.trace(" shell hasFocus: " + (!tree.isDisposed() && tree.isFocusControl())); //$NON-NLS-1$ + DebugUIPlugin.trace(" tree hasFocus: " + treeHasFocus); //$NON-NLS-1$ } if (tree.isDisposed()) diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java index ea8021b16..8d89714e7 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java @@ -133,7 +133,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU viewCount = getContentProvider().modelToViewChildCount(elementPath, fCount); } if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("setChildCount(" + getElement() + ", modelCount: " + fCount + " viewCount: " + viewCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + DebugUIPlugin.trace("setChildCount(" + getElement() + ", modelCount: " + fCount + " viewCount: " + viewCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } // Special case for element 0 in a set of filtered elements: // Child 0 is automatically updated by the tree at the same time that the child count is requested. Therefore, diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java index 5cd5eecc7..857c2a49a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java @@ -65,7 +65,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda if (provider.addFilteredIndex(elementPath, modelIndex, element)) { if (!updateFilterOnly) { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("REMOVE(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + DebugUIPlugin.trace("REMOVE(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } viewer.remove(elementPath, viewIndex); } @@ -76,13 +76,13 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda if (!updateFilterOnly) { int insertIndex = provider.modelToViewIndex(elementPath, modelIndex); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER) { - System.out.println("insert(" + getElement() + ", modelIndex: " + modelIndex + " insertIndex: " + insertIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + DebugUIPlugin.trace("insert(" + getElement() + ", modelIndex: " + modelIndex + " insertIndex: " + insertIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } viewer.insert(elementPath, element, insertIndex); } } else if (!updateFilterOnly){ if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("replace(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + DebugUIPlugin.trace("replace(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } viewer.replace(elementPath, viewIndex, element); } @@ -142,7 +142,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda end = Math.max(end, otherEnd); fLength = end - fIndex; if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("coalesced: " + this.toString()); //$NON-NLS-1$ + DebugUIPlugin.trace("coalesced: " + this.toString()); //$NON-NLS-1$ } return true; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java index c16a16bcd..e4a22c50f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java @@ -52,7 +52,6 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat contentProvider.clearFilters(elementPath); } if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("setHasChildren(" + getElement() + " >> " + fHasChildren); //$NON-NLS-1$ //$NON-NLS-2$ } contentProvider.getViewer().setHasChildren(elementPath, fHasChildren); if (fHasChildren) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java index 67b708c58..08b73d12f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java @@ -302,7 +302,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon /** * Finds the model proxy that an element with a given path is associated with. - * @param path Path of the elemnt. + * @param path Path of the element. * @return Element's model proxy. */ private IModelProxy getElementProxy(TreePath path) { @@ -324,7 +324,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } /** - * Uninstalls each model proxy + * Removes all model proxies */ private void disposeAllModelProxies() { Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() ); @@ -345,7 +345,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } /** - * Uninstalls the model proxy installed for the given element, if any. + * Removes the model proxy installed for the given element, if any. * @param path the {@link TreePath} to dispose the model proxy for */ private void disposeModelProxy(TreePath path) { @@ -386,14 +386,14 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } /** - * Executes the mdoel proxy in UI thread. + * Executes the model proxy in UI thread. * @param delta Delta to process * @param proxy Proxy that fired the delta. */ private void doModelChanged(IModelDelta delta, IModelProxy proxy) { if (!proxy.isDisposed()) { if (DebugUIPlugin.DEBUG_DELTAS && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - DebugUIPlugin.debug("RECEIVED DELTA: " + delta.toString()); //$NON-NLS-1$ + DebugUIPlugin.trace("RECEIVED DELTA: " + delta.toString()); //$NON-NLS-1$ } updateModel(delta, getModelDeltaMask()); @@ -588,12 +588,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon requests.add(update); if (begin) { if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("MODEL SEQUENCE BEGINS"); //$NON-NLS-1$ + DebugUIPlugin.trace("MODEL SEQUENCE BEGINS"); //$NON-NLS-1$ } notifyUpdate(UPDATE_SEQUENCE_BEGINS, null); } if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("\tBEGIN - " + update); //$NON-NLS-1$ + DebugUIPlugin.trace("\tBEGIN - " + update); //$NON-NLS-1$ } notifyUpdate(UPDATE_BEGINS, update); } @@ -608,7 +608,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon ViewerUpdateMonitor update = (ViewerUpdateMonitor)updates.get(i); notifyUpdate(UPDATE_COMPLETE, update); if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("\tEND - " + update); //$NON-NLS-1$ + DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$ } } @@ -639,7 +639,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon // fRequestsInProgress map. This way updateStarted() will not send a // redundant "UPDATE SEQUENCE STARTED" notification. trigger(update.getSchedulingPath()); - if (requests.isEmpty()) { + if (requests != null && requests.isEmpty()) { fRequestsInProgress.remove(update.getSchedulingPath()); } } else { @@ -649,7 +649,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } if (fRequestsInProgress.isEmpty() && fWaitingRequests.isEmpty()) { if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("MODEL SEQUENCE ENDS"); //$NON-NLS-1$ + DebugUIPlugin.trace("MODEL SEQUENCE ENDS"); //$NON-NLS-1$ } notifyUpdate(UPDATE_SEQUENCE_COMPLETE, null); } @@ -852,10 +852,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon * Requests are processed in order such that updates to * children are delayed until updates for parent elements are completed. * This allows the expansion/selection state of the elements to be - * properly restored as new elements are retreived from model. + * properly restored as new elements are retrieved from model. * </p> - * - * @param The schedulingPath path or requests to start processing. May + * @param schedulingPath schedulingPath path or requests to start processing. May * be <code>null</code> to start the shortest path request. */ private void trigger(TreePath schedulingPath) { @@ -975,7 +974,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } reCreate.add(childrenUpdate); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("canceled update in progress handling REMOVE: " + childrenUpdate); //$NON-NLS-1$ + DebugUIPlugin.trace("canceled update in progress handling REMOVE: " + childrenUpdate); //$NON-NLS-1$ } } } @@ -991,7 +990,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon if (childrenUpdate.getOffset() > modelIndex) { ((ChildrenUpdate) childrenUpdate).setOffset(childrenUpdate.getOffset() - 1); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("modified waiting update handling REMOVE: " + childrenUpdate); //$NON-NLS-1$ + DebugUIPlugin.trace("modified waiting update handling REMOVE: " + childrenUpdate); //$NON-NLS-1$ } } } @@ -1050,7 +1049,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon * Checks if there are outstanding updates that may replace the element * at given path. * @param path Path of element to check. - * @return Returns true if there are outsanding updates. + * @return Returns true if there are outstanding updates. */ boolean areElementUpdatesPending(TreePath path) { Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() ); @@ -1183,7 +1182,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon if (shouldFilter(parentPath, element)) { addFilteredIndex(parentPath, modelIndex, element); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[filtered] handleAdd(" + delta.getElement() + ") > modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("[filtered] handleAdd(" + delta.getElement() + ") > modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ } // it was filtered so the child count does not change } else { @@ -1193,7 +1192,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon int viewIndex = modelToViewIndex(parentPath, modelIndex); int viewCount = modelToViewChildCount(parentPath, count); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("handleAdd(" + delta.getElement() + ") viewIndex: " + viewIndex + " modelIndex: " + modelIndex + " viewCount: " + viewCount + " modelCount: " + count); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + DebugUIPlugin.trace("handleAdd(" + delta.getElement() + ") viewIndex: " + viewIndex + " modelIndex: " + modelIndex + " viewCount: " + viewCount + " modelCount: " + count); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } getViewer().setChildCount(parentPath, viewCount); getViewer().autoExpand(parentPath); @@ -1204,7 +1203,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } } else { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("handleAdd(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("handleAdd(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } doUpdateChildCount(getViewerTreePath(delta.getParentDelta())); } @@ -1251,7 +1250,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon if (childCount > 0) { int viewCount = modelToViewChildCount(elementPath, childCount); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } getViewer().setChildCount(elementPath, viewCount); } @@ -1275,7 +1274,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon int viewIndex = modelToViewIndex(parentPath, modelIndex); if (viewIndex >= 0) { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[expand] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + DebugUIPlugin.trace("[expand] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } treeViewer.replace(parentPath, viewIndex, delta.getElement()); } else { @@ -1290,7 +1289,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon if (childCount > 0) { int viewCount = modelToViewChildCount(elementPath, childCount); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } treeViewer.setChildCount(elementPath, viewCount); if (!treeViewer.getExpandedState(elementPath)) { @@ -1315,7 +1314,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon // Element is filtered - if no longer filtered, insert the element if (shouldFilter(parentPath, element)) { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[unfilter] abort unfilter element: " + element + ", (model) " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("[unfilter] abort unfilter element: " + element + ", (model) " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ } // still filtered, stop return -1; @@ -1325,7 +1324,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon int viewIndex = modelToViewIndex(parentPath, modelIndex); if (viewIndex >= 0) { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[unfilter] insert(" + parentPath.getLastSegment() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + element); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + DebugUIPlugin.trace("[unfilter] insert(" + parentPath.getLastSegment() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + element); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } getViewer().insert(parentPath, element, viewIndex); return viewIndex; @@ -1342,7 +1341,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon protected void handleRemove(IModelDelta delta) { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("handleRemove(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("handleRemove(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } IModelDelta parentDelta = delta.getParentDelta(); IInternalTreeModelViewer treeViewer = getViewer(); @@ -1373,7 +1372,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon if (modelIndex >= 0) { // found the element if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println(" - (found) remove(" + parentPath.getLastSegment() + ", viewIndex: " + viewIndex + " modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace(" - (found) remove(" + parentPath.getLastSegment() + ", viewIndex: " + viewIndex + " modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } rescheduleUpdates(parentPath, modelIndex); getViewer().remove(parentPath, viewIndex); @@ -1384,7 +1383,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon // did not find the element, but found an unmapped item. // remove the unmapped item in it's place and update filters if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println(" - (not found) remove(" + parentPath.getLastSegment() + ", viewIndex: " + viewIndex + " modelIndex: " + modelIndex + " unmapped index: " + unmappedIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + DebugUIPlugin.trace(" - (not found) remove(" + parentPath.getLastSegment() + ", viewIndex: " + viewIndex + " modelIndex: " + modelIndex + " unmapped index: " + unmappedIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } modelIndex = viewToModelIndex(parentPath, unmappedIndex); rescheduleUpdates(parentPath, modelIndex); @@ -1402,7 +1401,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon // failing that, refresh the parent to properly update for non-visible/unmapped children // and update filtered indexes if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println(" - (not found) remove/refresh(" + delta.getElement()); //$NON-NLS-1$ + DebugUIPlugin.trace(" - (not found) remove/refresh(" + delta.getElement()); //$NON-NLS-1$ } getViewer().remove(getViewerTreePath(delta)); clearFilters(parentPath); @@ -1465,12 +1464,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon if (modelCount > 0) { int viewCount = modelToViewChildCount(parentPath, modelCount); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[select] setChildCount(" + parentDelta.getElement() + ", (model) " + parentDelta.getChildCount() + " (view) " + viewCount ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("[select] setChildCount(" + parentDelta.getElement() + ", (model) " + parentDelta.getChildCount() + " (view) " + viewCount ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } treeViewer.setChildCount(parentPath, viewCount); } if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[select] replace(" + parentDelta.getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + DebugUIPlugin.trace("[select] replace(" + parentDelta.getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } treeViewer.replace(parentPath, viewIndex, delta.getElement()); } @@ -1510,7 +1509,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon int viewIndex = modelToViewIndex(parentPath, modelIndex); if (viewIndex >= 0) { if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("[reveal] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + DebugUIPlugin.trace("[reveal] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } treeViewer.replace(parentPath, viewIndex, delta.getElement()); } else { @@ -1546,7 +1545,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() ); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("updateChildCount(" + getElement(treePath) + ", " + currentChildCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("updateChildCount(" + getElement(treePath) + ", " + currentChildCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } doUpdateChildCount(treePath); } @@ -1559,7 +1558,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon int modelIndex = viewToModelIndex(parentPath, viewIndex); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("updateElement("+ getElement(parentPath) + ", " + viewIndex + ") > modelIndex = " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("updateElement("+ getElement(parentPath) + ", " + viewIndex + ") > modelIndex = " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } doUpdateElement(parentPath, modelIndex); } @@ -1571,7 +1570,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() ); if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("updateHasChildren(" + getElement(path)); //$NON-NLS-1$ + DebugUIPlugin.trace("updateHasChildren(" + getElement(path)); //$NON-NLS-1$ } doUpdateHasChildren(path); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java index b81f135f0..2b37f0e03 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java @@ -127,7 +127,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider /** * Constructs a new label provider on the given display - * @param viewer Viewer that this label provieer is used with. + * @param viewer Viewer that this label provider is used with. */ public TreeModelLabelProvider(IInternalTreeModelViewer viewer) { fViewer = viewer; @@ -326,9 +326,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider * @param backgrounds Array of RGB values for background colors, may be * <code>null</code>. * @param checked Whether given item should be checked. - * @param grayed Whether given item's checkbox shoudl be grayed. - * @see ITreeModelLabelProviderTarget#setElementData(TreePath, int, String[], ImageDescriptor[], FontData[], RGB[], RGB[]) - * @see ITreeModelCheckProviderTarget#setElementChecked(TreePath, boolean, boolean) + * @param grayed Whether given item's checkbox should be grayed. */ void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds, boolean checked, boolean grayed) @@ -359,7 +357,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider /** * Cancels all running updates for the given element. If seachFullPath is true, - * all updtes will be canceled which have the given element anywhere in their + * all updates will be canceled which have the given element anywhere in their * patch. * @param element element to search for. * @param searchFullPath flag whether to look for the element in the full path @@ -452,12 +450,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider if (begin) { if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("LABEL SEQUENCE BEGINS"); //$NON-NLS-1$ + DebugUIPlugin.trace("LABEL SEQUENCE BEGINS"); //$NON-NLS-1$ } notifyUpdate(TreeModelContentProvider.UPDATE_SEQUENCE_BEGINS, null); } if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("\tBEGIN - " + update); //$NON-NLS-1$ + DebugUIPlugin.trace("\tBEGIN - " + update); //$NON-NLS-1$ } notifyUpdate(TreeModelContentProvider.UPDATE_BEGINS, update); } @@ -471,12 +469,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider fUpdatesInProgress.remove(update); if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("\tEND - " + update); //$NON-NLS-1$ + DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$ } notifyUpdate(TreeModelContentProvider.UPDATE_COMPLETE, update); if (fUpdatesInProgress.isEmpty()) { if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) { - System.out.println("LABEL SEQUENCE ENDS"); //$NON-NLS-1$ + DebugUIPlugin.trace("LABEL SEQUENCE ENDS"); //$NON-NLS-1$ } notifyUpdate(TreeModelContentProvider.UPDATE_SEQUENCE_COMPLETE, null); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java index efde63ed5..2ee05ca48 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java @@ -275,7 +275,7 @@ class ViewerStateTracker { ModelDelta stateDelta = (ModelDelta) fViewerStates.get(keyMementoString); if (stateDelta != null) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - MATCHING STATE FOUND"); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - MATCHING STATE FOUND"); //$NON-NLS-1$ //$NON-NLS-2$ } // Process start of restore in an async cycle because we may still be inside inputChanged() @@ -286,8 +286,8 @@ class ViewerStateTracker { ModelDelta stateDelta2 = (ModelDelta) fViewerStates.remove(keyMementoString); if (stateDelta2 != null) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE BEGINS"); //$NON-NLS-1$ - System.out.println("\tRESTORE: " + stateDelta2.toString()); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE RESTORE BEGINS"); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE: " + stateDelta2.toString()); //$NON-NLS-1$ notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null); } stateDelta2.setElement(input); @@ -296,14 +296,14 @@ class ViewerStateTracker { } } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE CANCELED."); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE RESTORE CANCELED."); //$NON-NLS-1$ } } } }); } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - NO MATCHING STATE"); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - NO MATCHING STATE"); //$NON-NLS-1$ //$NON-NLS-2$ } } } catch (IOException e) { @@ -324,7 +324,7 @@ class ViewerStateTracker { public void processReqeusts() { notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE INPUT COMARE BEGIN : " + fRequest); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE RESTORE INPUT COMARE BEGIN : " + fRequest); //$NON-NLS-1$ } notifyStateUpdate(input, TreeModelContentProvider.UPDATE_BEGINS, fRequest); defaultProvider.encodeElements(new IElementMementoRequest[] { fRequest }); @@ -354,7 +354,7 @@ class ViewerStateTracker { manager.processReqeusts(); } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE: No input memento provider"); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE RESTORE: No input memento provider"); //$NON-NLS-1$ } } } @@ -367,7 +367,7 @@ class ViewerStateTracker { if (fContentProvider.getViewer() == null) return; // Not initialized yet. if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE APPEND BEGIN: " + path.getLastSegment()); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE APPEND BEGIN: " + path.getLastSegment()); //$NON-NLS-1$ } // build a model delta representing expansion and selection state @@ -381,7 +381,7 @@ class ViewerStateTracker { // Path to save the state was not found or there was no // (expansion) state to save! Abort. if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE APPEND CANCEL: Element " + path.getLastSegment() + " not found."); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("STATE APPEND CANCEL: Element " + path.getLastSegment() + " not found."); //$NON-NLS-1$ //$NON-NLS-2$ } return; } @@ -400,7 +400,7 @@ class ViewerStateTracker { }); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tAPPEND DELTA: " + appendDeltaRoot); //$NON-NLS-1$ + DebugUIPlugin.trace("\tAPPEND DELTA: " + appendDeltaRoot); //$NON-NLS-1$ } if (fPendingState != null) { @@ -408,10 +408,10 @@ class ViewerStateTracker { // preserve // that restore along with the restore that was completed. if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tAPPEND OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$ + DebugUIPlugin.trace("\tAPPEND OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$ } - // If the append delta is generated for a sub-tree, copy the pending dela + // If the append delta is generated for a sub-tree, copy the pending delta // attributes into the pending delta. if (path.getSegmentCount() > 0) { fPendingState.accept( new IModelDeltaVisitor() { @@ -456,7 +456,7 @@ class ViewerStateTracker { copyIntoDelta(pendingDeltaNode, saveDeltaNode); } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSKIPPED: " + pendingDeltaNode.getElement()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSKIPPED: " + pendingDeltaNode.getElement()); //$NON-NLS-1$ } } @@ -481,11 +481,11 @@ class ViewerStateTracker { } fPendingState = appendDeltaRoot; if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE APPEND COMPLETE " + fPendingState); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE APPEND COMPLETE " + fPendingState); //$NON-NLS-1$ } } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE APPEND CANCELED: No Data"); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE APPEND CANCELED: No Data"); //$NON-NLS-1$ } } } @@ -503,14 +503,14 @@ class ViewerStateTracker { IElementMementoProvider stateProvider = ViewerAdapterService.getMementoProvider(input); if (stateProvider != null) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE SAVE BEGIN: " + input); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE SAVE BEGIN: " + input); //$NON-NLS-1$ } // build a model delta representing expansion and selection state final ModelDelta saveDeltaRoot = new ModelDelta(input, IModelDelta.NO_CHANGE); buildViewerState(saveDeltaRoot); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSAVE DELTA FROM VIEW:\n" + saveDeltaRoot); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSAVE DELTA FROM VIEW:\n" + saveDeltaRoot); //$NON-NLS-1$ } // check if pending restore reveal @@ -534,7 +534,7 @@ class ViewerStateTracker { } } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSKIPPED: " + revealDelta.getElement()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSKIPPED: " + revealDelta.getElement()); //$NON-NLS-1$ } } } @@ -544,7 +544,7 @@ class ViewerStateTracker { // preserve // that restore along with the restore that was completed. if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSAVE OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSAVE OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$ } IModelDeltaVisitor pendingStateVisitor = new IModelDeltaVisitor() { @@ -580,7 +580,7 @@ class ViewerStateTracker { copyIntoDelta(pendingDeltaNode, saveDeltaNode); } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSKIPPED: " + pendingDeltaNode.getElement()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSKIPPED: " + pendingDeltaNode.getElement()); //$NON-NLS-1$ } } @@ -604,7 +604,7 @@ class ViewerStateTracker { encodeDelta(saveDeltaRoot, stateProvider); } else { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE SAVE CANCELED, NO DATA"); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE SAVE CANCELED, NO DATA"); //$NON-NLS-1$ } } } @@ -703,7 +703,7 @@ class ViewerStateTracker { notifyStateUpdate(input, TreeModelContentProvider.UPDATE_COMPLETE, request); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSTATE END: " + request); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSTATE END: " + request); //$NON-NLS-1$ } if (!request.isCanceled() && (request.getStatus() == null || request.getStatus().isOK())) { @@ -722,7 +722,7 @@ class ViewerStateTracker { DebugUIPlugin.log(e); } if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE SAVE COMPLETED: " + rootDelta); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE SAVE COMPLETED: " + rootDelta); //$NON-NLS-1$ } stateSaveComplete(input, this); } @@ -746,7 +746,7 @@ class ViewerStateTracker { } fRequests.clear(); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE SAVE ABORTED: " + rootDelta.getElement()); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE SAVE ABORTED: " + rootDelta.getElement()); //$NON-NLS-1$ } stateSaveComplete(input, this); } @@ -923,7 +923,7 @@ class ViewerStateTracker { int newFlags = deltaFlags & ~mask; if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { if (deltaFlags != newFlags) { - System.out.println("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(deltaFlags & mask) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(deltaFlags & mask) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } ((ModelDelta)delta).setFlags(newFlags); @@ -952,7 +952,7 @@ class ViewerStateTracker { int newFlags = deltaFlags & ~mask; if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { if (deltaFlags != newFlags) { - System.out.println("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(deltaFlags & mask) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(deltaFlags & mask) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } ((ModelDelta)delta).setFlags(newFlags); @@ -968,7 +968,7 @@ class ViewerStateTracker { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { if (delta.getFlags() != IModelDelta.NO_CHANGE) { - System.out.println("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(delta.getFlags()) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + DebugUIPlugin.trace("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(delta.getFlags()) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } ((ModelDelta)delta).setFlags(IModelDelta.NO_CHANGE); @@ -1032,7 +1032,7 @@ class ViewerStateTracker { knowsChildCount, checkChildrenRealized); fCompareRequestsInProgress.put(key, compareRequest); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSTATE BEGIN: " + compareRequest); //$NON-NLS-1$ + DebugUIPlugin.trace("\tSTATE BEGIN: " + compareRequest); //$NON-NLS-1$ } notifyStateUpdate(element, TreeModelContentProvider.UPDATE_BEGINS, compareRequest); provider.compareElements(new IElementCompareRequest[] { compareRequest }); @@ -1086,7 +1086,7 @@ class ViewerStateTracker { * int) */ public boolean visit(IModelDelta delta, int depth) { - // Filster out the CONTENT flags from the delta flags, the content + // Filter out the CONTENT flags from the delta flags, the content // flag is only used as a marker indicating that all the sub-elements // of a given delta have been retrieved. int flags = (delta.getFlags() & ~IModelDelta.CONTENT); @@ -1132,7 +1132,7 @@ class ViewerStateTracker { private void removeDelta(IModelDelta delta) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tRESTORE REMOVED: " + delta.getElement()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE REMOVED: " + delta.getElement()); //$NON-NLS-1$ } delta.accept(new IModelDeltaVisitor() { @@ -1154,7 +1154,7 @@ class ViewerStateTracker { // postpone until then. if (fPendingSetTopItem == null) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$ } notifyStateUpdate(fPendingState.getElement(), STATE_RESTORE_SEQUENCE_COMPLETE, null); @@ -1181,14 +1181,14 @@ class ViewerStateTracker { if (knowsHasChildren) { if ((delta.getFlags() & IModelDelta.EXPAND) != 0) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tRESTORE EXPAND: " + treePath.getLastSegment()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE EXPAND: " + treePath.getLastSegment()); //$NON-NLS-1$ } viewer.expandToLevel(treePath, 1); delta.setFlags(delta.getFlags() & ~IModelDelta.EXPAND); } if ((delta.getFlags() & IModelDelta.COLLAPSE) != 0) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tRESTORE COLLAPSE: " + treePath.getLastSegment()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE COLLAPSE: " + treePath.getLastSegment()); //$NON-NLS-1$ } // Check auto-expand before collapsing an element (bug 335734) int autoexpand = fContentProvider.getViewer().getAutoExpandLevel(); @@ -1202,7 +1202,7 @@ class ViewerStateTracker { if ((delta.getFlags() & IModelDelta.SELECT) != 0) { delta.setFlags(delta.getFlags() & ~IModelDelta.SELECT); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tRESTORE SELECT: " + treePath.getLastSegment()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE SELECT: " + treePath.getLastSegment()); //$NON-NLS-1$ } ITreeSelection currentSelection = (ITreeSelection)viewer.getSelection(); if (currentSelection == null || currentSelection.isEmpty()) { @@ -1283,7 +1283,7 @@ class ViewerStateTracker { (knowsHasChildren && !viewer.getHasChildren(treePath)) ) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tRESTORE CONTENT: " + treePath.getLastSegment()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE CONTENT: " + treePath.getLastSegment()); //$NON-NLS-1$ } delta.setFlags(delta.getFlags() & ~IModelDelta.CONTENT); } @@ -1329,7 +1329,7 @@ class ViewerStateTracker { int index = viewer.findElementIndex(parentPath, fPathToReveal.getLastSegment()); if (index >= 0) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tRESTORE REVEAL: " + fPathToReveal.getLastSegment()); //$NON-NLS-1$ + DebugUIPlugin.trace("\tRESTORE REVEAL: " + fPathToReveal.getLastSegment()); //$NON-NLS-1$ } viewer.reveal(parentPath, index); @@ -1372,7 +1372,7 @@ class ViewerStateTracker { if (fPendingState == null) { if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$ + DebugUIPlugin.trace("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$ } notifyStateUpdate(fModelInput, STATE_RESTORE_SEQUENCE_COMPLETE, null); } else { @@ -1488,7 +1488,7 @@ class ViewerStateTracker { void compareFinished(ElementCompareRequest request, ModelDelta delta) { notifyStateUpdate(request.getViewerInput(), TreeModelContentProvider.UPDATE_COMPLETE, request); if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) { - System.out.println("\tSTATE END: " + request + " = " + false); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace("\tSTATE END: " + request + " = " + false); //$NON-NLS-1$ //$NON-NLS-2$ } fCompareRequestsInProgress.remove(new CompareRequestKey(request.getElementPath(), delta)); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java index 9d944ad27..ccf1ec15b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,7 +14,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; @@ -44,14 +43,6 @@ public abstract class AbstractModelProxy implements IModelProxy2 { private ListenerList fListeners = new ListenerList(); - // debug flags - public static boolean DEBUG_DELTAS = false; - - static { - DEBUG_DELTAS = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$ - Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/deltas")); //$NON-NLS-1$ - } - protected Object[] getListeners() { synchronized (fListeners) { return fListeners.getListeners(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java index 07f3900fa..c99109a02 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2010 IBM Corporation and others. + * Copyright (c) 2004, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,6 +18,7 @@ import java.util.Hashtable; import org.eclipse.core.runtime.SafeRunner; import org.eclipse.debug.core.IMemoryBlockListener; import org.eclipse.debug.core.model.IMemoryBlock; +import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.ui.memory.IMemoryRendering; import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService; import org.eclipse.jface.util.IPropertyChangeListener; @@ -73,7 +74,7 @@ public class MemoryViewSynchronizationService implements /** * If the property matches one of the filters, the property * is valid and the view should be notified about its change. - * @param property + * @param property the property * @return if the property is specified in the filter */ public boolean isValidProperty(String property){ @@ -92,7 +93,7 @@ public class MemoryViewSynchronizationService implements /** * Set property filters, indicating what property change events * the listener is interested in. - * @param filters + * @param filters the property filters or <code>null</code> */ public void setPropertyFilters(String[] filters){ fFilters = filters; @@ -165,7 +166,7 @@ public class MemoryViewSynchronizationService implements } /** - * Clean up when the plugin is shutdown + * Clean up when the plug-in is shutdown */ public void shutdown() { @@ -205,7 +206,7 @@ public class MemoryViewSynchronizationService implements /** * Fire property change events - * @param propertyId + * @param evt the event to fire */ public void firePropertyChanged(final PropertyChangeEvent evt) { @@ -286,7 +287,7 @@ public class MemoryViewSynchronizationService implements // Do not handle any property changed event as the // sync service is being enabled. - // Otheriwse, current sync info provider may overwrite + // Otherwise, current sync info provider may overwrite // sync info unexpectedly. We want to sync with the rendering // that is last changed. if (fEnableState == ENABLING) @@ -299,14 +300,14 @@ public class MemoryViewSynchronizationService implements if (DEBUG_SYNC_SERVICE) { - System.out.println("SYNC SERVICE RECEIVED CHANGED EVENT:"); //$NON-NLS-1$ - System.out.println("Source: " + rendering); //$NON-NLS-1$ - System.out.println("Property: " + propertyId); //$NON-NLS-1$ - System.out.println("Value: " + value); //$NON-NLS-1$ + DebugUIPlugin.trace("SYNC SERVICE RECEIVED CHANGED EVENT:"); //$NON-NLS-1$ + DebugUIPlugin.trace("Source: " + rendering); //$NON-NLS-1$ + DebugUIPlugin.trace("Property: " + propertyId); //$NON-NLS-1$ + DebugUIPlugin.trace("Value: " + value); //$NON-NLS-1$ if (value instanceof BigInteger) { - System.out.println("Value in hex: " + ((BigInteger)value).toString(16)); //$NON-NLS-1$ + DebugUIPlugin.trace("Value in hex: " + ((BigInteger)value).toString(16)); //$NON-NLS-1$ } } @@ -401,15 +402,15 @@ public class MemoryViewSynchronizationService implements */ public void setSynchronizationProvider(IMemoryRendering rendering) { - if (DEBUG_SYNC_SERVICE) - System.out.println("SYNCHRONIZATION PROVIDER: " + rendering); //$NON-NLS-1$ - - if (fSyncServiceProvider != null) + if (DEBUG_SYNC_SERVICE) { + DebugUIPlugin.trace("SYNCHRONIZATION PROVIDER: " + rendering); //$NON-NLS-1$ + } + if (fSyncServiceProvider != null) { fSyncServiceProvider.removePropertyChangeListener(this); - - if (rendering != null) + } + if (rendering != null) { rendering.addPropertyChangeListener(this); - + } fSyncServiceProvider = rendering; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java index a2b11f2d3..1b8736878 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -268,9 +268,9 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { fSelectionKey = getSelectionKeyFromCursor(); fPendingSelection = null; - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(Thread.currentThread().getName() + " cursor moved selection is: " + ((BigInteger)fSelectionKey).toString(16)); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(Thread.currentThread().getName() + " cursor moved selection is: " + ((BigInteger)fSelectionKey).toString(16)); //$NON-NLS-1$ + } // now check to see if the cursor is approaching buffer limit handleScrollBarSelection(); fireSelectionChanged(fSelectionKey); @@ -323,9 +323,9 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { public IStatus runInUIThread(IProgressMonitor monitor) { try { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(getRendering() + " set cursor selection " + ((BigInteger)key).toString(16)); //$NON-NLS-1$ - + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(getRendering() + " set cursor selection " + ((BigInteger)key).toString(16)); //$NON-NLS-1$ + } if (fPendingSelection != null && fPendingSelection != key) return Status.OK_STATUS; @@ -344,10 +344,9 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { fSelectionKey = key; fPendingSelection = null; - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - { - System.out.println(getRendering() + " set cursor selection, row is " + getTable().getItem(newLocation[0]).getData()); //$NON-NLS-1$ - System.out.println(getRendering() + " set cursor selection, model is " + getVirtualContentModel().getElement(newLocation[0])); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(getRendering() + " set cursor selection, row is " + getTable().getItem(newLocation[0]).getData()); //$NON-NLS-1$ + DebugUIPlugin.trace(getRendering() + " set cursor selection, model is " + getVirtualContentModel().getElement(newLocation[0])); //$NON-NLS-1$ } fTableCursor.setSelection(newLocation[0], newLocation[1]); @@ -479,12 +478,14 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } Object oldSelectionKey = null; try { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { - if (oldTopIndexKey != null) - System.out.println(getRendering() + " preserve top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ - else - System.out.println("top index key is null, nothing to preserve"); //$NON-NLS-1$ + if (oldTopIndexKey != null) { + DebugUIPlugin.trace(getRendering() + " preserve top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ + } + else { + DebugUIPlugin.trace("top index key is null, nothing to preserve"); //$NON-NLS-1$ + } } if (fPendingSelection != null) @@ -492,12 +493,14 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { else oldSelectionKey = getSelectionKey(); - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { - if (oldTopIndexKey != null) - System.out.println(getRendering() + " preserve selection: " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$ - else - System.out.println("selection key is null, nothing to preserve"); //$NON-NLS-1$ + if (oldTopIndexKey != null) { + DebugUIPlugin.trace(getRendering() + " preserve selection: " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$ + } + else { + DebugUIPlugin.trace("selection key is null, nothing to preserve"); //$NON-NLS-1$ + } } // perform the update @@ -507,16 +510,17 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { if (oldSelectionKey != null) { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(getRendering() + " preserved selection " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(getRendering() + " preserved selection " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$ + } setSelection(oldSelectionKey); } if (getPendingSetTopIndexKey() != null) { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) { + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { if (oldTopIndexKey != null) { - System.out.println(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ + DebugUIPlugin.trace(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ } } setTopIndex(getPendingSetTopIndexKey()); @@ -525,8 +529,9 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { { setTopIndex(oldTopIndexKey); - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ + } } } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java index 928d4b44e..f1759b003 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,8 +48,6 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi private ListenerList fPresentationErrorListeners; private Object fTopIndexKey; - public static boolean DEBUG_DYNAMIC_LOADING = false; - public AsyncVirtualContentTableViewer(Composite parent, int style) { super(parent, style); fVirtualContentListeners = new ListenerList(); @@ -182,8 +180,9 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi int idx = getVirtualContentModel().indexOfKey(topIndexKey); if (idx >= 0) { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println("actual set top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace("actual set top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + } fPendingTopIndexKey = null; setTopIndexKey(topIndexKey); getTable().setTopIndex(idx); @@ -191,14 +190,16 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi if (getTable().getTopIndex() != idx ) { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(">>> FAILED set top index : " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(">>> FAILED set top index : " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + } // only retry if we have pending updates if (hasPendingUpdates()) { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(">>> Retry top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(">>> Retry top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + } fPendingTopIndexKey = topIndexKey; } @@ -206,8 +207,9 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi } else { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println("cannot find key, put it back to the queue: " + topIndexKey); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace("cannot find key, put it back to the queue: " + topIndexKey); //$NON-NLS-1$ + } fPendingTopIndexKey = topIndexKey; } @@ -298,10 +300,10 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi public void topIndexChanged() { - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { MemorySegment a = (MemorySegment)getTable().getItem(getTable().getTopIndex()).getData(); - System.out.println(Thread.currentThread().getName() + " " + this + " handle scroll bar moved: top index: " + a.getAddress().toString(16)); //$NON-NLS-1$ //$NON-NLS-2$ + DebugUIPlugin.trace(Thread.currentThread().getName() + " " + this + " handle scroll bar moved: top index: " + a.getAddress().toString(16)); //$NON-NLS-1$ //$NON-NLS-2$ } setTopIndexKey(getVirtualContentModel().getKey(getTable().getTopIndex())); @@ -384,8 +386,9 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi private void addKeyToQueue(Object topIndexKey) { synchronized(fTopIndexQueue){ - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(" >>> add to top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(" >>> add to top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + } fTopIndexQueue.add(topIndexKey); } } @@ -393,8 +396,9 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi private void removeKeyFromQueue(Object topIndexKey) { synchronized(fTopIndexQueue){ - if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING) - System.out.println(" >>> remove frome top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { + DebugUIPlugin.trace(" >>> remove frome top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$ + } fTopIndexQueue.remove(topIndexKey); } } |