From ebb2566c95427e5c7cffd5e27f1e910b0a187b17 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Mon, 9 Jan 2017 14:12:58 +0100 Subject: Bug 510100 - [cleanup] Get rid of trailing white space in platform.debug Also enabled "cleanup whitespace on save" actions for debug.ui and debug.tests bundles. Change-Id: I755b879ab1d49144a1bec3f4318dbb8b29521bb3 Signed-off-by: Andrey Loskutov --- .../ui/views/DebugModelPresentationContext.java | 8 +- .../internal/ui/views/IDebugExceptionHandler.java | 8 +- .../internal/ui/views/ViewContextManager.java | 22 +- .../internal/ui/views/ViewContextService.java | 288 +++++++-------- .../ui/views/breakpoints/BreakpointContainer.java | 244 ++++++------ .../BreakpointContainerWorkbenchAdapter.java | 8 +- .../ui/views/breakpoints/BreakpointFactory.java | 2 +- .../breakpoints/BreakpointOrganizerExtension.java | 28 +- .../breakpoints/BreakpointOrganizerManager.java | 30 +- .../BreakpointPersistableElementAdapter.java | 12 +- .../views/breakpoints/BreakpointSetOrganizer.java | 56 +-- .../views/breakpoints/BreakpointTypeOrganizer.java | 8 +- .../breakpoints/BreakpointWorkingSetCache.java | 12 +- .../BreakpointWorkingSetElementAdapter.java | 8 +- .../breakpoints/BreakpointWorkingSetPage.java | 26 +- .../views/breakpoints/BreakpointsComparator.java | 40 +- .../breakpoints/BreakpointsContentProvider.java | 28 +- .../views/breakpoints/BreakpointsDragAdapter.java | 22 +- .../views/breakpoints/BreakpointsDropAdapter.java | 6 +- .../breakpoints/BreakpointsLabelProvider.java | 20 +- .../ui/views/breakpoints/BreakpointsView.java | 156 ++++---- .../ui/views/breakpoints/BreakpointsViewer.java | 54 +-- .../ui/views/breakpoints/ElementComparator.java | 62 ++-- .../views/breakpoints/FileBreakpointOrganizer.java | 4 +- .../breakpoints/ProjectBreakpointOrganizer.java | 4 +- .../breakpoints/WorkingSetBreakpointOrganizer.java | 12 +- .../ui/views/breakpoints/WorkingSetCategory.java | 20 +- .../ui/views/console/ConsoleLineNotifier.java | 20 +- .../internal/ui/views/console/ConsoleMessages.java | 2 +- .../console/ConsoleRemoveAllTerminatedAction.java | 10 +- .../views/console/ConsoleRemoveLaunchAction.java | 8 +- .../console/ConsoleShowPreferencesAction.java | 8 +- .../ui/views/console/ConsoleTerminateAction.java | 14 +- .../internal/ui/views/console/ProcessConsole.java | 58 +-- .../ui/views/console/ProcessConsoleManager.java | 70 ++-- .../console/ProcessConsolePageParticipant.java | 36 +- .../views/console/ProcessTypePropertyTester.java | 4 +- .../ui/views/console/ShowStandardErrorAction.java | 4 +- .../ui/views/console/ShowStandardOutAction.java | 4 +- .../console/ShowWhenContentChangesAction.java | 12 +- .../ui/views/expression/ExpressionDropAdapter.java | 62 ++-- .../ui/views/expression/ExpressionView.java | 52 +-- .../launch/BreadcrumbDropDownAutoExpandAction.java | 20 +- .../ui/views/launch/BreadcrumbWorkbenchPart.java | 6 +- .../views/launch/DebugElementAdapterFactory.java | 68 ++-- .../ui/views/launch/DebugElementHelper.java | 24 +- .../ui/views/launch/DebugToolBarAction.java | 20 +- .../ui/views/launch/DebugViewModeAction.java | 34 +- .../debug/internal/ui/views/launch/Decoration.java | 6 +- .../ui/views/launch/DecorationManager.java | 6 +- .../ui/views/launch/ImageImageDescriptor.java | 2 +- .../debug/internal/ui/views/launch/LaunchView.java | 408 ++++++++++----------- .../ui/views/launch/LaunchViewBreadcrumb.java | 138 +++---- .../LaunchViewCopyToClipboardActionDelegate.java | 14 +- .../ui/views/launch/SourceNotFoundEditor.java | 6 +- .../ui/views/launch/SourceNotFoundEditorInput.java | 10 +- .../ui/views/launch/StandardDecoration.java | 6 +- .../ui/views/launch/TerminateAndRemoveHandler.java | 2 +- .../ui/views/memory/AbstractMemoryViewPane.java | 4 +- .../ui/views/memory/AddMemoryBlockAction.java | 6 +- .../ui/views/memory/AddMemoryRenderingAction.java | 4 +- .../memory/AddMemoryRenderingContextAction.java | 2 +- .../ui/views/memory/AddMemoryRenderingDialog.java | 4 +- .../ui/views/memory/CodePagesPreferencePage.java | 2 +- .../internal/ui/views/memory/IMemoryView.java | 6 +- .../internal/ui/views/memory/IMemoryViewPane.java | 14 +- .../internal/ui/views/memory/IMemoryViewTab.java | 10 +- .../ui/views/memory/LinkRenderingPanesAction.java | 2 +- .../ui/views/memory/MemoryBlocksTreeViewPane.java | 6 +- .../debug/internal/ui/views/memory/MemoryView.java | 8 +- .../ui/views/memory/MemoryViewIdRegistry.java | 4 +- .../ui/views/memory/MemoryViewPrefAction.java | 2 +- .../memory/MemoryViewSynchronizationService.java | 8 +- .../internal/ui/views/memory/MemoryViewTab.java | 2 +- .../ui/views/memory/MemoryViewTreeViewer.java | 6 +- .../internal/ui/views/memory/MemoryViewUtil.java | 14 +- .../ui/views/memory/MonitorMemoryBlockDialog.java | 2 +- .../ui/views/memory/PinMemoryBlockAction.java | 4 +- .../ui/views/memory/PropertyChangeNotifier.java | 4 +- .../views/memory/RemoveMemoryRenderingAction.java | 6 +- .../views/memory/RemoveRenderingContextAction.java | 4 +- .../ui/views/memory/RenderingViewPane.java | 14 +- .../ui/views/memory/ResetMemoryBlockAction.java | 2 +- .../memory/ResetMemoryBlockPreferencePage.java | 2 +- .../views/memory/RetargetAddMemoryBlockAction.java | 2 +- .../memory/SetPaddedStringPreferencePage.java | 2 +- .../ui/views/memory/SwitchMemoryBlockAction.java | 12 +- .../internal/ui/views/memory/SynchronizeInfo.java | 12 +- .../views/memory/ToggleMemoryMonitorsAction.java | 6 +- .../ui/views/memory/ToggleSplitPaneAction.java | 6 +- .../ui/views/memory/ToggleViewPaneAction.java | 2 +- .../ui/views/memory/ViewPaneRenderingMgr.java | 4 +- .../ui/views/memory/ViewPaneSelectionProvider.java | 6 +- .../ui/views/memory/ViewTabEnablementManager.java | 4 +- .../ui/views/memory/renderings/ASCIIRendering.java | 28 +- .../renderings/ASCIIRenderingTypeDelegate.java | 2 +- .../renderings/AbstractBaseTableRendering.java | 28 +- .../renderings/AbstractIntegerRendering.java | 16 +- .../AbstractTableRenderingLabelProvider.java | 32 +- .../AbstractVirtualContentTableModel.java | 2 +- .../renderings/AsyncCopyTableRenderingAction.java | 4 +- .../renderings/AsyncPrintTableRenderingAction.java | 4 +- .../AsyncTableRenderingCellModifier.java | 48 +-- .../AsyncTableRenderingUpdatePolicy.java | 34 +- .../renderings/AsyncTableRenderingViewer.java | 308 ++++++++-------- .../renderings/BasicDebugViewContentProvider.java | 20 +- .../views/memory/renderings/BigEndianAction.java | 16 +- .../CopyTableRenderingToClipboardAction.java | 54 +-- .../views/memory/renderings/CreateRendering.java | 102 +++--- .../memory/renderings/DefaultEndianessAction.java | 6 +- .../ui/views/memory/renderings/ErrorRendering.java | 24 +- .../renderings/FormatTableRenderingAction.java | 4 +- .../renderings/FormatTableRenderingDialog.java | 166 ++++----- .../views/memory/renderings/GoToAddressAction.java | 60 +-- .../memory/renderings/GoToAddressComposite.java | 48 +-- .../memory/renderings/HexIntegerRendering.java | 18 +- .../ui/views/memory/renderings/HexRendering.java | 12 +- .../renderings/HexRenderingTypeDelegate.java | 2 +- .../memory/renderings/IContentChangeComputer.java | 12 +- .../renderings/IPresentationErrorListener.java | 4 +- .../memory/renderings/IVirtualContentListener.java | 8 +- .../memory/renderings/LittleEndianAction.java | 18 +- .../ui/views/memory/renderings/MemorySegment.java | 26 +- .../memory/renderings/PendingPropertyChanges.java | 8 +- .../renderings/PrintTableRenderingAction.java | 50 +-- .../ui/views/memory/renderings/ReformatAction.java | 6 +- .../ui/views/memory/renderings/RenderingsUtil.java | 140 +++---- .../renderings/ResetToBaseAddressAction.java | 2 +- .../memory/renderings/SignedIntegerRendering.java | 62 ++-- .../SignedIntegerRenderingTypeDelegate.java | 2 +- .../renderings/TableRenderingCellModifier.java | 8 +- .../TableRenderingContentDescriptor.java | 50 +-- .../renderings/TableRenderingContentInput.java | 34 +- .../renderings/TableRenderingContentProvider.java | 310 ++++++++-------- .../renderings/TableRenderingLabelProvider.java | 28 +- .../renderings/TableRenderingLabelProviderEx.java | 12 +- .../memory/renderings/TableRenderingLine.java | 102 +++--- .../memory/renderings/TableRenderingModel.java | 6 +- .../renderings/TableRenderingPrefAction.java | 8 +- .../renderings/TableRenderingPreferencePage.java | 52 +-- .../renderings/TableRenderingPropertiesPage.java | 50 +-- .../renderings/UnsignedIntegerRendering.java | 72 ++-- .../UnsignedIntegerRenderingTypeDelegate.java | 2 +- .../ui/views/modules/IHelpContextIdProvider.java | 6 +- .../internal/ui/views/modules/ModulesView.java | 40 +- .../ui/views/modules/ModulesViewMessages.java | 4 +- .../internal/ui/views/registers/RegistersView.java | 14 +- .../ui/views/registers/RegistersViewMessages.java | 4 +- .../AvailableLogicalStructuresAction.java | 22 +- .../ui/views/variables/IndexedValuePartition.java | 14 +- .../views/variables/IndexedVariablePartition.java | 16 +- .../ui/views/variables/LogicalStructureCache.java | 38 +- .../variables/SelectLogicalStructureAction.java | 12 +- .../ui/views/variables/SelectionDragAdapter.java | 16 +- .../variables/ToggleLogicalStructureAction.java | 14 +- .../views/variables/ToggleShowColumnsAction.java | 14 +- .../views/variables/VariableViewToggleAction.java | 22 +- .../internal/ui/views/variables/VariablesView.java | 336 ++++++++--------- .../ui/views/variables/VariablesViewMessages.java | 2 +- .../variables/details/AbstractDetailPane.java | 48 +-- .../details/AvailableDetailPanesAction.java | 48 +-- .../views/variables/details/DefaultDetailPane.java | 214 +++++------ .../details/DefaultDetailPaneFactory.java | 8 +- .../views/variables/details/DetailPaneManager.java | 142 +++---- .../views/variables/details/DetailPaneProxy.java | 74 ++-- .../variables/details/IDetailPaneContainer.java | 26 +- .../variables/details/IDetailPaneContainer2.java | 4 +- .../views/variables/details/MessageDetailPane.java | 20 +- 168 files changed, 2894 insertions(+), 2894 deletions(-) (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views') diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java index 6779bd9c1..91006d479 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java @@ -16,17 +16,17 @@ import org.eclipse.ui.IWorkbenchPart; /** * A presentation context that has a debug model presentation. - * + * * @since 3.3 */ public class DebugModelPresentationContext extends PresentationContext { private IDebugModelPresentation fPresentation; - + /** * Constructs a presentation context for the given id using the * specified model presentation. - * + * * @param id context id * @param part workbench view * @param presentation debug model presentation @@ -35,7 +35,7 @@ public class DebugModelPresentationContext extends PresentationContext { super(id, part); fPresentation = presentation; } - + public IDebugModelPresentation getModelPresentation() { return fPresentation; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java index 4bc7087b0..1be2ce3e7 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -12,15 +12,15 @@ package org.eclipse.debug.internal.ui.views; import org.eclipse.debug.core.DebugException; - + /** * A plugable exception handler. */ public interface IDebugExceptionHandler { - + /** * Handles the given debug exception. - * + * * @param e debug exception */ public abstract void handleException(DebugException e); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java index a12318450..d4a931e03 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Wind River - Pawel Piech - Fixed debug context service usage (Bug 258189) @@ -21,22 +21,22 @@ import org.eclipse.ui.PlatformUI; /** * Manages the view context services for each window. - * + * * @since 3.2 */ public class ViewContextManager implements IWindowListener { - + /** * Map of services */ private Map fWindowToService = new HashMap(); - + // singleton manager private static ViewContextManager fgManager; - + /** * Returns the singleton view context manager. - * + * * @return view manager */ public static ViewContextManager getDefault() { @@ -45,8 +45,8 @@ public class ViewContextManager implements IWindowListener { } return fgManager; } - - + + private ViewContextManager() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows(); @@ -56,7 +56,7 @@ public class ViewContextManager implements IWindowListener { } workbench.addWindowListener(this); } - + /* (non-Javadoc) * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow) */ @@ -94,10 +94,10 @@ public class ViewContextManager implements IWindowListener { fWindowToService.put(window, service); } } - + /** * Returns the service for the given window, or null if none. - * + * * @param window * @return view context service or null */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java index a39b75c56..125f973c1 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -67,69 +67,69 @@ import org.w3c.dom.NodeList; /** * Performs view management for a window. - * + * * @since 3.2 */ public class ViewContextService implements IDebugContextListener, IPerspectiveListener4, IPreferenceChangeListener, IContextManagerListener { - + /** * Maps the perspectives in this window to its last activated workbench context */ private final Map fPerspectiveToActiveContext = new HashMap(); - + /** - * Map of the perspectives to all workbench contexts activated in that perspective + * Map of the perspectives to all workbench contexts activated in that perspective */ private final Map> fPerspectiveToActivatedContexts = new HashMap>(); - + /** * Map of context id's to context view bindings */ private Map fContextIdsToBindings; - + /** * List of perspectives that debugging is allowed in */ private Set fEnabledPerspectives = new HashSet(); - + /** - * Whether to ignore perspective change call backs (set to - * true when this class is modifying views). + * Whether to ignore perspective change call backs (set to + * true when this class is modifying views). */ private boolean fIgnoreChanges = false; - + /** * The window this service is working for */ private IWorkbenchWindow fWindow; - + private final IContextService fContextService; - + private final IDebugContextService fDebugContextService; - + /** * Perspective that is currently being de-activated. Used to determine - * when to ignore active context changes. + * when to ignore active context changes. */ private IPerspectiveDescriptor fActivePerspective; - + // base debug context public static final String DEBUG_CONTEXT= "org.eclipse.debug.ui.debugging"; //$NON-NLS-1$ - + // extension points private static final String ID_CONTEXT_VIEW_BINDINGS= "contextViewBindings"; //$NON-NLS-1$ // extension elements private static final String ELEM_CONTEXT_VIEW_BINDING= "contextViewBinding"; //$NON-NLS-1$ private static final String ELEM_PERSPECTIVE= "perspective"; //$NON-NLS-1$ - + // extension attributes private static final String ATTR_CONTEXT_ID= "contextId"; //$NON-NLS-1$ private static final String ATTR_VIEW_ID= "viewId"; //$NON-NLS-1$ private static final String ATTR_AUTO_OPEN= "autoOpen"; //$NON-NLS-1$ - private static final String ATTR_AUTO_CLOSE= "autoClose"; //$NON-NLS-1$ + private static final String ATTR_AUTO_CLOSE= "autoClose"; //$NON-NLS-1$ private static final String ATTR_PERSPECTIVE_ID= "perspectiveId"; //$NON-NLS-1$ - + // XML tags private static final String XML_ELEMENT_VIEW_BINDINGS ="viewBindings"; //$NON-NLS-1$ private static final String XML_ELEMENT_PERSPECTIVE ="perspective"; //$NON-NLS-1$ @@ -138,10 +138,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi private static final String XML_ATTR_USER_ACTION = "userAction"; //$NON-NLS-1$ private static final String XML_VALUE_OPENED = "opened"; //$NON-NLS-1$ private static final String XML_VALUE_CLOSED = "closed"; //$NON-NLS-1$ - + // ids of base debug views in debug perspective that should not be auto-closed private static Set fgBaseDebugViewIds = null; - + static { fgBaseDebugViewIds = new HashSet(); fgBaseDebugViewIds.add(IDebugUIConstants.ID_DEBUG_VIEW); @@ -149,20 +149,20 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi fgBaseDebugViewIds.add(IDebugUIConstants.ID_BREAKPOINT_VIEW); fgBaseDebugViewIds.add(IConsoleConstants.ID_CONSOLE_VIEW); } - + private static String[] EMPTY_IDS = new String[0]; - + /** * View bindings for a debug context */ private class DebugContextViewBindings { - + // context id private final String fId; - + // list of view bindings id's specific to this context private String[] fViewBindingIds = EMPTY_IDS; - + // all bindings including inherited bindings, top down in activation order private String[] fAllViewBindingIds = null; // associated binding to activate @@ -172,28 +172,28 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi // id of parent context private String fParentId; - + /** * Constructs an empty view binding for the given context. - * + * * @param id context id */ public DebugContextViewBindings(String id) { fId = id; } - + /** * Returns the context id for these view bindings - * + * * @return context id */ public String getId() { return fId; } - + /** * Adds the given view binding to this context - * + * * @param binding view binding to add */ public void addBinding(ViewBinding binding) { @@ -203,19 +203,19 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi fAllViewIdToBindings.put(binding.getViewId(), binding); fViewBindingIds = newBindings; } - + /** * Sets the parent id of this view bindings - * + * * @param id parent context id */ protected void setParentId(String id) { fParentId = id; } - + /** * Returns the id of parent context - * + * * @return parent context id */ public DebugContextViewBindings getParentContext() { @@ -224,7 +224,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } return fContextIdsToBindings.get(fParentId); } - + /** * Activates the views in this context hierarchy. Views are activated top down, allowing * sub-contexts to override settings in a parent context. @@ -235,17 +235,17 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi public void activateChain(IWorkbenchPage page, IPerspectiveDescriptor perspective, Set allViewIds) { initializeChain(); doActivation(page, perspective, allViewIds, fAllConetxtIds); - } - + } + public String[] getAllViewBindingsIds() { initializeChain(); return fAllViewBindingIds; } - + /** - * Activates the view bindings for the specified views and the + * Activates the view bindings for the specified views and the * specified contexts in the given page. - * + * * @param page page to activate views in * @param perspective the perspective description * @param allViewIds id's of all the views that are relevant in this context activation @@ -266,7 +266,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi binding.checkZOrder(page, allViewIds); } } - + /** * Builds the top down ordered list of bindings for this context allowing sub-contexts * to override parent settings. @@ -299,10 +299,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi fAllViewBindingIds = orderedIds.toArray(new String[orderedIds.size()]); } } - + /** * Deactivates this context only (not parents) - * + * * @param page workbench page * @param perspective the perspective description */ @@ -317,10 +317,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi binding.deactivated(page, perspective); } } - + /** * Notes when a view is opened/closed manually. - * + * * @param opened opened or closed * @param viewId the view identifier */ @@ -342,11 +342,11 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi if (binding != null) { binding.applyUserSettings(viewElement); } - } - + } + /** * Save view binding settings into XML document. - * + * * @param document the document to save to * @param root the root XML element * @param alreadyDone views already done @@ -360,9 +360,9 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi binding.saveBindings(document, root); } } - } + } } - + /** * Information for a view */ @@ -380,40 +380,40 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi * Set of perspectives this view was auto-opened by view management. */ private final Set fAutoOpened = new HashSet(); - + public ViewBinding(IConfigurationElement element) { fElement = element; } - + /** * Returns the id of the view this binding pertains to. - * + * * @return the id of the view */ public String getViewId() { return fElement.getAttribute(ATTR_VIEW_ID); } - + /** * Returns whether this view binding is set for auto-open. - * + * * @return if the view is set to auto-open */ public boolean isAutoOpen() { String autoopen = fElement.getAttribute(ATTR_AUTO_OPEN); return autoopen == null || "true".equals(autoopen); //$NON-NLS-1$ } - + /** * Returns whether this view binding is set for auto-close. - * + * * @return if the view is set to auto-close */ public boolean isAutoClose() { String autoclose = fElement.getAttribute(ATTR_AUTO_CLOSE); return autoclose == null || "true".equals(autoclose); //$NON-NLS-1$ } - + /** * Returns whether this view was opened by the user in the active perspective. * @param perspective the perspective description @@ -422,19 +422,19 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi public boolean isUserOpened(IPerspectiveDescriptor perspective) { return fUserOpened.contains(perspective.getId()); } - + /** * Returns whether this view was closed by the user in the active perspective * @param perspective the description of the perspective - * @return if this view was closed by the user in the active perspective + * @return if this view was closed by the user in the active perspective */ public boolean isUserClosed(IPerspectiveDescriptor perspective) { return fUserClosed.contains(getActivePerspective().getId()); } - + /** * Returns whether this view is part of the active perspective by default - * + * * TODO: we really need an API to determine which views are * in a perspective by default, but it does not seem to exist. * @param perspective the description of the perspective @@ -447,7 +447,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } return false; } - + protected void userOpened() { if (isTrackingViews()) { String id = getActivePerspective().getId(); @@ -457,7 +457,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi saveViewBindings(); } } - + protected void userClosed() { if (isTrackingViews()) { String id = getActivePerspective().getId(); @@ -467,19 +467,19 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi saveViewBindings(); } } - + /** * Returns whether the preference is set to track user view open/close. - * + * * @return if the service is set to track user view open/close */ protected boolean isTrackingViews() { return DebugUITools.getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_TRACK_VIEWS); } - + /** * Context has been activated, open/show as required. - * + * * @param page the workbench page * @param perspective the perspective description */ @@ -502,11 +502,11 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - + /** * Context has been activated. Check the view stack to see if this view * should be made visible. - * + * * @param page the page to check * @param relevantViews the array of view identifiers */ @@ -537,11 +537,11 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - } - + } + /** * Context has been deactivated, close as required. - * + * * @param page the workbench page * @param perspective the perspective description */ @@ -563,7 +563,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi /** * Save view binding settings into XML document. - * + * * @param document the document to save to * @param root the root XML element */ @@ -576,7 +576,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi root.appendChild(viewElement); } } - + private void appendPerspectives(Document document, Element parent, Set perpectives, String xmlValue) { String[] ids = perpectives.toArray(new String[perpectives.size()]); for (int i = 0; i < ids.length; i++) { @@ -587,7 +587,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi parent.appendChild(element); } } - + public void applyUserSettings(Element viewElement) { NodeList list = viewElement.getChildNodes(); int length = list.getLength(); @@ -608,17 +608,17 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - } + } } } - + private IDebugContextService getDebugContextService() { return fDebugContextService; } - + /** * Creates a service for the given window - * + * * @param window the window to attach this service to */ ViewContextService(IWorkbenchWindow window) { @@ -642,7 +642,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - + public void dispose() { fWindow.removePerspectiveListener(this); fWindow = null; // avoid leaking a window reference (bug 321658). @@ -654,7 +654,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi fContextService.removeContextManagerListener(this); fActivePerspective = null; } - + /** * Loads extensions which map context id's to view bindings. */ @@ -681,7 +681,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } linkParentContexts(); } - + /** * Applies user settings that modify view binding extensions. */ @@ -704,13 +704,13 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - } + } } catch (CoreException e) { DebugUIPlugin.log(e); } } } - + /** * Load the collection of perspectives in which view management will occur from the preference store. */ @@ -723,10 +723,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi fEnabledPerspectives = parseList(preference); } } - + /** * Returns whether this service's window's active perspective supports view management. - * + * * @return whether this service's window's active perspective supports view management */ private boolean isEnabledPerspective() { @@ -735,11 +735,11 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi return fEnabledPerspectives.contains(perspective.getId()); } return false; - } - + } + /** * Returns the active perspective in this service's window, or null - * + * * @return active perspective or null */ private IPerspectiveDescriptor getActivePerspective() { @@ -749,11 +749,11 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi return fActivePerspective; } - + /** * Parses the comma separated string into a list of strings * @param listString the comma separated string to parse into a list object - * + * * @return list */ public static Set parseList(String listString) { @@ -765,13 +765,13 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } return list; } - + /** - * Calculates the default set of perspectives enabled for view management + * Calculates the default set of perspectives enabled for view management * based on the contextViewBindings extension point. - * + * * @return set of enabled perspectives. - * + * * @since 3.5 */ public static Set getDefaultEnabledPerspectives() { @@ -787,7 +787,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - + return perspectives; } @@ -819,10 +819,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi break; } } - + if (needToActivate) { Set allViewIds = getAllContextsViewIDs(workbenchContexts); - + // if all contexts already activate and last context is already active context == done for (int i = 0; i < workbenchContexts.size(); i++) { String contextId = workbenchContexts.get(i); @@ -831,21 +831,21 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - } + } } } catch (CoreException e) { DebugUIPlugin.log(e); } - } - } + } + } } } } } - + /** * Returns whether the given context is the active context in the active perspective. - * + * * @param contextId the id of the context * @return if the given id is the id for the currently active context */ @@ -857,12 +857,12 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } return false; } - + /** - * Returns whether the given context is activated in the active perspective. - * + * Returns whether the given context is activated in the active perspective. + * * @param contextId the context id - * @return if the given context is activated in the active perspective + * @return if the given context is activated in the active perspective */ private boolean isActivated(String contextId) { IPerspectiveDescriptor activePerspective = getActivePerspective(); @@ -874,7 +874,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } return false; } - + private void addActivated(String contextId) { IPerspectiveDescriptor activePerspective = getActivePerspective(); if (activePerspective != null) { @@ -886,7 +886,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi contexts.add(contextId); } } - + private void removeActivated(String contextId) { IPerspectiveDescriptor activePerspective = getActivePerspective(); if (activePerspective != null) { @@ -894,7 +894,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi if (contexts != null) { contexts.remove(contextId); } - } + } } @Override @@ -908,7 +908,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi * @see org.eclipse.ui.IPerspectiveListener3#perspectiveOpened(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor) */ @Override - public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective) { + public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective) { } /* (non-Javadoc) @@ -924,10 +924,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi @Override public void perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) { } - + /** * Closes all auto-opened views. - * + * * @param perspective the perspective descriptor */ private void clean(IPerspectiveDescriptor perspective) { @@ -967,7 +967,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - } + } } /* (non-Javadoc) @@ -990,10 +990,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi @Override public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) { } - + /** * Activates all parent contexts of the given context, top down. - * + * * @param contextId the identifier of the {@link DebugContextViewBindings} to activate * @param perspective the perspective description */ @@ -1001,7 +1001,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi if (fWindow == null) { return; // disposed } - + IWorkbenchPage page = fWindow.getActivePage(); if (page != null) { DebugContextViewBindings bindings= fContextIdsToBindings.get(contextId); @@ -1010,12 +1010,12 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - + private Set getAllContextsViewIDs(List contextsIds) { if (fWindow == null) { return Collections.EMPTY_SET; // disposed } - + TreeSet viewIds = new TreeSet(); for (int i = 0; i < contextsIds.size(); i++) { DebugContextViewBindings bindings= fContextIdsToBindings.get(contextsIds.get(i)); @@ -1028,9 +1028,9 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } return viewIds; } - + /** - * Links each debug context view bindings with its parent context bindings + * Links each debug context view bindings with its parent context bindings */ private void linkParentContexts() { for (Entry entry : fContextIdsToBindings.entrySet()) { @@ -1044,12 +1044,12 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } } } - } - + } + /** * Sets the active context in the given perspective, or removes * when null. - * + * * @param perspective the perspective descriptor * @param contextId the context identifier */ @@ -1081,25 +1081,25 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi contextActivated(DebugUITools.getDebugContextManager().getContextService(fWindow).getActiveContext()); } } - + private void deactivate(String contextId, IPerspectiveDescriptor perspective) { if (fWindow == null) { return; // disposed } - + IWorkbenchPage page = fWindow.getActivePage(); if (page != null) { DebugContextViewBindings bindings = fContextIdsToBindings.get(contextId); if (bindings != null) { bindings.deactivate(page, perspective); } - } + } } - + /** * Returns a set of contexts disabled in the given event, possibly empty. - * + * * @param event the event * @return disabled context id's */ @@ -1110,18 +1110,18 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi prev.removeAll(activeContextIds); } return prev; - } + } /** * Returns whether the given context has view bindings. - * + * * @param id the context id * @return whether the given context has view bindings */ private boolean isViewContext(String id) { return fContextIdsToBindings.containsKey(id); } - + /** * Save view binding settings that differ from extension settings */ @@ -1146,20 +1146,20 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi fIgnoreChanges = false; } - } - + } + /** * Returns the perspectives in which debugging is enabled. - * - * @return the array of perspective identifiers in which debugging is enabled + * + * @return the array of perspective identifiers in which debugging is enabled */ public String[] getEnabledPerspectives() { return fEnabledPerspectives.toArray(new String[fEnabledPerspectives.size()]); } - + /** * Show the view without effecting user preferences - * + * * @param viewId the id of the view to show */ public void showViewQuiet(String viewId) { @@ -1167,7 +1167,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi { return; // disposed; } - + IWorkbenchPage page = fWindow.getActivePage(); if (page != null) { try { @@ -1181,7 +1181,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi } finally { fIgnoreChanges = false; } - } + } } /* (non-Javadoc) diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java index 565ff4855..a1df06ca9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) @@ -40,45 +40,45 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap * Child breakpoints - inserting new element into this collection should use the insertBreakpoint method */ final private List fBreakpoints = new ArrayList(); - + /** * Child containers - inserting new element into this container should use the insertChildContainer method */ final private List fChildContainers = new ArrayList(); - + /** * The category for this container */ private IAdaptable fCategory; - + /** * The breakpoint organizer for this container */ private IBreakpointOrganizer fOrganizer; - + /** * The nested breakpoint organizer */ private IBreakpointOrganizer[] fNesting; - + /** * A flag to indicate this is the default container */ private boolean fDefaultContainer; - + /** * Parent container */ private BreakpointContainer fParent; - + /** * The comparator, will be use to compare the order for inserting new element into this container */ private ElementComparator fComparator; - + /** * Constructor, intended to be call when creating the root container. - * + * * @param organizers the breakpoint organizer for this container * @param comparator the element comparator, can be null. If null than new element * will be added to the end of the list. @@ -87,39 +87,39 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap fNesting = organizers; fComparator = comparator; } - + /** * Constructor, intended to be call within this class only. - * + * * @param parent the parent breakpoint container * @param category the category for this container * @param organizer the organizer for this container * @param comparator the element comparator * @param nesting the nested breakpoint organizer */ - private BreakpointContainer(BreakpointContainer parent, IAdaptable category, IBreakpointOrganizer organizer, - ElementComparator comparator, IBreakpointOrganizer[] nesting) { + private BreakpointContainer(BreakpointContainer parent, IAdaptable category, IBreakpointOrganizer organizer, + ElementComparator comparator, IBreakpointOrganizer[] nesting) { this(category, organizer, nesting); fParent = parent; fComparator = comparator; } - + /** * Constructor, intended to be call when reorganizing the content. - * + * * @param category the breakpoint category * @param organizer the breakpoint organizer * @param nesting the nested breakpoint organizer */ - BreakpointContainer(IAdaptable category, IBreakpointOrganizer organizer, IBreakpointOrganizer[] nesting) { + BreakpointContainer(IAdaptable category, IBreakpointOrganizer organizer, IBreakpointOrganizer[] nesting) { fCategory = category; fOrganizer = organizer; fNesting = nesting; } - + /** * Initialize the default containers. - * + * * @param parentDelta the parent delta, addition child delta will be added to the parent */ public void initDefaultContainers(ModelDelta parentDelta) { @@ -144,11 +144,11 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap } } } - } - + } + /** * Insert the breakpoint to this container. - * + * * @param breakpoint the new breakpoint * @return the index of the breakpoint in the cache, -1 if the breakpoint already exist */ @@ -166,12 +166,12 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap index = 0; } fBreakpoints.add(index, breakpoint); - return index; + return index; } - + /** * Insert the child container this container. - * + * * @param container the child container * @return the index of the container in the cache, -1 if the child container already exist */ @@ -182,46 +182,46 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap break; } } - + if (index < 0) { index = 0; } fChildContainers.add(index, container); - + return index; } - - + + /** * Returns the element comparator. - * + * * @return the element comparator */ public ElementComparator getElementComparator() { return fComparator; - } - + } + /** * Returns the parent container, can be null. - * + * * @return the parent container */ public BreakpointContainer getParent() { return fParent; } - + /** * Determine whether there is any nested container. - * + * * @return true if has nested container */ private boolean hasNesting() { return fNesting != null && fNesting.length > 0; } - + /** * Get the categories for the breakpoint with the given organizer. - * + * * @param breakpoint the breakpoint * @param organizer the organizer * @return the categories @@ -233,10 +233,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap } return categories; } - + /** * Find existing breakpoint container in the container array the given category. - * + * * @param containers the container array * @param category the category * @return the breakpoint container, can be null. @@ -249,36 +249,36 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap } return null; } - + // TODO [pchuong]: can be remove if BreakpointsContentProvider no longer uses this class void addBreakpoint(IBreakpoint breakpoint) { addBreakpoint(breakpoint, new ModelDelta(null, IModelDelta.NO_CHANGE)); - } - + } + /** - * Add a breakpoint to the container, additional delta will be added to the root delta. - * + * Add a breakpoint to the container, additional delta will be added to the root delta. + * * @param breakpoint the breakpoint to added * @param rootDelta the root delta of this container * @see #removeBreakpoint */ - public void addBreakpoint(IBreakpoint breakpoint, ModelDelta rootDelta) { + public void addBreakpoint(IBreakpoint breakpoint, ModelDelta rootDelta) { final int bpIndex = insertBreakpoint(breakpoint); if (bpIndex < 0) { return; } - + if (hasNesting()) { IBreakpointOrganizer organizer = fNesting[0]; - + // get the breakpoint categories from the organizer - IAdaptable[] categories = getCategories(breakpoint, organizer); - + IAdaptable[] categories = getCategories(breakpoint, organizer); + for (int i = 0; i < categories.length; ++i) { ModelDelta childDelta = null; IAdaptable category = categories[i]; - BreakpointContainer container = findExistingContainer(fChildContainers, category); - + BreakpointContainer container = findExistingContainer(fChildContainers, category); + // create a new container if it doesn't exist if (container == null) { IBreakpointOrganizer[] nesting = null; @@ -289,7 +289,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap container = new BreakpointContainer(this, category, organizer, fComparator, nesting); insertChildContainer(container); childDelta = rootDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.INSERTED|IModelDelta.INSTALL, -1); - + } else { childDelta = rootDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.STATE, -1); } @@ -297,23 +297,23 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap container.addBreakpoint(breakpoint, childDelta); childDelta.setChildCount(container.getChildren().length); } - + } else { - // TODO [pchuong]: There seems to be some kind of problem when the INSERTED flag is used, + // TODO [pchuong]: There seems to be some kind of problem when the INSERTED flag is used, // there is a additional checkbox added to the end of the tree. // Also the tree seems to have a strange visual effect when using the INSERTED // flag for the child node instead of ADDED flag. Note: all breakpoint delta // is using the ADDED flag in this class. rootDelta.addNode(breakpoint, bpIndex, IModelDelta.ADDED|IModelDelta.INSTALL, 0); // rootDelta.addNode(breakpoint, bpIndex, IModelDelta.INSERTED|IModelDelta.INSTALL, 0); - + rootDelta.setFlags(rootDelta.getFlags() | IModelDelta.EXPAND); } } - + /** * Remove a breakpoint from the container, additional delta will be added to the root delta. - * + * * @param breakpoint the breakpoint to remove * @param rootDelta the root delta of this container * @return if the breakpoint was successfully removed @@ -321,10 +321,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap */ public boolean removeBreakpoint(IBreakpoint breakpoint, ModelDelta rootDelta) { boolean removed = fBreakpoints.remove(breakpoint); - + if (removed) { boolean addRemoveBpDelta = getContainers().length == 0; - + Iterator it = fChildContainers.iterator(); while (it.hasNext()) { BreakpointContainer container = it.next(); @@ -335,25 +335,25 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap if ((!container.isDefaultContainer()) && (container.getBreakpoints().length <= 1)) { it.remove(); childDelta = rootDelta.addNode(container, IModelDelta.REMOVED|IModelDelta.UNINSTALL); - + } else { childDelta = rootDelta.addNode(container, IModelDelta.STATE); } // remove the breakpoint from the nested containers container.removeBreakpoint(breakpoint, childDelta); } - } - + } + if (addRemoveBpDelta) { rootDelta.addNode(breakpoint, IModelDelta.REMOVED|IModelDelta.UNINSTALL); } } return removed; - } - + } + /** * A helper method to copy the organizers between two containers. - * + * * @param destContainer the destination container * @param sourceContainer the source container */ @@ -362,10 +362,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap destContainer.fOrganizer = sourceContainer.fOrganizer; destContainer.fCategory = sourceContainer.fCategory; } - + /** * A helper method to update the breakpoint cache of the container and it's ancestors. - * + * * @param container the breakpoint container * @param breakpoints the breakpoint to update * @param add true if breakpoint should be added to the cache, otherwise remove the breakpoint from the cache @@ -379,10 +379,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap updateSelfAndAncestorsBreakpointCache(container.getParent(), breakpoints, add); } } - + /** * A helper method to add a breakpoint to an existing container. - * + * * @param destContainer the destination container * @param breakpoint the breakpoint to add * @param destContainerDelta the destination container delta, additional delta will be added to this delta @@ -390,18 +390,18 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap static public void addBreakpoint(BreakpointContainer destContainer, IBreakpoint breakpoint, ModelDelta destContainerDelta) { int index = destContainer.insertBreakpoint(breakpoint); Assert.isTrue(index >= 0); - + List breakpoints = destContainer.fBreakpoints; destContainerDelta.addNode(breakpoint, index/*breakpoints.indexOf(breakpoint)*/, IModelDelta.ADDED|IModelDelta.INSTALL, 0); destContainerDelta.setFlags(destContainerDelta.getFlags() | IModelDelta.EXPAND); - // add the breakpoints to the parent containers. + // add the breakpoints to the parent containers. updateSelfAndAncestorsBreakpointCache(destContainer.getParent(), breakpoints, true); } - + /** * A helper method to add a child container to an existing container. - * + * * @param destContainer the destination container * @param sourceContainer the source container * @param destContainerDelta the delta of the destination container, additional delta will be added to this delta @@ -409,21 +409,21 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap static public void addChildContainer(BreakpointContainer destContainer, BreakpointContainer sourceContainer, ModelDelta destContainerDelta) { destContainer.insertChildContainer(sourceContainer); sourceContainer.fParent = destContainer; - + // add the breakpoints to the parent containers. List breakpoints = Arrays.asList(sourceContainer.getBreakpoints()); updateSelfAndAncestorsBreakpointCache(destContainer, breakpoints, true); - + int index = destContainer.fChildContainers.indexOf(sourceContainer); int size = sourceContainer.getChildren().length; ModelDelta childDelta = destContainerDelta.addNode(sourceContainer, index, IModelDelta.INSERTED|IModelDelta.INSTALL|IModelDelta.EXPAND, size); - + appendContainerDelta(sourceContainer, childDelta); } - + /** * A helper method to append delta to the breakpoint container. This method is used by addContainer only. - * + * * @param container the container to append child delta * @param containerDelta the delta of the breakpoint container, additional delta will be added to this delta */ @@ -431,21 +431,21 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap Object[] children = container.getChildren(); for (int i = 0; i < children.length; ++i) { boolean isBreakpoint = children[0] instanceof IBreakpoint; - int numChild = isBreakpoint ? 0 : children.length; - int flag = isBreakpoint ? IModelDelta.ADDED|IModelDelta.INSTALL + int numChild = isBreakpoint ? 0 : children.length; + int flag = isBreakpoint ? IModelDelta.ADDED|IModelDelta.INSTALL : IModelDelta.INSERTED|IModelDelta.INSTALL|IModelDelta.EXPAND; ModelDelta childDelta = containerDelta.addNode(children[i], i, flag, numChild); - - if (children[i] instanceof BreakpointContainer) { - BreakpointContainer childContainer = (BreakpointContainer) children[i]; + + if (children[i] instanceof BreakpointContainer) { + BreakpointContainer childContainer = (BreakpointContainer) children[i]; appendContainerDelta(childContainer, childDelta); - } + } } } - + /** * A helper method to remove the breakpoint from the container. - * + * * @param container the container to remove the breakpoint * @param breakpoint the breakpoint to remove * @param containerDelta the delta of the breakpoint container, additional delta will be added to this delta @@ -456,10 +456,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap breakpoints.add(breakpoint); updateSelfAndAncestorsBreakpointCache(container.getParent(), breakpoints, false); } - + /** * Remove all child elements including the given container itself. - * + * * @param container the breakpoint container * @param delta the parent delta */ @@ -469,7 +469,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap parent.fChildContainers.remove(container); delta = delta.addNode(container, IModelDelta.UNINSTALL|IModelDelta.REMOVED); } - + if (container.fChildContainers.size() == 0) { List breakpoints = new ArrayList(); Iterator iterator = container.fBreakpoints.iterator(); @@ -477,67 +477,67 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap IBreakpoint obj = iterator.next(); breakpoints.add(obj); delta.addNode(obj, IModelDelta.UNINSTALL|IModelDelta.REMOVED); - iterator.remove(); + iterator.remove(); } - + // remove the breakpoints from the parent containers. - updateSelfAndAncestorsBreakpointCache(container.getParent(), breakpoints, false); + updateSelfAndAncestorsBreakpointCache(container.getParent(), breakpoints, false); return; } - + Iterator iterator = container.fChildContainers.iterator(); while (iterator.hasNext()) { - BreakpointContainer childContainer = iterator.next(); - ModelDelta childDelta = delta.addNode(childContainer, IModelDelta.REMOVED|IModelDelta.UNINSTALL); + BreakpointContainer childContainer = iterator.next(); + ModelDelta childDelta = delta.addNode(childContainer, IModelDelta.REMOVED|IModelDelta.UNINSTALL); iterator.remove(); removeAll(childContainer, childDelta); } } - + /** * Returns whether this is the default container. - * + * * @return true if it is a default container */ boolean isDefaultContainer() { return fDefaultContainer; } - + /** * Returns the breakpoints in this container - * + * * @return the breakpoints in this container */ @Override public IBreakpoint[] getBreakpoints() { return fBreakpoints.toArray(new IBreakpoint[fBreakpoints.size()]); } - + /** * Returns this container's category. - * + * * @return container category */ @Override public IAdaptable getCategory() { return fCategory; } - + /** * Returns children as breakpoints or nested containers. - * + * * @return children as breakpoints or nested containers */ public Object[] getChildren() { if (fChildContainers.isEmpty()) { return getBreakpoints(); } - return getContainers(); - } + return getContainers(); + } /** * Returns the index of the given child element (breakpoint or container. - * + * * @param child Child to calculate index of. * @return index of child */ @@ -547,40 +547,40 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap } return fChildContainers.indexOf(child); } - + /** * Returns the containers nested in this container, possibly empty. - * + * * @return the containers nested in this container, can be empty. */ public BreakpointContainer[] getContainers() { return fChildContainers.toArray(new BreakpointContainer[fChildContainers.size()]); } - + /** * Returns this container's organizer. - * + * * @return this container's organizer */ @Override public IBreakpointOrganizer getOrganizer() { return fOrganizer; } - + /** * Returns whether this container contains the given breakpoint. - * + * * @param breakpoint the breakpoint to check * @return true if this container contains the given breakpoint */ @Override public boolean contains(IBreakpoint breakpoint) { return fBreakpoints.contains(breakpoint); - } - + } + /** * Returns the child containers for the given breakpoint. - * + * * @param breakpoint the breakpoint to get containers for * @return child containers */ @@ -604,7 +604,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap } return new BreakpointContainer[0]; } - + /* * (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) @@ -615,11 +615,11 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap BreakpointContainer container = (BreakpointContainer) obj; // With Group by "Advanced" the same category can contain a different subset of breakpoints, // therefore to have the same category is not enough to be equal. - if (! (fParent != null && container.fParent != null && fParent.equals(container.fParent) || + if (! (fParent != null && container.fParent != null && fParent.equals(container.fParent) || fParent == null && container.fParent == null) ) { return false; } - if (getCategory() != null && container.getCategory() != null) { + if (getCategory() != null && container.getCategory() != null) { return getCategory().equals(container.getCategory()); } else { return true; @@ -642,10 +642,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) */ @Override - protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { + protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { return getElements(getChildren(), index, length); } - + /* * (non-Javadoc) * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String) @@ -653,8 +653,8 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap @Override protected boolean supportsContextId(String id) { return id.equals(IDebugUIConstants.ID_BREAKPOINT_VIEW); - } - + } + /* * (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java index 1aededf79..9120325b8 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) @@ -92,7 +92,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I if (adapter != null) { return adapter.getForeground(category); } - } + } return null; } @@ -108,7 +108,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I if (adapter != null) { return adapter.getBackground(category); } - } + } return null; } @@ -124,7 +124,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I if (adapter != null) { return adapter.getFont(category); } - } + } return null; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java index b7a88d77d..8281f8c69 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java index 36b064707..907f0d23d 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java @@ -26,25 +26,25 @@ import org.eclipse.jface.util.IPropertyChangeListener; * A contributed breakpoint organizer. */ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBreakpointOrganizerDelegateExtension { - + private IConfigurationElement fElement; private IBreakpointOrganizerDelegate fDelegate; private ImageDescriptor fDescriptor; - + // attributes public static final String ATTR_LABEL = "label"; //$NON-NLS-1$ public static final String ATTR_CLASS = "class"; //$NON-NLS-1$ public static final String ATTR_ID = "id"; //$NON-NLS-1$ public static final String ATTR_ICON = "icon"; //$NON-NLS-1$ public static final String ATTR_OTHERS_LABEL = "othersLabel"; //$NON-NLS-1$ - + public BreakpointOrganizerExtension(IConfigurationElement element) { fElement = element; } - + /** * Returns the image descriptor for this organizer. - * + * * @return image descriptor */ @Override @@ -55,32 +55,32 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea fDescriptor = ImageDescriptor.getMissingImageDescriptor(); } } - return fDescriptor; + return fDescriptor; } - + /** * Returns this organizer's label. - * + * * @return this organizer's label */ @Override public String getLabel() { return fElement.getAttribute(ATTR_LABEL); } - + /** * Returns this organizer's identifier. - * + * * @return this organizer's identifier */ @Override public String getIdentifier() { return fElement.getAttribute(ATTR_ID); } - + /** * Returns this organizer's delegate, instantiating it if required. - * + * * @return this organizer's delegate */ protected IBreakpointOrganizerDelegate getOrganizer() { @@ -168,7 +168,7 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea public String getOthersLabel() { String attribute = fElement.getAttribute(ATTR_OTHERS_LABEL); if (attribute == null) { - return DebugUIViewsMessages.OtherBreakpointOrganizer_0; + return DebugUIViewsMessages.OtherBreakpointOrganizer_0; } return attribute; } @@ -209,6 +209,6 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea removeBreakpoint(breakpoints[i], category); } } - + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java index eb09e90a9..a83b56c86 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -38,9 +38,9 @@ import org.eclipse.jface.util.PropertyChangeEvent; * @since 3.1 */ public class BreakpointOrganizerManager { - + private static BreakpointOrganizerManager fgManager; - + // map for lookup by id private Map fOrganizers = new HashMap(); // cached sorted list by label @@ -57,7 +57,7 @@ public class BreakpointOrganizerManager { } return fgManager; } - + /** * Creates and initializes a new breakpoint container factory. */ @@ -67,10 +67,10 @@ public class BreakpointOrganizerManager { start("org.eclipse.debug.ui.workingSetOrganizer"); //$NON-NLS-1$ start("org.eclipse.debug.ui.breakpointWorkingSetOrganizer"); //$NON-NLS-1$ } - + /** * Forces instantiation of organizer delegate. - * + * * @param organizerId organizer to start */ private void start(String organizerId) { @@ -81,9 +81,9 @@ public class BreakpointOrganizerManager { } }; organizer.addPropertyChangeListener(listener); - organizer.removePropertyChangeListener(listener); + organizer.removePropertyChangeListener(listener); } - + /** * Loads all contributed breakpoint organizers. */ @@ -97,8 +97,8 @@ public class BreakpointOrganizerManager { fOrganizers.put(organizer.getIdentifier(), organizer); } } - } - + } + /** * Validates the given organizer. Checks that certain required attributes * are available. @@ -109,11 +109,11 @@ public class BreakpointOrganizerManager { String id = organizer.getIdentifier(); String label = organizer.getLabel(); return id != null && id.length() > 0 && label != null && label.length() > 0; - } - + } + /** * Returns all contributed breakpoint organizers. - * + * * @return all contributed breakpoint organizers */ public IBreakpointOrganizer[] getOrganizers() { @@ -132,7 +132,7 @@ public class BreakpointOrganizerManager { } return fSorted.toArray(new IBreakpointOrganizer[fSorted.size()]); } - + /** * Returns the specified breakpoint organizer or null * @param id organizer identifier @@ -141,7 +141,7 @@ public class BreakpointOrganizerManager { public IBreakpointOrganizer getOrganizer(String id) { return fOrganizers.get(id); } - + /** * Shuts down the organizer manager, disposing organizers. */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java index 3ff9bc666..e563bf9c7 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,15 +20,15 @@ import org.eclipse.ui.IPersistableElement; * Adapter to save and restore breakpoints for a working set. */ public class BreakpointPersistableElementAdapter implements IPersistableElement { - + private IBreakpoint fBreakpoint; - + public static final String TAG_MARKER_ID = "TAG_MARKER_ID"; //$NON-NLS-1$ public static final String TAG_RESOURCE_FACTORY_ID = "TAG_RESOURCE_FACTORY_ID"; //$NON-NLS-1$ - + /** * Constructs a new persitable element adapter for the given breakpoint. - * + * * @param breakpoint the backing {@link IBreakpoint} */ public BreakpointPersistableElementAdapter(IBreakpoint breakpoint) { @@ -58,7 +58,7 @@ public class BreakpointPersistableElementAdapter implements IPersistableElement memento.putString(TAG_MARKER_ID, longString); memento.putString(TAG_RESOURCE_FACTORY_ID, pe.getFactoryId()); pe.saveState(memento); - } + } } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java index ec22c8ff2..46ebc1f89 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java @@ -45,23 +45,23 @@ import org.osgi.service.prefs.BackingStoreException; /** * Breakpoint organizers for breakpoint working sets. - * + * * @since 3.1 */ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate implements IBreakpointOrganizerDelegateExtension, IPropertyChangeListener, IBreakpointsListener { private IWorkingSetManager fWorkingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); - + /** * A cache for mapping markers to the working set they belong to * @since 3.2 */ private BreakpointWorkingSetCache fCache = null; - + // Cache of the default working set, so we can know when it changes name private static IWorkingSet fDefaultWorkingSet = null; - - + + /** * Constructs a working set breakpoint organizer. Listens for changes in * working sets and fires property change notification. @@ -76,7 +76,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint) */ @Override @@ -101,7 +101,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose() */ @Override @@ -115,7 +115,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ @Override @@ -169,7 +169,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[]) */ @Override @@ -198,7 +198,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate addBreakpointsToSet(list.toArray(new IBreakpoint[list.size()]), set); } } - + private void queueToSet(IBreakpoint breakpoint, IWorkingSet set, Map> queue) { List list = queue.get(set); if (list == null) { @@ -207,12 +207,12 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate } list.add(breakpoint); } - + /** * Adds a breakpoint to a working set * @param breakpoints the breakpoints to add * @param set the set to add it to or null if none - * + * * @since 3.2 */ private void addBreakpointsToSet(IBreakpoint[] breakpoints, IWorkingSet set) { @@ -228,17 +228,17 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate IBreakpoint breakpoint = breakpoints[i]; if (!collection.contains(breakpoint)) { list.add(breakpoint); - fCache.addEntry(breakpoint.getMarker(), set.getName()); //fix for bug 103731 + fCache.addEntry(breakpoint.getMarker(), set.getName()); //fix for bug 103731 fCache.flushMarkerCache(breakpoint.getMarker()); } } set.setElements(list.toArray(new IAdaptable[list.size()])); } - } - + } + /* * (non-Javadoc) - * + * * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], * org.eclipse.core.resources.IMarkerDelta[]) */ @@ -257,7 +257,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /** * Removes deleted breakpoints from the given working set. - * + * * @param workingSet * breakpoint working set */ @@ -289,7 +289,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], * org.eclipse.core.resources.IMarkerDelta[]) */ @@ -300,7 +300,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /** * Returns the active default breakpoint working set, or null * if none. - * + * * @return the active default breakpoint working set, or null */ public static IWorkingSet getDefaultWorkingSet() { @@ -315,7 +315,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /** * Sets the active default breakpoint working set, or null if * none. - * + * * @param set * default working set or null */ @@ -341,7 +341,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.runtime.IAdaptable) */ @@ -356,7 +356,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.runtime.IAdaptable) */ @@ -371,7 +371,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.runtime.IAdaptable) */ @@ -379,14 +379,14 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) { addBreakpoints(new IBreakpoint[]{breakpoint}, category); } - + /** * Gets the working set names from the marker - * + * * @param marker them marker to get the names from * @param type the type attribute to look up * @return the listing of markers or an empty String array, never null - * + * * @since 3.2 */ private String[] getWorkingsetAttributeFromMarker(IMarker marker, String type) { @@ -402,7 +402,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.runtime.IAdaptable) */ @@ -426,7 +426,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories() */ @Override diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java index f90031689..f071ae559 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,11 +22,11 @@ import org.eclipse.debug.ui.IBreakpointTypeCategory; /** * Breakpoint organizers for breakpoint types. - * + * * @since 3.1 */ public class BreakpointTypeOrganizer extends AbstractBreakpointOrganizerDelegate { - + private Map fTypes = new HashMap(); /* (non-Javadoc) @@ -49,7 +49,7 @@ public class BreakpointTypeOrganizer extends AbstractBreakpointOrganizerDelegate } return null; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose() */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java index 6d843d2b4..2b021c97e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java @@ -27,7 +27,7 @@ import org.eclipse.ui.PlatformUI; * Class to cache the breakpoint to working set information in its underlying * marker as breakpoints are moved between breakpoint working sets. It resolves * the need for constant attribute lookup and parsing to fix bug 103731 - * + * * @since 3.2 */ public class BreakpointWorkingSetCache { @@ -38,14 +38,14 @@ public class BreakpointWorkingSetCache { * value: vector of working sets the marker belongs to */ HashMap> fCache = null; - + /** * Default constructor */ public BreakpointWorkingSetCache() { fCache = new HashMap>(15); } - + /** * Adds an entry into the cache * @param marker the marker to add the workingset information about @@ -64,7 +64,7 @@ public class BreakpointWorkingSetCache { } } } - + /** * Removes an item from the list contained under the marker key, not the marker entry * @param marker the marker key to remove the item from @@ -76,7 +76,7 @@ public class BreakpointWorkingSetCache { list.remove(entry); } } - + /** * Flushes the cache of only the specified marker * @param marker the marker whose cache is to be flushed @@ -102,5 +102,5 @@ public class BreakpointWorkingSetCache { catch(CoreException e) {DebugPlugin.log(e);} } } - + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java index b82c79975..194bc91fd 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java @@ -23,7 +23,7 @@ import org.eclipse.ui.IWorkingSetElementAdapter; * Consulted by workbench pull down actions that add/remove selected elements to/from * working sets. Allows breakpoint working sets to select which elements are applicable * for adding/removing. - * + * * @since 3.3 */ public class BreakpointWorkingSetElementAdapter implements IWorkingSetElementAdapter { @@ -34,18 +34,18 @@ public class BreakpointWorkingSetElementAdapter implements IWorkingSetElementAda @Override public IAdaptable[] adaptElements(IWorkingSet ws, IAdaptable[] elements) { for (int i = 0; i < elements.length; i++) { - IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(elements[i], IBreakpoint.class); + IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(elements[i], IBreakpoint.class); if (breakpoint != null) { return selectBreakpoints(elements); } } return elements; } - + private IAdaptable[] selectBreakpoints(IAdaptable[] elements) { List breakpoints = new ArrayList(elements.length); for (int i = 0; i < elements.length; i++) { - IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(elements[i], IBreakpoint.class); + IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(elements[i], IBreakpoint.class); if (breakpoint != null) { breakpoints.add(breakpoint); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java index f141d634e..3ef157f10 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java @@ -47,14 +47,14 @@ import org.eclipse.ui.dialogs.IWorkingSetPage; /** * The Breakpoint working set page allows the user to create * and edit a Breakpoint working set. - * + * * @since 3.1 */ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetPage { - final private static String PAGE_TITLE= DebugUIViewsMessages.BreakpointWorkingSetPage_0; + final private static String PAGE_TITLE= DebugUIViewsMessages.BreakpointWorkingSetPage_0; final private static String PAGE_ID= "breakpointWorkingSetPage"; //$NON-NLS-1$ - + private Text fWorkingSetName; private EmbeddedBreakpointsViewer fTViewer; private boolean fFirstCheck; @@ -65,7 +65,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP */ public BreakpointWorkingSetPage() { super(PAGE_ID, PAGE_TITLE, DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_WIZBAN_DEBUG)); - setDescription(DebugUIViewsMessages.BreakpointWorkingSetPage_1); + setDescription(DebugUIViewsMessages.BreakpointWorkingSetPage_1); fFirstCheck= true; } @@ -80,7 +80,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); setControl(composite); Label label= new Label(composite, SWT.WRAP); - label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_2); + label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_2); GridData gd= new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); label.setLayoutData(gd); fWorkingSetName= new Text(composite, SWT.SINGLE | SWT.BORDER); @@ -95,11 +95,11 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP ); fWorkingSetName.setFocus(); label= new Label(composite, SWT.WRAP); - label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_3); + label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_3); gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); label.setLayoutData(gd); IViewPart viewpart = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_BREAKPOINT_VIEW); - IStructuredSelection selection; + IStructuredSelection selection; if (viewpart == null) { selection = new StructuredSelection(); } else { @@ -190,31 +190,31 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP * validates the current input of the page to determine if the finish button can be enabled */ private void validateInput() { - String errorMessage= null; + String errorMessage= null; String newText= fWorkingSetName.getText(); if (newText.equals(newText.trim()) == false) { errorMessage = DebugUIViewsMessages.BreakpointWorkingSetPage_4; - } + } if (newText.equals(IInternalDebugCoreConstants.EMPTY_STRING)) { if (fFirstCheck) { setPageComplete(false); fFirstCheck= false; return; - } - errorMessage= DebugUIViewsMessages.BreakpointWorkingSetPage_5; + } + errorMessage= DebugUIViewsMessages.BreakpointWorkingSetPage_5; } fFirstCheck= false; if (errorMessage == null && (fWorkingSet == null || newText.equals(fWorkingSet.getName()) == false)) { IWorkingSet[] workingSets= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets(); for (int i= 0; i < workingSets.length; i++) { if (newText.equals(workingSets[i].getName())) { - errorMessage= DebugUIViewsMessages.BreakpointWorkingSetPage_6; + errorMessage= DebugUIViewsMessages.BreakpointWorkingSetPage_6; } } } setErrorMessage(errorMessage); setPageComplete(errorMessage == null); } - + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java index 6d087385e..1d6b122cd 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java @@ -38,21 +38,21 @@ public class BreakpointsComparator extends ViewerComparator { public boolean isSorterProperty(Object element,String propertyId) { return propertyId.equals(IBasicPropertyConstants.P_TEXT); } - + /** * Returns a negative, zero, or positive number depending on whether * the first element is less than, equal to, or greater than * the second element. *

* Group breakpoints by debug model - * within debug model, group breakpoints by type + * within debug model, group breakpoints by type * within type groups, sort by line number (if applicable) and then * alphabetically by label - * + * * @param viewer the viewer * @param e1 the first element * @param e2 the second element - * @return a negative number if the first element is less than the + * @return a negative number if the first element is less than the * second element; the value 0 if the first element is * equal to the second element; and a positive number if the first * element is greater than the second element @@ -87,21 +87,21 @@ public class BreakpointsComparator extends ViewerComparator { if (!marker2.exists()) { return 0; } - type2= marker2.getType(); + type2= marker2.getType(); } catch (CoreException e) { DebugUIPlugin.log(e); } - + result= type1.compareTo(type2); if (result != 0) { return result; } - // model and type are the same + // model and type are the same ILabelProvider lprov = (ILabelProvider) ((StructuredViewer)viewer).getLabelProvider(); String name1= lprov.getText(e1); String name2= lprov.getText(e2); - + result = numericalStringCompare(name1, name2); if (result != 0) { @@ -114,14 +114,14 @@ public class BreakpointsComparator extends ViewerComparator { // Note: intentionally using line 0 if not a line breakpoint or if ILineBreakpoint.getLineNumber throws. if (b1 instanceof ILineBreakpoint) { try { - l1 = ((ILineBreakpoint)b1).getLineNumber(); + l1 = ((ILineBreakpoint)b1).getLineNumber(); } catch (CoreException e) { DebugUIPlugin.log(e); } } if (b2 instanceof ILineBreakpoint) { try { - l2 = ((ILineBreakpoint)b2).getLineNumber(); + l2 = ((ILineBreakpoint)b2).getLineNumber(); } catch (CoreException e) { DebugUIPlugin.log(e); } @@ -131,20 +131,20 @@ public class BreakpointsComparator extends ViewerComparator { } return result; } - + /** * Utility routine to order strings with respect to numerical values. - * + * * E.g. *

* "0", "1", "9", "11" *

* - * Note that String.compareTo orders "11" before "9". + * Note that String.compareTo orders "11" before "9". * * The function also supports mixed numbers and values. It uses the string comparison except when both strings differ by a number only, - * in this case the numerical value is compared. - * E.g. + * in this case the numerical value is compared. + * E.g. *

* stringNumberCompareTo("a_01", "a_1") returns 0. *

@@ -152,7 +152,7 @@ public class BreakpointsComparator extends ViewerComparator { * * @param n1 the first string to compare * @param n2 the second string to compare - * @return + * @return * < 0, negative - if n1 < n2 * == 0, zero - if n1 == n2 (with a a special comparison, not identical or equals) * > 0, negative - if n1 > n2 @@ -164,23 +164,23 @@ public class BreakpointsComparator extends ViewerComparator { for (; index1 < n1.length() && index2 < n2.length(); ) { char c1 = n1.charAt(index1); char c2 = n2.charAt(index2); - + if (c1 != c2) { // Strings are different starting at index. // If both strings have a number at this location, compare it. boolean isDig1 = Character.isDigit(c1); boolean isDig2 = Character.isDigit(c2); - + if (isDig1 && isDig2 || digitLen > 0 && (isDig1 || isDig2)) { // Have 2 numbers if either the different characters are both digits or if there are common digits before the difference. - DecimalFormat format = new DecimalFormat(); + DecimalFormat format = new DecimalFormat(); ParsePosition p1 = new ParsePosition(index1 - digitLen); Number num1 = format.parse(n1, p1); ParsePosition p2 = new ParsePosition(index2 - digitLen); Number num2 = format.parse(n2, p2); if (num1 == null || num2 == null) { // Failed to parse number. Should not happen - return c1 - c2; + return c1 - c2; } int cmp; if (num1 instanceof Long && num2 instanceof Long) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java index 72c065a97..6b79da330 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java @@ -31,12 +31,12 @@ import org.eclipse.jface.viewers.Viewer; * Content provider for the breakpoints view */ public class BreakpointsContentProvider implements ITreeContentProvider, IPropertyChangeListener { - + private IBreakpointOrganizer[] fOrganizers = null; private BreakpointsViewer fViewer; private Object[] fElements; private boolean fDisposed = false; - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ @@ -94,13 +94,13 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper reorganize(); } } - + /** * Sets the nested order of breakpoint organizers, or null * if none. - * + * * @param organizers the nested order of breakpoint organizers, or null - * if none + * if none */ public void setOrganizers(IBreakpointOrganizer[] organizers) { // remove previous listeners @@ -138,17 +138,17 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper break; } } - + } } fViewer.getControl().setRedraw(true); } } - + /** * Returns the root containers containing the given breakpoint, or null * if none - * + * * @param breakpoint the breakpoint to get containers for * @return root containers containing the given breakpoint or null */ @@ -165,18 +165,18 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper } return null; } - + /** * Returns the nested order of breakpoint organizers being used, or null * if none. - * + * * @return the nested order of breakpoint organizers being used, or null * if none */ IBreakpointOrganizer[] getOrganizers() { return fOrganizers; } - + /** * Organizes the breakpoints based on nested categories, if any. */ @@ -237,10 +237,10 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper reorganize(); } } - + /** * Returns the existing containers the given breakpoint is contained in, or null. - * + * * @param breakpoint the breakpoint to get containers for * @return the existing containers the given breakpoint is contained in, or null */ @@ -269,7 +269,7 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper /** * Returns whether content is grouped by categories. - * + * * @return whether content is grouped by categories */ protected boolean isShowingGroups() { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java index ef2443bd9..6123c0136 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java @@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Item; * A drag adapter for the breakpoints viewer */ public class BreakpointsDragAdapter extends DragSourceAdapter implements TransferDragSourceListener { - + /** * the associated viewer for the adapter */ @@ -37,7 +37,7 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe private BreakpointsView fView; private TreePath[] fTreePaths = null; - + /** * Constructor * @param viewer the associated viewer, which acts as the selection provider and therefore must implement ISelectionProvider @@ -59,7 +59,7 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe public Transfer getTransfer() { return LocalSelectionTransfer.getTransfer(); } - + /* non Java-doc * @see org.eclipse.swt.dnd.DragSourceListener#dragStart */ @@ -69,7 +69,7 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe LocalSelectionTransfer.getTransfer().setSelection(selection); LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL); if (fViewer instanceof BreakpointsViewer) { - BreakpointsViewer viewer = (BreakpointsViewer)fViewer; + BreakpointsViewer viewer = (BreakpointsViewer)fViewer; fItems = viewer.getSelectedItems(); event.doit = viewer.canDrag(fItems); } else { @@ -78,13 +78,13 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe } else { fTreePaths = new TreePath[0]; } - event.doit = fView.canDrag(fTreePaths); + event.doit = fView.canDrag(fTreePaths); } } - + /* non Java-doc * @see org.eclipse.swt.dnd.DragSourceListener#dragSetData - */ + */ @Override public void dragSetData(DragSourceEvent event) { // For consistency set the data to the selection even though @@ -95,20 +95,20 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe /* non Java-doc * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished - */ + */ @Override public void dragFinished(DragSourceEvent event) { if (event.detail == DND.DROP_MOVE) { // remove from source on move operation if (fViewer instanceof BreakpointsViewer) { - BreakpointsViewer viewer = (BreakpointsViewer)fViewer; + BreakpointsViewer viewer = (BreakpointsViewer)fViewer; viewer.performDrag(fItems); } else { - fView.performDrag(fTreePaths); + fView.performDrag(fTreePaths); } } fItems = null; LocalSelectionTransfer.getTransfer().setSelection(null); LocalSelectionTransfer.getTransfer().setSelectionSetTime(0); - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java index 5f2276fde..16d026853 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) @@ -34,7 +34,7 @@ public class BreakpointsDropAdapter extends ViewerDropAdapter { private Item fTarget = null; private TreePath fPath = null; private BreakpointsView fView; - + /** * Constructor * @param viewer the backing viewer @@ -87,7 +87,7 @@ public class BreakpointsDropAdapter extends ViewerDropAdapter { } return fTarget; } - + /** * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData) */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java index 63b875639..a1ff4cc13 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java @@ -29,7 +29,7 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv private WorkbenchLabelProvider fWorkbenchLabelProvider; private IDebugModelPresentation fPresentation; - + /** * Constructs a new label provide for the breakpoints view. */ @@ -37,7 +37,7 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv fWorkbenchLabelProvider = new WorkbenchLabelProvider(); fPresentation = DebugUITools.newDebugModelPresentation(); } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ @@ -47,7 +47,7 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv fPresentation.dispose(); super.dispose(); } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) */ @@ -64,12 +64,12 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv return DebugUIPlugin.getImageDescriptorRegistry().get(descriptor); } } - return image; + return image; } - + /** * Computes and return common adornment flags for the given category. - * + * * @return adornment flags defined in CompositeDebugImageDescriptor */ private int computeAdornmentFlags() { @@ -77,8 +77,8 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv return CompositeDebugImageDescriptor.SKIP_BREAKPOINT; } return 0; - } - + } + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ @@ -100,10 +100,10 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv } return fWorkbenchLabelProvider.getFont(element); } - + /** * Returns the debug model presentation used by this label provider. - * + * * @return the debug model presentation used by this label provider */ public IDebugModelPresentation getPresentation() { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java index 368ae3243..557eaeb62 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java @@ -84,25 +84,25 @@ import org.eclipse.ui.operations.UndoActionHandler; /** * This class implements the breakpoints view. */ -public class BreakpointsView extends VariablesView implements IBreakpointManagerListener { +public class BreakpointsView extends VariablesView implements IBreakpointManagerListener { private static final String ACTION_GOTO_MARKER = "GotoMarker"; //$NON-NLS-1$ private static final String ACTION_SKIP_BREAKPOINTS = "SkipBreakpoints"; //$NON-NLS-1$ private static final String ACTION_SHOW_MODEL_BREAKPOINT = "ShowBreakpointsForModel";//$NON-NLS-1$ private static final String ACTION_REMOVE_FROM_GROUP = "RemoveFromGroup"; //$NON-NLS-1$ - - + + private static final String KEY_VALUE = "value"; //$NON-NLS-1$ - private Clipboard fClipboard; + private Clipboard fClipboard; private IBreakpointOrganizer[] fOrganizers; /** - * Flag used to determine whether the viewer input is being set for the + * Flag used to determine whether the viewer input is being set for the * fist time. If this is the case the view contents are expanded. * (bug 297762) */ private boolean fFirstInputSet = false; - + private UndoActionHandler fUndoAction; private RedoActionHandler fRedoAction; @@ -111,7 +111,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager public void dispose() { if (fClipboard != null) { fClipboard.dispose(); - } + } DebugPlugin.getDefault().getBreakpointManager().removeBreakpointManagerListener(this); fUndoAction.dispose(); @@ -119,7 +119,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager super.dispose(); } - + /* * (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey() @@ -128,7 +128,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager protected String getDetailPanePreferenceKey() { return IDebugPreferenceConstants.BREAKPOINTS_DETAIL_PANE_ORIENTATION; } - + /* * (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId() @@ -153,11 +153,11 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager */ @Override public Viewer createViewer(Composite parent) { - TreeModelViewer viewer = (TreeModelViewer) super.createViewer(parent); - + TreeModelViewer viewer = (TreeModelViewer) super.createViewer(parent); + initBreakpointOrganizers(getMemento()); - IPresentationContext presentationContext = viewer.getPresentationContext(); + IPresentationContext presentationContext = viewer.getPresentationContext(); presentationContext.setProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_ORGANIZERS, fOrganizers); presentationContext.setProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_ELEMENT_COMPARATOR, new ElementComparator(presentationContext)); @@ -176,7 +176,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager * Undo double slashes. */ @Override - public String getText(Object element) { + public String getText(Object element) { IDebugModelPresentation lp= getConfiguredPresentation(element); if (lp != null) { return lp.getText(element); @@ -187,7 +187,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } return fModelPresentation; } - + /** * Returns the tree model viewer. * @return the backin gviewer @@ -195,7 +195,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager public TreeModelViewer getTreeModelViewer() { return (TreeModelViewer) getViewer(); } - + /* * (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#configureToolBar(org.eclipse.jface.action.IToolBarManager) @@ -203,7 +203,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager @Override protected void configureToolBar(IToolBarManager tbm) { tbm.add(new Separator(IDebugUIConstants.BREAKPOINT_GROUP)); - tbm.add(getAction(ACTION_SHOW_MODEL_BREAKPOINT)); + tbm.add(getAction(ACTION_SHOW_MODEL_BREAKPOINT)); tbm.add(getAction(ACTION_GOTO_MARKER)); tbm.add(getAction(ACTION_SKIP_BREAKPOINTS)); tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP)); @@ -252,7 +252,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager DebugPlugin.getDefault().getBreakpointManager().addBreakpointManagerListener(this); fClipboard = new Clipboard(getSite().getShell().getDisplay()); - + PasteBreakpointsAction paste = new PasteBreakpointsAction(this); setAction(PASTE_ACTION, paste); paste.setActionDefinitionId(ActionFactory.PASTE.getCommandId()); @@ -260,11 +260,11 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager setGlobalAction(PASTE_ACTION, paste); getViewer().addSelectionChangedListener(paste); paste.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); - + SelectionListenerAction remove = new RemoveFromWorkingSetAction(this); setAction(ACTION_REMOVE_FROM_GROUP, remove); getViewer().addSelectionChangedListener(remove); - + IUndoContext undoContext= DebugUITools.getBreakpointsUndoContext(); fUndoAction= new UndoActionHandler(getSite(), undoContext); fUndoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO); @@ -279,7 +279,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /* * (non-Javadoc) - * + * * @seeorg.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel() */ @Override @@ -289,7 +289,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /* * (non-Javadoc) - * + * * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId() */ @Override @@ -299,13 +299,13 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /* * (non-Javadoc) - * + * * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#contextActivated(org.eclipse.jface.viewers.ISelection) */ @Override protected void contextActivated(ISelection selection) { IPresentationContext presentationContext = getTreeModelViewer().getPresentationContext(); - + if (selection == null || selection.isEmpty()) { Object input = new DefaultBreakpointsViewInput(presentationContext); super.contextActivated(new StructuredSelection(input)); @@ -319,7 +319,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /* * (non-Javadoc) - * + * * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#setViewerInput(java.lang.Object) */ @Override @@ -332,23 +332,23 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager if (current != null && current.equals(context)) { return; } - + showViewer(); getViewer().setInput(context); - + // Expand all elements when the view is first shown. (bug 297762) if (!fFirstInputSet) { fFirstInputSet = true; expandAllElementsInViewer(); } } - + /* * (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#viewerInputUpdateComplete(org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate) */ @Override - protected void viewerInputUpdateComplete(IViewerInputUpdate update) { + protected void viewerInputUpdateComplete(IViewerInputUpdate update) { // handles non-standard debug model IStatus status = update.getStatus(); if ( (status == null || status.isOK()) && update.getElement() != null) { @@ -357,17 +357,17 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager setViewerInput(new DefaultBreakpointsViewInput(getTreeModelViewer().getPresentationContext())); } } - - + + /** * Returns whether this view is currently tracking the selection from the debug view. - * + * * @return whether this view is currently tracking the debug view's selection */ public boolean isTrackingSelection() { final TreeModelViewer viewer = getTreeModelViewer(); if (viewer != null) { - return Boolean.TRUE.equals( + return Boolean.TRUE.equals( viewer.getPresentationContext().getProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_TRACK_SELECTION) ); } return false; @@ -375,7 +375,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /** * Sets whether this view should track the selection from the debug view. - * + * * @param trackSelection whether or not this view should track the debug view's selection. */ public void setTrackSelection(boolean trackSelection) { @@ -383,14 +383,14 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager final TreeModelViewer viewer = getTreeModelViewer(); if (viewer != null) { viewer.getPresentationContext().setProperty( - IBreakpointUIConstants.PROP_BREAKPOINTS_TRACK_SELECTION, + IBreakpointUIConstants.PROP_BREAKPOINTS_TRACK_SELECTION, trackSelection ? Boolean.TRUE : Boolean.FALSE); } } - + /** * Initializes the persisted breakpoints organizers. - * @param memento the memento to read + * @param memento the memento to read */ private void initBreakpointOrganizers(IMemento memento) { if (memento != null) { @@ -410,7 +410,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } } fOrganizers = organziers.toArray(new IBreakpointOrganizer[organziers.size()]); - + for (int i = 0; i < fOrganizers.length; i++) { fOrganizers[i].addPropertyChangeListener(this); } @@ -418,7 +418,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } } } - + /** * Initializes drag and drop for the breakpoints viewer * @param viewer the viewer to add drag and drop support to @@ -431,7 +431,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager // Drag viewer.addDragSupport(ops, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new BreakpointsDragAdapter(viewer, this)); } - + /* * (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#saveViewerState(org.eclipse.ui.IMemento) @@ -452,10 +452,10 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } super.saveViewerState(memento); } - + /** * Preserves the selection. - * + * * @param selection the selection */ public void preserveSelection(IStructuredSelection selection) { @@ -494,23 +494,23 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /** * Sets the breakpoint organizers for this view. - * + * * @param organizers the organizers, can be null. */ public void setBreakpointOrganizers(IBreakpointOrganizer[] organizers) { fOrganizers = organizers; - + TreeModelViewer viewer = getTreeModelViewer(); if (viewer != null) { // update the presentation context organizer - viewer.getPresentationContext().setProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_ORGANIZERS, fOrganizers); + viewer.getPresentationContext().setProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_ORGANIZERS, fOrganizers); } System.out.println(); } /** * Sets the breakpoint filter for this view. - * @param filter the selection to act as a filter + * @param filter the selection to act as a filter */ public void setFilterSelection(boolean filter) { TreeModelViewer viewer = getTreeModelViewer(); @@ -536,16 +536,16 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } }); } - + /** * Expands all elements in the viewer. */ public void expandAllElementsInViewer() { - Display display = getSite().getShell().getDisplay(); - + Display display = getSite().getShell().getDisplay(); + final VirtualTreeModelViewer virtualViewer = new VirtualTreeModelViewer( display, 0, ((ITreeModelViewer)getViewer()).getPresentationContext()); - + virtualViewer.setAutoExpandLevel(-1); virtualViewer.addViewerUpdateListener(new IViewerUpdateListener() { @Override @@ -567,17 +567,17 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager }); virtualViewer.setInput(getViewer().getInput()); } - - + + /** * Returns the breakpoint organizers for this view. - * + * * @return the breakpoint organizers. */ public IBreakpointOrganizer[] getBreakpointOrganizers() { return fOrganizers; } - + /** * Returns whether the given selection can be pasted into the given target. *

@@ -588,11 +588,11 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager *

  • Breakpoints can only be pasted into containers, not other breakpoints
  • * *

    - * + * * @param target target of the paste * @param selection the selection to paste * @return whether the given selection can be pasted into the given target - * + * * TODO Remove in favor of using TreeItems and TreePaths to determine paste targets */ public boolean canPaste(Object target, ISelection selection) { @@ -611,21 +611,21 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } } return true; - } - - /** + } + + /** * Pastes the selection into the given target - * + * * @param target target of the paste, either a IBreakpointContainer, * or a Breakpoint within a IBreakpointContainer * @param selection breakpoints * @return whether successful - * - * TODO remove in favor of using TreeItem as paste target + * + * TODO remove in favor of using TreeItem as paste target */ public boolean performPaste(Object target, ISelection selection) { if (target instanceof IBreakpointContainer && selection instanceof IStructuredSelection) { - IBreakpointContainer container = (IBreakpointContainer) target; + IBreakpointContainer container = (IBreakpointContainer) target; Object[] objects = ((IStructuredSelection)selection).toArray(); for (int i = 0; i < objects.length; i++) { IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(objects[i], IBreakpoint.class); @@ -637,10 +637,10 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } return false; } - + /** * Returns the container from within the specified path that is the container the breakpoint can be removed from - * @param path the path to get the container from + * @param path the path to get the container from * @return the first found container that includes the breakpoint that allows removal, or null if none found * @since 3.3 */ @@ -650,11 +650,11 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager if (breakpoint != null) { IBreakpointContainer container = null; for(int i = path.getSegmentCount()-2; i > -1; i--) { - Object segment = path.getSegment(i); + Object segment = path.getSegment(i); if (segment instanceof IBreakpointContainer) { container = (IBreakpointContainer) segment; - if(container.contains(breakpoint) && - container.getOrganizer() != null && + if(container.contains(breakpoint) && + container.getOrganizer() != null && container.getOrganizer().canRemove(breakpoint, container.getCategory())) { return container; } @@ -667,7 +667,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager /** * Returns the addable breakpoint container of the specified tree path - * @param path the path to get the container for + * @param path the path to get the container for * @return the first found addable container for the specified tree path or null if none found * @since 3.3 */ @@ -681,7 +681,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager if (breakpoint != null) { IBreakpointContainer container = null; for (int i = path.getSegmentCount()-2; i > -1; i--) { - Object segment = path.getSegment(i); + Object segment = path.getSegment(i); if (segment instanceof IBreakpointContainer) { container = (IBreakpointContainer) segment; if (container.contains(breakpoint) && container.getOrganizer().canAdd(breakpoint, container.getCategory())) { @@ -697,7 +697,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager * This method is used to determine if there is an addable parent container available for the specified drop target. *

    * A drop target can be either a IBreakpointContainer or an IBreakpoint. This method always checks the entire hierarchy - * of the tree path for the specified target in the event one of the parent element does not support dropping. + * of the tree path for the specified target in the event one of the parent element does not support dropping. *

    * @param path the path * @param breakpoint the breakpoint @@ -718,7 +718,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } return true; } - + /** * Returns if the selected item in the tree can be dragged *

    @@ -746,10 +746,10 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } return true; } - + /** * Performs the actual removal of breakpoints from their respective (removable) containers on a successful drag operation - * @param paths the tree paths to drag + * @param paths the tree paths to drag * @since 3.3 */ void performDrag(TreePath[] paths) { @@ -785,8 +785,8 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } } } - } - + } + /** * Performs the actual addition of the selected breakpoints to the specified target * @param target the target to add the selection of breakpoints to @@ -802,7 +802,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager if (container == null) { return false; } - + IBreakpointOrganizer organizer = container.getOrganizer(); List breakpoints = new ArrayList(selection.size()); for (Iterator iter = selection.iterator(); iter.hasNext();) { @@ -814,7 +814,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager if (organizer instanceof IBreakpointOrganizerDelegateExtension) { IBreakpointOrganizerDelegateExtension extension = (IBreakpointOrganizerDelegateExtension) organizer; extension.addBreakpoints( - breakpoints.toArray(new IBreakpoint[breakpoints.size()]), + breakpoints.toArray(new IBreakpoint[breakpoints.size()]), container.getCategory()); } else { for (int i = 0; i < breakpoints.size(); i++) { @@ -835,7 +835,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager * *

    * @param target the target for the drop - * @param selection the selection to see if we can drop + * @param selection the selection to see if we can drop * @return true if the specified element can be dropped into the specified target, false otherwise * @since 3.3 */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java index 4ffb30c12..4c3d619bb 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) @@ -39,47 +39,47 @@ import org.eclipse.swt.widgets.Widget; * Breakpoints viewer. */ public class BreakpointsViewer extends CheckboxTreeViewer { - + /** * Constructs a new breakpoints viewer with the given tree. - * + * * @param tree the backing tree widget */ public BreakpointsViewer(Tree tree) { super(tree); } - + /** * Returns the selected items. - * + * * @return selected items */ public Item[] getSelectedItems() { return getSelection(getControl()); } - + /** * Returns the item associated with the given element, or null. - * + * * @param element element in breakpoints view * @return item associated with the given element, or null */ public Widget searchItem(Object element) { return findItem(element); } - + /** * Refreshes the given item in the tree. - * + * * @param item item to refresh */ public void refreshItem(TreeItem item) { updateItem(item, item.getData()); } - + /** * Returns a collection of currently visible breakpoints. - * + * * @return collection of currently visible breakpoints */ public IBreakpoint[] getVisibleBreakpoints() { @@ -98,7 +98,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { /** * Adds expanded breakpoints to the list. Traverses children of the given * tree item if any. - * + * * @param item the item to get breakpoints from * @param list collection of visible breakpoints */ @@ -118,7 +118,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { /** * Sets the selection to a specific tree item - * + * * @param item the item to set as the current tree selection */ protected void setSelection(TreeItem item) { @@ -151,7 +151,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { } return null; } - + /** * Returns the addable breakpoint container of the specified breakpoint * @param item the item to get the container for @@ -175,7 +175,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { } return null; } - + /** * Returns if the selected item in the tree can be dragged *

    @@ -203,7 +203,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { } return true; } - + /** * Performs the actual removal of breakpoints from their respective (removable) containers on a successful drag operation * @param items the items involved in the drag @@ -245,7 +245,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { } } } - + /** * Determines if the specified element can be dropped into the specified target *

    @@ -277,7 +277,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { * This method is used to determine if there is an addable parent container available for the specified drop target. *

    * A drop target can be either a BreakpointContainer or an IBreakpoint. This method always checks the entire hierarchy - * of the tree path for the specified target in the event one of the parent element does not support dropping. + * of the tree path for the specified target in the event one of the parent element does not support dropping. *

    * @param target the target to check * @param breakpoint the breakpoint we would like to drop @@ -334,7 +334,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { expandToLevel(target.getData(), ALL_LEVELS); return true; } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.Viewer#refresh() */ @@ -352,11 +352,11 @@ public class BreakpointsViewer extends CheckboxTreeViewer { for (int i = 0; i < items.length; i++) { updateCheckedState(items[i]); } - } - + } + /** * Update the checked state up the given element and all of its children. - * + * * @param element the element to update */ public void updateCheckedState(Object element) { @@ -368,7 +368,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { } } } - + /** * finds all occurrences of a widget to update * @param element the element to search for when finding occurrences @@ -382,7 +382,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer { } return list.toArray(new Widget[0]); } - + /** * performs the actual search for items in the tree * @param list the list to add matches to @@ -398,10 +398,10 @@ public class BreakpointsViewer extends CheckboxTreeViewer { findAllOccurrences(items[i], element, list); } } - + /** * Update the checked state up the given element and all of its children. - * + * * @param item the item to update */ public void updateCheckedState(TreeItem item) { @@ -445,5 +445,5 @@ public class BreakpointsViewer extends CheckboxTreeViewer { updateCheckedState(items[i]); } } - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java index 8537258b4..4d00ee655 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java @@ -29,40 +29,40 @@ import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext; /** * Breakpoint element comparator. - * + * * @since 3.6 */ public class ElementComparator implements Comparator { final private static String SPACE = " "; //$NON-NLS-1$ - + protected DebugModelPresentationContext fContext; - + public ElementComparator(IPresentationContext context) { if (context instanceof DebugModelPresentationContext) { fContext = (DebugModelPresentationContext) context; } } - - + + /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ @Override public int compare(Object arg0, Object arg1) { - IBreakpoint bp0 = (IBreakpoint)DebugPlugin.getAdapter(arg0, IBreakpoint.class); - IBreakpoint bp1 = (IBreakpoint)DebugPlugin.getAdapter(arg1, IBreakpoint.class); + IBreakpoint bp0 = (IBreakpoint)DebugPlugin.getAdapter(arg0, IBreakpoint.class); + IBreakpoint bp1 = (IBreakpoint)DebugPlugin.getAdapter(arg1, IBreakpoint.class); if (bp0 != null && bp1 != null) { return doCompare(bp0, bp1); } else if (arg0 instanceof IBreakpointContainer && arg1 instanceof IBreakpointContainer) { return doCompare((IBreakpointContainer) arg0, (IBreakpointContainer) arg1); - } else { + } else { return -1; // just return -1 if the two objects are not IBreakpoint type } } - + /** * Compares two breakpoint containers. - * + * * @param c1 * @param c2 * @return @@ -78,21 +78,21 @@ public class ElementComparator implements Comparator { } else if (c2.getCategory() instanceof OtherBreakpointCategory) { return -1; } - + // Rest of categories should be listed alphabetically. if (fContext != null) { String name1 = fContext.getModelPresentation().getText(c1); String name2 = fContext.getModelPresentation().getText(c2); - + return name1.compareTo(name2); } - + return -1; - } - + } + /** * Compares two breakpoints. - * + * * @param b1 * @param b2 * @return @@ -118,12 +118,12 @@ public class ElementComparator implements Comparator { } String text1 = IInternalDebugCoreConstants.EMPTY_STRING; String text2 = IInternalDebugCoreConstants.EMPTY_STRING; - + text1 += b1.getModelIdentifier(); text2 += b2.getModelIdentifier(); - - try { + + try { if (marker1.exists() && marker2.exists()) { text1 += SPACE + marker1.getType(); text2 += SPACE + marker2.getType(); @@ -131,17 +131,17 @@ public class ElementComparator implements Comparator { } catch (CoreException e) { DebugUIPlugin.log(e); } - + int result = text1.compareTo(text2); if (result != 0) { return result; } - - // model and type are the same + + // model and type are the same if (fContext != null) { String name1 = fContext.getModelPresentation().getText(b1); String name2 = fContext.getModelPresentation().getText(b2); - + boolean lineBreakpoint = false; try { lineBreakpoint = marker1.isSubtypeOf(IBreakpoint.LINE_BREAKPOINT_MARKER); @@ -149,17 +149,17 @@ public class ElementComparator implements Comparator { } if (lineBreakpoint) { return compareLineBreakpoints(b1, b2, name1,name2); - } - + } + return name1.compareTo(name2); } - + return result; } - + /** * Compares two line breakpoints. - * + * * @param b1 * @param b2 * @param name1 @@ -176,12 +176,12 @@ public class ElementComparator implements Comparator { int l1 = 0; int l2 = 0; try { - l1 = ((ILineBreakpoint)b1).getLineNumber(); + l1 = ((ILineBreakpoint)b1).getLineNumber(); } catch (CoreException e) { DebugUIPlugin.log(e); } try { - l2 = ((ILineBreakpoint)b2).getLineNumber(); + l2 = ((ILineBreakpoint)b2).getLineNumber(); } catch (CoreException e) { DebugUIPlugin.log(e); } @@ -190,6 +190,6 @@ public class ElementComparator implements Comparator { } } return name1.compareTo(name2); - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java index 656899ba0..df31a71fb 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -19,7 +19,7 @@ import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate; /** * Breakpoint organizers for files. - * + * * @since 3.1 */ public class FileBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java index 5aaef21e4..49b25a2a0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -18,7 +18,7 @@ import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate; /** * Breakpoint organizers for projects. - * + * * @since 3.1 */ public class ProjectBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java index 972e41ed2..05a74768d 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -26,18 +26,18 @@ import org.eclipse.ui.PlatformUI; /** * Breakpoint organizers for resource working sets. - * + * * @since 3.1 */ public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate implements IPropertyChangeListener { - + IWorkingSetManager fWorkingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); - + /** * Constructs a working set breakpoint organizer. Listens for changes in * working sets and fires property change notification. */ - public WorkingSetBreakpointOrganizer() { + public WorkingSetBreakpointOrganizer() { fWorkingSetManager.addPropertyChangeListener(this); } @@ -83,7 +83,7 @@ public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDe fWorkingSetManager = null; super.dispose(); } - + /* (non-Javadoc) * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java index 7dd94a277..ed32a154a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java @@ -25,18 +25,18 @@ import org.eclipse.ui.model.IWorkbenchAdapter2; * Represents a breakpoint category for a specific working set. */ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdapter, IWorkbenchAdapter2 { - + private IWorkingSet fWorkingSet; /** * Constructs a new workings set category for the given working set. - * + * * @param workingSet */ public WorkingSetCategory(IWorkingSet workingSet) { fWorkingSet = workingSet; } - + /* (non-Javadoc) * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object) */ @@ -60,7 +60,7 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap public String getLabel(Object o) { StringBuffer name = new StringBuffer(fWorkingSet.getName()); if (isDefault()) { - name.append(DebugUIViewsMessages.WorkingSetCategory_0); + name.append(DebugUIViewsMessages.WorkingSetCategory_0); } return name.toString(); } @@ -72,10 +72,10 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap public Object getParent(Object o) { return null; } - + /** * Returns the working set for this category. - * + * * @return */ public IWorkingSet getWorkingSet() { @@ -93,7 +93,7 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap } return false; } - + /* (non-Javadoc) * @see java.lang.Object#hashCode() */ @@ -133,16 +133,16 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap } return null; } - + /** * Whether this is the default breakpoint working set. - * + * * @return whether this is the default breakpoint working set */ private boolean isDefault() { return fWorkingSet.equals(BreakpointSetOrganizer.getDefaultWorkingSet()); } - + @Override public String toString() { return fWorkingSet.getName(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java index d00a40569..92d9e863c 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java @@ -39,10 +39,10 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan private List fListeners = new ArrayList(2); /** - * The console this notifier is tracking + * The console this notifier is tracking */ private ProcessConsole fConsole = null; - + /* (non-Javadoc) * @see org.eclipse.ui.console.IPatternMatchListenerDelegate#connect(org.eclipse.ui.console.TextConsole) */ @@ -56,11 +56,11 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan lineTrackers[i].init(fConsole); addConsoleListener(lineTrackers[i]); } - + fConsole.addPropertyChangeListener(this); } } - + /* (non-Javadoc) * @see org.eclipse.ui.console.IPatternMatchListener#disconnect() */ @@ -95,19 +95,19 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan fConsole = null; fListeners = null; } - + /** * Adds the given listener to the list of listeners notified when a line of * text is appended to the console. - * - * @param listener the listener to add + * + * @param listener the listener to add */ public void addConsoleListener(IConsoleLineTracker listener) { if (!fListeners.contains(listener)) { fListeners.add(listener); } } - + /* (non-Javadoc) * @see org.eclipse.ui.console.IPatternMatchListener#matchFound(org.eclipse.ui.console.PatternMatchEvent) */ @@ -118,11 +118,11 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan int lineOfOffset = document.getLineOfOffset(event.getOffset()); String delimiter = document.getLineDelimiter(lineOfOffset); int strip = delimiter==null ? 0 : delimiter.length(); - Region region = new Region(event.getOffset(), event.getLength()-strip); + Region region = new Region(event.getOffset(), event.getLength()-strip); lineAppended(region); } catch (BadLocationException e) {} } - + public void lineAppended(IRegion region) { int size = fListeners.size(); for (int i=0; inull */ protected ImageDescriptor computeImageDescriptor() { @@ -250,7 +250,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe /** * Computes and returns the current name of this console. - * + * * @return a name for this console */ protected String computeName() { @@ -467,7 +467,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe /** * Notify listeners when name changes. - * + * * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[]) */ @Override @@ -487,7 +487,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe } /** - * resets the name of this console to the original computed name + * resets the name of this console to the original computed name */ private void resetName() { final String newName = computeName(); @@ -526,7 +526,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe } streamMonitor = streamsProxy.getOutputStreamMonitor(); if (streamMonitor != null) { - connect(streamMonitor, IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM, + connect(streamMonitor, IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM, store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT)); } InputReadJob readJob = new InputReadJob(streamsProxy); @@ -541,13 +541,13 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe public void connect(IStreamMonitor streamMonitor, String streamIdentifier) { connect(streamMonitor, streamIdentifier, false); } - + /** * Connects the given stream monitor to a new output stream with the given identifier. - * + * * @param streamMonitor stream monitor * @param streamIdentifier stream identifier - * @param activateOnWrite whether the stream should displayed when written to + * @param activateOnWrite whether the stream should displayed when written to */ @SuppressWarnings("resource") private void connect(IStreamMonitor streamMonitor, String streamIdentifier, boolean activateOnWrite) { @@ -616,14 +616,14 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe this.fStreamId = streamIdentifier; this.fStreamMonitor = monitor; this.fStream = stream; - fStreamMonitor.addListener(this); + fStreamMonitor.addListener(this); //fix to bug 121454. Ensure that output to fast processes is processed. streamAppended(null, monitor); } /* * (non-Javadoc) - * + * * @see org.eclipse.debug.core.IStreamListener#streamAppended(java.lang.String, * org.eclipse.debug.core.model.IStreamMonitor) */ @@ -720,7 +720,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe /* * (non-Javadoc) - * + * * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ @Override @@ -750,7 +750,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe /* * (non-Javadoc) - * + * * @see org.eclipse.ui.console.IConsole#getImageDescriptor() */ @Override @@ -767,7 +767,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe public ConsoleLogFilePatternMatcher(String filePath) { fFilePath = escape(filePath); } - + private String escape(String path) { StringBuffer buffer = new StringBuffer(path); int index = buffer.indexOf("\\"); //$NON-NLS-1$ @@ -777,7 +777,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe } return buffer.toString(); } - + @Override public String getPattern() { return fFilePath; @@ -816,7 +816,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe ConsoleLogFileHyperlink(String filePath) { fFilePath = filePath; } - + @Override public void linkActivated() { IEditorInput input; @@ -831,7 +831,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe } else { input = new FileEditorInput(ifile); } - + IWorkbenchPage activePage = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage(); try { activePage.openEditor(input, EditorsUI.DEFAULT_TEXT_EDITOR_ID, true); @@ -845,16 +845,16 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe public void linkExited() { } } - + class StorageEditorInput extends PlatformObject implements IStorageEditorInput { private File fFile; private IStorage fStorage; - + public StorageEditorInput(IStorage storage, File file) { fStorage = storage; fFile = file; } - + @Override public IStorage getStorage() { return fStorage; @@ -879,13 +879,13 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe public String getToolTipText() { return getStorage().getFullPath().toOSString(); } - + @Override public boolean equals(Object object) { return object instanceof StorageEditorInput && getStorage().equals(((StorageEditorInput)object).getStorage()); } - + @Override public int hashCode() { return getStorage().hashCode(); @@ -903,5 +903,5 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe @Override public String getHelpContextId() { return IDebugHelpContextIds.PROCESS_CONSOLE; - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java index c1cc89c2c..b5d735b69 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java @@ -42,23 +42,23 @@ import com.ibm.icu.text.MessageFormat; * The singleton manager is accessible from the debug UI plugin. */ public class ProcessConsoleManager implements ILaunchListener { - + /** * Console document content provider extensions, keyed by extension id */ private Map fColorProviders; - + /** * The default color provider. Used if no color provider is contributed * for the given process type. */ private IConsoleColorProvider fDefaultColorProvider; - + /** - * Console line trackers; keyed by process type to list of trackers (1:N) + * Console line trackers; keyed by process type to list of trackers (1:N) */ private Map> fLineTrackers; - + /** * Map of processes for a launch to compute removed processes */ @@ -75,40 +75,40 @@ public class ProcessConsoleManager implements ILaunchListener { public void launchRemoved(ILaunch launch) { removeLaunch(launch); } - + protected void removeLaunch(ILaunch launch) { - IProcess[] processes= launch.getProcesses(); + IProcess[] processes= launch.getProcesses(); for (int i= 0; i < processes.length; i++) { IProcess iProcess = processes[i]; removeProcess(iProcess); - } + } if (fProcesses != null) { fProcesses.remove(launch); } } - + /** * Removes the console and document associated with the given process. - * + * * @param iProcess process to clean up */ private void removeProcess(IProcess iProcess) { IConsole console = getConsole(iProcess); - + if (console != null) { IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); manager.removeConsoles(new IConsole[]{console}); } } - + /** * Returns the console for the given process, or null if none. - * + * * @param process * @return the console for the given process, or null if none */ public IConsole getConsole(IProcess process) { - IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); + IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); IConsole[] consoles = manager.getConsoles(); for (int i = 0; i < consoles.length; i++) { IConsole console = consoles[i]; @@ -121,7 +121,7 @@ public class ProcessConsoleManager implements ILaunchListener { } return null; } - + /** * @see ILaunchListener#launchAdded(ILaunch) */ @@ -129,7 +129,7 @@ public class ProcessConsoleManager implements ILaunchListener { public void launchAdded(ILaunch launch) { launchChanged(launch); } - + /** * @see ILaunchListener#launchChanged(ILaunch) */ @@ -160,7 +160,7 @@ public class ProcessConsoleManager implements ILaunchListener { } } } - + /** * Returns the document for the process, or null * if none. @@ -168,8 +168,8 @@ public class ProcessConsoleManager implements ILaunchListener { public IDocument getConsoleDocument(IProcess process) { ProcessConsole console = (ProcessConsole) getConsole(process); return (console != null ? console.getDocument() : null); - } - + } + /** * Called by the debug ui plug-in on startup. * The console document manager starts listening for @@ -178,18 +178,18 @@ public class ProcessConsoleManager implements ILaunchListener { */ public void startup() { ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager(); - launchManager.addLaunchListener(this); - + launchManager.addLaunchListener(this); + //set up the docs for launches already registered ILaunch[] launches= launchManager.getLaunches(); for (int i = 0; i < launches.length; i++) { launchAdded(launches[i]); } } - + /** * Called by the debug ui plug-in on shutdown. - * The console document manager de-registers as a + * The console document manager de-registers as a * launch listener and kills all existing console documents. */ public void shutdown() { @@ -204,11 +204,11 @@ public class ProcessConsoleManager implements ILaunchListener { fProcesses.clear(); } } - + /** * Returns a new console document color provider extension for the given * process type, or null if none. - * + * * @param type corresponds to IProcess.ATTR_PROCESS_TYPE * @return IConsoleColorProvider */ @@ -228,7 +228,7 @@ public class ProcessConsoleManager implements ILaunchListener { Object colorProvider = extension.createExecutableExtension("class"); //$NON-NLS-1$ if (colorProvider instanceof IConsoleColorProvider) { return (IConsoleColorProvider)colorProvider; - } + } DebugUIPlugin.logErrorMessage(MessageFormat.format( "Extension {0} must specify an instanceof IConsoleColorProvider for class attribute.", //$NON-NLS-1$ new Object[] { extension.getDeclaringExtension().getUniqueIdentifier() })); @@ -241,8 +241,8 @@ public class ProcessConsoleManager implements ILaunchListener { fDefaultColorProvider = new ConsoleColorProvider(); } return fDefaultColorProvider; - } - + } + /** * Returns the Line Trackers for a given process type. * @param process The process for which line trackers are required. @@ -250,7 +250,7 @@ public class ProcessConsoleManager implements ILaunchListener { */ public IConsoleLineTracker[] getLineTrackers(IProcess process) { String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE); - + if (fLineTrackers == null) { synchronized (fLineTrackersLock) { // can't use fLineTrackers as lock as it is null here fLineTrackers = new HashMap>(); @@ -268,14 +268,14 @@ public class ProcessConsoleManager implements ILaunchListener { } } } - + ArrayList trackers = new ArrayList(); if (type != null) { List lineTrackerExtensions; synchronized (fLineTrackers) {// need to synchronize as the update to list might be still happening lineTrackerExtensions = fLineTrackers.get(type); } - if(lineTrackerExtensions != null) { + if(lineTrackerExtensions != null) { for (IConfigurationElement element : lineTrackerExtensions) { try { trackers.add((IConsoleLineTracker) element.createExecutableExtension("class")); //$NON-NLS-1$ @@ -287,11 +287,11 @@ public class ProcessConsoleManager implements ILaunchListener { } return trackers.toArray(new IConsoleLineTracker[0]); } - + /** * Returns the processes that have been removed from the given * launch, or null if none. - * + * * @param launch launch that has changed * @return removed processes or null */ @@ -317,10 +317,10 @@ public class ProcessConsoleManager implements ILaunchListener { fProcesses.put(launch, curr); return removed; } - + /** * Returns whether the given object is contained in the list. - * + * * @param list list to search * @param object object to search for * @return whether the given object is contained in the list diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java index 4052537dd..9f85f919a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java @@ -53,11 +53,11 @@ import org.eclipse.ui.part.ShowInContext; /** * Creates and manages process console specific actions - * + * * @since 3.1 */ public class ProcessConsolePageParticipant implements IConsolePageParticipant, IShowInSource, IShowInTargetList, IDebugEventSetListener, IDebugContextListener { - + // actions private ConsoleTerminateAction fTerminate; private ConsoleRemoveLaunchAction fRemoveTerminated; @@ -70,14 +70,14 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I private IPageBookViewPage fPage; private IConsoleView fView; - + private EOFHandler fEOFHandler; private String fContextId = "org.eclipse.debug.ui.console"; //$NON-NLS-1$; private IContextActivation fActivatedContext; private IHandlerActivation fActivatedHandler; /** * Handler to send EOF - */ + */ private class EOFHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException { @@ -91,9 +91,9 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I } return null; } - - } - + + } + /* (non-Javadoc) * @see org.eclipse.ui.console.IConsolePageParticipant#init(IPageBookViewPage, IConsole) */ @@ -101,26 +101,26 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I public void init(IPageBookViewPage page, IConsole console) { fPage = page; fConsole = (ProcessConsole) console; - + fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getProcess().getLaunch()); fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction(); fTerminate = new ConsoleTerminateAction(page.getSite().getWorkbenchWindow(), fConsole); fStdOut = new ShowStandardOutAction(); fStdErr = new ShowStandardErrorAction(); - + fView = (IConsoleView) fPage.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW); - + DebugPlugin.getDefault().addDebugEventListener(this); DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).addDebugContextListener(this); - + // contribute to toolbar IActionBars actionBars = fPage.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); - + // create handler and submissions for EOF fEOFHandler = new EOFHandler(); } - + /* (non-Javadoc) * @see org.eclipse.ui.console.IConsolePageParticipant#dispose() */ @@ -193,7 +193,7 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I IProcess process = getProcess(); if (process == null) { return null; - } + } IDebugTarget target = process.getAdapter(IDebugTarget.class); ISelection selection = null; if (target == null) { @@ -234,12 +234,12 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I } } }; - - DebugUIPlugin.getStandardDisplay().asyncExec(r); + + DebugUIPlugin.getStandardDisplay().asyncExec(r); } } } - + protected IProcess getProcess() { return fConsole != null ? fConsole.getProcess() : null; } @@ -284,6 +284,6 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I fView.display(fConsole); } } - + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java index 478cc0eae..79fb709d0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -17,7 +17,7 @@ import org.eclipse.ui.console.TextConsole; /** * Tests if a process type matches the expected value. - * + * * @since 3.1 */ public class ProcessTypePropertyTester extends PropertyTester { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java index a13a0cfe4..a72f597b0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java @@ -20,11 +20,11 @@ import org.eclipse.ui.PlatformUI; /** * Toggles preference show the console when output is written * to standard error stream. - * + * * @since 3.3 */ public class ShowStandardErrorAction extends ShowWhenContentChangesAction { - + /** * Constructs an action to toggle console auto activation preferences */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java index 71fd9fd12..daa7ece0f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java @@ -20,11 +20,11 @@ import org.eclipse.ui.PlatformUI; /** * Toggles preference show the console when output is written * to standard output stream. - * + * * @since 3.3 */ public class ShowStandardOutAction extends ShowWhenContentChangesAction { - + /** * Constructs an action to toggle console auto activation preferences */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java index fca78ddb6..760cd9333 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java @@ -20,17 +20,17 @@ import org.eclipse.jface.util.PropertyChangeEvent; /** * Abstract action for toggling preference to automatically show * the console when a streams content changes. - * + * * @since 3.3 */ public abstract class ShowWhenContentChangesAction extends Action implements IPropertyChangeListener{ - + /** * Constructs an action to toggle console auto activation preferences */ public ShowWhenContentChangesAction(String name) { super(name, IAction.AS_CHECK_BOX); - setToolTipText(name); + setToolTipText(name); getPreferenceStore().addPropertyChangeListener(this); update(); } @@ -45,9 +45,9 @@ public abstract class ShowWhenContentChangesAction extends Action implements IPr update(); } } - + protected abstract String getKey(); - + private void update() { IPreferenceStore store = getPreferenceStore(); if (store.getBoolean(getKey())) { @@ -77,7 +77,7 @@ public abstract class ShowWhenContentChangesAction extends Action implements IPr store.setValue(getKey(), show); store.addPropertyChangeListener(this); } - + /** * Must be called to dispose this action. */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java index 7a6671672..a6ae957a4 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - Pawel Piech - Initial Implementation - Drag/Drop to Expressions View (Bug 184057), Integration with non-standard debug models (Bug 209883) * IBM Corporation - further implementation and documentation @@ -48,7 +48,7 @@ import org.eclipse.ui.IWorkbenchPartSite; * Drop Adapter allowing expressions, variables and text to be dropped in the Expression View. * When IVariables or text is dropped new watch expressions are created at the drop location. * When IExpressions are dropped, they are moved to the drop location - * + * * @see org.eclipse.debug.internal.ui.views.variables.VariablesDragAdapter * @see ExpressionManager * @since 3.4 @@ -59,7 +59,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { private TransferData fCurrentTransferType = null; private boolean fInsertBefore; private int fDropType; - + private static final int DROP_TYPE_DEFAULT = 0; private static final int DROP_TYPE_VARIABLE = 1; private static final int DROP_TYPE_EXPRESSION = 2; @@ -84,7 +84,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { public void dragEnter(DropTargetEvent event) { fDropType = DROP_TYPE_DEFAULT; event.detail = DND.DROP_NONE; - + for (int i = 0; i < event.dataTypes.length; i++) { if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataTypes[i])) { if (isExpressionDrop()){ @@ -113,7 +113,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { super.dragEnter(event); } - + /** * @return whether the selection transfer contains only IExpressions */ @@ -145,7 +145,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { } /** - * @return whether the selection transfer contains only objects adaptable + * @return whether the selection transfer contains only objects adaptable * to IWatchExpressionFactoryAdapter2 */ private boolean isWatchAdaptableElementDrop() { @@ -153,7 +153,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { Iterator iterator = selection.iterator(); while (iterator.hasNext()) { Object element = iterator.next(); - if (!(element instanceof IAdaptable && + if (!(element instanceof IAdaptable && ((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class) != null)) { return false; @@ -198,7 +198,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { * @return whether the drop is valid */ private boolean validateExpressionDrop(Object target){ - return target instanceof IExpression || + return target instanceof IExpression || ((target instanceof IAdaptable) && ((IAdaptable)target).getAdapter(IExpression.class) != null); } @@ -210,9 +210,9 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { } return null; } - + /** - * Validates if the drop is valid by validating the local selection transfer + * Validates if the drop is valid by validating the local selection transfer * to ensure that a watch expression can be created for each contained IVariable. * @param target target of the drop * @return whether the drop is valid @@ -222,7 +222,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { if (target != null && getTargetExpression(target) == null) { return false; } - + IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection(); int enabled = 0; int size = -1; @@ -248,7 +248,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { } /** - * Validates if the drop is valid by validating the local selection transfer + * Validates if the drop is valid by validating the local selection transfer * to ensure that a watch expression can be created for each contained element. * @param target target of the drop * @return whether the drop is valid @@ -258,7 +258,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { if (target != null && getTargetExpression(target) == null) { return false; } - + IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection(); int enabled = 0; int size = -1; @@ -290,7 +290,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { /** * Returns whether the factory adapter for the given variable is currently enabled. - * + * * @param variable the variable to ask for the adapter * @return whether the factory is enabled */ @@ -305,7 +305,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { /** * Returns whether the factory adapter for the given element is currently enabled. - * + * * @param element the element to ask for the adapter * @return whether the factory is enabled */ @@ -363,7 +363,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { for (int i = 0; i < selectionElements.length; i++) { expressions[i] = getTargetExpression(selectionElements[i]); } - + IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager(); if (manager instanceof ExpressionManager){ ((ExpressionManager)manager).moveExpressions(expressions, targetExpression, fInsertBefore); @@ -371,15 +371,15 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { return true; } return false; - + } /** - * If the dragged data is a structured selection, get any IVariables in it + * If the dragged data is a structured selection, get any IVariables in it * and create expressions for each of them. Insert the created expressions * at the currently selected target or add them to the end of the collection * if no target is selected. - * + * * @param selection Structured selection containing IVariables * @return whether the drop was successful */ @@ -420,7 +420,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { * Performs the drop when text was dragged. Creates a new watch expression from * the text. Inserts the expression at the currently selected target or adds it * to the end of the collection if no target is selected. - * + * * @param text string to use to create the expression * @return whether the drop was successful */ @@ -441,13 +441,13 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { DebugUIPlugin.log(new Status(IStatus.ERROR,DebugUIPlugin.getUniqueIdentifier(),"Drop failed. Watch expression could not be created for the text " + text)); //$NON-NLS-1$ return false; } - + /** * Creates a new watch expression from an IVariable using the watch expression factory * adapter for that variable. - * + * * @param variable the variable to use to create the watch expression - * @return the string to be used to create expression, return null + * @return the string to be used to create expression, return null * if no expression is to be created */ private String createExpressionString(Object element) { @@ -457,7 +457,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { IWatchExpressionFactoryAdapter factory = getFactory(variable); String exp = variable.getName(); if (factory != null) { - //if a factory exists, use it to create expression, + //if a factory exists, use it to create expression, //otherwise just use variable name exp = factory.createWatchExpression(variable); } @@ -466,7 +466,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { IWatchExpressionFactoryAdapter2 factory2 = getFactory2(element); if (factory2 != null) { return factory2.createWatchExpression(element); - } + } } } catch (CoreException e) { DebugUIPlugin.log(e.getStatus()); @@ -476,7 +476,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { /** * Creates a new watch expression from a string using the default expression manager. - * + * * @param exp the string to use to create the expression */ private IExpression createExpression(String exp) { @@ -491,21 +491,21 @@ public class ExpressionDropAdapter extends ViewerDropAdapter { expression.setExpressionContext(context); return expression; } - - + + /** * Returns the factory adapter for the given variable or null if none. - * + * * @param variable * @return factory or null */ private IWatchExpressionFactoryAdapter getFactory(IVariable variable) { - return variable.getAdapter(IWatchExpressionFactoryAdapter.class); + return variable.getAdapter(IWatchExpressionFactoryAdapter.class); } /** * Returns the factory adapter for the given element or null if none. - * + * * @param element * @return factory or null */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java index d7e811e5d..2a0fd26ae 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.debug.internal.ui.views.expression; - + import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IStatus; import org.eclipse.debug.core.DebugPlugin; @@ -51,34 +51,34 @@ import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchCommandConstants; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.ActionFactory; - + /** * Displays expressions and their values with a detail * pane. */ public class ExpressionView extends VariablesView { - + private PasteWatchExpressionsAction fPasteAction; private EditWatchExpressinInPlaceAction fEditInPlaceAction; - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId() */ @Override protected String getHelpContextId() { - return IDebugHelpContextIds.EXPRESSION_VIEW; - } - + return IDebugHelpContextIds.EXPRESSION_VIEW; + } + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#configureToolBar(org.eclipse.jface.action.IToolBarManager) */ @Override protected void configureToolBar(IToolBarManager tbm) { super.configureToolBar(tbm); - tbm.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP)); + tbm.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP)); tbm.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP)); - } - + } + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#fillContextMenu(org.eclipse.jface.action.IMenuManager) */ @@ -89,7 +89,7 @@ public class ExpressionView extends VariablesView { menu.add(getAction(FIND_ACTION)); ChangeVariableValueAction changeValueAction = (ChangeVariableValueAction)getAction("ChangeVariableValue"); //$NON-NLS-1$ if (changeValueAction.isApplicable()) { - menu.add(changeValueAction); + menu.add(changeValueAction); } menu.add(new Separator()); IAction action = new AvailableLogicalStructuresAction(this); @@ -135,7 +135,7 @@ public class ExpressionView extends VariablesView { } updateAction(FIND_ACTION); } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey() */ @@ -149,7 +149,7 @@ public class ExpressionView extends VariablesView { */ @Override protected String getToggleActionLabel() { - return VariablesViewMessages.ExpressionView_4; + return VariablesViewMessages.ExpressionView_4; } /* (non-Javadoc) @@ -158,8 +158,8 @@ public class ExpressionView extends VariablesView { @Override protected String getPresentationContextId() { return IDebugUIConstants.ID_EXPRESSION_VIEW; - } - + } + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#initDragAndDrop(org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer) */ @@ -168,7 +168,7 @@ public class ExpressionView extends VariablesView { viewer.addDragSupport(DND.DROP_MOVE, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new SelectionDragAdapter(viewer)); viewer.addDropSupport(DND.DROP_MOVE|DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance()}, new ExpressionDropAdapter(getSite(), viewer)); } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createActions() */ @@ -180,17 +180,17 @@ public class ExpressionView extends VariablesView { fEditInPlaceAction = new EditWatchExpressinInPlaceAction(this); configure(fEditInPlaceAction, IWorkbenchCommandConstants.FILE_RENAME, ActionFactory.RENAME.getId(), null); } - + @Override public void dispose() { fEditInPlaceAction.dispose(); super.dispose(); } - + /** * Configures the action to override the global action, and registers the * action with this view. - * + * * @param action * action * @param defId @@ -209,11 +209,11 @@ public class ExpressionView extends VariablesView { action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imgId)); } } - + /** * Returns whether the given selection can be pasted into the expressions * view. - * + * * @return whether the given selection can be pasted into the given target */ public boolean canPaste() { @@ -223,10 +223,10 @@ public class ExpressionView extends VariablesView { } return false; } - + /** * Pastes the selection into the given target - * + * * @return whether successful */ public boolean performPaste() { @@ -241,7 +241,7 @@ public class ExpressionView extends VariablesView { } return false; } - + // TODO: duplicate code from WatchExpressionAction protected IDebugElement getContext() { IAdaptable object = DebugUITools.getPartDebugContext(getSite()); @@ -253,7 +253,7 @@ public class ExpressionView extends VariablesView { } return context; } - + protected String getClipboardText() { Clipboard clipboard = new Clipboard(Display.getDefault()); try { @@ -264,5 +264,5 @@ public class ExpressionView extends VariablesView { } } - + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java index 39825b009..c5ec83c5f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -16,9 +16,9 @@ import org.eclipse.jface.action.Action; import org.eclipse.ui.PlatformUI; /** - * Action that controls the preference for whether elements should be + * Action that controls the preference for whether elements should be * automatically expanded in the breadcrumb drop down viewers. - * + * * @since 3.5 */ class BreadcrumbDropDownAutoExpandAction extends Action { @@ -27,19 +27,19 @@ class BreadcrumbDropDownAutoExpandAction extends Action { /** * Creates a new action to set the debug view mode. - * + * * @param view Reference to the debug view. * in auto mode. */ public BreadcrumbDropDownAutoExpandAction(LaunchView view) { super(IInternalDebugCoreConstants.EMPTY_STRING, AS_CHECK_BOX); fLaunchView = view; - + setText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_label); - setToolTipText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_tooltip); - setDescription(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_description); + setToolTipText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_tooltip); + setDescription(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION); - + setChecked(fLaunchView.getBreadcrumbDropDownAutoExpand()); } @@ -48,7 +48,7 @@ class BreadcrumbDropDownAutoExpandAction extends Action { */ @Override public void run() { - fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked()); - } + fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked()); + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java index 997f2a89f..9ae17da01 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Pawel Piech - Wind River - adapted to use in Debug view @@ -20,13 +20,13 @@ import org.eclipse.ui.IWorkbenchPartSite; /** * Fake part to used to create the breadcrumb page. - * + * * @since 3.5 */ class BreadcrumbWorkbenchPart implements IWorkbenchPart { private IWorkbenchPartSite fSite = null; - + /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java index 928c937be..c9c19a6fc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java @@ -91,28 +91,28 @@ import org.eclipse.debug.ui.sourcelookup.ISourceDisplay; * DebugElementAdapterFactory */ public class DebugElementAdapterFactory implements IAdapterFactory { - + private static IModelProxyFactory fgModelProxyFactoryAdapter = new DefaultModelProxyFactory(); private static ISourceDisplay fgStackFrameSourceDisplayAdapter = new StackFrameSourceDisplayAdapter(); private static IModelSelectionPolicyFactory fgModelSelectionPolicyFactoryAdapter = new DefaultModelSelectionPolicyFactory(); - + private static IAsynchronousLabelAdapter fgDebugLabelAdapter = new AsynchronousDebugLabelAdapter(); private static IAsynchronousLabelAdapter fgMemoryBlockLabelAdapter = new MemoryBlockLabelAdapter(); private static IAsynchronousLabelAdapter fgTableRenderingLineLabelAdapter = new MemorySegmentLabelAdapter(); - + private static IElementLabelProvider fgLPDebugElement = new DebugElementLabelProvider(); private static IElementLabelProvider fgLPVariable = new VariableLabelProvider(); private static IElementLabelProvider fgLPExpression = new ExpressionLabelProvider(); private static IElementLabelProvider fgLPRegisterGroup = new RegisterGroupLabelProvider(); - private static IElementLabelProvider fgLPMemoryBlock = new MemoryBlockLabelProvider(); + private static IElementLabelProvider fgLPMemoryBlock = new MemoryBlockLabelProvider(); private static IElementLabelProvider fgLPBreakpoint = new BreakpointLabelProvider(); - private static IElementLabelProvider fgLPBreakpointContainer = new BreakpointContainerLabelProvider(); + private static IElementLabelProvider fgLPBreakpointContainer = new BreakpointContainerLabelProvider(); private static IElementEditor fgEEVariable = new VariableEditor(); private static IElementEditor fgEEWatchExpression = new WatchExpressionEditor(); - + private static IAsynchronousContentAdapter fgAsyncMemoryRetrieval = new MemoryRetrievalContentAdapter(); private static IAsynchronousContentAdapter fgAsyncMemoryBlock = new MemoryBlockContentAdapter(); - + private static IElementContentProvider fgCPLaunchManger = new LaunchManagerContentProvider(); private static IElementContentProvider fgCPLaunch = new LaunchContentProvider(); private static IElementContentProvider fgCPProcess = new ProcessContentProvider(); @@ -120,14 +120,14 @@ public class DebugElementAdapterFactory implements IAdapterFactory { private static IElementContentProvider fgCPThread = new ThreadContentProvider(); private static IElementContentProvider fgCPFrame = new StackFrameContentProvider(); private static IElementContentProvider fgCPVariable = new VariableContentProvider(); - private static IElementContentProvider fgCPExpressionManager = new ExpressionManagerContentProvider(); + private static IElementContentProvider fgCPExpressionManager = new ExpressionManagerContentProvider(); private static IElementContentProvider fgCPExpression = new ExpressionContentProvider(); private static IElementContentProvider fgCPRegisterGroup = new RegisterGroupContentProvider(); private static IElementContentProvider fgCPMemoryRetrieval = new MemoryRetrievalContentProvider(); - private static IElementContentProvider fgCPMemoryBlock = new MemoryBlockContentProvider(); + private static IElementContentProvider fgCPMemoryBlock = new MemoryBlockContentProvider(); private static IElementContentProvider fgCPBreakpointManager = new BreakpointManagerContentProvider(); private static IElementContentProvider fgCPBreakpoint = new BreakpointContentProvider(); - + private static IElementMementoProvider fgMPFrame = new StackFrameMementoProvider(); private static IElementMementoProvider fgMPVariable = new VariableMementoProvider(); private static IElementMementoProvider fgMPExpression = new ExpressionMementoProvider(); @@ -137,12 +137,12 @@ public class DebugElementAdapterFactory implements IAdapterFactory { private static IElementMementoProvider fgMPBreakpointManagerInput = new BreakpointManagerInputMementoProvider(); private static IElementMementoProvider fgMPBreakpointContainer = new BreakpointContainerMementoProvider(); private static IElementMementoProvider fgMPBreakpoint = new BreakpointMementoProvider(); - + private static IColumnPresentationFactory fgVariableColumnFactory = new VariableColumnFactoryAdapter(); - + private static IViewerInputProvider fgDefaultViewerInputProvider = new DefaultViewerInputProvider(); private static IViewerInputProvider fgStackFrameViewerInputProvider = new StackFrameViewerInputProvider(); - + /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) */ @@ -152,7 +152,7 @@ public class DebugElementAdapterFactory implements IAdapterFactory { if (adapterType.isInstance(adaptableObject)) { return (T) adaptableObject; } - + if (adapterType.equals(IAsynchronousContentAdapter.class)) { if (adaptableObject instanceof IMemoryBlockRetrieval) { return (T) fgAsyncMemoryRetrieval; @@ -161,7 +161,7 @@ public class DebugElementAdapterFactory implements IAdapterFactory { return (T) fgAsyncMemoryBlock; } } - + if (adapterType.equals(IElementContentProvider.class)) { if (adaptableObject instanceof ILaunchManager) { return (T) fgCPLaunchManger; @@ -190,7 +190,7 @@ public class DebugElementAdapterFactory implements IAdapterFactory { } if (adaptableObject instanceof IExpressionManager) { return (T) fgCPExpressionManager; - } + } if (adaptableObject instanceof IExpression) { return (T) fgCPExpression; } @@ -199,26 +199,26 @@ public class DebugElementAdapterFactory implements IAdapterFactory { } if (adaptableObject instanceof IMemoryBlock) { return (T) fgCPMemoryBlock; - } + } if (adaptableObject instanceof DefaultBreakpointsViewInput) { return (T) fgCPBreakpointManager; } if (adaptableObject instanceof IBreakpoint) { return (T) fgCPBreakpoint; } - } - + } + if (adapterType.equals(IAsynchronousLabelAdapter.class)) { if (adaptableObject instanceof IMemoryBlock) { return (T) fgMemoryBlockLabelAdapter; } - + if (adaptableObject instanceof MemorySegment) { return (T) fgTableRenderingLineLabelAdapter; } return (T) fgDebugLabelAdapter; } - + if (adapterType.equals(IElementLabelProvider.class)) { if (adaptableObject instanceof IVariable) { return (T) fgLPVariable; @@ -231,16 +231,16 @@ public class DebugElementAdapterFactory implements IAdapterFactory { } if (adaptableObject instanceof IMemoryBlock) { return (T) fgLPMemoryBlock; - } + } if (adaptableObject instanceof IBreakpoint) { return (T) fgLPBreakpoint; } if (adaptableObject instanceof IBreakpointContainer) { return (T) fgLPBreakpointContainer; - } + } return (T) fgLPDebugElement; - } - + } + if (adapterType.equals(IModelProxyFactory.class)) { if (adaptableObject instanceof ILaunch || adaptableObject instanceof IDebugTarget || adaptableObject instanceof IProcess || adaptableObject instanceof ILaunchManager || @@ -253,25 +253,25 @@ public class DebugElementAdapterFactory implements IAdapterFactory { return (T) fgModelProxyFactoryAdapter; } } - + if (adapterType.equals(ISourceDisplay.class)) { if (adaptableObject instanceof IStackFrame) { return (T) fgStackFrameSourceDisplayAdapter; } } - + if (adapterType.equals(IModelSelectionPolicyFactory.class)) { if (adaptableObject instanceof IDebugElement) { return (T) fgModelSelectionPolicyFactoryAdapter; } } - + if (adapterType.equals(IColumnPresentationFactory.class)) { if (adaptableObject instanceof IStackFrame || adaptableObject instanceof IExpressionManager) { return (T) fgVariableColumnFactory; } - } - + } + if (adapterType.equals(IElementMementoProvider.class)) { if (adaptableObject instanceof IStackFrame) { return (T) fgMPFrame; @@ -301,7 +301,7 @@ public class DebugElementAdapterFactory implements IAdapterFactory { return (T) fgMPBreakpointManagerInput; } } - + if (adapterType.equals(IElementEditor.class)) { if (adaptableObject instanceof IVariable) { return (T) fgEEVariable; @@ -310,15 +310,15 @@ public class DebugElementAdapterFactory implements IAdapterFactory { return (T) fgEEWatchExpression; } } - + if (adapterType.equals(IViewerInputProvider.class)) { if (adaptableObject instanceof IStackFrame) { return (T) fgStackFrameViewerInputProvider; } else { return (T) fgDefaultViewerInputProvider; } - } - + } + return null; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java index 04acbd126..cb012b88a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java @@ -27,7 +27,7 @@ import org.eclipse.swt.graphics.RGB; /** * Translates images, colors, and fonts into image descriptors, RGBs, and font * data for workbench adapters. Also provides labels. - * + * * @since 3.1 */ public class DebugElementHelper { @@ -51,7 +51,7 @@ public class DebugElementHelper { /** * Returns an image descriptor for the given debug element. - * + * * @param object object for which an image descriptor is required */ public static ImageDescriptor getImageDescriptor(Object object) { @@ -61,7 +61,7 @@ public class DebugElementHelper { /** * Returns an image descriptor for the given debug element. - * + * * @param presentation presentation to obtain image from * @param object object for which an image descriptor is required * @since 3.3 @@ -85,7 +85,7 @@ public class DebugElementHelper { /** * Returns a label for the given debug element. - * + * * @param o object for which a label is required */ public static String getLabel(Object o) { @@ -94,7 +94,7 @@ public class DebugElementHelper { /** * Returns a model presentation to use to retrieve lables & images. - * + * * @return a model presentation to use to retrieve lables & images */ public static DelegatingModelPresentation getPresentation() { @@ -107,7 +107,7 @@ public class DebugElementHelper { /** * Returns the RGB of the foreground color for the given element, or * null if none. - * + * * @param element object for which a foreground color is required * @return the RGB of the foreground color for the given element, or * null if none @@ -123,7 +123,7 @@ public class DebugElementHelper { /** * Returns the RGB of the foreground color for the given element, or * null if none. - * + * * @param element object for which a foreground color is required * @param presentation presentation to obtain color from * @return the RGB of the foreground color for the given element, or @@ -147,7 +147,7 @@ public class DebugElementHelper { /** * Returns the RGB of the background color for the given element, or * null if none. - * + * * @param element object for which a background color is required * @return the RGB of the background color for the given element, or * null if none @@ -163,7 +163,7 @@ public class DebugElementHelper { /** * Returns the RGB of the background color for the given element, or * null if none. - * + * * @param element object for which a background color is required * @param presentation presentation to use to retrieve color * @return the RGB of the background color for the given element, or @@ -187,7 +187,7 @@ public class DebugElementHelper { /** * Returns the font data for the given element, or null if * none. - * + * * @param element object for which font data is required * @return the font data for the given element, or null if none */ @@ -202,7 +202,7 @@ public class DebugElementHelper { /** * Returns the font data for the given element, or null if * none. - * + * * @param element object for which font data is required * @param presentation presentation to obtain font from * @return the font data for the given element, or null if none @@ -225,7 +225,7 @@ public class DebugElementHelper { /** * Returns whether the UI thread is required for computing the label for the * given object. - * + * * @param object object a label is being computed for * @return whether the UI thread is required */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java index 38f9c6900..becca2d09 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -17,38 +17,38 @@ import org.eclipse.ui.PlatformUI; /** * Action that controls whether Debug actions are shown in Launch view. - * + * * @since 3.8 */ class DebugToolBarAction extends Action { private final LaunchView fLaunchView; - + /** * Creates a new action to set the debug view mode. - * + * * @param view Reference to the debug view. */ public DebugToolBarAction(LaunchView view) { super(IInternalDebugCoreConstants.EMPTY_STRING, AS_CHECK_BOX); fLaunchView = view; - + setText(LaunchViewMessages.DebugToolBarAction_View_label); - setToolTipText(LaunchViewMessages.DebugToolBarAction_View_tooltip); - setDescription(LaunchViewMessages.DebugToolBarAction_View_description); + setToolTipText(LaunchViewMessages.DebugToolBarAction_View_tooltip); + setDescription(LaunchViewMessages.DebugToolBarAction_View_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_TOOLBAR_VIEW_ACTION); } public void setShowingDebugToolbar(boolean showingToolbar) { setChecked(showingToolbar); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IAction#run() */ @Override public void run() { - fLaunchView.setDebugToolbarInView(isChecked()); - } + fLaunchView.setDebugToolbarInView(isChecked()); + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java index 712f05126..3da6ebbbe 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -21,9 +21,9 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.PlatformUI; /** - * Action that controls the view mode for Debug view (auto vs. breadcrumb, vs. - * tree view). - * + * Action that controls the view mode for Debug view (auto vs. breadcrumb, vs. + * tree view). + * * @since 3.5 */ class DebugViewModeAction extends Action { @@ -34,7 +34,7 @@ class DebugViewModeAction extends Action { /** * Creates a new action to set the debug view mode. - * + * * @param view Reference to the debug view. * @param mode The mode to be set by this action. * @param parent The view's parent control used to calculate view size @@ -45,29 +45,29 @@ class DebugViewModeAction extends Action { fLaunchView = view; fParent = parent; fMode = mode; - + if (mode == IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO) { setText(LaunchViewMessages.DebugViewModeAction_Auto_label); - setToolTipText(LaunchViewMessages.DebugViewModeAction_Auto_tooltip); + setToolTipText(LaunchViewMessages.DebugViewModeAction_Auto_tooltip); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_AUTO)); setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_AUTO)); - setDescription(LaunchViewMessages.DebugViewModeAction_Auto_description); + setDescription(LaunchViewMessages.DebugViewModeAction_Auto_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_AUTO_ACTION); } else if (mode == IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL) { - setText(LaunchViewMessages.DebugViewModeAction_Full_label); - setToolTipText(LaunchViewMessages.DebugViewModeAction_Full_tooltip); + setText(LaunchViewMessages.DebugViewModeAction_Full_label); + setToolTipText(LaunchViewMessages.DebugViewModeAction_Full_tooltip); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_HIDE)); setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_HIDE)); - setDescription(LaunchViewMessages.DebugViewModeAction_Full_description); + setDescription(LaunchViewMessages.DebugViewModeAction_Full_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_FULL_ACTION); } else { setText(LaunchViewMessages.DebugViewModeAction_Compact_label); - setToolTipText(LaunchViewMessages.DebugViewModeAction_Compact_tooltip); - setDescription(LaunchViewMessages.DebugViewModeAction_Compact_description); + setToolTipText(LaunchViewMessages.DebugViewModeAction_Compact_tooltip); + setDescription(LaunchViewMessages.DebugViewModeAction_Compact_description); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DEBUG_VIEW_COMPACT_LAYOUT)); setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DEBUG_VIEW_COMPACT_LAYOUT)); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_COMPACT_ACTION); - } + } } /* (non-Javadoc) @@ -75,9 +75,9 @@ class DebugViewModeAction extends Action { */ @Override public void run() { - fLaunchView.setViewMode(fMode, fParent); - } - + fLaunchView.setViewMode(fMode, fParent); + } + /** * Returns the view mode set by this action. * @return the mode of the action diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java index 6f5cc4c71..2c0c2994c 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java @@ -16,15 +16,15 @@ import org.eclipse.debug.core.model.IThread; * A decoration in an editor, created by the debugger. */ public abstract class Decoration { - + /** * Removes this decoration */ public abstract void remove(); - + /** * Returns the thread this decoration decorates. - * + * * @return thread associated with this decoration */ public abstract IThread getThread(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java index d44ec65a5..e3fac7213 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java @@ -30,7 +30,7 @@ public class DecorationManager { /** * Adds the given decoration for the given stack frame. - * + * * @param decoration * @param frame */ @@ -48,7 +48,7 @@ public class DecorationManager { /** * Removes any decorations for the given debug target. - * + * * @param target to remove editor decorations for */ public static void removeDecorations(IDebugTarget target) { @@ -57,7 +57,7 @@ public class DecorationManager { /** * Removes any decorations for the given thread - * + * * @param thread thread to remove decorations for */ public static void removeDecorations(IThread thread) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java index 0caeab28c..e7f41e33e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java index 1973cff96..f3b492b2f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java @@ -136,11 +136,11 @@ import org.eclipse.ui.progress.IWorkbenchSiteProgressService; import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.texteditor.IUpdate; -public class LaunchView extends AbstractDebugView - implements ISelectionChangedListener, IPerspectiveListener2, IPageListener, IShowInTarget, IShowInSource, +public class LaunchView extends AbstractDebugView + implements ISelectionChangedListener, IPerspectiveListener2, IPageListener, IShowInTarget, IShowInSource, IShowInTargetList, IPartListener2, IViewerUpdateListener, IContextManagerListener, IModelChangedListener { - + public static final String ID_CONTEXT_ACTIVITY_BINDINGS = "contextActivityBindings"; //$NON-NLS-1$ private static final String TERMINATE = "terminate"; //$NON-NLS-1$ @@ -160,48 +160,48 @@ public class LaunchView extends AbstractDebugView private static final String STEP_INTO = "step_into"; //$NON-NLS-1$ public static final String TERMINATE_AND_REMOVE = "terminate_and_remove"; //$NON-NLS-1$ - + private static final String TERMINATE_ALL = "terminate_all"; //$NON-NLS-1$ public static final String TERMINATE_AND_RELAUNCH = "terminate_relaunch"; //$NON-NLS-1$ - + private static final String TOGGLE_STEP_FILTERS = "toggle_step_filters"; //$NON-NLS-1$ private static final String RESTART = "restart"; //$NON-NLS-1$ private static final int BREADCRUMB_TRIGGER_HEIGHT_DEFAULT = 30; // pixels - + private static final int BREADCRUMB_TRIGGER_RANGE = 5; // pixels - + private static final int BREADCRUMB_STICKY_RANGE = 20; // pixels - + /** * Whether this view is in the active page of a perspective. */ - private boolean fIsActive = true; - + private boolean fIsActive = true; + /** * Model presentation or null if none */ private IDebugModelPresentation fPresentation = null; - + private IPresentationContext fPresentationContext; - + private EditLaunchConfigurationAction fEditConfigAction = null; private AddToFavoritesAction fAddToFavoritesAction = null; private EditSourceLookupPathAction fEditSourceAction = null; private LookupSourceAction fLookupAction = null; /** - * Current view mode (auto vs. breadcrumb, vs. tree view). - * + * Current view mode (auto vs. breadcrumb, vs. tree view). + * * @since 3.5 */ private String fCurrentViewMode = IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO; - + /** * Actions for selecting the view mode (auto vs. breadcrumb, vs. tree view). - * + * * @since 3.5 */ private DebugViewModeAction[] fDebugViewModeActions; @@ -210,25 +210,25 @@ public class LaunchView extends AbstractDebugView * Action which shows or hides the Debug view toolbar. */ private DebugToolBarAction fDebugToolBarAction; - + /** * Action that controls the breadcrumb drop-down auto-expand behavior. - * + * * @since 3.5 */ private BreadcrumbDropDownAutoExpandAction fBreadcrumbDropDownAutoExpandAction; - + /** * Context service for this view. Used to track whether debug toolbar * action set is active. - * + * * @since 3.8 */ private IContextService fContextService; - + /** * Preference name for the view's memento. - * + * * @since 3.5 */ private String PREF_STATE_MEMENTO = "pref_state_memento."; //$NON-NLS-1$ @@ -236,7 +236,7 @@ public class LaunchView extends AbstractDebugView /** * Key for a view preference for whether the elements in breadcrumb's * drop-down viewer should be automatically expanded. - * + * * @since 3.5 */ private static final String BREADCRUMB_DROPDOWN_AUTO_EXPAND = DebugUIPlugin.getUniqueIdentifier() + ".BREADCRUMB_DROPDOWN_AUTO_EXPAND"; //$NON-NLS-1$ @@ -244,26 +244,26 @@ public class LaunchView extends AbstractDebugView /** * Preference for whether the elements in breadcrumb's * drop-down viewer should be automatically expanded. - * + * * @since 3.5 */ private boolean fBreadcrumbDropDownAutoExpand = false; - + /** * Action handlers. Maps action identifiers to IHandler's. - * + * * @since 3.6 */ private Map fHandlers = new HashMap(); - + private boolean fDebugToolbarInView = true; - + private Set fDebugToolbarPerspectives = new TreeSet(); - + /** - * Page-book page for the breadcrumb viewer. This page is activated in - * Debug view when the height of the view is reduced to just one line. - * + * Page-book page for the breadcrumb viewer. This page is activated in + * Debug view when the height of the view is reduced to just one line. + * * @since 3.5 */ private class BreadcrumbPage extends Page { @@ -282,7 +282,7 @@ public class LaunchView extends AbstractDebugView super.init(pageSite); pageSite.setSelectionProvider(fCrumb.getSelectionProvider()); } - + @Override public Control getControl() { return fControl; @@ -292,7 +292,7 @@ public class LaunchView extends AbstractDebugView public void setFocus() { fCrumb.activate(); } - + IDebugContextProvider getContextProvider() { return fCrumb.getContextProvider(); } @@ -300,7 +300,7 @@ public class LaunchView extends AbstractDebugView int getHeight() { return fCrumb.getHeight(); } - + @Override public void dispose() { fCrumb.dispose(); @@ -308,13 +308,13 @@ public class LaunchView extends AbstractDebugView } private BreadcrumbPage fBreadcrumbPage; - + class TreeViewerContextProvider extends AbstractDebugContextProvider implements IModelChangedListener { - + private ISelection fContext = null; private TreeModelViewer fViewer = null; private Visitor fVisitor = new Visitor(); - + class Visitor implements IModelDeltaVisitor { @Override public boolean visit(IModelDelta delta, int depth) { @@ -332,12 +332,12 @@ public class LaunchView extends AbstractDebugView } } return true; - } + } } - + /** * Returns a tree path for the node, *not* including the root element. - * + * * @param node * model delta * @return corresponding tree path @@ -352,51 +352,51 @@ public class LaunchView extends AbstractDebugView } return new TreePath(list.toArray()); } - + public TreeViewerContextProvider(TreeModelViewer viewer) { super(LaunchView.this); fViewer = viewer; fViewer.addModelChangedListener(this); } - - protected void dispose() { + + protected void dispose() { fContext = null; fViewer.removeModelChangedListener(this); } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.contexts.IDebugContextProvider#getActiveContext() */ @Override public synchronized ISelection getActiveContext() { return fContext; - } - + } + protected void activate(ISelection selection) { synchronized (this) { fContext = selection; } fire(new DebugContextEvent(this, selection, DebugContextEvent.ACTIVATED)); } - + protected void possibleChange(TreePath element, int type) { DebugContextEvent event = null; synchronized (this) { if (fContext instanceof ITreeSelection) { ITreeSelection ss = (ITreeSelection) fContext; - TreePath[] ssPaths = ss.getPaths(); + TreePath[] ssPaths = ss.getPaths(); for (int i = 0; i < ssPaths.length; i++) { if (ssPaths[i].startsWith(element, null)) { if (ssPaths[i].getSegmentCount() == element.getSegmentCount()) { event = new DebugContextEvent(this, fContext, type); } else { - // if parent of the currently selected element + // if parent of the currently selected element // changes, issue event to update STATE only event = new DebugContextEvent(this, fContext, DebugContextEvent.STATE); } } } - } + } } if (event == null) { return; @@ -434,35 +434,35 @@ public class LaunchView extends AbstractDebugView public void modelChanged(IModelDelta delta, IModelProxy proxy) { delta.accept(fVisitor); } - + } - + /** * Context provider */ private TreeViewerContextProvider fTreeViewerDebugContextProvider; /** - * The PageBookView, which is a base class of this class does not make it - * easy to control which page is currently active. It is intended that the - * page book pages are associated with workbench parts, and the parts are - * in turn associated with PageRec records. + * The PageBookView, which is a base class of this class does not make it + * easy to control which page is currently active. It is intended that the + * page book pages are associated with workbench parts, and the parts are + * in turn associated with PageRec records. *

    - * PageRec is needed in order to properly active a page book page, by + * PageRec is needed in order to properly active a page book page, by * calling showPageRec(), so in this class we need to add some hooks in - * order to obtain the page record for the tree viewer page and the - * breadcrumb page.

    - * For the default page, we override the showPageRec() + * order to obtain the page record for the tree viewer page and the + * breadcrumb page.

    + * For the default page, we override the showPageRec() * to determine if the default page is being shown and if it is, we save * its record for later use. showPageRec() is always called for the default * page after it is created. For the breadcrumb page, we use the page book - * view mechanism to create the page based on a workbench part, but we have + * view mechanism to create the page based on a workbench part, but we have * to create a dummy part in order for this to work. - *

    + *

    *

    * See bug 262845 and 262870. *

    - * + * * @see #createPartControl(Composite) * @see BreadcrumbWorkbenchPart * @eee #doCreatePage(IWorkbenchPart) @@ -483,7 +483,7 @@ public class LaunchView extends AbstractDebugView private class ContextProviderProxy extends AbstractDebugContextProvider implements IDebugContextListener { private IDebugContextProvider fActiveProvider; private IDebugContextProvider[] fProviders; - + ContextProviderProxy(IDebugContextProvider[] providers) { super(LaunchView.this); fProviders = providers; @@ -492,7 +492,7 @@ public class LaunchView extends AbstractDebugView fProviders[i].addDebugContextListener(this); } } - + void setActiveProvider(IDebugContextProvider provider) { if (!provider.equals(fActiveProvider)) { ISelection activeContext = getActiveContext(); @@ -503,7 +503,7 @@ public class LaunchView extends AbstractDebugView } } } - + @Override public ISelection getActiveContext() { ISelection activeContext = fActiveProvider.getActiveContext(); @@ -519,7 +519,7 @@ public class LaunchView extends AbstractDebugView fire(new DebugContextEvent(this, event.getContext(), event.getFlags())); } } - + void dispose() { for (int i = 0; i < fProviders.length; i++) { fProviders[i].removeDebugContextListener(this); @@ -528,9 +528,9 @@ public class LaunchView extends AbstractDebugView fActiveProvider = null; } } - + private ContextProviderProxy fContextProviderProxy; - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() */ @@ -538,7 +538,7 @@ public class LaunchView extends AbstractDebugView protected String getHelpContextId() { return IDebugHelpContextIds.DEBUG_VIEW; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#createActions() */ @@ -549,8 +549,8 @@ public class LaunchView extends AbstractDebugView fAddToFavoritesAction = new AddToFavoritesAction(); fEditSourceAction = new EditSourceLookupPathAction(this); fLookupAction = new LookupSourceAction(this); - setAction(FIND_ACTION, new VirtualFindAction((TreeModelViewer) getViewer())); - + setAction(FIND_ACTION, new VirtualFindAction((TreeModelViewer) getViewer())); + addCapabilityAction(new TerminateCommandAction(), TERMINATE); addCapabilityAction(new DisconnectCommandAction(), DISCONNECT); addCapabilityAction(new SuspendCommandAction(), SUSPEND); @@ -569,30 +569,30 @@ public class LaunchView extends AbstractDebugView addCapabilityAction(new TerminateAllAction(), TERMINATE_ALL); addCapabilityAction(new ToggleStepFiltersAction(), TOGGLE_STEP_FILTERS); } - + /** * Sets the handler associated with the given action identifier. - * + * * @param id action identifier * @param handler handler */ private void setHandler(String id, IHandler2 handler) { fHandlers.put(id, handler); } - + /** * Returns the handler associated with the given action identifier or null. - * + * * @param id action identifier * @return handler or null */ public IHandler2 getHandler(String id) { return fHandlers.get(id); } - + /** * Initializes the action and associates it with the given id. - * + * * @param capability * @param actionID */ @@ -600,23 +600,23 @@ public class LaunchView extends AbstractDebugView capability.init(this); setAction(actionID, capability); } - + /** * Disposes the given action. - * + * * @param actionID */ private void disposeCommandAction(String actionID) { DebugCommandAction action = (DebugCommandAction) getAction(actionID); action.dispose(); } - + /** * Override the default implementation to create the breadcrumb page. - * + * * @since 3.5 * @see #fDefaultPageRec - */ + */ @Override public void createPartControl(final Composite parent) { super.createPartControl(parent); @@ -626,8 +626,8 @@ public class LaunchView extends AbstractDebugView // Add view as a selection listener to the site. getSite().getSelectionProvider().addSelectionChangedListener(this); - - // Set the tree viewer as the selection provider to the default page. + + // Set the tree viewer as the selection provider to the default page. // The page book view handles switching the between page selection // providers as needed. ((IPageBookViewPage)getDefaultPage()).getSite().setSelectionProvider(getViewer()); @@ -635,7 +635,7 @@ public class LaunchView extends AbstractDebugView // Call the PageBookView part listener to indirectly create the breadcrumb page. // This call eventually calls doCreatePage() implemented below. partActivated(new BreadcrumbWorkbenchPart(getSite())); - + fContextProviderProxy = new ContextProviderProxy( new IDebugContextProvider[] {fTreeViewerDebugContextProvider, fBreadcrumbPage.getContextProvider()}); DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).addDebugContextProvider(fContextProviderProxy); @@ -648,10 +648,10 @@ public class LaunchView extends AbstractDebugView for (int i = 0; i < fDebugViewModeActions.length; i++) { fDebugViewModeActions[i].setChecked(fDebugViewModeActions[i].getMode().equals(mode)); } - + createDebugToolBarInViewActions(parent); - - // Add a resize listener for the view to activate breadcrumb as needed. + + // Add a resize listener for the view to activate breadcrumb as needed. parent.addControlListener(new ControlListener() { @Override public void controlMoved(ControlEvent e) { @@ -666,35 +666,35 @@ public class LaunchView extends AbstractDebugView } } }); - - fContextService.addContextManagerListener(this); + + fContextService.addContextManagerListener(this); } /** - * Copies the view's global action handlers created by createActions(), + * Copies the view's global action handlers created by createActions(), * into the page site's action bars. This is necessary because the page * book view resets the view site's global actions after each page switch * (see bug 264618). - * + * * @param page Page to copy the global actions into. - * + * * @since 3.5 */ private void setGlobalActionBarsToPage(IPageBookViewPage page) { IActionBars pageActionBars = page.getSite().getActionBars(); - // Set the view site action bars created by createActions() to the + // Set the view site action bars created by createActions() to the // default page site. IActionBars bars = getViewSite().getActionBars(); pageActionBars.setGlobalActionHandler(FIND_ACTION, bars.getGlobalActionHandler(FIND_ACTION)); - pageActionBars.setGlobalActionHandler(COPY_ACTION, bars.getGlobalActionHandler(COPY_ACTION)); + pageActionBars.setGlobalActionHandler(COPY_ACTION, bars.getGlobalActionHandler(COPY_ACTION)); } - + /** * Override the default implementation to create the breadcrumb page. - * + * * @since 3.5 * @see #fDefaultPageRec - */ + */ @Override protected PageRec doCreatePage(IWorkbenchPart part) { if (part instanceof BreadcrumbWorkbenchPart) { @@ -706,13 +706,13 @@ public class LaunchView extends AbstractDebugView } return null; } - + /** * Override the default implementation to create the breadcrumb page. - * + * * @since 3.5 * @see #fDefaultPageRec - */ + */ @Override protected boolean isImportant(IWorkbenchPart part) { return part instanceof BreadcrumbWorkbenchPart; @@ -721,36 +721,36 @@ public class LaunchView extends AbstractDebugView /** * Override the default implementation to gain access at the default * page record. - * + * * @since 3.5 * @see #fDefaultPageRec - */ + */ @Override protected void showPageRec(PageRec pageRec) { if (pageRec.page == getDefaultPage()) { fDefaultPageRec = pageRec; } - + super.showPageRec(pageRec); - } + } /** * Creates actions for controlling view mode. - * + * * @param parent The view's parent control used to calculate view size * in auto mode. */ private void createViewModeActions(final Composite parent) { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager viewMenu = actionBars.getMenuManager(); - + fDebugViewModeActions = new DebugViewModeAction[3]; fDebugViewModeActions[0] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO, parent); fDebugViewModeActions[1] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL, parent); fDebugViewModeActions[2] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT, parent); fBreadcrumbDropDownAutoExpandAction = new BreadcrumbDropDownAutoExpandAction(this); viewMenu.add(new Separator()); - + final MenuManager modeSubmenu = new MenuManager(LaunchViewMessages.LaunchView_ViewModeMenu_label); modeSubmenu.setRemoveAllWhenShown(true); modeSubmenu.add(fDebugViewModeActions[0]); @@ -759,7 +759,7 @@ public class LaunchView extends AbstractDebugView modeSubmenu.add(new Separator()); modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction); viewMenu.add(modeSubmenu); - + modeSubmenu.addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(IMenuManager manager) { @@ -774,34 +774,34 @@ public class LaunchView extends AbstractDebugView /** * Creates actions for controlling view mode. - * + * * @param parent The view's parent control used to calculate view size * in auto mode. */ private void createDebugToolBarInViewActions(final Composite parent) { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager viewMenu = actionBars.getMenuManager(); - + fDebugToolBarAction = new DebugToolBarAction(this); viewMenu.add(fDebugToolBarAction); updateCheckedDebugToolBarAction(); } - + /** - * Sets the current view mode. If needed, the active view page is changed. - * + * Sets the current view mode. If needed, the active view page is changed. + * * @param mode New mode to set. * @param parent The view's parent control used to calculate view size * in auto mode. - * + * * @since 3.5 */ void setViewMode(String mode, Composite parent) { if (fCurrentViewMode.equals(mode)) { return; } - + fCurrentViewMode = mode; if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT.equals(mode)) { showBreadcrumbPage(); @@ -814,11 +814,11 @@ public class LaunchView extends AbstractDebugView } /** - * Based on the current view size, select the active view page + * Based on the current view size, select the active view page * (tree viewer vs. breadcrumb). - * + * * @param parent View pane control. - * + * * @since 3.5 */ private void autoSelectViewPage(Composite parent) { @@ -830,17 +830,17 @@ public class LaunchView extends AbstractDebugView } if (parent.getClientArea().height < breadcrumbHeight + BREADCRUMB_TRIGGER_RANGE) { showBreadcrumbPage(); - } - else if (parent.getClientArea().height > breadcrumbHeight + BREADCRUMB_STICKY_RANGE) + } + else if (parent.getClientArea().height > breadcrumbHeight + BREADCRUMB_STICKY_RANGE) { showTreeViewerPage(); } } - + /** * Shows the tree viewer in the Debug view. - * + * * @since 3.5 */ void showTreeViewerPage() { @@ -855,7 +855,7 @@ public class LaunchView extends AbstractDebugView /** * Shows the breadcrumb in the Debug view. - * + * * @since 3.5 */ void showBreadcrumbPage() { @@ -867,13 +867,13 @@ public class LaunchView extends AbstractDebugView setFocus(); } fBreadcrumbPage.fCrumb.debugContextChanged(new DebugContextEvent( - fTreeViewerDebugContextProvider, - fTreeViewerDebugContextProvider.getActiveContext(), + fTreeViewerDebugContextProvider, + fTreeViewerDebugContextProvider.getActiveContext(), DebugContextEvent.ACTIVATED)); fContextProviderProxy.setActiveProvider(fBreadcrumbPage.getContextProvider()); } } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite) */ @@ -884,15 +884,15 @@ public class LaunchView extends AbstractDebugView TreeModelViewer viewer = new TreeModelViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL, fPresentationContext); - + viewer.addSelectionChangedListener(fTreeViewerSelectionChangedListener); viewer.addViewerUpdateListener(this); viewer.addModelChangedListener(this); - + viewer.setInput(DebugPlugin.getDefault().getLaunchManager()); //setEventHandler(new LaunchViewEventHandler(this)); fTreeViewerDebugContextProvider = new TreeViewerContextProvider(viewer); - + return viewer; } @@ -901,7 +901,7 @@ public class LaunchView extends AbstractDebugView site.getWorkbenchWindow().addPageListener(this); site.getWorkbenchWindow().addPerspectiveListener(this); } - + private void preferenceInit(IViewSite site) { PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId(); IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); @@ -920,7 +920,7 @@ public class LaunchView extends AbstractDebugView Boolean auto = mem.getBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND); if(auto != null) { setBreadcrumbDropDownAutoExpand(auto.booleanValue()); - } + } } String preference = DebugUIPlugin.getDefault().getPreferenceStore().getString( @@ -931,7 +931,7 @@ public class LaunchView extends AbstractDebugView IPerspectiveDescriptor perspective = getSite().getPage().getPerspective(); fDebugToolbarInView = isDebugToolbarShownInPerspective(perspective); } - + /* (non-Javadoc) * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite) */ @@ -972,11 +972,11 @@ public class LaunchView extends AbstractDebugView } catch (IOException e) { } } - + StringBuffer buffer= new StringBuffer(); for (Iterator itr = fDebugToolbarPerspectives.iterator(); itr.hasNext();) { - buffer.append(itr.next()).append(','); - } + buffer.append(itr.next()).append(','); + } getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_TOOLBAR_HIDDEN_PERSPECTIVES, buffer.toString()); super.partDeactivated(part); @@ -989,7 +989,7 @@ public class LaunchView extends AbstractDebugView public void saveViewerState(IMemento memento) { memento.putBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND, getBreadcrumbDropDownAutoExpand()); } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager) */ @@ -1006,25 +1006,25 @@ public class LaunchView extends AbstractDebugView if (fDebugToolbarInView) { addDebugToolbarActions(tbm); } - } + } protected void addDebugToolbarActions(IToolBarManager tbm) { tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME)); tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND)); tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE)); tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT)); - + tbm.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO)); tbm.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER)); tbm.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN)); tbm.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME)); - + tbm.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS)); - } - + } + /** - * Removes the toolbar actions contributed by this view from the toolbar + * Removes the toolbar actions contributed by this view from the toolbar * manager. * @param tbm */ @@ -1033,30 +1033,30 @@ public class LaunchView extends AbstractDebugView tbm.remove(new ActionContributionItem(getAction(SUSPEND))); tbm.remove(new ActionContributionItem(getAction(TERMINATE))); tbm.remove(new ActionContributionItem(getAction(DISCONNECT))); - + tbm.remove(new ActionContributionItem(getAction(STEP_INTO))); tbm.remove(new ActionContributionItem(getAction(STEP_OVER))); tbm.remove(new ActionContributionItem(getAction(STEP_RETURN))); - + tbm.remove(new ActionContributionItem(getAction(DROP_TO_FRAME))); - + tbm.remove(new ActionContributionItem(getAction(TOGGLE_STEP_FILTERS))); } - + public boolean isDebugToolbarInView() { return fDebugToolbarInView; } - + public boolean isDebugToolbarShownInPerspective(IPerspectiveDescriptor perspective) { return perspective == null || fDebugToolbarPerspectives.contains(perspective.getId()); } - + public void setDebugToolbarInView(boolean show) { if (show == isDebugToolbarInView()) { return; } fDebugToolbarInView = show; - + // Update the perspectives set. IPerspectiveDescriptor perspective = getSite().getPage().getPerspective(); if (perspective != null) { @@ -1075,12 +1075,12 @@ public class LaunchView extends AbstractDebugView removeDebugToolbarActions(tbm); } getViewSite().getActionBars().updateActionBars(); - + // Update system property used by contributed actions. System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, Boolean.toString(show)); } - - + + /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPart#dispose() */ @@ -1116,11 +1116,11 @@ public class LaunchView extends AbstractDebugView } super.dispose(); } - + private void disposeActions() { PropertyDialogAction properties = (PropertyDialogAction) getAction("Properties"); //$NON-NLS-1$ properties.dispose(); - + disposeCommandAction(TERMINATE); disposeCommandAction(DISCONNECT); disposeCommandAction(SUSPEND); @@ -1139,7 +1139,7 @@ public class LaunchView extends AbstractDebugView /** * The selection has changed in the viewer. Show the * associated source code if it is a stack frame. - * + * * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ @Override @@ -1160,11 +1160,11 @@ public class LaunchView extends AbstractDebugView Object o= ss.getFirstElement(); if (o == null || o instanceof IStackFrame) { return; - } + } StructuredViewer viewer = (StructuredViewer) getViewer(); viewer.refresh(o); } - + /* (non-Javadoc) * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor) */ @@ -1183,7 +1183,7 @@ public class LaunchView extends AbstractDebugView public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) { setActive(page.findView(getSite().getId()) != null); } - + /* (non-Javadoc) * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String) */ @@ -1215,7 +1215,7 @@ public class LaunchView extends AbstractDebugView @Override public void pageOpened(IWorkbenchPage page) { } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDebugView#getPresentation(java.lang.String) */ @@ -1223,15 +1223,15 @@ public class LaunchView extends AbstractDebugView public IDebugModelPresentation getPresentation(String id) { return ((DelegatingModelPresentation)fPresentation).getPresentation(id); } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager) */ @Override protected void fillContextMenu(IMenuManager menu) { TreeSelection sel = (TreeSelection) fTreeViewerDebugContextProvider.getActiveContext(); - Object element = sel != null && sel.size() > 0 ? sel.getFirstElement() : null; - + Object element = sel != null && sel.size() > 0 ? sel.getFirstElement() : null; + menu.add(new Separator(IDebugUIConstants.EMPTY_EDIT_GROUP)); menu.add(new Separator(IDebugUIConstants.EDIT_GROUP)); menu.add(getAction(FIND_ACTION)); @@ -1260,10 +1260,10 @@ public class LaunchView extends AbstractDebugView action.setEnabled(action.isApplicableForSelection() && !(element instanceof ILaunch)); menu.add(action); menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - + menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_AND_REMOVE)); menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_ALL)); - + menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME)); menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND)); menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE)); @@ -1272,37 +1272,37 @@ public class LaunchView extends AbstractDebugView menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESTART)); } menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT)); - + menu.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO)); menu.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER)); menu.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN)); - + menu.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME)); - + menu.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS)); } - + @Override public void contextManagerChanged(ContextManagerEvent event) { if (event.isActiveContextsChanged()) { Set oldContexts = event.getPreviouslyActiveContextIds(); Set newContexts = event.getContextManager().getActiveContextIds(); - if (oldContexts.contains(IDebugUIConstants.DEBUG_TOOLBAR_ACTION_SET) != - newContexts.contains(IDebugUIConstants.DEBUG_TOOLBAR_ACTION_SET)) + if (oldContexts.contains(IDebugUIConstants.DEBUG_TOOLBAR_ACTION_SET) != + newContexts.contains(IDebugUIConstants.DEBUG_TOOLBAR_ACTION_SET)) { updateCheckedDebugToolBarAction(); } } } - + private void updateCheckedDebugToolBarAction() { fDebugToolBarAction.setChecked(isDebugToolbarInView()); } - + /** * Updates the enabled state of the given action based on the selection * and adds to the menu if enabled. - * + * * @param menu menu to add the action to * @param action action to add if enabled * @param selection selection to update enabled state for @@ -1311,33 +1311,33 @@ public class LaunchView extends AbstractDebugView action.selectionChanged(selection); if (action.isEnabled()) { menu.add(action); - } + } } - + /** * Sets whether this view is in the active page of a * perspective. Since a page can have more than one * perspective, this view only show's source when in * the active perspective/page. - * + * * @param active whether this view is in the active page of a * perspective */ protected void setActive(boolean active) { fIsActive = active; - } + } /** * Returns whether this view is in the active page of * the active perspective and has been fully created. - * + * * @return whether this view is in the active page of * the active perspective and has been fully created. */ protected boolean isActive() { return fIsActive && getViewer() != null; } - + /* (non-Javadoc) * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext) */ @@ -1370,9 +1370,9 @@ public class LaunchView extends AbstractDebugView */ @Override public ShowInContext getShowInContext() { - if (isActive()) { + if (isActive()) { IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection(); - if (selection.size() == 1) { + if (selection.size() == 1) { Object object = selection.getFirstElement(); if (object instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) object; @@ -1385,15 +1385,15 @@ public class LaunchView extends AbstractDebugView } return null; } - + /* (non-Javadoc) * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds() */ @Override public String[] getShowInTargetIds() { - if (isActive()) { + if (isActive()) { IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection(); - if (selection.size() == 1) { + if (selection.size() == 1) { Object object = selection.getFirstElement(); if (object instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) object; @@ -1447,7 +1447,7 @@ public class LaunchView extends AbstractDebugView public void partActivated(IWorkbenchPartReference partRef) { // Ensure that the system property matches the debug toolbar state. // Bug 385400 - System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, + System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, Boolean.toString(isDebugToolbarShownInPerspective(getSite().getPage().getPerspective())) ); } @@ -1487,7 +1487,7 @@ public class LaunchView extends AbstractDebugView super.becomesVisible(); getViewer().refresh(); } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor) */ @@ -1500,7 +1500,7 @@ public class LaunchView extends AbstractDebugView } } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor) */ @@ -1513,7 +1513,7 @@ public class LaunchView extends AbstractDebugView */ @Override public synchronized void viewerUpdatesBegin() { - IWorkbenchSiteProgressService progressService = + IWorkbenchSiteProgressService progressService = getSite().getAdapter(IWorkbenchSiteProgressService.class); if (progressService != null) { progressService.incrementBusy(); @@ -1525,48 +1525,48 @@ public class LaunchView extends AbstractDebugView */ @Override public synchronized void viewerUpdatesComplete() { - IWorkbenchSiteProgressService progressService = + IWorkbenchSiteProgressService progressService = getSite().getAdapter(IWorkbenchSiteProgressService.class); if (progressService != null) { progressService.decrementBusy(); - } - } - + } + } + @Override public void modelChanged(IModelDelta delta, IModelProxy proxy) { updateFindAction(); } - + private void updateFindAction() { IAction action= getAction(FIND_ACTION); if (action instanceof IUpdate) { ((IUpdate) action).update(); } } - + /** * Returns whether the breadcrumb viewer is currently visible in the view. - * + * * @since 3.5 */ boolean isBreadcrumbVisible() { return fBreadcrumbPage.equals(getCurrentPage()); } - + /** - * Returns whether the elements in breadcrumb's drop-down viewer should be + * Returns whether the elements in breadcrumb's drop-down viewer should be * automatically expanded. - * + * * @since 3.5 */ boolean getBreadcrumbDropDownAutoExpand() { return fBreadcrumbDropDownAutoExpand; } - + /** - * Sets whether the elements in breadcrumb's drop-down viewer should be + * Sets whether the elements in breadcrumb's drop-down viewer should be * automatically expanded. - * + * * @since 3.5 */ void setBreadcrumbDropDownAutoExpand(boolean expand) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java index 00597dbb4..0c74d79b9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation = bug fixing @@ -69,26 +69,26 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo Input(TreePath path) { fPath = path; } - + @Override public boolean equals(Object obj) { - return obj instanceof Input && + return obj instanceof Input && ((fPath == null && ((Input)obj).fPath == null) || (fPath != null && fPath.equals( ((Input)obj).fPath ))); } - + @Override public int hashCode() { return fPath == null ? 0 : fPath.hashCode(); } } - + private static class ContentProvider implements ITreePathContentProvider { private static final Object[] EMPTY_ELEMENTS_ARRAY = new Object[0]; - - public Input fInput; - + + public Input fInput; + @Override public Object[] getChildren(TreePath parentPath) { if (hasChildren(parentPath)) { @@ -107,9 +107,9 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo public boolean hasChildren(TreePath parentPath) { if ( parentPath.getSegmentCount() == 0) { return fInput != null; - } else if (fInput != null && - fInput.fPath != null && - fInput.fPath.getSegmentCount() > parentPath.getSegmentCount()) + } else if (fInput != null && + fInput.fPath != null && + fInput.fPath.getSegmentCount() > parentPath.getSegmentCount()) { for (int i = 0; i < parentPath.getSegmentCount(); i++) { if (i >= fInput.fPath.getSegmentCount()) { @@ -129,8 +129,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo @Override public Object[] getElements(Object inputElement) { - if (fInput != null && - fInput.fPath != null) + if (fInput != null && + fInput.fPath != null) { return getChildren(TreePath.EMPTY); } else { @@ -152,7 +152,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } } } - + private class LabelProvider extends BaseLabelProvider implements ITreePathLabelProvider { @Override public void updateLabel(ViewerLabel label, TreePath elementPath) { @@ -171,31 +171,31 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo label.setFont(treeViewerLabel.getFont()); label.setForeground(treeViewerLabel.getForeground()); label.setBackground(treeViewerLabel.getBackground()); - + } - } + } } } - + private final LaunchView fView; private final TreeModelViewer fTreeViewer; private final IDebugContextProvider fTreeViewerContextProvider; private Input fBreadcrumbInput; - static final private Object fgEmptyDebugContextElement = new Object(); + static final private Object fgEmptyDebugContextElement = new Object(); private BreadcrumbViewer fViewer; private boolean fRefreshBreadcrumb = false; - + private class BreadcrumbContextProvider extends AbstractDebugContextProvider implements IDebugContextListener, ISelectionChangedListener { - + private ISelection fBreadcrumbSelection = null; - + BreadcrumbContextProvider() { super(fView); fViewer.addSelectionChangedListener(this); fBreadcrumbSelection = fViewer.getSelection(); fTreeViewerContextProvider.addDebugContextListener(this); } - + @Override public ISelection getActiveContext() { if (fBreadcrumbSelection != null && !fBreadcrumbSelection.isEmpty()) { @@ -205,17 +205,17 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo return treeViewerSelection != null ? treeViewerSelection : StructuredSelection.EMPTY; } } - + void dispose() { fViewer.removeSelectionChangedListener(this); fTreeViewerContextProvider.removeDebugContextListener(this); } - + @Override public void debugContextChanged(DebugContextEvent event) { fire(new DebugContextEvent(this, getActiveContext(), event.getFlags())); } - + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection oldContext = getActiveContext(); @@ -227,7 +227,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } private BreadcrumbContextProvider fBreadcrumbContextProvider; - + public LaunchViewBreadcrumb(LaunchView view, TreeModelViewer treeViewer, IDebugContextProvider contextProvider) { fView = view; fTreeViewer = treeViewer; @@ -236,7 +236,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo fBreadcrumbInput = new Input( getPathForSelection(fTreeViewerContextProvider.getActiveContext()) ); fTreeViewerContextProvider.addDebugContextListener(this); } - + @Override protected void activateBreadcrumb() { } @@ -260,7 +260,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } }; - // Force the layout of the breadcrumb viewer so that we may calcualte + // Force the layout of the breadcrumb viewer so that we may calcualte // its proper size. parent.pack(true); @@ -268,11 +268,11 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo fViewer.setLabelProvider(new LabelProvider()); createMenuManager(); - + fViewer.setInput(getCurrentInput()); - + fBreadcrumbContextProvider = new BreadcrumbContextProvider(); - + return fViewer; } @@ -306,7 +306,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } }); } - + @Override protected Object getCurrentInput() { return fBreadcrumbInput; @@ -333,12 +333,12 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo @Override public void debugContextChanged(DebugContextEvent event) { if (fView.isBreadcrumbVisible()) { - fBreadcrumbInput = new Input(getPathForSelection(event.getContext())); + fBreadcrumbInput = new Input(getPathForSelection(event.getContext())); if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) { setInput(getCurrentInput()); - + // If the context was activated, then clear the selection in breadcrumb - // so that the activated context will become the active context for the + // so that the activated context will become the active context for the // window. fViewer.setSelection(StructuredSelection.EMPTY); } else { @@ -346,11 +346,11 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } } } - + @Override public void labelUpdateStarted(ILabelUpdate update) { } - + @Override public void labelUpdateComplete(ILabelUpdate update) { if (fBreadcrumbInput != null && fBreadcrumbInput.fPath != null) { @@ -361,11 +361,11 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } } } - + @Override public void labelUpdatesBegin() { } - + @Override public void labelUpdatesComplete() { boolean refresh = false; @@ -384,36 +384,36 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo }.schedule(); } } - + IDebugContextProvider getContextProvider() { return fBreadcrumbContextProvider; } - + int getHeight() { return fViewer.getControl().getSize().y; } - + void clearSelection() { fViewer.setSelection(StructuredSelection.EMPTY); } - + private TreePath getPathForSelection(ISelection selection) { if (selection instanceof ITreeSelection && !selection.isEmpty()) { return ((ITreeSelection)selection).getPaths()[0]; } return null; } - + public Control createDropDownControl(Composite parent, final IBreadcrumbDropDownSite site, TreePath paramPath) { - + TreeViewerDropDown dropDownTreeViewer = new TreeViewerDropDown() { - + SubTreeModelViewer fDropDownViewer; - + @Override protected TreeViewer createTreeViewer(Composite composite, int style, final TreePath path) { fDropDownViewer = new SubTreeModelViewer( - composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL | SWT.POP_UP, + composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL | SWT.POP_UP, fTreeViewer.getPresentationContext()); Object launchViewInput = fTreeViewer.getInput(); @@ -421,12 +421,12 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo ViewerFilter[] filters = fTreeViewer.getFilters(); fDropDownViewer.setFilters(filters); - + ModelDelta stateDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE); fTreeViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND | IModelDelta.SELECT); - + // If we do not want to expand the elements in the drop-down. - // Prune the delta to only select the element in the + // Prune the delta to only select the element in the // top-most list. if (!fView.getBreadcrumbDropDownAutoExpand()) { final ModelDelta prunedDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE); @@ -442,19 +442,19 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo // Build up the delta copy along the path of the drop-down element. copy = copy.addNode( delta.getElement(), delta.getIndex(), delta.getFlags(), delta.getChildCount()); - } - - // If the delta is for the drop-down element, set its select flag and stop traversing + } + + // If the delta is for the drop-down element, set its select flag and stop traversing // the delta.. if (deltaPath.equals(path)) { copy.setFlags(IModelDelta.SELECT | IModelDelta.REVEAL); return false; } - + // Continue traversing the delta. return true; } - + private TreePath getViewerTreePath(IModelDelta node) { ArrayList list = new ArrayList(); IModelDelta parentDelta = node.getParentDelta(); @@ -468,9 +468,9 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo }); stateDelta = prunedDelta; } - + fDropDownViewer.updateViewer(stateDelta); - + fDropDownViewer.addLabelUpdateListener(new ILabelUpdateListener() { @Override public void labelUpdateComplete(ILabelUpdate update) {} @@ -499,16 +499,16 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo if (fTreeViewer.getControl().isDisposed()) { return; } - + if (selection != null && (selection instanceof ITreeSelection) && !selection.isEmpty()) { // Create the path to the root element of the drop-down viewer. Need to calcualte - // indexes and counts for the delta in order for the selection from the drop-down + // indexes and counts for the delta in order for the selection from the drop-down // viewer to work properly. TreeModelContentProvider contentProvider = (TreeModelContentProvider)fTreeViewer.getContentProvider(); TreePath path = TreePath.EMPTY; int count = fTreeViewer.getChildCount(path); count = contentProvider.viewToModelCount(path, count); - ModelDelta rootDelta = + ModelDelta rootDelta = new ModelDelta(fTreeViewer.getInput(), -1, IModelDelta.NO_CHANGE, count); TreePath rootPath = fDropDownViewer.getRootPath(); ModelDelta delta = rootDelta; @@ -521,10 +521,10 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo count = contentProvider.viewToModelCount(path, count); delta = delta.addNode(rootPath.getSegment(i), index, IModelDelta.NO_CHANGE, count); } - + // Create the delta and save the drop-down viewer's state to it. fDropDownViewer.saveElementState(TreePath.EMPTY, delta, IModelDelta.EXPAND | IModelDelta.SELECT); - + // Add the IModelDelta.FORCE flag to override the current selection in view. rootDelta.accept(new IModelDeltaVisitor(){ @Override @@ -536,23 +536,23 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo } }); - // If elements in the drop-down were auto-expanded, then collapse the drop-down's sub tree in the + // If elements in the drop-down were auto-expanded, then collapse the drop-down's sub tree in the // full viewer. After the drop-down's full expansion state is saved out to the tree viewer, the - // tree viewer will accurately reflect the state changes made by the user. + // tree viewer will accurately reflect the state changes made by the user. if (fView.getBreadcrumbDropDownAutoExpand()) { fTreeViewer.collapseToLevel(rootPath, AbstractTreeViewer.ALL_LEVELS); - } - + } + // Save the state of the drop-down out into the tree viewer. fTreeViewer.updateViewer(rootDelta); fViewer.setSelection(StructuredSelection.EMPTY); site.close(); } - + super.openElement(selection); } }; - + return dropDownTreeViewer.createDropDown(parent, site, paramPath); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java index cffa5ecb0..494856be0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation = bug fixing @@ -24,15 +24,15 @@ import org.eclipse.swt.widgets.TreeItem; import org.eclipse.swt.widgets.Widget; /** - * Copy action for debug view. This action is specialized from the standard + * Copy action for debug view. This action is specialized from the standard * copy action in a couple of ways: *
      - *
    • If debug view is in debug mode, then the selected element in + *
    • If debug view is in debug mode, then the selected element in * breadcrumb is translated into the tree viewer, and then copied
    • - *
    • If an item is selected all the item's children are copied into + *
    • If an item is selected all the item's children are copied into * clipbard.
    • *
    - * + * * @since 3.5 */ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipboardActionDelegate { @@ -76,10 +76,10 @@ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipbo } } else if (item instanceof Tree) { collectChildItems(set, ((Tree)item).getItems()); - } + } return set.toArray(new TreeItem[set.size()]); } - + private void collectChildItems(Set set, TreeItem[] items) { if (items == null) { return; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java index 06b9c4dea..5abc9ad87 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -23,11 +23,11 @@ import org.eclipse.ui.part.EditorPart; /** * Editor used when no source if found for a stack frame. - * + * * @since 2.1 */ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor { - + /** * Text widget used for this editor */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java index 6d94c489a..70e456ecc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java @@ -25,16 +25,16 @@ import com.ibm.icu.text.MessageFormat; /** * Editor input for a stack frame for which source could not be located. - * + * * @since 2.1 */ public class SourceNotFoundEditorInput extends PlatformObject implements IEditorInput { - + /** * Associated stack frame */ private IStackFrame fFrame; - + /** * Stack frame text (cached on creation) */ @@ -43,7 +43,7 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor /** * Constructs an editor input for the given stack frame, * to indicate source could not be found. - * + * * @param frame stack frame */ public SourceNotFoundEditorInput(IStackFrame frame) { @@ -77,7 +77,7 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor try { return fFrame.getName(); } catch (DebugException e) { - return DebugUIViewsMessages.SourceNotFoundEditorInput_Source_Not_Found_1; + return DebugUIViewsMessages.SourceNotFoundEditorInput_Source_Not_Found_1; } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java index 639f708ef..511cfbf4b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -18,11 +18,11 @@ import org.eclipse.ui.IEditorPart; * A reminder to remove any annotations created by an editor presentation */ public class StandardDecoration extends Decoration { - + private IThread fThread; private IEditorPart fEditor; private IDebugEditorPresentation fPresentation; - + public StandardDecoration(IDebugEditorPresentation presentation, IEditorPart editorPart, IThread thread) { fThread = thread; fEditor = editorPart; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/TerminateAndRemoveHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/TerminateAndRemoveHandler.java index f2de925f8..a94ec1fcd 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/TerminateAndRemoveHandler.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/TerminateAndRemoveHandler.java @@ -18,7 +18,7 @@ import org.eclipse.debug.internal.ui.commands.actions.DebugActionHandler; * @since 3.6 */ public class TerminateAndRemoveHandler extends DebugActionHandler { - + public TerminateAndRemoveHandler() { super(LaunchView.TERMINATE_AND_REMOVE); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java index 09164c325..53e2351af 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java @@ -72,7 +72,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS /** * Create the content of the view pane - * + * * @param parent the parent composite * @param paneId the id of the pane to create * @param label the label for the new pane @@ -324,7 +324,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS /** * Helper method to dispose of a tab folder, and of any tab items it * contains. Must be called from the UI thread. - * + * * @param tabFolder the {@link CTabFolder} to dispose * */ private void disposeOfFolder(CTabFolder tabFolder) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java index 8d1ecc175..a7a180c71 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java @@ -52,7 +52,7 @@ import org.eclipse.ui.PlatformUI; /** * Action for adding memory block. - * + * * @since 3.0 */ public class AddMemoryBlockAction extends Action implements IDebugContextListener, IDebugEventSetListener { @@ -98,7 +98,7 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION)); setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_ADD)); setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".addMemoryMonitorAction_context"); //$NON-NLS-1$ + PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".addMemoryMonitorAction_context"); //$NON-NLS-1$ // listen for context changed DebugUITools.addPartDebugContextListener(fSite.getSite(), this); @@ -321,7 +321,7 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene /** * Return the last memory block added to memory block manager via this * action. - * + * * @return Returns the fLastMemoryBlock. */ public IMemoryBlock getLastMemoryBlock() { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java index c6fcd7ab6..e7dc1e735 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java @@ -7,8 +7,8 @@ * * Contributors: * IBM Corporation - initial API and implementation - * WindRiver - Bug 192028 [Memory View] Memory view does not - * display memory blocks that do not reference IDebugTarget + * WindRiver - Bug 192028 [Memory View] Memory view does not + * display memory blocks that do not reference IDebugTarget * Ted Williams - WindRiver - Bug 215432 - [Memory View] Memory View: Workflow Enhancements *******************************************************************************/ package org.eclipse.debug.internal.ui.views.memory; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java index b1da6ccef..06597ce72 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java index 6756edd30..46aa62bd3 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java @@ -7,7 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation - * WindRiver - Bug 192028 [Memory View] Memory view does not + * WindRiver - Bug 192028 [Memory View] Memory view does not * display memory blocks that do not reference IDebugTarget *******************************************************************************/ package org.eclipse.debug.internal.ui.views.memory; @@ -593,7 +593,7 @@ public class AddMemoryRenderingDialog extends SelectionDialog { } /** - * + * */ private void addNew() { WorkbenchJob job = new WorkbenchJob("populate dialog") { //$NON-NLS-1$ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java index 69d744617..d0974bdf5 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java index 61933c8dc..4a54366be 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -14,7 +14,7 @@ package org.eclipse.debug.internal.ui.views.memory; /** * Functions to allow user to control the Memory View or the Memory Rendering * View - * + * * @since 3.0 */ public interface IMemoryView { @@ -30,7 +30,7 @@ public interface IMemoryView { /** * Move specified view tab to the top - * + * * @param viewTab */ public void moveToTop(IMemoryViewTab viewTab); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java index b092ff38c..85481db34 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -18,17 +18,17 @@ import org.eclipse.swt.widgets.Control; /** * Represent a view pane in the memory view. - * + * * This is an internal interface for mananging the view panes within the Memory * View - * + * * @since 3.1 */ public interface IMemoryViewPane { /** * Create the view pane with the given parent composite, and pane id. - * + * * @param parent * @param paneId * @param label @@ -61,7 +61,7 @@ public interface IMemoryViewPane { /** * Add the given selection listener to the view pane. The selection listener * gets notified when the selection from the view pane has changed. - * + * * @param listener */ public void addSelectionListener(ISelectionChangedListener listener); @@ -69,7 +69,7 @@ public interface IMemoryViewPane { /** * Remove the selection listener from the view pane. The listener will no * longer get notified when selection is changed. - * + * * @param listener */ public void removeSelctionListener(ISelectionChangedListener listener); @@ -86,7 +86,7 @@ public interface IMemoryViewPane { /** * Called when the view pane becomes visible or hidden - * + * * @param visible visibility state of teh view pane */ public void setVisible(boolean visible); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java index 0b5f388bc..1b89e2204 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -15,10 +15,10 @@ import org.eclipse.debug.ui.memory.IMemoryRendering; /** * Represent a view tab in the Memory View or Memory Rendering View - * + * * Refer to AbstractMemoryViewTab. This is an internal interface. This class is * not intended to be implemented by clients. - * + * * @since 3.0 */ public interface IMemoryViewTab { @@ -39,14 +39,14 @@ public interface IMemoryViewTab { /** * Sets the enablament state of the view tab. - * + * * @param enabled */ public void setEnabled(boolean enabled); /** * Set view tab's label - * + * * @param label */ public void setTabLabel(String label); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java index 7af713e31..3f105328a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java index 0adc1a39e..9ae970c70 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java @@ -7,9 +7,9 @@ * * Contributors: * IBM Corporation - initial API and implementation - * WindRiver - Bug 192028 [Memory View] Memory view does not + * WindRiver - Bug 192028 [Memory View] Memory view does not * display memory blocks that do not reference IDebugTarget - * + * *******************************************************************************/ package org.eclipse.debug.internal.ui.views.memory; @@ -349,7 +349,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC } /** - * + * */ private void updateRetrieval() { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java index a4041592c..fa334728d 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java @@ -70,7 +70,7 @@ import org.eclipse.ui.part.ViewPart; import org.osgi.service.prefs.BackingStoreException; /** - * + * * @since 3.0 */ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 { @@ -459,7 +459,7 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 { } /** - * + * */ private void createMemoryBlocksTreeViewPane(Composite parent) { @@ -501,7 +501,7 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 { /** * @return an activate listener for the given view pane - * + * */ private Listener createDeactivateListener(final IMemoryViewPane viewPane) { Listener deactivateListener = new Listener() { @@ -534,7 +534,7 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 { } /** - * + * */ public void createRenderingViewPane(final String paneId) { final RenderingViewPane renderingPane = new RenderingViewPane(this); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java index 92c3d6686..659c664f3 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -14,7 +14,7 @@ import java.util.ArrayList; /** * Class for managing the secondary ids for Memory View - * + * */ public class MemoryViewIdRegistry { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java index 8980ef6f0..88e58f65f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ 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 4669b9a4a..d4e94933c 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 @@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Display; /** * Synchronization service for the memory view. - * + * * @since 3.1 */ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchronizationService, IMemoryBlockListener, IPropertyChangeListener { @@ -70,7 +70,7 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro /** * If the property matches one of the filters, the property is valid and * the view should be notified about its change. - * + * * @param property the property * @return if the property is specified in the filter */ @@ -89,7 +89,7 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro /** * Set property filters, indicating what property change events the * listener is interested in. - * + * * @param filters the property filters or null */ public void setPropertyFilters(String[] filters) { @@ -216,7 +216,7 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro /** * Fire property change events - * + * * @param evt the event to fire */ public void firePropertyChanged(final PropertyChangeEvent evt) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java index 1f7dd7c23..2715b970e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java @@ -34,7 +34,7 @@ import org.eclipse.ui.progress.WorkbenchJob; /** * Represents a tab in the Memory View. This is where memory renderings are * hosted in the Memory View. - * + * * @since 3.1 */ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, Listener { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java index 2031204ee..48be9f417 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -23,11 +23,11 @@ import org.eclipse.swt.widgets.Composite; * by SELECT, and the added element is an memory blok, then the udpate policy * asks the Memory View if the it is currently pinned to a memory block. If the * view is currently pinned, then the SELECT delta is ignored. - * + * * If the ADDED delta and SELECT delta are recieved in separate nodes, then the * delta will be handled as-is and would not take the pinning state of the * memory view into account. - * + * */ public class MemoryViewTreeViewer extends TreeModelViewer { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java index e8579f78e..b53c5e6da 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -35,7 +35,7 @@ import org.eclipse.ui.progress.UIJob; /** * Util class for Memory View - * + * * @since 3.0 */ public class MemoryViewUtil { @@ -106,7 +106,7 @@ public class MemoryViewUtil { /** * Helper function to open an error dialog. - * + * * @param title * @param message * @param e @@ -143,7 +143,7 @@ public class MemoryViewUtil { /** * Checks to see if the event is valid for activating cell editing in a view * tab - * + * * @param event * @return true if the edit event is valid for activating the cell editor */ @@ -175,14 +175,14 @@ public class MemoryViewUtil { /** * Return the memory block retrieval of the given object - * + * * @param object * @return the memory block retrieval of the given object or * null if no memory block retrieval can be found - * + * * Returning null for the memory block retrieval will result in * errors in operations that follow. - * + * * Non-standard debug models must provide a memory block retrieval * via getAdapter(IMemoryBlockRetrieval.class */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java index 937f26044..31dc04038 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java @@ -45,7 +45,7 @@ public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListen /** * the predefined width of the wrapping label for the expression to enter * combo - * + * * @since 3.3 */ private static final int LABEL_WIDTH = 210; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java index c4ee61cb6..970877caf 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,7 +20,7 @@ import org.eclipse.ui.IViewPart; * Action for pinning the display of the memory view to the current memory * block. The view would not change selection when a new memory block is added * if the diplay is pinned. - * + * */ public class PinMemoryBlockAction implements IViewActionDelegate { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java index 558cd48bd..ef87fa2df 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -19,7 +19,7 @@ import org.eclipse.jface.util.PropertyChangeEvent; /** * Fire properties changes events in ISafeRunnable to ensure that exceptions are * caught and handled. - * + * * @since 3.1 */ public class PropertyChangeNotifier implements ISafeRunnable { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java index d0fb67ef6..38acb2ebc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,10 +22,10 @@ import org.eclipse.jface.action.Action; * Remove Memory Rendering action This action serves two purposes: - remove * memory rendering from Memory Rendering Pane - quck way to remove a memory * block from Memory Rendering Pane - * + * * When user clicks on the this tool bar action, it simply removes the top view * tab from Memory Rendering Pane. - * + * * @since 3.0 */ public class RemoveMemoryRenderingAction extends Action { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java index 43a741344..31be797fe 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -19,7 +19,7 @@ import org.eclipse.ui.IViewPart; /** * @since 3.0 - * + * */ public class RemoveRenderingContextAction implements IViewActionDelegate { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java index 3628aa755..310738b83 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java @@ -7,9 +7,9 @@ * * Contributors: * IBM Corporation - initial API and implementation - * WindRiver - Bug 192028 [Memory View] Memory view does not + * WindRiver - Bug 192028 [Memory View] Memory view does not * display memory blocks that do not reference IDebugTarget - * ARM - Bug 192028 [Memory View] Memory view does not + * ARM - Bug 192028 [Memory View] Memory view does not * display memory blocks that do not reference IDebugTarget * WindRiver - Bug 216509 [Memory View] typo, s/isMeomryBlockRemoved/isMemoryBlockRemoved * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432) @@ -65,9 +65,9 @@ import org.eclipse.ui.progress.UIJob; /** * Represents a rendering view pane in the Memory View. This hosts the memory * view tabs in the view. - * + * * @since 3.1 - * + * */ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemoryRenderingContainer { @@ -88,7 +88,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory /** * @param parent is the view hosting this view pane * @param paneId is the identifier assigned by the Memory View - * + * * Pane id is assigned with the following format. Rendering view * pane created has its id assigned to * org.eclipse.debug.ui.MemoryView.RenderingViewPane.#. # is a @@ -100,7 +100,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory * org.eclipse.debug.ui.MemoryView.RenderingViewPane.2. and so * on. View pane are created from left to right by the Memory * View. - * + * */ public RenderingViewPane(IViewPart parent) { super(parent); @@ -1098,7 +1098,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory /** * Reset the memory renderings within this view pane. - * + * * @param memoryBlock - reset renderings associated with the given memory * block * @param resetVisible - reset what's currently visible if the parameter is diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java index 04cb9bba0..a2bbbb8f4 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java @@ -28,7 +28,7 @@ import org.eclipse.ui.IViewPart; /** * The popup menu action for a memory rendering used to reset the current * selection to the default first memory position - * + * * @since 3.2.0 */ public class ResetMemoryBlockAction implements IViewActionDelegate { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java index 01dc1515b..258862dd0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java index 89b298b34..420092cd0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java @@ -24,7 +24,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingSite; * This is the retargettable add memory block action in the Memory View. All * AddMemoryBlock actions in the view will use this action to make sure that * clients can override the "Add Memory Monitor" dialog. - * + * */ public class RetargetAddMemoryBlockAction extends AddMemoryBlockAction { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java index 8cd837bd7..5e7cd391f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java index 26cc15d23..bc5210356 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java @@ -4,10 +4,10 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation - * WindRiver - Bug 192028 [Memory View] Memory view does not + * WindRiver - Bug 192028 [Memory View] Memory view does not * display memory blocks that do not reference IDebugTarget *******************************************************************************/ @@ -57,7 +57,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega /** * A job that updates the enablement of the of the backing action delegate * in the UI thread - * + * * @since 3.3.0 */ class UpdateActionEnablementJob extends UIJob { @@ -294,7 +294,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega /** * Returns the current memory blocks tree viewer, or null - * + * * @return the memory blocks tree viewer or null */ private StructuredViewer getViewer() { @@ -413,7 +413,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega /** * Returns the current memory block - * + * * @return the current memory block or null */ private IMemoryBlock getCurrentMemoryBlock() { @@ -438,7 +438,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega /** * Decorate the label for the specified IMemoryBlock - * + * * @param memBlk * @param label * @return the decorated label for the specified IMemoryBlock diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java index 80ea1e47e..4a3ac8880 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -23,11 +23,11 @@ import org.eclipse.debug.core.model.IMemoryBlock; * responsible for defining properties to be synchronized and notifying the * synchronizer of properties changes. This is only for keeping track of values * of synchronized properties and firing events when properties are changed. - * + * * Memory block serves as a key for synchronization. Views displaying the same * memory block can be synchronized. Views displaying different memory block * cannot be synchronized. - * + * * @since 3.0 */ public class SynchronizeInfo { @@ -37,7 +37,7 @@ public class SynchronizeInfo { /** * Create a new synchronization info object for the memory block - * + * * @param block */ public SynchronizeInfo(IMemoryBlock block) { @@ -47,7 +47,7 @@ public class SynchronizeInfo { /** * Set a property and its value to the info object - * + * * @param propertyId * @param value */ @@ -63,7 +63,7 @@ public class SynchronizeInfo { /** * Returns the value of the property from the info object - * + * * @param propertyId * @return value of the property */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java index 429b22e29..63091bb1b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -12,9 +12,9 @@ package org.eclipse.debug.internal.ui.views.memory; /** * Toggles the visiblity of a view pane. - * + * * @since 3.1 - * + * */ public class ToggleMemoryMonitorsAction extends ToggleViewPaneAction { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java index bd99fa281..9c5861f19 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -14,9 +14,9 @@ import org.eclipse.debug.ui.IDebugUIConstants; /** * Toggles the visibility of the rendering view pane 2. - * + * * @since 3.1 - * + * */ public class ToggleSplitPaneAction extends ToggleViewPaneAction { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java index c340b3b76..f7887fbdf 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java index b16085334..1639da7be 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java @@ -50,7 +50,7 @@ import org.w3c.dom.NodeList; * be persisted when the memory view is disposed. If the view is opened again, * the same set of renderings will be created in the view pane if the renderings * are still valid. - * + * * @since 3.1 */ public class ViewPaneRenderingMgr implements IDebugEventSetListener { @@ -283,7 +283,7 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener { /** * Convert renderings to xml text - * + * * @return * @throws IOException * @throws ParserConfigurationException diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java index 8e8c7795c..8efa99637 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,9 +20,9 @@ import org.eclipse.jface.viewers.SelectionChangedEvent; /** * Handles selection changes in a rendering view pane. - * + * * @since 3.1 - * + * */ public class ViewPaneSelectionProvider implements ISelectionProvider { ArrayList fListeners = new ArrayList(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java index f129ae23c..0a37ab935 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432) @@ -19,7 +19,7 @@ import org.eclipse.swt.events.SelectionListener; /** * Controls view tab enablement based on tab folder selection - * + * * @since 3.0 */ public class ViewTabEnablementManager implements SelectionListener { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java index 946a2c5ad..5073b9fb9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java @@ -26,9 +26,9 @@ import org.eclipse.jface.util.PropertyChangeEvent; * @since 3.1 */ public class ASCIIRendering extends AbstractAsyncTextRendering{ - + private final int numCharsPerByte = 1; - + public ASCIIRendering(String renderingId) { @@ -36,12 +36,12 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{ String codepage = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE); setCodePage(codepage); } - + @Override public void dispose() { super.dispose(); } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.memory.AbstractMemoryRendering#getNumCharsPerByte() */ @@ -49,7 +49,7 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{ public int getNumCharsPerByte() { return numCharsPerByte; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String) @@ -60,9 +60,9 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{ BigInteger address, MemoryByte[] currentValues, String data) { - + byte[] bytes = super.getBytes(renderingId, address, currentValues, data); - + // undo the replacement of 1's to 0's. for (int i=0; inull if the bytes cannot be formatted properly. - * + * * @param renderingTypeId rendering type identifier * @param address address the bytes begin at * @param currentValues current values of the data in bytes format diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java index a8cab1aaa..eeb6c770e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java @@ -22,22 +22,22 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingContainer; * */ public abstract class AbstractIntegerRendering extends AbstractAsyncTableRendering { - + private int fDisplayEndianess = RenderingsUtil.ENDIANESS_UNKNOWN; - + public AbstractIntegerRendering(String renderingId){ super(renderingId); } - + @Override public void init(IMemoryRenderingContainer container, IMemoryBlock block) { super.init(container, block); - + // default to big endian for simple memory block if (!(block instanceof IMemoryBlockExtension)) fDisplayEndianess = RenderingsUtil.BIG_ENDIAN; } - + /** * @return Returns the currentEndianess. */ @@ -54,10 +54,10 @@ public abstract class AbstractIntegerRendering extends AbstractAsyncTableRenderi protected int getBytesEndianess(MemoryByte[] data) { int endianess = RenderingsUtil.ENDIANESS_UNKNOWN; - + if (!data[0].isEndianessKnown()) return endianess; - + if (data[0].isBigEndian()) endianess = RenderingsUtil.BIG_ENDIAN; else @@ -67,7 +67,7 @@ public abstract class AbstractIntegerRendering extends AbstractAsyncTableRenderi // if endianess is not known for a byte, return unknown if (!data[i].isEndianessKnown()) return RenderingsUtil.ENDIANESS_UNKNOWN; - + int byteEndianess = data[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN; if (byteEndianess != endianess) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java index b48978798..e87bc0ca5 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,21 +22,21 @@ import org.eclipse.swt.graphics.Image; /** * Abstract label provider for an ITableMemoryViewTab - * + * * @since 3.0 */ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider implements ITableLabelProvider{ protected AbstractTableRendering fRendering; - + /** - * + * * Constructor for MemoryViewLabelProvider */ public AbstractTableRenderingLabelProvider() { super(); } - + public AbstractTableRenderingLabelProvider(AbstractTableRendering rendering){ fRendering = rendering; } @@ -55,28 +55,28 @@ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider */ @Override public Image getColumnImage(Object element, int columnIndex) { - + if (columnIndex == 0) { - return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY); + return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY); } else if (columnIndex > (fRendering.getBytesPerLine()/fRendering.getBytesPerColumn())) { - return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY); + return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY); } else - { + { // if memory in the range has changed, return delta icon int startOffset = (columnIndex-1)*fRendering.getBytesPerColumn(); int endOffset = startOffset + fRendering.getBytesPerColumn() - 1; if (((TableRenderingLine)element).isRangeChange(startOffset, endOffset)) { return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY_CHANGED); } - return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY); + return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY); } } - - + + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) */ @@ -87,7 +87,7 @@ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider if (columnIndex == 0) { columnLabel = ((TableRenderingLine)element).getAddress(); - + // consult model presentation for address presentation } else if (columnIndex > (fRendering.getBytesPerLine()/fRendering.getBytesPerColumn())) @@ -95,14 +95,14 @@ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider columnLabel = " "; //$NON-NLS-1$ } else - { + { int start = (columnIndex-1)*fRendering.getBytesPerColumn(); int end = start + fRendering.getBytesPerColumn(); MemoryByte[] bytes = ((TableRenderingLine)element).getBytes(start, end); BigInteger address = new BigInteger(((TableRenderingLine)element).getAddress(), 16); - address = address.add(BigInteger.valueOf(start)); - + address = address.add(BigInteger.valueOf(start)); + columnLabel = fRendering.getString(fRendering.getRenderingId(), address, bytes); } return columnLabel; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java index a4f056241..ecec35404 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java index 854148932..15eb8b648 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,7 +20,7 @@ import org.eclipse.swt.widgets.TableItem; /** * Copy action for AbstractAsyncTableRendering. Only copy what is * visible in the view. - * + * */ public class AsyncCopyTableRenderingAction extends CopyTableRenderingToClipboardAction { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java index d132fbedc..799bdcaff 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.TableItem; /** * Print action for AbstractAsyncTableRendering. Only print what is * visible in the view. - * + * */ public class AsyncPrintTableRenderingAction extends PrintTableRenderingAction { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java index 8cc3feea2..0080981e5 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java @@ -39,13 +39,13 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { private AbstractAsyncTableRendering fRendering; private boolean fMBSupportsValueModification = false; - + private ICellModifier fCustomModifier; public AsyncTableRenderingCellModifier(AbstractAsyncTableRendering rendering, ICellModifier customModifier) { fRendering = rendering; fCustomModifier = customModifier; - + Job job = new Job("AsyncTableRenderingCellModifier"){ //$NON-NLS-1$ @Override @@ -59,7 +59,7 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { /* * (non-Javadoc) - * + * * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, * java.lang.String) */ @@ -78,7 +78,7 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { if (TableRenderingLine.P_ADDRESS.equals(property)) { return false; } - + // property is stored as number of addressable unit away from the // line address // to calculate offset to the memory line array, offset = @@ -93,7 +93,7 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { { BigInteger address = line.getAddress().add(BigInteger.valueOf(offset)); MemoryRenderingElement mElement = new MemoryRenderingElement(fRendering, address, bytes); - return fCustomModifier.canModify(mElement, null); + return fCustomModifier.canModify(mElement, null); } for (int i = 0; i < bytes.length; i++) { @@ -120,13 +120,13 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { /* * (non-Javadoc) - * + * * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, * java.lang.String) */ @Override public Object getValue(Object element, String property) { - + // give back the value of the column if (!(element instanceof MemorySegment)) @@ -137,16 +137,16 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { if (TableRenderingLine.P_ADDRESS.equals(property)) return line.getAddress(); - int offsetToLineBuffer = Integer.valueOf(property, 16).intValue() * getAddressableSize(); + int offsetToLineBuffer = Integer.valueOf(property, 16).intValue() * getAddressableSize(); MemoryByte[] memory = line.getBytes(offsetToLineBuffer, fRendering.getBytesPerColumn()); int offsetFromLineAddress = Integer.valueOf(property, 16).intValue(); BigInteger address = line.getAddress().add(BigInteger.valueOf(offsetFromLineAddress)); - + if (fCustomModifier != null) { MemoryRenderingElement mElement = new MemoryRenderingElement(fRendering, address, memory); - return fCustomModifier.getValue(mElement, null); + return fCustomModifier.getValue(mElement, null); } // ask the rendering for a string representation of the bytes @@ -159,28 +159,28 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { /* * (non-Javadoc) - * + * * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, * java.lang.String, java.lang.Object) */ @Override public void modify(Object element, final String property, final Object value) { - + MemorySegment segment = null; if (element instanceof TableItem) { Object data = ((TableItem)element).getData(); if (data != null && data instanceof MemorySegment) segment = (MemorySegment)data; - + } else if (element instanceof MemorySegment){ segment = (MemorySegment) element; } - + if (segment == null) return; - + final MemorySegment line = segment; - + Job job = new Job("Set Values"){ //$NON-NLS-1$ @Override @@ -211,15 +211,15 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { fCustomModifier.modify(mElement, null, value); return Status.OK_STATUS; } - + if (!(value instanceof String)) { DebugUIPlugin.logErrorMessage("Cell modifier cannot handle non-string values."); //$NON-NLS-1$ return Status.OK_STATUS; } - - byte[] bytes = null; - String oldValue = (String) getValue(line, property); + + byte[] bytes = null; + String oldValue = (String) getValue(line, property); if (!oldValue.equals(value)) { bytes = fRendering.getBytes(fRendering.getRenderingId(), address, oldArray, (String) value); @@ -245,13 +245,13 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { // return if value has not changed return Status.OK_STATUS; } - + final byte[] newByteValues = bytes; - + if (memoryBlk instanceof IMemoryBlockExtension) ((IMemoryBlockExtension) memoryBlk).setValue(offsetFromMBBase, newByteValues); else - memoryBlk.setValue(offsetFromMBBase.longValue(), newByteValues); + memoryBlk.setValue(offsetFromMBBase.longValue(), newByteValues); } catch (DebugException e) { MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_failed, e); } catch (NumberFormatException e) { @@ -279,7 +279,7 @@ public class AsyncTableRenderingCellModifier implements ICellModifier { return lineAddress.subtract(memoryAddr).add(BigInteger.valueOf(lineOffset)); } - + private boolean isValueModificationSupported() { return fMBSupportsValueModification; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java index 32ea601cb..0ad7c3d07 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -37,23 +37,23 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy { @Override public void modelChanged(IModelDelta node, IModelProxy proxy) { - + // clear current cache as it becomes invalid when the memory block is changed AbstractVirtualContentTableModel model = getTableViewer().getVirtualContentModel(); - + if (model != null) { IContentChangeComputer computer = null; if (model instanceof IContentChangeComputer) computer = (IContentChangeComputer)model; - + clearCache(computer); - + if (!containsEvent()) { return; } - + if (node.getElement() instanceof IMemoryBlock && (node.getFlags() & IModelDelta.CONTENT) != 0) { if (computer != null && getTableViewer() != null) @@ -72,17 +72,17 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy notifyRendering(node, proxy); handleMemoryBlockChanged((IMemoryBlock)node.getElement(), node); return; - + } else if (node.getElement() instanceof IMemoryBlock && (node.getFlags() & IModelDelta.STATE) != 0) { // override handling of state change event // let the super class deals with the rest of the changes handleMemoryBlockChanged((IMemoryBlock)node.getElement(), node); - return; - } + return; + } } - + super.modelChanged(node, proxy); } @@ -102,7 +102,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy listener.modelChanged(node, proxy); } } - + protected void handleMemoryBlockChanged(IMemoryBlock mb, IModelDelta delta) { try { @@ -115,7 +115,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy if ((delta.getFlags() & IModelDelta.CONTENT) != 0) { TableRenderingContentDescriptor descriptor = rendering.getAdapter(TableRenderingContentDescriptor.class); - + if (descriptor != null) { final BigInteger address = getMemoryBlockBaseAddress(mb); @@ -123,7 +123,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy { descriptor.updateContentBaseAddress(); UIJob job = new UIJob("go to address"){ //$NON-NLS-1$ - + @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { @@ -154,7 +154,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy getTableViewer().handlePresentationFailure(null, e.getStatus()); } } - + private BigInteger getMemoryBlockBaseAddress(IMemoryBlock mb) throws DebugException { if (mb instanceof IMemoryBlockExtension) @@ -162,14 +162,14 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy else return BigInteger.valueOf(mb.getStartAddress()); } - + private AsyncTableRenderingViewer getTableViewer() { if (getViewer() instanceof AsyncTableRenderingViewer) return (AsyncTableRenderingViewer)getViewer(); return null; } - + private boolean containsEvent() { if (getViewer().getPresentationContext() instanceof MemoryViewPresentationContext) @@ -184,7 +184,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy } return true; } - + protected AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context) { IMemoryRendering memRendering = context.getRendering(); 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 64c70baae..8069d259b 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 @@ -62,11 +62,11 @@ import org.eclipse.ui.progress.UIJob; public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { private AbstractAsyncTableRendering fRendering; - + // selection keys private Object fPendingSelection; private Object fSelectionKey; - + // cursor and associated listeners private TableCursor fTableCursor; private KeyAdapter fCursorKeyAdapter; @@ -78,40 +78,40 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { private TableEditor fCursorEditor; private KeyAdapter fEditorKeyListener; private CellEditorListener fCellEditorListener; - + private class CellEditorListener implements ICellEditorListener { private CellEditor fEditor; private int fRow; private int fCol; - + public CellEditorListener(int row, int col, CellEditor editor) { fEditor = editor; fRow = row; fCol = col; } - + @Override public void applyEditorValue() { fEditor.removeListener(this); - modifyValue(fRow, fCol, fEditor.getValue()); + modifyValue(fRow, fCol, fEditor.getValue()); } @Override public void cancelEditor() { fEditor.removeListener(this); } - + @Override public void editorValueChanged(boolean oldValidState, boolean newValidState) { } - + public int getRow() { return fRow; } - + public int getCol() { return fCol; @@ -120,17 +120,17 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { private boolean fPendingFormatViewer; - + public AsyncTableRenderingViewer(AbstractAsyncTableRendering rendering, Composite parent, int style) { super(parent, style); fRendering = rendering; - + getTable().addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { handleTableMouseEvent(e); }}); - + createCursor(getTable()); } @@ -138,49 +138,49 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { public AbstractUpdatePolicy createUpdatePolicy() { return new AsyncTableRenderingUpdatePolicy(); } - + public AbstractAsyncTableRendering getRendering() { return fRendering; } - + private void createCursor(Table table) { fTableCursor = new TableCursor(table, SWT.NONE); - + Display display = fTableCursor.getDisplay(); - + // set up cursor color fTableCursor.setBackground(display.getSystemColor(SWT.COLOR_LIST_SELECTION)); fTableCursor.setForeground(display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT)); - + fTableCursor.setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME)); - + fCursorKeyAdapter = new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { handleCursorKeyPressed(e); - } + } }; - + fTableCursor.addKeyListener(fCursorKeyAdapter); - + fCursorTraverseListener = new TraverseListener() { @Override public void keyTraversed(TraverseEvent e) { handleCursorTraverseEvt(e); }}; - + fTableCursor.addTraverseListener(fCursorTraverseListener); - + fCursorMouseListener = new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { handleCursorMouseEvent(e); }}; fTableCursor.addMouseListener(fCursorMouseListener); - + // cursor may be disposed before disposed is called // remove listeners whenever the cursor is disposed fTableCursor.addDisposeListener(new DisposeListener() { @@ -193,7 +193,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { fTableCursor.removeMouseListener(fCursorMouseListener); fTableCursor.removeSelectionListener(fCursorSelectionListener); }}); - + fCursorSelectionListener = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -201,19 +201,19 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } }; fTableCursor.addSelectionListener(fCursorSelectionListener); - fCursorEditor = new TableEditor (getTable()); + fCursorEditor = new TableEditor (getTable()); } - + private void handleCursorKeyPressed(KeyEvent event) { if (event.character == '\r' && event.getSource() instanceof TableCursor) { activateCellEditor(null); return; - } - + } + if (MemoryViewUtil.isValidEditEvent(event.keyCode)) - { + { // activate edit as soon as user types something at the cursor if (event.getSource() instanceof TableCursor) { @@ -226,20 +226,20 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } } } - + private void handleCursorMouseEvent(MouseEvent e){ if (e.button == 1) { int col = fTableCursor.getColumn(); if (col > 0 && col <= (getNumCol())) activateCellEditor(null); - } + } } - + private void handleCursorTraverseEvt(TraverseEvent e){ if (fTableCursor.getRow() == null) return; - + Table table = (Table)fTableCursor.getParent(); int row = table.indexOf(fTableCursor.getRow()); int col = fTableCursor.getColumn(); @@ -249,7 +249,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { { return; } - + row = row +1; col = 0; fTableCursor.setSelection(row, col); @@ -260,24 +260,24 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { { return; } - + row = row - 1; col = getNumCol()+1; fTableCursor.setSelection(row, col); - } - + } + handleCursorMoved(); } - + /** * Update selected address. * Load more memory if required. */ private void handleCursorMoved() - { + { fSelectionKey = getSelectionKeyFromCursor(); fPendingSelection = null; - + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { DebugUIPlugin.trace(Thread.currentThread().getName() + " cursor moved selection is: " + ((BigInteger)fSelectionKey).toString(16)); //$NON-NLS-1$ } @@ -285,15 +285,15 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { handleScrollBarSelection(); fireSelectionChanged(fSelectionKey); } - + private int getNumCol() { - + int bytesPerLine = fRendering.getBytesPerLine(); int columnSize = fRendering.getBytesPerColumn(); - + return bytesPerLine/columnSize; } - + /** * Sets the cursor at the specified address * @param key selection key @@ -303,32 +303,32 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { fPendingSelection = key; attemptSetKeySelection(); } - + public Object getSelectionKey() { return fSelectionKey; } - + private synchronized void attemptSetKeySelection() { if (fPendingSelection != null) { doAttemptSetKeySelection(fPendingSelection); } - + } - + synchronized private Object doAttemptSetKeySelection(final Object key) - { + { if (getBufferTopKey() == null || getBufferEndKey() == null) return key; - + // calculate selected row address int[] location = getCoordinatesFromKey(key); if(location.length == 0) { return key; } - + UIJob uiJob = new UIJob("Set Cursor Selection"){ //$NON-NLS-1$ @Override @@ -339,10 +339,10 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } if (fPendingSelection != null && fPendingSelection != key) return Status.OK_STATUS; - + if (fTableCursor.isDisposed()) return Status.OK_STATUS; - + // by the time this is called, the location may not be valid anymore int[] newLocation = getCoordinatesFromKey(key); if (newLocation.length == 0) @@ -351,28 +351,28 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { fPendingSelection = selectionKey; return Status.OK_STATUS; } - + fSelectionKey = key; fPendingSelection = null; - + 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]); showTableCursor(true); - + // show the column for the selection getTable().showColumn(getTable().getColumn(newLocation[1])); - + int topIndex = getTable().getTopIndex(); Object topKey = getVirtualContentModel().getKey(topIndex); setTopIndexKey(topKey); - - + + } catch (RuntimeException e) { - + // by the time this is called, the selection may no longer // get the latest selection and try to set selection again Object selectionKey = getSelectionKey(); @@ -381,15 +381,15 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } return Status.OK_STATUS; }}; - + uiJob.setSystem(true); uiJob.schedule(); - + return null; } - + /** - * + * * @param key the element * @return the coordinates of the key * Element[0] is the row index @@ -398,44 +398,44 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { private int[] getCoordinatesFromKey(Object key) { final int row = indexOf(key); - + if (row == -1) { return new int[0]; } - + Object element = getVirtualContentModel().getElement(row); final int col = columnOf(element, key); - + if (col == -1) { return new int[0]; } return new int[]{row, col}; } - + private Object getSelectionKeyFromCursor() - { - int idx = getTable().indexOf(fTableCursor.getRow()); + { + int idx = getTable().indexOf(fTableCursor.getRow()); int col = fTableCursor.getColumn(); - + return getVirtualContentModel().getKey(idx, col); } - + private Object getBufferTopKey() { return getKey(0); } - + private Object getBufferEndKey() { AbstractVirtualContentTableModel model = getVirtualContentModel(); - + if (model != null) return getKey(model.getElements().length-1); return null; } - + public int indexOf(Object key) { int idx = -1; @@ -444,7 +444,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { idx = model.indexOfKey(key); return idx; } - + private int columnOf(Object element, Object key) { int idx = -1; @@ -455,7 +455,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } return idx; } - + public Object getKey(int index) { AbstractVirtualContentTableModel model = getVirtualContentModel(); @@ -466,20 +466,20 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } return null; } - + public Object getKey(int row, int col) - { + { AbstractVirtualContentTableModel model = getVirtualContentModel(); if (model != null) return model.getKey(row, col); return null; } - - + + @Override protected synchronized void preservingSelection(Runnable updateCode) { Object oldTopIndexKey = null; - + if (getPendingSetTopIndexKey() == null) { // preserve selection oldTopIndexKey = getTopIndexKey(); @@ -504,22 +504,22 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { oldSelectionKey = fPendingSelection; else oldSelectionKey = getSelectionKey(); - + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { if (oldTopIndexKey != null) { DebugUIPlugin.trace(getRendering() + " preserve selection: " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$ } - else { + else { DebugUIPlugin.trace("selection key is null, nothing to preserve"); //$NON-NLS-1$ } } - + // perform the update updateCode.run(); - + } finally { - + if (oldSelectionKey != null) { if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { @@ -527,7 +527,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } setSelection(oldSelectionKey); } - + if (getPendingSetTopIndexKey() != null) { if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { @@ -540,37 +540,37 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { else if (oldTopIndexKey != null) { setTopIndex(oldTopIndexKey); - + if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) { DebugUIPlugin.trace(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$ } } } } - + @Override public void dispose() { super.dispose(); - + if (fTableCursor != null && !fTableCursor.isDisposed()) { fCursorEditor.dispose(); fCursorEditor = null; - + fTableCursor.removeTraverseListener(fCursorTraverseListener); fTableCursor.removeKeyListener(fCursorKeyAdapter); fTableCursor.removeMouseListener(fCursorMouseListener); fTableCursor.removeSelectionListener(fCursorSelectionListener); - + fTableCursor.dispose(); fTableCursor = null; } } - + public void showTableCursor(final boolean show) { - + Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay(); if (Thread.currentThread() == display.getThread()) { @@ -583,7 +583,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { else { UIJob job = new UIJob("show table cursor"){ //$NON-NLS-1$ - + @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (!fTableCursor.isDisposed()) @@ -593,7 +593,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } return Status.OK_STATUS; }}; - + job.setSystem(true); job.schedule(); } @@ -605,7 +605,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { TableItem selectedRow = null; int colNum = -1; int numCol = getColumnProperties().length; - + for (int j=0; j= 0) break; } - + // if column position cannot be determined, return if (colNum < 1) return; - + // handle user mouse click onto table // move cursor to new position if (selectedRow != null) @@ -637,13 +637,13 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { int row = getTable().indexOf(selectedRow); showTableCursor(true); fTableCursor.setSelection(row, colNum); - + // manually call this since we don't get an event when // the table cursor changes selection. handleCursorMoved(); - + fTableCursor.setFocus(); - } + } } /** @@ -716,7 +716,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { // add listeners for the editor control addListeners(control); - + fCellEditorListener = new CellEditorListener(row, col, editor); editor.addListener(fCellEditorListener); @@ -725,19 +725,19 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } } } - + private void deactivateEditor(CellEditor editor) { removeListeners(editor.getControl()); fTableCursor.moveAbove(editor.getControl()); fTableCursor.setFocus(); } - + /* * @param editor */ private void addListeners(Control control) { - + fEditorKeyListener = new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { @@ -747,12 +747,12 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { control.addKeyListener(fEditorKeyListener); } - + /** * @param event the key event */ private void handleKeyEventInEditor(KeyEvent event) { - + final KeyEvent e = event; Display.getDefault().asyncExec(new Runnable() { @@ -765,17 +765,17 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { Control control = (Control)obj; int row = fCellEditorListener.getRow(); int col = fCellEditorListener.getCol(); - + try { switch (e.keyCode) { case 0: doHandleKeyEvent(row, col); - break; + break; case SWT.ESC: cancelEditing(row, col); - break; + break; default : doHandleKeyEvent(row, col); break; @@ -783,36 +783,36 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } catch (NumberFormatException e1) { - MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, + MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null); - + fTableCursor.setSelection(row, col); handleCursorMoved(); - + removeListeners(control); } } } }); } - + private void doHandleKeyEvent(int row, int col) { int numCharsPerByte = fRendering.getNumCharsPerByte(); if (numCharsPerByte > 0) - { + { Object value = getCellEditors()[col].getValue(); if (getCellEditors()[col] instanceof TextCellEditor && value instanceof String) { String str = (String)value; - + if (str.length() > fRendering.getBytesPerColumn()*numCharsPerByte) - { + { String newValue = str; - + CellEditor editor = getCellEditors()[col]; editor.setValue(newValue.substring(0,fRendering.getBytesPerColumn()* numCharsPerByte)); - + // We want to call modify value here to avoid race condition. // Relying on the editor event to modify the cell may introduce a race condition since // we try to activate another cell editor in this method. If we happen to use same cell @@ -820,9 +820,9 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { // We may write the wrong value in that case. Calling modify here allows us to capture the value // now and send that to the model. fCellEditorListener.cancelEditor(); - deactivateEditor(editor); + deactivateEditor(editor); modifyValue(fCellEditorListener.getRow(), fCellEditorListener.getCol(), editor.getValue()); - + // if cursor is at the end of a line, move to next line if (col >= getNumCol()) { @@ -833,38 +833,38 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { { col++; } - - fTableCursor.setSelection(row, col); + + fTableCursor.setSelection(row, col); handleCursorMoved(); - + activateCellEditor(newValue.substring(fRendering.getBytesPerColumn()*numCharsPerByte)); } } } } - + private void cancelEditing(int row, int col) { // if user has pressed escape, do not commit the changes // remove listener to avoid getting notified on the modify value fCellEditorListener.cancelEditor(); deactivateEditor(getCellEditors()[col]); - + fTableCursor.setSelection(row, col); handleCursorMoved(); - + // cursor needs to have focus to remove focus from cell editor - fTableCursor.setFocus(); + fTableCursor.setFocus(); } - + /** * @param control the control to remove the default key listener from */ private void removeListeners(Control control) { - + control.removeKeyListener(fEditorKeyListener); } - + /** * Modify value and send new value to debug adapter * @param row the row @@ -873,27 +873,27 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { * @throws NumberFormatException if trying to set a number value fails */ private void modifyValue(int row, int col, Object newValue) throws NumberFormatException - { + { if (newValue instanceof String && ((String)newValue).length() == 0) - { + { // do not do anything if user has not entered anything return; } - + if (row >= 0 && row < getTable().getItemCount()) { TableItem tableItem = getTable().getItem(row); - + Object property = getColumnProperties()[col]; getCellModifier().modify(tableItem, (String)property, newValue); } } - + public TableCursor getCursor() { return fTableCursor; } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ContentViewer#getLabelProvider() * Implemented minimum to work with PrintTableRendering action. @@ -913,7 +913,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { public String getColumnText(Object element, int columnIndex) { int idx = getVirtualContentModel().indexOfElement(element); if (idx >= 0 ) - { + { TableItem item = getTable().getItem(idx); return item.getText(columnIndex); } @@ -937,19 +937,19 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { public void removeListener(ILabelProviderListener listener) { }}; } - + public void formatViewer() { if (getModel() == null || !hasPendingUpdates()) doFormatViewer(); - else + else // do not format in the middle of an update // set pending update and will format when update is completed fPendingFormatViewer = true; } /** - * + * */ private void doFormatViewer() { fPendingFormatViewer = false; @@ -966,7 +966,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { } }}); } - + private void fireSelectionChanged(Object selectionKey) { if (selectionKey != null) @@ -980,7 +980,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { public void handlePresentationFailure(IStatusMonitor monitor, IStatus status) { super.handlePresentationFailure(monitor, status); } - + @Override public void refresh(boolean getContent) { @@ -1002,10 +1002,10 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { }}); } } - + @Override protected void tableTopIndexSetComplete() { - + if (!fTableCursor.isDisposed()) { // TODO: work around swt bug, must force a table cursor redraw after top index is changed @@ -1025,7 +1025,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { public AsynchronousModel getModel() { return super.getModel(); } - + // TODO: need pluggable model to be truly flexible @Override protected AbstractVirtualContentTableModel createVirtualContentTableModel() { @@ -1035,12 +1035,12 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { @Override protected void updateComplete(IStatusMonitor monitor) { super.updateComplete(monitor); - + if (!hasPendingUpdates() && !fTableCursor.isDisposed()) { attemptSetKeySelection(); fTableCursor.redraw(); - + // if the viewer has pending top index, then more updates will come in // and the cursor should not be redrawn yet. if (!hasPendingSetTopIndex()) @@ -1058,7 +1058,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { }}); } } - + if (!hasPendingUpdates() && fPendingFormatViewer) { formatViewer(); @@ -1069,7 +1069,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer { @Override protected void clear(Widget item) { super.clear(item); - + // this table viewer assumes that #getData will return null // set data to null when clearing an item. // only visible item will get SET DATA event again and at that time diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java index 8c16264b0..18b1aa5dd 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,7 +20,7 @@ import org.eclipse.swt.widgets.Control; /** * @since 3.0 - * + * */ public abstract class BasicDebugViewContentProvider implements IStructuredContentProvider, IDebugEventSetListener { @@ -34,7 +34,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten public void dispose() { fDisposed= true; } - + /** * Returns whether this content provider has already * been disposed. @@ -43,7 +43,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten protected boolean isDisposed() { return fDisposed; } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ @@ -60,7 +60,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten } } } - + protected void syncExec(Runnable r) { if (fViewer != null) { Control ctrl= fViewer.getControl(); @@ -69,7 +69,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten } } } - + /** * Refreshes the viewer - must be called in UI thread. */ @@ -78,7 +78,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten fViewer.refresh(); } } - + /** * Refresh the given element in the viewer - must be called in UI thread. * @param element the element to refresh in the viewer @@ -88,7 +88,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten fViewer.refresh(element); } } - + /** * Handle debug events on the main thread. * @param event the debug event @@ -109,7 +109,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten } } }; - + asyncExec(r); } @@ -121,7 +121,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten for (int i=0; i < events.length; i++) handleDebugEvent(events[i]); } - + /** * Performs an update based on the event * @param event the debug event diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java index 77e707a87..09e3fce9f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -23,7 +23,7 @@ import org.eclipse.ui.IWorkbenchPart; public class BigEndianAction implements IObjectActionDelegate { AbstractIntegerRendering fRendering; - + /* (non-Javadoc) * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) */ @@ -39,7 +39,7 @@ public class BigEndianAction implements IObjectActionDelegate { if (fRendering == null) return; - + if (fRendering.getDisplayEndianess() != RenderingsUtil.BIG_ENDIAN){ fRendering.setDisplayEndianess(RenderingsUtil.BIG_ENDIAN); fRendering.refresh(); @@ -51,21 +51,21 @@ public class BigEndianAction implements IObjectActionDelegate { */ @Override public void selectionChanged(IAction action, ISelection selection) { - + if (selection == null) return; - + if (selection instanceof IStructuredSelection) { Object obj = ((IStructuredSelection)selection).getFirstElement(); if (obj == null) return; - + if (obj instanceof AbstractIntegerRendering) { fRendering = (AbstractIntegerRendering)obj; } - + int endianess = RenderingsUtil.ENDIANESS_UNKNOWN; if (fRendering.getDisplayEndianess() == RenderingsUtil.ENDIANESS_UNKNOWN) { @@ -94,7 +94,7 @@ public class BigEndianAction implements IObjectActionDelegate { } else endianess = fRendering.getDisplayEndianess(); - + if (endianess == RenderingsUtil.BIG_ENDIAN) action.setChecked(true); else diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java index 7c3b7fc94..e0ddb885b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java @@ -34,16 +34,16 @@ import org.eclipse.ui.PlatformUI; /** * Toobar Copy View Tab to Clipboard action - * + * * @since 3.0 */ public class CopyTableRenderingToClipboardAction extends Action { private final String COLUMN_SEPERATOR = " "; //$NON-NLS-1$ - + protected AbstractBaseTableRendering fRendering; protected StructuredViewer fViewer; - + public CopyTableRenderingToClipboardAction(AbstractBaseTableRendering rendering, StructuredViewer viewer) { super(); @@ -61,31 +61,31 @@ public class CopyTableRenderingToClipboardAction extends Action if (itemList.length == 0) return null; StringBuffer tableContents = new StringBuffer(); - + Table table = (Table)fViewer.getControl(); int numColumns = table.getColumnCount(); - ITableLabelProvider labelProvider = (ITableLabelProvider)fViewer.getLabelProvider(); + ITableLabelProvider labelProvider = (ITableLabelProvider)fViewer.getLabelProvider(); TableColumn columns[] = table.getColumns(); - + // get title of view tab String label = fRendering.getLabel(); tableContents.append(label); tableContents.append(System.getProperty("line.separator")); //$NON-NLS-1$ tableContents.append(COLUMN_SEPERATOR); - + int charsPerByte = fRendering.getNumCharsPerByte(); if (charsPerByte < 0) charsPerByte = 4; - + //get the column headers and line them up properly for (int k=0; k < numColumns; k++) { - + StringBuffer columnLabel = new StringBuffer(columns[k].getText()); int numBytes = 0; int numChars = 0; - + if (k > 0) - { + { numBytes = fRendering.getBytesPerColumn(); numChars = numBytes * charsPerByte; } @@ -106,7 +106,7 @@ public class CopyTableRenderingToClipboardAction extends Action } else numBytes = descriptor.getAddressSize(); - + // check address size if (numBytes <= 0) numBytes = 4; @@ -116,30 +116,30 @@ public class CopyTableRenderingToClipboardAction extends Action numBytes = 4; } numChars = numBytes*2; - + } - + while (columnLabel.length() < numChars) { columnLabel.append(" "); //$NON-NLS-1$ } - - tableContents.append(columnLabel); + + tableContents.append(columnLabel); tableContents.append(COLUMN_SEPERATOR); } - + tableContents.append(System.getProperty("line.separator")); //$NON-NLS-1$ StringBuffer temp; - + //get the column contents from all the rows for (int i=0; i < itemList.length; i++) { for (int j=0; j < numColumns; j++) { tableContents.append(COLUMN_SEPERATOR); - + temp = new StringBuffer(labelProvider.getColumnText(itemList[i].getData(), j)); - + if (j>0) - { + { int numBytes = fRendering.getBytesPerColumn(); int numChars = numBytes * charsPerByte; while (temp.length() < numChars) @@ -147,28 +147,28 @@ public class CopyTableRenderingToClipboardAction extends Action temp.append(" "); //$NON-NLS-1$ } } - + tableContents.append(temp); } tableContents.append(System.getProperty("line.separator")); //$NON-NLS-1$ } return tableContents.toString(); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IAction#run() */ @Override public void run() { - + if (fRendering == null) return; - + if (! (fViewer.getControl() instanceof Table)) return; - + Table table = (Table)fViewer.getControl(); - + if (table == null) return; Clipboard clip= null; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java index afedc2b75..666ebf3c3 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java @@ -4,11 +4,11 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation - * WindRiver - Bug 192028 [Memory View] Memory view does not - * display memory blocks that do not reference IDebugTarget + * WindRiver - Bug 192028 [Memory View] Memory view does not + * display memory blocks that do not reference IDebugTarget * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432) *******************************************************************************/ package org.eclipse.debug.internal.ui.views.memory.renderings; @@ -65,12 +65,12 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR private ListViewer fViewer; private Label fMemoryBlockLabel; - private IMemoryRenderingContainer fContainer; + private IMemoryRenderingContainer fContainer; private Composite fCanvas; private String fLabel; - + private String fTabLabel; - + public CreateRendering(IMemoryRenderingContainer container) { super("org.eclipse.debug.internal.ui.views.createrendering"); //$NON-NLS-1$ @@ -79,7 +79,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR class MemoryRenderingLabelProvider implements ILabelProvider { - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) */ @@ -95,7 +95,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR @Override public String getText(Object element) { if (element instanceof IMemoryRenderingType) - { + { String label = ((IMemoryRenderingType)element).getLabel(); return label; } @@ -132,7 +132,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR } } - + class MemoryRenderingContentProvider implements IStructuredContentProvider { @@ -150,7 +150,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR */ @Override public void dispose() { - + } /* (non-Javadoc) @@ -159,9 +159,9 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } - + } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite) */ @@ -172,54 +172,54 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR compositeLayout.numColumns = 2; compositeLayout.makeColumnsEqualWidth = false; fCanvas.setLayout(compositeLayout); - + GridData comositeSpec= new GridData(); comositeSpec.grabExcessVerticalSpace= true; comositeSpec.grabExcessHorizontalSpace= true; comositeSpec.horizontalAlignment= GridData.FILL; comositeSpec.verticalAlignment= GridData.CENTER; fCanvas.setLayoutData(comositeSpec); - + fMemoryBlockLabel = new Label(fCanvas, SWT.BORDER); - + String memoryBlockLabel = " "; //$NON-NLS-1$ memoryBlockLabel = getLabel(); - - fMemoryBlockLabel.setText(" " + DebugUIMessages.CreateRenderingTab_Memory_monitor + memoryBlockLabel + " "); //$NON-NLS-1$ //$NON-NLS-2$ + + fMemoryBlockLabel.setText(" " + DebugUIMessages.CreateRenderingTab_Memory_monitor + memoryBlockLabel + " "); //$NON-NLS-1$ //$NON-NLS-2$ GridData textLayout = new GridData(); textLayout.verticalAlignment=GridData.CENTER; textLayout.horizontalAlignment=GridData.BEGINNING; fMemoryBlockLabel.setLayoutData(textLayout); Label renderingLabel = new Label(fCanvas, SWT.NONE); - renderingLabel.setText(DebugUIMessages.CreateRenderingTab_Select_renderings_to_create); + renderingLabel.setText(DebugUIMessages.CreateRenderingTab_Select_renderings_to_create); GridData renderingLayout = new GridData(); renderingLayout.horizontalAlignment = GridData.BEGINNING; renderingLayout.verticalAlignment = GridData.CENTER; renderingLayout.horizontalSpan = 2; renderingLabel.setLayoutData(renderingLayout); - + fViewer = new ListViewer(fCanvas); fViewer.setContentProvider(new MemoryRenderingContentProvider()); fViewer.setLabelProvider(new MemoryRenderingLabelProvider()); fViewer.setInput(getMemoryBlock()); - + if (fViewer.getElementAt(0) != null) { fViewer.getList().select(0); } - + GridData listLayout = new GridData(GridData.FILL_BOTH); listLayout.horizontalSpan = 1; fViewer.getControl().setLayoutData(listLayout); - + fViewer.addDoubleClickListener(new IDoubleClickListener (){ @Override public void doubleClick(DoubleClickEvent event) { addRenderings(); }}); - + // listen for enter being pressed fViewer.getList().addKeyListener(new KeyAdapter() { @Override @@ -227,14 +227,14 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR if (e.character == SWT.CR) addRenderings(); }}); - + Button addButton = new Button(fCanvas, SWT.NONE); - addButton.setText(DebugUIMessages.CreateRenderingTab_Add_renderings); + addButton.setText(DebugUIMessages.CreateRenderingTab_Add_renderings); GridData buttonLayout = new GridData(); buttonLayout.horizontalAlignment = GridData.BEGINNING; buttonLayout.verticalAlignment = GridData.BEGINNING; addButton.setLayoutData(buttonLayout); - + addButton.addSelectionListener(new SelectionListener() { @Override @@ -246,44 +246,44 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR public void widgetDefaultSelected(SelectionEvent e) { addRenderings(); }}); - + DebugUITools.getMemoryRenderingManager().addListener(this); - - return fCanvas; + + return fCanvas; } - + private void addRenderings() - { + { ISelection selection = fViewer.getSelection(); Object[] renderings = null; - + if (selection instanceof IStructuredSelection) { IStructuredSelection strucSelection = (IStructuredSelection)selection; - + renderings = strucSelection.toArray(); } - + if (renderings == null) { Status stat = new Status( IStatus.ERROR,DebugUIPlugin.getUniqueIdentifier(), - DebugException.INTERNAL_ERROR, DebugUIMessages.CreateRenderingTab_0, null); - DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIMessages.CreateRenderingTab_1, DebugUIMessages.CreateRenderingTab_2, stat); // + DebugException.INTERNAL_ERROR, DebugUIMessages.CreateRenderingTab_0, null); + DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIMessages.CreateRenderingTab_1, DebugUIMessages.CreateRenderingTab_2, stat); // return; } - + // ask for debug target and memory block retrieval IMemoryBlockRetrieval standardMemRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(getMemoryBlock()); - + if (standardMemRetrieval == null) return; - + // make a copy of the container, may be diposed when a rendering is added IMemoryRenderingContainer container = fContainer; // add memory renderings to Memory Rendering Manager for (int i=0; i rowSize) { errorMsg.append("\n"); //$NON-NLS-1$ errorMsg.append(DebugUIMessages.FormatTableRenderingAction_13); } - + label.setText(errorMsg.toString()); - + return label; } - + Table table = new Table(parent, SWT.BORDER); table.setHeaderVisible(true); - + int numCol = rowSize/colSize; - + TableColumn addressCol = new TableColumn(table, SWT.NONE); - + TableColumn[] columns = new TableColumn[numCol]; for (int i=0; i rowSize) return false; - + return true; } private void refreshPreviewPage() { fPreivewPage.dispose(); - + int rowSize = fRowSizes[fRowControl.getSelectionIndex()]; int colSize = fColumnSizes[fColumnControl.getSelectionIndex()]; fPreivewPage = createPreviewPage(fPreviewPageBook, rowSize, colSize); @@ -387,8 +387,8 @@ public class FormatTableRenderingDialog extends TrayDialog { button.setEnabled(false); fDefaultButton.setEnabled(false); - - + + } else { @@ -406,7 +406,7 @@ public class FormatTableRenderingDialog extends TrayDialog String colPrefId = IDebugPreferenceConstants.PREF_COLUMN_SIZE + ":" + modelId; //$NON-NLS-1$ return colPrefId; } - + private int getDefaultRowSize() { int size = -1; @@ -416,12 +416,12 @@ public class FormatTableRenderingDialog extends TrayDialog if (elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL)) return getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL); } - + size = getDefaultRowSize(fRendering.getMemoryBlock().getModelIdentifier()); - + return size; } - + private int getDefaultColumnSize() { int size = -1; @@ -435,7 +435,7 @@ public class FormatTableRenderingDialog extends TrayDialog size = getDefaultColumnSize(fRendering.getMemoryBlock().getModelIdentifier()); return size; } - + private int getDefaultRowSize(String modelId) { int row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId)); @@ -444,11 +444,11 @@ public class FormatTableRenderingDialog extends TrayDialog DebugUITools.getPreferenceStore().setValue(getRowPrefId(modelId), IDebugPreferenceConstants.PREF_ROW_SIZE_DEFAULT); row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId)); } - + return row; - + } - + private int getDefaultColumnSize(String modelId) { int col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId)); @@ -464,9 +464,9 @@ public class FormatTableRenderingDialog extends TrayDialog private void saveDefaults() { int columnSize = fColumnSizes[fColumnControl.getSelectionIndex()]; int rowSize = fRowSizes[fRowControl.getSelectionIndex()]; - + IPersistableDebugElement elmt = fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class); - + if (elmt != null && elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL) && elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL)) { @@ -482,37 +482,37 @@ public class FormatTableRenderingDialog extends TrayDialog // save preference // find model id String modelId = fRendering.getMemoryBlock().getModelIdentifier(); - + // constrcut preference id String rowPrefId = getRowPrefId(modelId); String colPrefId = getColumnPrefId(modelId); - + // save setting IPreferenceStore prefStore = DebugUITools.getPreferenceStore(); prefStore.setValue(rowPrefId, rowSize); prefStore.setValue(colPrefId, columnSize); } - + fDefaultColValue.setText(String.valueOf(getDefaultColumnSize())); fDefaultRowValue.setText(String.valueOf(getDefaultRowSize())); - + fDefaultRowValue.getParent().layout(); } private void restoreDefaults() { - // Determine the default values by using the following search order: + // Determine the default values by using the following search order: // IPersistableDebugElement, workspace preference, plugin defaults - // issue: 248486 + // issue: 248486 int defaultRowSize = getDefaultRowSize(); int defaultColSize = getDefaultColumnSize(); - + populateControl(defaultRowSize, fRowSizes, fRowControl); populateControl(defaultColSize, fColumnSizes, fColumnControl); - + fCurrentRowIdx = fRowControl.getSelectionIndex(); fCurrentColIdx = fColumnControl.getSelectionIndex(); - + refreshPreviewPage(); updateButtons(); } @@ -524,7 +524,7 @@ public class FormatTableRenderingDialog extends TrayDialog public int getRowSize() { return fRowSize; } - + public void setCurrentRowColSizes(int row, int col) { fCurrentColIdx = populateControl(col, fColumnSizes, fColumnControl); @@ -539,14 +539,14 @@ public class FormatTableRenderingDialog extends TrayDialog updateButtons(); return ret; } - + public void openError(String msg) { fDisableCancel = true; fMsg = msg; open(); } - + private int getDefaultFromPersistableElement(String propertyId) { int defaultValue = -1; IPersistableDebugElement elmt = fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class); @@ -559,7 +559,7 @@ public class FormatTableRenderingDialog extends TrayDialog IStatus status = DebugUIPlugin.newErrorStatus("Model returned invalid type on " + propertyId, null); //$NON-NLS-1$ DebugUIPlugin.log(status); } - + if (valueMB != null) { Integer value = (Integer)valueMB; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java index bfa245303..0380b37fc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java @@ -39,22 +39,22 @@ import org.eclipse.ui.PlatformUI; /** * Go To Address Action for table rendering - * + * * @since 3.0 */ public class GoToAddressAction extends Action { private IMemoryRenderingContainer fContainer; private IRepositionableMemoryRendering fRendering; - + public GoToAddressAction(IMemoryRenderingContainer container, IRepositionableMemoryRendering rendering) - { + { super(DebugUIMessages.GoToAddressAction_title); fContainer = container; setToolTipText(DebugUIMessages.GoToAddressAction_title); - + fRendering = rendering; - + PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".GoToAddressAction_context"); //$NON-NLS-1$ } /* (non-Javadoc) @@ -64,36 +64,36 @@ public class GoToAddressAction extends Action public void run() { try - { + { Shell shell= DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(); - + // create dialog to ask for expression/address to block GoToAddressDialog dialog = new GoToAddressDialog(shell); dialog.open(); - + int returnCode = dialog.getReturnCode(); - + if (returnCode == Window.CANCEL) { return; } - + // get expression from dialog String expression = dialog.getExpression(); - + expression = parseExpression(expression); - + doGoToAddress(expression); } // open error in case of any error catch (DebugException e) { - MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, + MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, DebugUIMessages.GoToAddressAction_Go_to_address_failed, e); } catch (NumberFormatException e1) { - MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, + MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, DebugUIMessages.GoToAddressAction_Address_is_invalid, null); } } @@ -104,7 +104,7 @@ public class GoToAddressAction extends Action public String parseExpression(String expression) { expression = expression.toUpperCase(); expression = expression.trim(); - + if (expression.startsWith("0X")) //$NON-NLS-1$ { expression = expression.substring(2); @@ -118,7 +118,7 @@ public class GoToAddressAction extends Action public void doGoToAddress(String expression) throws DebugException, NumberFormatException { // convert expression to address BigInteger address = new BigInteger(expression, 16); - + // look at this address and figure out if a new memory block should // be opened. IMemoryBlock mb = fRendering.getMemoryBlock(); @@ -127,15 +127,15 @@ public class GoToAddressAction extends Action IMemoryBlockExtension mbExt = (IMemoryBlockExtension)mb; BigInteger mbStart = mbExt.getMemoryBlockStartAddress(); BigInteger mbEnd = mbExt.getMemoryBlockEndAddress(); - + if (mbStart != null) { // if trying to go beyond the start address // of the memory block if (address.compareTo(mbStart) < 0) { - IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(mbExt); - + IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(mbExt); + // add a new memory block and then the same rendering as fRendering // in the same container. if (retrieval != null && retrieval instanceof IMemoryBlockRetrievalExtension) @@ -152,7 +152,7 @@ public class GoToAddressAction extends Action if (address.compareTo(mbEnd) > 0) { IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(mbExt); - + // add a new memory block and then the same rendering as fRendering // in the same container. if (retrieval != null && retrieval instanceof IMemoryBlockRetrievalExtension) @@ -163,34 +163,34 @@ public class GoToAddressAction extends Action } } } - + // go to specified address fRendering.goToAddress(address); } - + private void addNewMemoryBlock(String expression, IMemoryBlockRetrievalExtension retrieval) { Object elem = DebugUITools.getPartDebugContext(fContainer.getMemoryRenderingSite().getSite()); - + if (!(elem instanceof IDebugElement)) return; - + try { if (retrieval != null) - { + { IMemoryBlockExtension mbext = retrieval.getExtendedMemoryBlock(expression, elem); if (mbext != null) { IMemoryBlock[] memArray = new IMemoryBlock[]{mbext}; DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks(memArray); } - + IMemoryRenderingType renderingType = DebugUITools.getMemoryRenderingManager().getRenderingType(fRendering.getRenderingId()); - + if (renderingType != null) { IMemoryRendering rendering = renderingType.createRendering(); - + if (rendering != null && fRendering instanceof AbstractMemoryRendering) { rendering.init(((AbstractMemoryRendering)fRendering).getMemoryRenderingContainer(), mbext); @@ -199,11 +199,11 @@ public class GoToAddressAction extends Action } } } catch (DebugException e) { - MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, + MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, DebugUIMessages.GoToAddressAction_Go_to_address_failed, e); } catch (CoreException e) { - MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, + MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, DebugUIMessages.GoToAddressAction_Go_to_address_failed, e); } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java index 2fd4ef732..29ca117d9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -26,7 +26,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; public class GoToAddressComposite { - + private Text fExpression; private Button fOKButton; private Button fCancelButton; @@ -48,7 +48,7 @@ public class GoToAddressComposite { layout.marginHeight = 0; layout.marginLeft = 0; fComposite.setLayout(layout); - + fGoToCombo = new Combo(fComposite, SWT.READ_ONLY); fGoToCombo.add(DebugUIMessages.GoToAddressComposite_0); fGoToCombo.add(DebugUIMessages.GoToAddressComposite_4); @@ -57,26 +57,26 @@ public class GoToAddressComposite { fExpression = new Text(fComposite, SWT.SINGLE | SWT.BORDER); fExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - + fHexButton = new Button(fComposite, SWT.CHECK); fHexButton.setText(DebugUIMessages.GoToAddressComposite_6); fHexButton.setSelection(true); - + fOKButton = new Button(fComposite, SWT.NONE); fOKButton.setText(DebugUIMessages.GoToAddressComposite_1); - + fCancelButton = new Button(fComposite, SWT.NONE); fCancelButton.setText(DebugUIMessages.GoToAddressComposite_2); - + return fComposite; } - + public int getHeight() { int height = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; return height; } - + public Button getButton(int id) { if (id == IDialogConstants.OK_ID) @@ -85,46 +85,46 @@ public class GoToAddressComposite { return fCancelButton; return null; } - + public String getExpressionText() { return fExpression.getText(); } - + public Text getExpressionWidget() { return fExpression; } - + public boolean isGoToAddress() { return fGoToCombo.getSelectionIndex() == 0; } - + public boolean isOffset() { return fGoToCombo.getSelectionIndex() == 1; } - + public boolean isJump() { return fGoToCombo.getSelectionIndex() == 2; } - + public boolean isHex() { return fHexButton.getSelection(); } - + public BigInteger getGoToAddress(BigInteger baseAddress, BigInteger selectedAddress) throws NumberFormatException { boolean add = true; String expression = getExpressionText(); boolean hex = isHex(); int radix = hex?16:10; - + expression = expression.trim(); - + if (isGoToAddress()) { expression = expression.toUpperCase(); @@ -133,7 +133,7 @@ public class GoToAddressComposite { expression = expression.substring(2); radix = 16; } - + return new BigInteger(expression, radix); } @@ -146,15 +146,15 @@ public class GoToAddressComposite { expression = expression.substring(1); add = false; } - + expression = expression.toUpperCase(); if (expression.startsWith("0X")) //$NON-NLS-1$ { expression = expression.substring(2); radix = 16; } - - BigInteger gotoAddress = new BigInteger(expression, radix); + + BigInteger gotoAddress = new BigInteger(expression, radix); BigInteger address = baseAddress; if (isJump()) @@ -162,12 +162,12 @@ public class GoToAddressComposite { if (address == null) throw new NumberFormatException(DebugUIMessages.GoToAddressComposite_7); - + if (add) gotoAddress = address.add(gotoAddress); else gotoAddress = address.subtract(gotoAddress); - + return gotoAddress; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java index fa2c7b7de..ba9500d6e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java @@ -21,7 +21,7 @@ import org.eclipse.debug.ui.IDebugUIConstants; * @since 3.3 */ public class HexIntegerRendering extends AbstractIntegerRendering { - + public HexIntegerRendering(String renderingId) { super(renderingId); @@ -37,7 +37,7 @@ public class HexIntegerRendering extends AbstractIntegerRendering { int endianess = getEndianness(data); String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); - + if (endianess == RenderingsUtil.LITTLE_ENDIAN) { MemoryByte[] swapped = new MemoryByte[data.length]; for (int i = 0; i < data.length; i++){ @@ -45,7 +45,7 @@ public class HexIntegerRendering extends AbstractIntegerRendering { } data = swapped; } - + for (int i=0; i= 0) return true; return false; } - + public BigInteger getEndAddress() { if (fEndAddress == null) @@ -58,7 +58,7 @@ public class MemorySegment extends PlatformObject { } return fEndAddress; } - + /** * @param start - zero-based start offset * @param length - number of bytes to get @@ -68,17 +68,17 @@ public class MemorySegment extends PlatformObject { { if (start < 0) return new MemoryByte[0]; - + if (start + length > fBytes.length) return new MemoryByte[0]; - + ArrayList ret = new ArrayList(); - + for (int i=start; i< start+length; i++) { ret.add(fBytes[i]); } return ret.toArray(new MemoryByte[ret.size()]); } - + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java index ce3b06406..9266c03a8 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -65,15 +65,15 @@ public class PendingPropertyChanges public void setTopVisibleAddress(BigInteger topVisibleAddress) { fTopVisibleAddress = topVisibleAddress; } - + public void setPageSize(int pageSize) { fPageSize = pageSize; } - + public int getPageSize() { return fPageSize; } - + } \ No newline at end of file diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java index ef3f1e9a6..7b9ee2400 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java @@ -34,16 +34,16 @@ import org.eclipse.ui.PlatformUI; /** * Print view tab toolbar action - * + * * @since 3.0 */ public class PrintTableRenderingAction extends Action { private AbstractBaseTableRendering fRendering; private StructuredViewer fViewer; - + private static final String COLUMN_SEPERATOR = " "; //$NON-NLS-1$ - + public PrintTableRenderingAction(AbstractBaseTableRendering rendering, StructuredViewer viewer) { super(DebugUIMessages.PrintViewTabAction_title); @@ -62,16 +62,16 @@ public class PrintTableRenderingAction extends Action * and endPage() and endJob() must be called after printTable(...). */ protected void printTable(TableItem[] itemList, GC printGC, Printer printer) { - - + + int numColumns = ((Table)fViewer.getControl()).getColumnCount(); - ITableLabelProvider labelProvider = (ITableLabelProvider)fViewer.getLabelProvider(); + ITableLabelProvider labelProvider = (ITableLabelProvider)fViewer.getLabelProvider(); int lineNum = 1; int charsPerByte = fRendering.getNumCharsPerByte(); if (charsPerByte < 0) charsPerByte = 4; - + // return line number after column labels are printed lineNum = printColumnLabels(printGC, lineNum); @@ -81,13 +81,13 @@ public class PrintTableRenderingAction extends Action //print all columns for this row for (int j=0; j < numColumns; j++) { String columnText = labelProvider.getColumnText(itemList[i].getData(), j); - + while (columnText.length() < fRendering.getBytesPerColumn() * charsPerByte) { columnText += " "; //$NON-NLS-1$ } tableContents.append(COLUMN_SEPERATOR); - tableContents.append(columnText); + tableContents.append(columnText); } printGC.drawString(tableContents.toString(), 10, 10+(lineNum*printGC.getFontMetrics().getHeight())); lineNum++; @@ -101,17 +101,17 @@ public class PrintTableRenderingAction extends Action } } } - + private int printColumnLabels(GC printGC, int lineNum) - { + { StringBuffer tableContents = new StringBuffer(); - int numColumns = ((Table)fViewer.getControl()).getColumnCount(); + int numColumns = ((Table)fViewer.getControl()).getColumnCount(); TableColumn columns[] = ((Table)fViewer.getControl()).getColumns(); - + int charsPerByte = fRendering.getNumCharsPerByte(); if (charsPerByte < 0) charsPerByte = 4; - + int addressSizeInBytes = 0; TableRenderingContentDescriptor descriptor = fRendering.getAdapter(TableRenderingContentDescriptor.class); if (descriptor == null) @@ -125,7 +125,7 @@ public class PrintTableRenderingAction extends Action } catch (DebugException e) { addressSizeInBytes = 0; } - + if (addressSizeInBytes <= 0) addressSizeInBytes = 4; } @@ -138,13 +138,13 @@ public class PrintTableRenderingAction extends Action { addressSizeInBytes = descriptor.getAddressSize(); } - + //get the column headers for (int k=0; k < numColumns; k++) { - + StringBuffer columnLabel = new StringBuffer(columns[k].getText()); int numBytes = 0; - + if (k > 0) { numBytes = fRendering.getBytesPerColumn(); @@ -153,18 +153,18 @@ public class PrintTableRenderingAction extends Action { numBytes = addressSizeInBytes; } - + while (columnLabel.length() < numBytes * charsPerByte) { columnLabel.append(" "); //$NON-NLS-1$ } - + tableContents.append(COLUMN_SEPERATOR); tableContents.append(columnLabel); } printGC.drawString(tableContents.toString(), 10, 10+(lineNum*printGC.getFontMetrics().getHeight())); - lineNum++; - + lineNum++; + return lineNum; } @@ -173,17 +173,17 @@ public class PrintTableRenderingAction extends Action */ @Override public void run() { - + if (!(fViewer.getControl() instanceof Table)) return; - + PrintDialog printDialog = new PrintDialog(DebugUIPlugin.getShell()); PrinterData printerData = printDialog.open(); // pop up a system print dialog if (printerData == null) {setChecked(false); return;} Printer printer = new Printer(printerData); GC gc = new GC(printer); TableItem[] tableItems = ((Table)fViewer.getControl()).getItems(); - + // start the print job and assign it a title printer.startJob(DebugUIMessages.PrintViewTabAction_jobtitle + fRendering.getLabel()); printer.startPage(); // start the first page diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java index 7b4e1a53f..6920da3e8 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java @@ -17,13 +17,13 @@ import org.eclipse.ui.PlatformUI; /** * Resize all columns - * + * * @since 3.0 */ public class ReformatAction extends Action { - + private AbstractBaseTableRendering fRendering; - + public ReformatAction(AbstractBaseTableRendering rendering) { super(DebugUIMessages.ReformatAction_title); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java index d4486e1f1..d795ea231 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java @@ -17,7 +17,7 @@ import java.math.BigInteger; * Util functions for data conversions */ public class RenderingsUtil { - + public static final int LITTLE_ENDIAN = 0; public static final int BIG_ENDIAN = 1; public static final int ENDIANESS_UNKNOWN = 2; @@ -35,28 +35,28 @@ public class RenderingsUtil { if (endianess == RenderingsUtil.LITTLE_ENDIAN) { byte[] temp = new byte[size]; - + for (int i=0; i 0) { buf.insert(0, "0"); //$NON-NLS-1$ requiredPadding--; } - + byte[] bytes = new byte[numBytes]; str = buf.toString(); - + // set data in memory for (int i=0; i 0) { int temp = number.intValue(); temp = temp - 256; - + String tempStr = Integer.toString(temp); - + Byte myByte = Byte.valueOf(tempStr); bytes[i] = myByte.byteValue(); } @@ -574,7 +574,7 @@ public class RenderingsUtil { bytes[i] = myByte.byteValue(); } } - + return bytes; - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java index 1dabe2ed9..ff1727d74 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java @@ -25,7 +25,7 @@ import org.eclipse.ui.PlatformUI; /** * Reest MemoryViewTab to the base address of a memory block - * + * * @since 3.0 */ public class ResetToBaseAddressAction extends Action { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java index 522f27eab..2bcf483d4 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -17,7 +17,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.ui.IDebugUIConstants; /** - * + * * Represent a signed integer rendering. */ public class SignedIntegerRendering extends AbstractIntegerRendering { @@ -25,7 +25,7 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { private int fColSize; private BigInteger fMax; private BigInteger fMin; - + /** * @param memBlock * @param renderingId @@ -38,13 +38,13 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { { String ret; long result = 0; - + if (columnSize == 1) { result = byteArray[0]; } else if (columnSize == 2) - { + { result = RenderingsUtil.convertByteArrayToShort(byteArray, endianess); } else if (columnSize == 4) @@ -53,7 +53,7 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { } else if (columnSize == 8) { - result = RenderingsUtil.convertByteArrayToLong(byteArray, endianess); + result = RenderingsUtil.convertByteArrayToLong(byteArray, endianess); } else if (columnSize == 16) { @@ -63,14 +63,14 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { else { BigInteger bigRet = RenderingsUtil.convertByteArrayToSignedBigInt(byteArray, endianess, columnSize); - return bigRet.toString(); + return bigRet.toString(); } ret = new Long(result).toString(); - + return ret; - } - + } + private byte[] convertToBytes(int colSize, String newValue, int endianess) { try { @@ -82,17 +82,17 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { bytes[0] = x; } else if (colSize == 2) - { + { short i = Short.parseShort(newValue); bytes = RenderingsUtil.convertShortToByteArray(i, endianess); } else if (colSize == 4) - { + { int i = Integer.parseInt(newValue); bytes = RenderingsUtil.convertIntToByteArray(i, endianess); } else if (colSize == 8) - { + { long i = Long.parseLong(newValue); bytes = RenderingsUtil.convertLongToByteArray(i, endianess); } @@ -102,13 +102,13 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { // need to represent number in Big Integer BigInteger i = new BigInteger(newValue); bytes = RenderingsUtil.convertBigIntegerToByteArray(i, endianess); - + return bytes; - } + } else { BigInteger i = new BigInteger(newValue); - + // avoid calculating max and min over and over again // for the same column size if (fColSize != colSize) @@ -119,14 +119,14 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { fMin = fMax.multiply(BigInteger.valueOf(-1)); fMax = fMax.subtract(BigInteger.valueOf(1)); } - + if (i.compareTo(fMax) > 0 || i.compareTo(fMin) < 0) throw new NumberFormatException(); - + bytes = RenderingsUtil.convertSignedBigIntToByteArray(i, endianess, colSize); - return bytes; + return bytes; } - + return bytes; } catch (NumberFormatException e) { throw e; @@ -138,7 +138,7 @@ public class SignedIntegerRendering extends AbstractIntegerRendering { */ @Override public String getString(String dataType, BigInteger address, MemoryByte[] data) { - + boolean invalid = false; String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); for (int i=0; i T getAdapter(Class adapter) { @@ -210,7 +210,7 @@ public class TableRenderingContentInput extends PlatformObject { return (T) fRendering; } } - + return super.getAdapter(adapter); } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java index 5848db937..d51dfe561 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java @@ -39,29 +39,29 @@ import org.eclipse.jface.viewers.Viewer; /** * Content Provider used by AbstractTableRendering - * + * * @since 3.0 */ public class TableRenderingContentProvider extends BasicDebugViewContentProvider { - + // lines currently being displayed by the table rendering protected Vector lineCache; - + // Cache to allow the content provider to comppute change information // Cache is taken by copying the lineCache after a suspend event // or change event from the the memory block. protected Hashtable contentCache; - + // cache in the form of MemoryByte // needed for reorganizing cache when the row size changes - private MemoryByte[] fContentCacheInBytes; + private MemoryByte[] fContentCacheInBytes; private String fContentCacheStartAddress; private BigInteger fBufferTopAddress; - + private TableRenderingContentInput fInput; private BigInteger fBufferEndAddress; - + private boolean fDynamicLoad; /** @@ -73,10 +73,10 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider lineCache = new Vector(); contentCache = new Hashtable(); initializeDynamicLoad(); - + DebugPlugin.getDefault().addDebugEventListener(this); } - + /** * @param viewer */ @@ -84,7 +84,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider { fViewer = viewer; } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ @@ -99,7 +99,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider } else { loadContentForSimpleMemoryBlock(); } - + // tell rendering to display table if the loading is successful getTableRendering(fInput).displayTable(); } @@ -110,7 +110,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider @Override public void dispose() { - DebugPlugin.getDefault().removeDebugEventListener(this); + DebugPlugin.getDefault().removeDebugEventListener(this); super.dispose(); } @@ -121,8 +121,8 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider public Object[] getElements(Object parent) { // if cache is empty, get memory - if (lineCache.isEmpty()) { - + if (lineCache.isEmpty()) { + try { getMemoryFromMemoryBlock(); } catch (DebugException e) { @@ -131,20 +131,20 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider return lineCache.toArray(); } } - + if (lineCache.isEmpty()) { return lineCache.toArray(); } - + // check to see if the row size has changed TableRenderingLine line = lineCache.get(0); int currentRowSize = line.getByteArray().length; int renderingRowSize = getTableRendering(fInput).getBytesPerLine(); - + if (renderingRowSize != currentRowSize) { try { - reorganizeContentCache(renderingRowSize); + reorganizeContentCache(renderingRowSize); reorganizeLines(lineCache, renderingRowSize); } catch (DebugException e) { DebugUIPlugin.log(e.getStatus()); @@ -154,7 +154,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider } return lineCache.toArray(); } - + private void getMemoryFromMemoryBlock() throws DebugException { IMemoryBlock memoryBlock = fInput.getMemoryBlock(); if (memoryBlock instanceof IMemoryBlockExtension) @@ -187,22 +187,22 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider * @throws DebugException */ public void loadContentForExtendedMemoryBlock() throws DebugException { - + // do not load if number of lines needed is < 0 if (fInput.getNumLines() <= 0) { return; } - + // calculate top buffered address BigInteger loadAddress = fInput.getLoadAddress(); if (loadAddress == null) { loadAddress = new BigInteger("0"); //$NON-NLS-1$ } - + BigInteger mbStart = fInput.getStartAddress(); BigInteger mbEnd = fInput.getEndAddress(); - + // check that the load address is within range if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0) { @@ -210,28 +210,28 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider loadAddress = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress(); fInput.setLoadAddress(loadAddress); } - + // if address is still out of range, throw an exception if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0) { throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_0 + loadAddress.toString(16), null)); } - + int addressableUnitsPerLine = getTableRendering(fInput).getAddressableUnitPerLine(); BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(fInput.getPreBuffer()*addressableUnitsPerLine)); BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(fInput.getPostBuffer()*addressableUnitsPerLine)); bufferEnd = bufferEnd.add(BigInteger.valueOf(fInput.getNumLines()*addressableUnitsPerLine)); - + if (isDynamicLoad()) { if (bufferStart.compareTo(mbStart) < 0) { bufferStart = mbStart; } - + if (bufferEnd.compareTo(mbEnd) > 0) { bufferEnd = mbEnd; - + int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue(); if (numLines < fInput.getNumLines()) { @@ -239,20 +239,20 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider bufferStart = bufferEnd.subtract(BigInteger.valueOf(fInput.getNumLines()*addressableUnitsPerLine)); bufferStart = bufferStart.subtract(BigInteger.valueOf(fInput.getPreBuffer()*addressableUnitsPerLine)); } - - // if after adjusting buffer start, it goes before the memory block start + + // if after adjusting buffer start, it goes before the memory block start // address, adjust it back if (bufferStart.compareTo(mbStart) < 0) { bufferStart = mbStart; } } - + // buffer end must be greater than buffer start if (bufferEnd.compareTo(bufferStart) <= 0) { throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null)); } - - int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1; + + int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1; // get stoarage to fit the memory view tab size getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta()); } @@ -261,42 +261,42 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider if (bufferStart.compareTo(mbStart) < 0) { bufferStart = mbStart; } - + if (bufferEnd.compareTo(mbEnd) > 0) { bufferStart = mbEnd.subtract(BigInteger.valueOf((fInput.getNumLines()-1)*addressableUnitsPerLine)); bufferEnd = mbEnd; - + // after adjusting buffer start, check if it's smaller than memory block's start address if (bufferStart.compareTo(mbStart) < 0) { bufferStart = mbStart; } } - + // buffer end must be greater than buffer start if (bufferEnd.compareTo(bufferStart) <= 0) { throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null)); } - - int numLines = fInput.getNumLines(); + + int numLines = fInput.getNumLines(); int bufferNumLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1; - + if (bufferNumLines < numLines) { numLines = bufferNumLines; } - + // get stoarage to fit the memory view tab size getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta()); } } - + /** * @return the memroy block */ public IMemoryBlock getMemoryBlock() { return fInput.getMemoryBlock(); } - + /** * Get memory to fit table * @param startingAddress @@ -309,16 +309,16 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider // do not ask for memory from memory block if the debug target // is already terminated IDebugTarget target = fInput.getMemoryBlock().getDebugTarget(); - + if (target.isDisconnected() || target.isTerminated()) { return; } - + DebugException dbgEvt = null; - + // calculate address size String adjustedAddress = startingAddress.toString(16); - + int addressSize; try { addressSize = getAddressSize(startingAddress); @@ -326,7 +326,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider dbgEvt = e1; addressSize = 4; } - + int addressLength = addressSize * IInternalDebugUIConstants.CHAR_PER_BYTE; // align to the closest boundary based on addressable size per line @@ -337,9 +337,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider IMemoryBlockExtension extMemoryBlock = null; MemoryByte[] memoryBuffer = null; - + String paddedString = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); - + long reqNumBytes = 0; try { @@ -348,11 +348,11 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider reqNumBytes = getTableRendering(fInput).getBytesPerLine() * numberOfLines; // get memory from memory block extMemoryBlock = (IMemoryBlockExtension) fInput.getMemoryBlock(); - + long reqNumberOfUnits = getTableRendering(fInput).getAddressableUnitPerLine() * numberOfLines; - + memoryBuffer = extMemoryBlock.getBytesFromAddress(startingAddress, reqNumberOfUnits); - + if(memoryBuffer == null) { DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null)); @@ -363,15 +363,15 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider { // get memory from memory block byte[] memory = fInput.getMemoryBlock().getBytes(); - + if (memory == null) { - DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null)); - throw e; + DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null)); + throw e; } - + int prefillNumBytes = 0; - + // number of bytes need to prefill if (!startingAddress.toString(16).endsWith("0")) //$NON-NLS-1$ { @@ -382,18 +382,18 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider startingAddress = adjustedStart; } reqNumBytes = fInput.getMemoryBlock().getLength() + prefillNumBytes; - + // figure out number of dummy bytes to append while (reqNumBytes % getTableRendering(fInput).getBytesPerLine() != 0) { reqNumBytes ++; } - + numberOfLines = reqNumBytes / getTableRendering(fInput).getBytesPerLine(); - + // create memory byte for IMemoryBlock memoryBuffer = new MemoryByte[(int)reqNumBytes]; - + // prefill buffer to ensure double-word alignment for (int i=0; i newBuffer = new ArrayList(); - + for (int i=0; i enumeration = contentCache.elements(); - + while (enumeration.hasMoreElements()) { TableRenderingLine line = enumeration.nextElement(); line.unmarkDeltas(); } } - + /** * Check if address is out of buffered range * @param address @@ -825,16 +825,16 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider { TableRenderingLine first = lineCache.firstElement(); TableRenderingLine last = lineCache.lastElement(); - + if (first == null ||last == null) { return true; } - + BigInteger startAddress = new BigInteger(first.getAddress(), 16); BigInteger lastAddress = new BigInteger(last.getAddress(), 16); int addressableUnit = getTableRendering(fInput).getAddressableUnitPerLine(); lastAddress = lastAddress.add(BigInteger.valueOf(addressableUnit)).subtract(BigInteger.valueOf(1)); - + if (startAddress.compareTo(address) <= 0 && lastAddress.compareTo(address) >= 0) { @@ -844,63 +844,63 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider } return true; } - + public void clearContentCache() { fContentCacheInBytes = new MemoryByte[0]; fContentCacheStartAddress = null; contentCache.clear(); } - + /** * @return if the memory block would manage its own update. */ private boolean isUpdateManagedByMB() { IMemoryBlock memoryBlock = getMemoryBlock(); - + IMemoryRenderingUpdater managedMB = null; if (memoryBlock instanceof IMemoryRenderingUpdater) { managedMB = (IMemoryRenderingUpdater)memoryBlock; } - + if (managedMB == null) { managedMB = memoryBlock.getAdapter(IMemoryRenderingUpdater.class); } - + // do not handle event if if the memory block wants to do its // own update if (managedMB != null && managedMB.supportsManagedUpdate(getTableRendering(fInput))) { return true; } - + return false; } - + public boolean isDynamicLoad() { return fDynamicLoad; } - + private void initializeDynamicLoad() { fDynamicLoad = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); } - + public void setDynamicLoad(boolean dynamicLoad) { fDynamicLoad = dynamicLoad; } - + private void reorganizeLines(Vector lines, int numBytesPerLine) throws DebugException { if (lines == null || lines.isEmpty()) { return; } - + Object[] objs = lines.toArray(); - + if (objs.length > 0) { TableRenderingLine[] renderingLines = lines.toArray(new TableRenderingLine[lines.size()]); @@ -912,10 +912,10 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider MemoryByte[] memoryBuffer = buffer; String address =renderingLines[0].getAddress(); String paddedString = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); - - // set to false to preserve information delta information + + // set to false to preserve information delta information boolean manageDelta = true; - + // If change information is not managed by the memory block // The view tab will manage it and calculate delta information // for its content cache. @@ -924,11 +924,11 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider manageDelta = !((IMemoryBlockExtension)fInput.getMemoryBlock()).supportsChangeManagement(); } lineCache.clear(); - + organizeLines(numberOfLines, updateDelta, addressLength, memoryBuffer, paddedString, address, manageDelta); } } - + private void reorganizeContentCache(int bytesPerLine) { // if content cache is empty, do nothing @@ -936,17 +936,17 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider || fContentCacheInBytes.length == 0 || fContentCacheStartAddress == null) { return; } - + MemoryByte[] bytes = fContentCacheInBytes; TableRenderingLine[] convertedLines = convertBytesToLines(bytes, bytesPerLine, new BigInteger(fContentCacheStartAddress, 16)); - + contentCache.clear(); for (int i=0; i lines = new ArrayList(); String paddedString = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); - + for (int i=0; inull if none. - * + * * @param element element to be rendered * @param columnIndex column index at which to render * @return memory rendering element or null @@ -147,7 +147,7 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i } return null; } - + private MemoryRenderingElement getMemoryRenderingElement(TableRenderingLine line, BigInteger lineAddress, int offset) { BigInteger cellAddress = lineAddress.add(BigInteger.valueOf(offset)); MemoryByte[] bytes = line.getBytes(offset, offset diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java index a175e55b8..390aa31e9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java @@ -23,7 +23,7 @@ public class TableRenderingLine extends PlatformObject { private String fAddress; private String fStrRep; private MemoryByte[] fBytes; - private byte[] fByteArray; + private byte[] fByteArray; private int fTableIndex = -1; private String fPaddedString; public boolean isMonitored; @@ -47,35 +47,35 @@ public class TableRenderingLine extends PlatformObject { public void setAddress(String address) { fAddress = address; } - + public MemoryByte[] getBytes() { return fBytes; } - + public MemoryByte getByte(int offset) { if (fBytes == null) return null; - + if (offset < fBytes.length) { return fBytes[offset]; } - - return null; + + return null; } - + public MemoryByte[] getBytes(int start, int end) { ArrayList ret = new ArrayList(); - + for (int i=start; i TableRenderingLine.numCharPerByteForHex) paddedString = paddedString.substring(0, TableRenderingLine.numCharPerByteForHex); } - buffer.replace(bufferCounter, bufferCounter+TableRenderingLine.numCharPerByteForHex, paddedString); + buffer.replace(bufferCounter, bufferCounter+TableRenderingLine.numCharPerByteForHex, paddedString); } bufferCounter += TableRenderingLine.numCharPerByteForHex; } - + fStrRep = buffer.toString(); } - + return fStrRep; } @@ -120,9 +120,9 @@ public class TableRenderingLine extends PlatformObject { public boolean isAvailable(int start, int end) { boolean available = true; for (int i=start; i 1 buffer size // otherwise, the rendering cannot be loaded dynamically - + if (preBuffer < 1 || postBuffer < 1) { setValid(false); @@ -155,19 +155,19 @@ public class TableRenderingPreferencePage extends PreferencePage implements { setValid(true); setErrorMessage(null); - + } } catch (NumberFormatException e) { setValid(false); setErrorMessage(DebugUIMessages.TableRenderingPreferencePage_4); } } - + @Override protected IPreferenceStore doGetPreferenceStore() { return DebugUIPlugin.getDefault().getPreferenceStore(); } - + @Override public void dispose() { fAuto.removeSelectionListener(this); @@ -187,28 +187,28 @@ public class TableRenderingPreferencePage extends PreferencePage implements public void widgetSelected(SelectionEvent e) { updateTextEditorsEnablement(); } - + @Override public boolean performOk() { boolean auto = fAuto.getSelection(); boolean currentValue = getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); if (auto != currentValue) getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, auto); - + fPageSize.store(); fPreBufferSize.store(); fPostBufferSize.store(); return super.performOk(); } - + @Override protected void performDefaults() { - + boolean auto = getPreferenceStore().getDefaultBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); fAuto.setSelection(auto); fManual.setSelection(!auto); updateTextEditorsEnablement(); - + fPageSize.loadDefault(); fPreBufferSize.loadDefault(); fPostBufferSize.loadDefault(); @@ -216,7 +216,7 @@ public class TableRenderingPreferencePage extends PreferencePage implements } /** - * + * */ private void updateTextEditorsEnablement() { boolean auto = fAuto.getSelection(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java index 7e9408004..02af03ea0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java @@ -43,49 +43,49 @@ public class TableRenderingPropertiesPage extends PropertyPage implements compositeLayout.numColumns = 2; compositeLayout.makeColumnsEqualWidth = false; composite.setLayout(compositeLayout); - + GridData comositeSpec= new GridData(); comositeSpec.grabExcessVerticalSpace= true; comositeSpec.grabExcessHorizontalSpace= true; comositeSpec.horizontalAlignment= GridData.FILL; comositeSpec.verticalAlignment= GridData.CENTER; composite.setLayoutData(comositeSpec); - + String label = rendering.getLabel(); if (label.startsWith("&&")) //$NON-NLS-1$ label = label.replaceFirst("&&", "&"); //$NON-NLS-1$//$NON-NLS-2$ addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_1, label); - + MemoryByte[] bytes = rendering.getSelectedAsBytes(); if (bytes.length > 0) { - + if (rendering.getSelectedAddress() != null) { String selectedAddress = "0x" + rendering.getSelectedAddress().toString(16).toUpperCase(); //$NON-NLS-1$ StringBuffer content = new StringBuffer(selectedAddress); addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_2, content.toString()); } - + String length = String.valueOf(rendering.getAddressableUnitPerColumn()) + " " + DebugUIMessages.TableRenderingPropertiesPage_3; //$NON-NLS-1$ addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_4, length); - + String selectedContent = rendering.getSelectedAsString(); addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_5, selectedContent); - + int addressableSize = rendering.getAddressableSize() * 8; addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_6, String.valueOf(addressableSize) + " " + DebugUIMessages.TableRenderingPropertiesPage_8); //$NON-NLS-1$ - + boolean endianessKnown = bytes[0].isEndianessKnown(); int endianess = RenderingsUtil.ENDIANESS_UNKNOWN; if (endianessKnown) - endianess = bytes[0].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN; - + endianess = bytes[0].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN; + boolean allBytesKnown = bytes[0].isHistoryKnown(); boolean allBytesUnchanged = bytes[0].isChanged()?false:true; - + boolean allBytesReadable = bytes[0].isReadable(); boolean allBytesWritable = bytes[0].isWritable(); - + if (bytes.length > 1) { for (int i=1; i bytes.length) throw new NumberFormatException(); - + // take the least significant 'colSize' bytes out of the bytes array // if it's big endian, it's the last 'colSize' bytes if (endianess == RenderingsUtil.BIG_ENDIAN) - { + { // check most significan bytes... if data has to be represented // using more than 'colSize' number of bytes, this // number is invalid, throw number format exception @@ -211,11 +211,11 @@ public class UnsignedIntegerRendering extends AbstractIntegerRendering { if (bytes[i] != 0) throw new NumberFormatException(); } - + byte[] copy = new byte[colSize]; for (int j=0, k=bytes.length-colSize; jnull if default is to be used */ - public String getHelpContextId(String helpId); + public String getHelpContextId(String helpId); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java index 578910e77..3e9dbcd81 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java @@ -4,11 +4,11 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: + * + * Contributors: * QNX Software Systems - Initial API and implementation * Wind River Systems - Pawel Piech - Added Modules view (bug 211158) - * IBM - Added the abiliity to update view label, context help and the orientation + * IBM - Added the abiliity to update view label, context help and the orientation * action upon input change ***********************************************************************/ package org.eclipse.debug.internal.ui.views.modules; @@ -35,8 +35,8 @@ import org.eclipse.ui.PlatformUI; /** * Displays modules and symbols with a detail area. */ -public class ModulesView extends VariablesView { - +public class ModulesView extends VariablesView { + /** * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() */ @@ -87,7 +87,7 @@ public class ModulesView extends VariablesView { */ @Override protected String getToggleActionLabel() { - + if (getViewer() != null) { Object viewerInput = getViewer().getInput(); @@ -101,10 +101,10 @@ public class ModulesView extends VariablesView { } } } - - return ModulesViewMessages.ModulesView_0; + + return ModulesViewMessages.ModulesView_0; } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId() */ @@ -112,21 +112,21 @@ public class ModulesView extends VariablesView { protected String getPresentationContextId() { return IDebugUIConstants.ID_MODULE_VIEW; } - + @Override protected void setViewerInput(Object context) { super.setViewerInput(context); - + // update view label when viewer input is changed updateViewLabels(context); - + // update orientation action based on input updateOrientationAction(context); - + // update context help hook when viewer input is changed updateContextHelp(context); } - + private void updateContextHelp(Object context) { if (context instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) context; @@ -142,15 +142,15 @@ public class ModulesView extends VariablesView { } PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl().getParent(), IDebugHelpContextIds.MODULES_VIEW); } - + private void updateViewLabels(Object context) { String viewName = getViewName(context); - + // only update label if the name has changed if (!getPartName().equals(viewName)) setPartName(viewName); - + // only update image if the image has changed Image image = getViewImage(context); if (!getTitleImage().equals(image)) @@ -173,7 +173,7 @@ public class ModulesView extends VariablesView { } return ModulesViewMessages.ModulesView_2; } - + private Image getViewImage(Object context) { if (context instanceof IAdaptable) { @@ -188,7 +188,7 @@ public class ModulesView extends VariablesView { } return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_CVIEW_MODULES_VIEW); } - + private void updateOrientationAction(Object context) { ToggleDetailPaneAction action = getToggleDetailPaneAction(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN); @@ -198,5 +198,5 @@ public class ModulesView extends VariablesView { action.setText(label); } } - + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java index 6930c44f4..4c81bdf80 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java @@ -4,8 +4,8 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: + * + * Contributors: * QNX Software Systems - Initial API and implementation * IBM Corporation - Bug 90318 * Wind River Systems - Pawel Piech - Added Modules view (bug 211158) diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java index d509d4f4f..395b942c9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java @@ -4,8 +4,8 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: + * + * Contributors: * QNX Software Systems - Initial API and implementation ***********************************************************************/ package org.eclipse.debug.internal.ui.views.registers; @@ -21,7 +21,7 @@ import org.eclipse.jface.action.Separator; * Displays registers and their values with a detail area. */ public class RegistersView extends VariablesView { - + /** * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() */ @@ -36,7 +36,7 @@ public class RegistersView extends VariablesView { @Override protected void configureToolBar(IToolBarManager tbm) { super.configureToolBar(tbm); - tbm.add(new Separator(IDebugUIConstants.EMPTY_REGISTER_GROUP)); + tbm.add(new Separator(IDebugUIConstants.EMPTY_REGISTER_GROUP)); tbm.add(new Separator(IDebugUIConstants.REGISTER_GROUP)); } @@ -53,15 +53,15 @@ public class RegistersView extends VariablesView { */ @Override protected String getToggleActionLabel() { - return RegistersViewMessages.RegistersView_0; + return RegistersViewMessages.RegistersView_0; } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId() */ @Override protected String getPresentationContextId() { return IDebugUIConstants.ID_REGISTER_VIEW; - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java index fee501218..a02c167db 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java @@ -4,8 +4,8 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: + * + * Contributors: * QNX Software Systems - Initial API and implementation * IBM Corporation - Bug 90318 ***********************************************************************/ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java index e21d3784b..f3aaae04f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -31,7 +31,7 @@ import org.eclipse.ui.PlatformUI; * variable or expression. */ public class AvailableLogicalStructuresAction extends Action implements IMenuCreator { - + private VariablesView fView; private Menu fMenu; private IValue fValue; @@ -39,8 +39,8 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre public AvailableLogicalStructuresAction(VariablesView view) { setView(view); - setToolTipText(VariablesViewMessages.AvailableLogicalStructuresAction_0); - setText(VariablesViewMessages.AvailableLogicalStructuresAction_1); + setToolTipText(VariablesViewMessages.AvailableLogicalStructuresAction_0); + setText(VariablesViewMessages.AvailableLogicalStructuresAction_1); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VARIABLES_SELECT_LOGICAL_STRUCTURE); setEnabled(false); setMenuCreator(this); @@ -53,7 +53,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre @Override public void run() { } - + protected VariablesView getView() { return fView; } @@ -87,7 +87,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre ActionContributionItem item= new ActionContributionItem(action); item.fill(parent, -1); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu) */ @@ -96,7 +96,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre if (fMenu != null) { fMenu.dispose(); } - + fMenu= new Menu(parent); ILogicalStructureType[] types = getTypes(); ILogicalStructureType enabledType = DebugPlugin.getDefaultStructureType(types); @@ -157,19 +157,19 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre } setEnabled(false); } - + protected ILogicalStructureType[] getTypes() { return fTypes; } - + private void setTypes(ILogicalStructureType[] types) { fTypes = types; } - + protected IValue getValue() { return fValue; } - + private void setValue(IValue value) { fValue = value; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java index 67be772b6..b60bd3134 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -18,22 +18,22 @@ import org.eclipse.debug.core.model.IVariable; import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; /** - * A parition (subrange) of values of an indexed value + * A parition (subrange) of values of an indexed value */ public class IndexedValuePartition implements IIndexedValue { // the starting offset of this parition, into the associated collection private int fOffset; - + // the length of this partition private int fLength; // the indexed value private IIndexedValue fValue; - + /** * Creates a parition for an indexed value. - * + * * @param value indexed value * @param offset beginning offset of this partition (into the value) * @param length the length of this parition @@ -42,8 +42,8 @@ public class IndexedValuePartition implements IIndexedValue { fValue = value; fOffset = offset; fLength = length; - } - + } + /* (non-Javadoc) * @see org.eclipse.debug.core.model.IIndexedValue#getSize() */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java index 4327e4aaf..04d377520 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java @@ -28,27 +28,27 @@ import org.eclipse.debug.ui.IDebugUIConstants; * (IIndexedValue). */ public class IndexedVariablePartition extends PlatformObject implements IVariable { - + // the starting offset of this partition, into the associated collection private int fOffset; - + // the length of this partition private int fLength; - + // the root variable or expression containing the indexed value private IDebugElement fOriginalVariable; // the indexed value private IIndexedValue fOriginalValue; - + // sub-range of values private IIndexedValue fValuePartition; - + private String fName = null; - + /** * Creates a partition for an indexed value. - * + * * @param variable variable or expression containing the indexed value * @param value indexed value * @param offset beginning offset of this partition (into the value) @@ -61,7 +61,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl fLength = length; fValuePartition = new IndexedValuePartition(value, offset, length); } - + /* (non-Javadoc) * @see org.eclipse.debug.core.model.IVariable#getValue() */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java index 5765ece18..6d2e50ddd 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java @@ -26,7 +26,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin; * Cache that stores evaluated logical structure values to replace raw values. Cache * should be cleared when a RESUME or TERMINATE event is fired so the structure can be * reevaluated for new values. - * + * * @since 3.3 * */ @@ -36,11 +36,11 @@ public class LogicalStructureCache { * Maps a ILogicalStructureType to the cache for that type */ private Map fCacheForType = new HashMap(); - + /** * Returns the logical value to replace the given value using the specified logical structure. * The value will be retrieved from the cache if possible, or evaluated if not. - * + * * @param type the logical structure type used to evaluate the logical value * @param value the raw value to replace with a logical structure * @return the logical value replacing the raw value or null if there is a problem @@ -48,23 +48,23 @@ public class LogicalStructureCache { public IValue getLogicalStructure(ILogicalStructureType type, IValue value) throws CoreException { synchronized (fCacheForType) { LogicalStructureTypeCache cache = getCacheForType(type); - return cache.getLogicalStructure(value); + return cache.getLogicalStructure(value); } } - + /** * Clears the cache of all evaluated values. */ public void clear(){ synchronized (fCacheForType) { - fCacheForType.clear(); + fCacheForType.clear(); } } - + /** * Helper method that returns the cache associated with the given logical structure type. * If there is not cache associated, one is created. - * + * * @param type the logical structure type to get the cache for * @return the cache associated with the logical structure type */ @@ -74,35 +74,35 @@ public class LogicalStructureCache { cache = new LogicalStructureTypeCache(type); fCacheForType.put(type, cache); } - return cache; + return cache; } - + /** * Inner class that caches the known and pending values for a given logical * structure type. */ class LogicalStructureTypeCache{ - + private ILogicalStructureType fType; - + /** - * Maps a raw IValue to its calculated logical IValue + * Maps a raw IValue to its calculated logical IValue */ private Map fKnownValues = new HashMap(); - + /** * Set of raw IValues that logical values are currently being evaluated for. */ private Set fPendingValues = new HashSet(); - + public LogicalStructureTypeCache(ILogicalStructureType type){ fType = type; } - + /** * Returns the logical structure value for the given raw value. If the value has been evaluated * the cached value is returned, otherwise the thread waits until the value is evaluated. - * + * * @param value the raw value * @return the logical value * @exception CoreException if an error occurs computing the value @@ -146,8 +146,8 @@ public class LogicalStructureCache { fPendingValues.notifyAll(); } throw e; - } + } } - + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java index 4ef148cf0..a33395d4a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,13 +22,13 @@ import org.eclipse.swt.custom.BusyIndicator; * logical structure types for the same variable). */ public class SelectLogicalStructureAction extends Action { - + private VariablesView fView; private ILogicalStructureType fType; private ILogicalStructureType[] fAvailableTypes; /** - * + * * @param view Variables view * @param type the type that this action will turn on/off * @param value the value for which logical structures are to be chosen @@ -64,11 +64,11 @@ public class SelectLogicalStructureAction extends Action { type= fType; } DebugPlugin.setDefaultStructureType(fAvailableTypes, type); - getView().getViewer().refresh(); + getView().getViewer().refresh(); } - }); + }); } - + protected VariablesView getView() { return fView; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java index 5ccaf11cb..5143a7b83 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River - Pawel Piech - Initial Implementation - Drag/Drop to Expressions View (Bug 184057) * IBM Corporation - further implementation and documentation @@ -23,19 +23,19 @@ import org.eclipse.swt.dnd.Transfer; /** * Drag adapter for the variables view and expressions view. Allows selected variables and * expressions to be dragged. - * + * * @see org.eclipse.debug.internal.ui.views.expression.ExpressionDropAdapter * @since 3.4 */ public class SelectionDragAdapter extends DragSourceAdapter implements TransferDragSourceListener { - + /** * The associated viewer for the adapter */ private TreeModelViewer fViewer; - + /** - * Constructor, takes the viewer that contains the selection provider + * Constructor, takes the viewer that contains the selection provider * @param view the associated view, must implement ISelectionProvider */ public SelectionDragAdapter(TreeModelViewer viewer) { @@ -50,7 +50,7 @@ public class SelectionDragAdapter extends DragSourceAdapter implements TransferD public Transfer getTransfer() { return LocalSelectionTransfer.getTransfer(); } - + /* (non-Javadoc) * @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent) */ @@ -61,7 +61,7 @@ public class SelectionDragAdapter extends DragSourceAdapter implements TransferD LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL); event.doit = !selection.isEmpty(); } - + /* (non-Javadoc) * @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent) */ @@ -80,5 +80,5 @@ public class SelectionDragAdapter extends DragSourceAdapter implements TransferD public void dragFinished(DragSourceEvent event) { LocalSelectionTransfer.getTransfer().setSelection(null); LocalSelectionTransfer.getTransfer().setSelectionSetTime(0); - } + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java index a554d56cd..2ddd2e8ec 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java @@ -26,13 +26,13 @@ import org.eclipse.ui.PlatformUI; * is used for all debug models. */ public class ToggleLogicalStructureAction extends Action { - + private VariablesView fView; public ToggleLogicalStructureAction(VariablesView view) { super(null, IAction.AS_CHECK_BOX); setView(view); - setToolTipText(VariablesViewMessages.ToggleObjectBrowsersAction_1); + setToolTipText(VariablesViewMessages.ToggleObjectBrowsersAction_1); setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_SHOW_LOGICAL_STRUCTURE)); setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SHOW_LOGICAL_STRUCTURE)); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SHOW_LOGICAL_STRUCTURE)); @@ -48,15 +48,15 @@ public class ToggleLogicalStructureAction extends Action { if (!getView().isAvailable()) { return; } - getView().setShowLogicalStructure(isChecked()); + getView().setShowLogicalStructure(isChecked()); BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() { @Override public void run() { - getView().getViewer().refresh(); + getView().getViewer().refresh(); } - }); + }); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.Action#setChecked(boolean) */ @@ -64,7 +64,7 @@ public class ToggleLogicalStructureAction extends Action { public void setChecked(boolean value) { super.setChecked(value); } - + protected VariablesView getView() { return fView; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java index a1e7b2c38..7294468b0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java @@ -28,13 +28,13 @@ import org.eclipse.ui.texteditor.IUpdate; * is used for all debug models. */ public class ToggleShowColumnsAction extends Action implements IUpdate { - + private TreeModelViewer fViewer; public ToggleShowColumnsAction(TreeModelViewer viewew) { super(VariablesViewMessages.ToggleShowColumnsAction_0, IAction.AS_CHECK_BOX); fViewer = viewew; - setToolTipText(VariablesViewMessages.ToggleShowColumnsAction_1); + setToolTipText(VariablesViewMessages.ToggleShowColumnsAction_1); setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB)); setId(DebugUIPlugin.getUniqueIdentifier() + ".ToggleShowColumsAction"); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SHOW_COLUMNS_ACTION); @@ -51,11 +51,11 @@ public class ToggleShowColumnsAction extends Action implements IUpdate { BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() { @Override public void run() { - fViewer.setShowColumns(isChecked()); + fViewer.setShowColumns(isChecked()); } - }); + }); } - + /* (non-Javadoc) * @see org.eclipse.ui.texteditor.IUpdate#update() */ @@ -63,7 +63,7 @@ public class ToggleShowColumnsAction extends Action implements IUpdate { public void update() { setEnabled(fViewer.canToggleColumns()); setChecked(fViewer.isShowColumns()); - } - + } + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java index 4b9cd843e..91817c304 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java @@ -24,10 +24,10 @@ import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewPart; /** - * + * */ public abstract class VariableViewToggleAction implements IViewActionDelegate, IActionDelegate2 { - + private IViewPart fView; private IAction fAction; @@ -89,11 +89,11 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I protected IPreferenceStore getPreferenceStore() { return DebugUIPlugin.getDefault().getPreferenceStore(); } - + /** * Returns the value of this filters preference (on/off) for the given * view. - * + * * @param part * @return boolean */ @@ -108,20 +108,20 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I } else { value = store.getBoolean(baseKey); } - return value; + return value; } - + /** * Returns the key for this action's preference - * + * * @return String */ - protected abstract String getPreferenceKey(); - + protected abstract String getPreferenceKey(); + protected IViewPart getView() { return fView; } - + protected StructuredViewer getStructuredViewer() { IDebugView view = getView().getAdapter(IDebugView.class); if (view != null) { @@ -129,7 +129,7 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I if (viewer instanceof StructuredViewer) { return (StructuredViewer)viewer; } - } + } return null; } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java index a83f7a210..ad267f25b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640) @@ -14,7 +14,7 @@ * Wind River - Pawel Piech - Fix viewer input race condition (Bug 234908) * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442) * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) - * Patrick Chuong (Texas Instruments) and Pawel Piech (Wind River) - + * Patrick Chuong (Texas Instruments) and Pawel Piech (Wind River) - * Allow multiple debug views and multiple debug context providers (Bug 327263) *******************************************************************************/ package org.eclipse.debug.internal.ui.views.variables; @@ -142,7 +142,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis IPropertyChangeListener, IDebugExceptionHandler, IPerspectiveListener, IModelChangedListener, IViewerUpdateListener, IDetailPaneContainer2, ISaveablePart2 { - + private static final String COLLAPSE_ALL = "CollapseAll"; //$NON-NLS-1$ /** @@ -159,7 +159,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } }; private ISelectionProvider fActiveProvider; - + private SelectionProviderWrapper(ISelectionProvider provider) { setActiveProvider(provider); } @@ -194,7 +194,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis */ @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { - fListenerList.add(listener); + fListenerList.add(listener); } /* @@ -226,77 +226,77 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } } } - + /** * The model presentation used as the label provider for the tree viewer, * and also as the detail information provider for the detail pane. */ protected VariablesViewModelPresentation fModelPresentation; - + /** * The UI construct that provides a sliding sash between the variables tree * and the detail pane. */ private SashForm fSashForm; - + /** * Composite that holds the details pane and always remains */ private Composite fDetailsAnchor; - + /** * Composite that holds the separator container and detail pane control. * Gets disposed/created as the layout changes. */ private Composite fDetailsComposite; - + /** * Separator used when detail pane background colors of tree/detail pane are different. */ private Label fSeparator; - + /** * Parent of the viewer, used to detect re-sizing for automatic layout */ private Composite fParent; - + /** * Whether the detail pane has been built yet. */ private boolean fPaneBuilt = false; - + /** * The detail pane that displays detailed information about the current selection * @since 3.3 */ private DetailPaneProxy fDetailPane; - + /** * Stores whether the tree viewer was the last control to have focus in the - * view. Used to give focus to the correct component if the user leaves the view. + * view. Used to give focus to the correct component if the user leaves the view. * @since 3.3 */ private boolean fTreeHasFocus = true; - + /** * Various listeners used to update the enabled state of actions and also to * populate the detail pane. */ private ISelectionChangedListener fTreeSelectionChangedListener; - + /** * Listener added to the control of the detail pane, allows view to keep track of which * part last had focus, the tree or the detail pane. */ - private Listener fDetailPaneActivatedListener; - + private Listener fDetailPaneActivatedListener; + /** * Viewer input service used to translate active debug context to viewer input. */ private ViewerInputService fInputService; - + private Map fGlobalActionMap = new HashMap(); - + /** * Viewer input requester used to update the viewer once the viewer input has been * resolved. @@ -309,7 +309,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } } }; - + /** * These are used to initialize and persist the position of the sash that * separates the tree viewer from the detail pane. @@ -320,20 +320,20 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis private String fCurrentDetailPaneOrientation = IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN; private ToggleDetailPaneAction[] fToggleDetailPaneActions; private ConfigureColumnsAction fConfigureColumnsAction; - + protected String PREF_STATE_MEMENTO = "pref_state_memento."; //$NON-NLS-1$ public static final String LOGICAL_STRUCTURE_TYPE_PREFIX = "VAR_LS_"; //$NON-NLS-1$ - + /** * Presentation context property. * @since 3.3 */ public static final String PRESENTATION_SHOW_LOGICAL_STRUCTURES = "PRESENTATION_SHOW_LOGICAL_STRUCTURES"; //$NON-NLS-1$ - + /** * the preference name for the view part of the sash form - * @since 3.2 + * @since 3.2 */ protected static final String SASH_VIEW_PART = DebugUIPlugin.getUniqueIdentifier() + ".SASH_VIEW_PART"; //$NON-NLS-1$ /** @@ -341,19 +341,19 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis * @since 3.2 */ protected static final String SASH_DETAILS_PART = DebugUIPlugin.getUniqueIdentifier() + ".SASH_DETAILS_PART"; //$NON-NLS-1$ - + /** * Sash weights for a specific detail pane type */ protected static final String DETAIL_PANE_TYPE = "DETAIL_PANE_TYPE"; //$NON-NLS-1$ - + /** * Visits deltas to determine if details should be displayed */ class Visitor implements IModelDeltaVisitor { /** * Whether to trigger details display. - * + * * @since 3.3 */ private boolean fTriggerDetails = false; @@ -368,31 +368,31 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } return true; } - + public void reset() { fTriggerDetails = false; } - + public boolean isTriggerDetails() { return fTriggerDetails; } - + } /** * Delta visitor */ private Visitor fVisitor = new Visitor(); - + /** * Job to update details in the UI thread. */ private Job fTriggerDetailsJob = new UIJob("trigger details") { //$NON-NLS-1$ - + @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; - } + } refreshDetailPaneContents(); return Status.OK_STATUS; } @@ -402,12 +402,12 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis * Selection provider registered with the view site. */ private SelectionProviderWrapper fSelectionProvider; - + /** * Presentation context for this view. */ private IPresentationContext fPresentationContext; - + /** * Remove myself as a selection listener * and preference change listener. @@ -416,7 +416,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis */ @Override public void dispose() { - + DebugUITools.removePartDebugContextListener(getSite(), this); getSite().getWorkbenchWindow().removePerspectiveListener(this); DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); @@ -439,17 +439,17 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } /** - * Called when the viewer input update is completed. Unlike + * Called when the viewer input update is completed. Unlike * {@link #setViewerInput(Object)}, it allows overriding classes * to examine the context for which the update was calculated. - * + * * @param update Completed viewer input update. */ protected void viewerInputUpdateComplete(IViewerInputUpdate update) { setViewerInput(update.getInputElement()); updateAction(FIND_ACTION); } - + /** * Sets the input to the viewer * @param context the object context @@ -459,9 +459,9 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis // Clear the detail pane refreshDetailPaneContents(); } - + Object current = getViewer().getInput(); - + if (current == null && context == null) { return; } @@ -469,25 +469,25 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis if (current != null && current.equals(context)) { return; } - + showViewer(); getViewer().setInput(context); updateObjects(); } - + /** * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ @Override public void propertyChange(PropertyChangeEvent event) { String propertyName= event.getProperty(); - if (propertyName.equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) || + if (propertyName.equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) || propertyName.equals(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND) || propertyName.equals(IDebugUIConstants.PREF_VARIABLE_TEXT_FONT)) { getViewer().refresh(); } } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite) */ @@ -496,31 +496,31 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis addResizeListener(parent); fParent = parent; fTriggerDetailsJob.setSystem(true); - + // create the sash form that will contain the tree viewer & text viewer fSashForm = new SashForm(parent, SWT.NONE); - + getModelPresentation(); DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); JFaceResources.getFontRegistry().addListener(this); TreeModelViewer variablesViewer = createTreeViewer(fSashForm); fInputService = new ViewerInputService(variablesViewer, fRequester); - + fSashForm.setMaximizedControl(variablesViewer.getControl()); fDetailsAnchor = SWTFactory.createComposite(fSashForm, parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0); fSashForm.setWeights(getLastSashWeights()); - + fSelectionProvider = new SelectionProviderWrapper(variablesViewer); getSite().setSelectionProvider(fSelectionProvider); - + createOrientationActions(variablesViewer); IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore(); String orientation = prefStore.getString(getDetailPanePreferenceKey()); for (int i = 0; i < fToggleDetailPaneActions.length; i++) { fToggleDetailPaneActions[i].setChecked(fToggleDetailPaneActions[i].getOrientation().equals(orientation)); } - + fDetailPane = new DetailPaneProxy(this); fDetailPane.addProperyListener(new IPropertyListener() { @Override @@ -529,15 +529,15 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } }); setDetailPaneOrientation(orientation); - + IMemento memento = getMemento(); if (memento != null) { variablesViewer.initState(memento); } - + variablesViewer.addModelChangedListener(this); variablesViewer.addViewerUpdateListener(this); - + initDragAndDrop(variablesViewer); return variablesViewer; @@ -545,14 +545,14 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis /** * Initializes the drag and/or drop adapters for this view. Called from createViewer(). - * + * * @param viewer the viewer to add drag/drop support to. * @since 3.4 */ protected void initDragAndDrop(TreeModelViewer viewer) { // Drag only viewer.addDragSupport(DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new SelectionDragAdapter(viewer)); - } + } /* (non-Javadoc) * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento) @@ -582,10 +582,10 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } site.getWorkbenchWindow().addPerspectiveListener(this); } - + /** * Returns sash weights stored in the given memento or null if none. - * + * * @param memento Memento to read sash weights from * @return sash weights or null */ @@ -603,7 +603,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } return null; } - + /* (non-Javadoc) * @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart) */ @@ -644,18 +644,18 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis protected String getDetailPanePreferenceKey() { return IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION; } - + /** * Create and return the main tree viewer that displays variable. * @param parent Viewer's parent control * @return The created viewer. */ protected TreeModelViewer createTreeViewer(Composite parent) { - + int style = getViewerStyle(); - fPresentationContext = new DebugModelPresentationContext(getPresentationContextId(), this, fModelPresentation); + fPresentationContext = new DebugModelPresentationContext(getPresentationContextId(), this, fModelPresentation); final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style, fPresentationContext); - + variablesViewer.getControl().addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { @@ -663,7 +663,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis fSelectionProvider.setActiveProvider(variablesViewer); setGlobalActions(); } - + @Override public void focusLost(FocusEvent e){ // Do not reset the selection provider with the provider proxy. @@ -686,10 +686,10 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } } }); - + variablesViewer.addPostSelectionChangedListener(getTreeSelectionChangedListener()); DebugUITools.addPartDebugContextListener(getSite(), this); - + return variablesViewer; } @@ -702,7 +702,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } setAction(actionID, action); } - getViewSite().getActionBars().updateActionBars(); + getViewSite().getActionBars().updateActionBars(); } /** @@ -713,30 +713,30 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis protected void createContextMenu(Control menuControl) { super.createContextMenu(menuControl); IActionBars actionBars = getViewSite().getActionBars(); - if (!fGlobalActionMap.containsKey(SELECT_ALL_ACTION)) { + if (!fGlobalActionMap.containsKey(SELECT_ALL_ACTION)) { setGlobalAction(IDebugView.SELECT_ALL_ACTION, actionBars.getGlobalActionHandler(SELECT_ALL_ACTION)); } - if (!fGlobalActionMap.containsKey(COPY_ACTION)) { + if (!fGlobalActionMap.containsKey(COPY_ACTION)) { setGlobalAction(COPY_ACTION, actionBars.getGlobalActionHandler(COPY_ACTION)); } - if (!fGlobalActionMap.containsKey(PASTE_ACTION)) { + if (!fGlobalActionMap.containsKey(PASTE_ACTION)) { setGlobalAction(PASTE_ACTION, actionBars.getGlobalActionHandler(PASTE_ACTION)); } } - + private void clearGlobalActions() { for (String id : fGlobalActionMap.keySet()) { setAction(id, null); } - getViewSite().getActionBars().updateActionBars(); + getViewSite().getActionBars().updateActionBars(); } /** - * Returns the active debug context for this view based on the view's + * Returns the active debug context for this view based on the view's * site IDs. - * + * * @return Active debug context for this view. - * + * * @since 3.7 */ protected ISelection getDebugContext() { @@ -744,42 +744,42 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis IDebugContextService contextService = DebugUITools.getDebugContextManager().getContextService(site.getWorkbenchWindow()); return contextService.getActiveContext(site.getId(), site.getSecondaryId()); } - + /** * Returns the presentation context id for this view. - * + * * @return context id */ protected String getPresentationContextId() { return IDebugUIConstants.ID_VARIABLE_VIEW; - } - + } + /** * Returns the presentation context secondary id for this view. - * + * * @return context secondary id. */ protected String getPresentationContextSecondaryId() { return ((IViewSite)getSite()).getSecondaryId(); } - + /** * Returns the style bits for the viewer. - * + * * @return SWT style */ protected int getViewerStyle() { return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL | SWT.FULL_SELECTION; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() */ @Override protected String getHelpContextId() { - return IDebugHelpContextIds.VARIABLE_VIEW; + return IDebugHelpContextIds.VARIABLE_VIEW; } - + private void addResizeListener(Composite parent) { parent.addControlListener(new ControlListener() { @Override @@ -793,10 +793,10 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } }); } - + /** * Returns vertical or horizontal based on view size. - * + * * @return vertical or horizontal */ int computeOrientation() { @@ -809,15 +809,15 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } } return SWT.HORIZONTAL; - } - + } + /** * Set the orientation of the details pane so that is one of: * - underneath the main tree view * - to the right of the main tree view * - not visible * @param orientation Detail pane orientation to set. - * + * * @see IDebugPreferenceConstants#VARIABLES_DETAIL_PANE_AUTO * @see IDebugPreferenceConstants#VARIABLES_DETAIL_PANE_HIDDEN * @see IDebugPreferenceConstants#VARIABLES_DETAIL_PANE_UNDERNEATH @@ -840,13 +840,13 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } } else { vertOrHoriz = orientation.equals(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH) ? SWT.VERTICAL : SWT.HORIZONTAL; - + } buildDetailPane(vertOrHoriz); revealTreeSelection(); } } - + private void buildDetailPane(int orientation) { try { fDetailsAnchor.setRedraw(false); @@ -876,7 +876,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis fPaneBuilt = true; } } - + /** * Hides the details pane */ @@ -884,11 +884,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis if (fToggledDetailOnce) { setLastSashWeights(fSashForm.getWeights()); } - fSashForm.setMaximizedControl(getViewer().getControl()); + fSashForm.setMaximizedControl(getViewer().getControl()); } - + /** - * Shows the details pane + * Shows the details pane */ private void showDetailPane() { fSashForm.setMaximizedControl(null); @@ -932,7 +932,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } return fLastSashWeights; } - + /** * Set the current relative weights of the controls in the sash form, so that * the sash form can be reset to this layout at a later time. @@ -941,7 +941,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis protected void setLastSashWeights(int[] weights) { fLastSashWeights = weights; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#createActions() */ @@ -949,12 +949,12 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis protected void createActions() { IAction action = new ShowTypesAction(this); setAction("ShowTypeNames",action); //$NON-NLS-1$ - + action = new ToggleLogicalStructureAction(this); setAction("ToggleContentProviders", action); //$NON-NLS-1$ - + action = new CollapseAllAction((TreeModelViewer)getViewer()); - setAction(COLLAPSE_ALL, action); + setAction(COLLAPSE_ALL, action); IHandlerService hs = getSite().getService(IHandlerService.class); if (hs != null) { hs.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(action)); @@ -963,29 +963,29 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis action = new ChangeVariableValueAction(this); action.setEnabled(false); setAction("ChangeVariableValue", action); //$NON-NLS-1$ - + action= new VirtualFindAction(getVariablesViewer()); setGlobalAction(FIND_ACTION, action); - } + } /** - * Adds the given action to the set of global actions managed by this - * variables view. Global actions are cleared and reset whenever the detail - * pane is activated to allow the detail pane to set the actions as + * Adds the given action to the set of global actions managed by this + * variables view. Global actions are cleared and reset whenever the detail + * pane is activated to allow the detail pane to set the actions as * well. - * + * * @param actionID Action ID that the given action implements. * @param action Action implementation. - * + * * @since 3.8 */ protected void setGlobalAction(String actionID, IAction action) { fGlobalActionMap.put(actionID, action); } - + @Override public IAction getAction(String actionID) { - // Check if model overrides the action. Global action overrides are + // Check if model overrides the action. Global action overrides are // checked in setGlobalActions() so skip them here. if (!fGlobalActionMap.containsKey(actionID)) { IAction overrideAction = getOverrideAction(actionID); @@ -995,7 +995,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } return super.getAction(actionID); } - + private IAction getOverrideAction(String actionID) { Viewer viewer = getViewer(); if (viewer != null) { @@ -1010,7 +1010,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } return null; } - + @Override public void updateObjects() { super.updateObjects(); @@ -1019,16 +1019,16 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis getViewSite().getActionBars().updateActionBars(); } } - + /** * Creates the actions that allow the orientation of the detail pane to be changed. - * + * * @param viewer Viewer to create actions for. */ private void createOrientationActions(TreeModelViewer viewer) { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager viewMenu = actionBars.getMenuManager(); - + fToggleDetailPaneActions = new ToggleDetailPaneAction[4]; fToggleDetailPaneActions[0] = new ToggleDetailPaneAction(this, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH, null); fToggleDetailPaneActions[1] = new ToggleDetailPaneAction(this, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_RIGHT, null); @@ -1043,10 +1043,10 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis layoutSubMenu.add(fToggleDetailPaneActions[3]); viewMenu.add(layoutSubMenu); viewMenu.add(new Separator()); - + fConfigureColumnsAction = new ConfigureColumnsAction(viewer); setAction("ToggleColmns", new ToggleShowColumnsAction(viewer)); //$NON-NLS-1$ - + layoutSubMenu.addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(IMenuManager manager) { @@ -1066,20 +1066,20 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } }); } - + /** * Returns the label to use for the action that toggles the view layout to be the tree viewer only (detail pane is hidden). * Should be of the style '[view name] View Only'. - * + * * @return action label for toggling the view layout to tree viewer only */ protected String getToggleActionLabel(){ return VariablesViewMessages.VariablesView_41; } - + /** * Configures the toolBar. - * + * * @param tbm The toolbar that will be configured */ @Override @@ -1088,13 +1088,13 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP)); tbm.add(getAction("ShowTypeNames")); //$NON-NLS-1$ tbm.add(getAction("ToggleContentProviders")); //$NON-NLS-1$ - tbm.add(getAction(COLLAPSE_ALL)); + tbm.add(getAction(COLLAPSE_ALL)); } /** * Adds items to the tree viewer's context menu including any extension defined * actions. - * + * * @param menu The menu to add the item to. */ @Override @@ -1104,7 +1104,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis menu.add(getAction(FIND_ACTION)); ChangeVariableValueAction changeValueAction = (ChangeVariableValueAction)getAction("ChangeVariableValue"); //$NON-NLS-1$ if (changeValueAction.isApplicable()) { - menu.add(changeValueAction); + menu.add(changeValueAction); } menu.add(new Separator()); IAction action = new AvailableLogicalStructuresAction(this); @@ -1119,11 +1119,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis menu.add(new Separator(IDebugUIConstants.EMPTY_NAVIGATION_GROUP)); menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); } - + /** * Lazily instantiate and return a selection listener that populates the detail pane, - * but only if the detail is currently visible. - * + * but only if the detail is currently visible. + * * @return Created selection listener */ protected ISelectionChangedListener getTreeSelectionChangedListener() { @@ -1132,23 +1132,23 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis @Override public void selectionChanged(final SelectionChangedEvent event) { if (event.getSelectionProvider().equals(getViewer())) { - clearStatusLine(); + clearStatusLine(); // if the detail pane is not visible, don't waste time retrieving details if (fSashForm.getMaximizedControl() == getViewer().getControl()) { return; - } + } refreshDetailPaneContents(); treeSelectionChanged(event); } - } + } }; } return fTreeSelectionChangedListener; } - + /** * Selection in the variable tree changed. Perform any updates. - * + * * @param event */ protected void treeSelectionChanged(SelectionChangedEvent event) {} @@ -1187,7 +1187,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis public IWorkbenchPartSite getWorkbenchPartSite() { return getSite(); } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents() */ @@ -1199,7 +1199,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis fLastSashWeights = fSashForm.getWeights(); } fDetailPane.display(getCurrentSelection()); - + // Use a grey (widget background) sash for the detail pane normally // If the detail pane is also grey, add a seperator line Control control = fDetailPane.getCurrentControl(); @@ -1229,7 +1229,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } fDetailPane.getCurrentControl().addListener(SWT.Activate, fDetailPaneActivatedListener); } - + /** * @return the model presentation to be used for this view */ @@ -1239,7 +1239,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis } return fModelPresentation; } - + /* (non-Javadoc) * @see org.eclipse.ui.part.WorkbenchPart#getAdapter(Class) */ @@ -1260,7 +1260,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis /** * If possible, calls the update method of the action associated with the given ID. - * + * * @param actionId the ID of the action to update */ protected void updateAction(String actionId) { @@ -1272,22 +1272,22 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis ((IUpdate) action).update(); } } - + /** * @return whether the detail pane is visible to the user */ protected boolean isDetailPaneVisible() { return !fToggleDetailPaneActions[3].isChecked(); } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#getDefaultControl() */ @Override protected Control getDefaultControl() { return fSashForm; - } - + } + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.IDebugExceptionHandler#handleException(org.eclipse.debug.core.DebugException) */ @@ -1295,7 +1295,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis public void handleException(DebugException e) { showMessage(e.getMessage()); } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent) */ @@ -1319,11 +1319,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis fInputService.resolveViewerInput(source); } } - + /** * Delegate to the DOUBLE_CLICK_ACTION, * if any. - * + * * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent) */ @Override @@ -1346,11 +1346,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis getVariablesViewer().expandToLevel(ss.getPaths()[0], 1); } } - + } } } - } + } /* (non-Javadoc) * @see org.eclipse.debug.ui.IDebugView#getPresentation(String) @@ -1377,30 +1377,30 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis public boolean isMainViewerAvailable() { return isAvailable(); } - + /** * @return the presentation context of the viewer */ protected IPresentationContext getPresentationContext() { return getVariablesViewer().getPresentationContext(); } - - /** + + /** * Sets whether logical structures are being displayed * @param flag If true, turns the logical structures on. */ public void setShowLogicalStructure(boolean flag) { getPresentationContext().setProperty(PRESENTATION_SHOW_LOGICAL_STRUCTURES, Boolean.valueOf(flag)); - } - - /** + } + + /** * Returns whether logical structures are being displayed - * @return Returns true if logical structures should be shown. + * @return Returns true if logical structures should be shown. */ public boolean isShowLogicalStructure() { Boolean show = (Boolean) getPresentationContext().getProperty(PRESENTATION_SHOW_LOGICAL_STRUCTURES); return show != null && show.booleanValue(); - } + } /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractDebugView#becomesHidden() @@ -1427,12 +1427,12 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis protected TreeModelViewer getVariablesViewer() { return (TreeModelViewer) getViewer(); } - + /** * Clears the status line of all messages and errors */ protected void clearStatusLine() { - IStatusLineManager manager = getViewSite().getActionBars().getStatusLineManager(); + IStatusLineManager manager = getViewSite().getActionBars().getStatusLineManager(); manager.setErrorMessage(null); manager.setMessage(null); } @@ -1462,7 +1462,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis public void modelChanged(IModelDelta delta, IModelProxy proxy) { fVisitor.reset(); delta.accept(fVisitor); - + updateAction(FIND_ACTION); updateAction(COLLAPSE_ALL); } @@ -1499,7 +1499,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis @Override public synchronized void viewerUpdatesBegin() { fTriggerDetailsJob.cancel(); - IWorkbenchSiteProgressService progressService = + IWorkbenchSiteProgressService progressService = getSite().getAdapter(IWorkbenchSiteProgressService.class); if (progressService != null) { progressService.incrementBusy(); @@ -1514,19 +1514,19 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis if (fVisitor.isTriggerDetails()) { fTriggerDetailsJob.schedule(); } - IWorkbenchSiteProgressService progressService = + IWorkbenchSiteProgressService progressService = getSite().getAdapter(IWorkbenchSiteProgressService.class); if (progressService != null) { progressService.decrementBusy(); - } - } - + } + } + /** * @see org.eclipse.ui.IWorkbenchPart#setFocus() */ @Override public void setFocus() { - boolean success = false; + boolean success = false; if (!fTreeHasFocus && fDetailPane != null){ success = fDetailPane.setFocus(); } @@ -1534,8 +1534,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis if (!success && getViewer() != null){ getViewer().getControl().setFocus(); } - } - + } + protected ToggleDetailPaneAction getToggleDetailPaneAction(String orientation) { for (int i=0; iIWorkbenchPartSite that the details area (and the + * The IWorkbenchPartSite that the details area (and the * variables view) belongs to. */ private IWorkbenchPartSite fWorkbenchPartSite; - + /** * Map of actions. Keys are strings, values * are IAction. */ private Map fActionMap = new HashMap(); - + /** * Collection to track actions that should be updated when selection occurs. */ private List fSelectionActions = new ArrayList(); - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite) */ @@ -55,7 +55,7 @@ public abstract class AbstractDetailPane implements IDetailPane { fWorkbenchPartSite = workbench; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#dispose() */ @@ -67,7 +67,7 @@ public abstract class AbstractDetailPane implements IDetailPane { /** * Adds an action to the Map storing actions. Removes it if action is null. - * + * * @param actionID The ID of the action, used as the key in the Map * @param action The action associated with the ID */ @@ -78,24 +78,24 @@ public abstract class AbstractDetailPane implements IDetailPane { fActionMap.put(actionID, action); } } - + /** * Adds the given action to the global action handler for the ViewSite. * A call to updateActionBars() must be called after changes * to propagate changes through the workbench. - * + * * @param actionID The ID of the action * @param action The action to be set globally */ protected void setGlobalAction(String actionID, IAction action){ getViewSite().getActionBars().setGlobalActionHandler(actionID, action); } - + /** * Adds the given action to the list of actions that will be updated when - * updateSelectionDependentActions() is called. If the string + * updateSelectionDependentActions() is called. If the string * is null it will not be added to the list. - * + * * @param actionID The ID of the action which should be updated */ protected void setSelectionDependantAction(String actionID){ @@ -103,22 +103,22 @@ public abstract class AbstractDetailPane implements IDetailPane { fSelectionActions.add(actionID); } } - + /** * Gets the action out of the map, casts it to an IAction - * + * * @param actionID The ID of the action to find * @return The action associated with the ID or null if none is found. */ protected IAction getAction(String actionID) { return fActionMap.get(actionID); } - + /** * Calls the update method of the action with the given action ID. * The action must exist in the action map and must be an instance of * IUpdate - * + * * @param actionId The ID of the action to update */ protected void updateAction(String actionId) { @@ -127,11 +127,11 @@ public abstract class AbstractDetailPane implements IDetailPane { ((IUpdate) action).update(); } } - + /** - * Iterates through the list of selection dependent actions and + * Iterates through the list of selection dependent actions and * updates them. Use setSelectionDependentAction(String actionID) - * to add an action to the list. The action must have been added to the known + * to add an action to the list. The action must have been added to the known * actions map by calling setAction(String actionID, IAction action) * before it can be updated by this method. */ @@ -140,11 +140,11 @@ public abstract class AbstractDetailPane implements IDetailPane { updateAction(string); } } - + /** * Gets the view site for this view. May be null if this detail pane * is not part of a view. - * + * * @return The site for this view or null */ protected IViewSite getViewSite(){ @@ -158,16 +158,16 @@ public abstract class AbstractDetailPane implements IDetailPane { /** * Gets the workbench part site for this view. May be null if this detail pane * is not part of a view. - * + * * @return The workbench part site or null */ protected IWorkbenchPartSite getWorkbenchPartSite() { return fWorkbenchPartSite; } - + /** * Returns whether this detail pane is being displayed in a view with a workbench part site. - * + * * @return whether this detail pane is being displayed in a view with a workbench part site. */ protected boolean isInView(){ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java index ca8e07c50..8445ad826 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java @@ -24,35 +24,35 @@ import org.eclipse.ui.PlatformUI; /** * Drop down action that displays the available detail panes for a selection. - * + * * @since 3.3 * @see IDetailPaneContainer */ public class AvailableDetailPanesAction extends Action implements IMenuCreator { - + private Menu fMenu; private Set fAvailableIDs; private IDetailPaneContainer fDetailPaneContainer; - + /** * Each entry in the menu will be of this type. It represents one possible detail pane * that the user can select. If the user selects it, the display is changed to use that * detail pane and the preferred detail pane map in the pane manager is updated. - * + * * @see DetailPaneManager * @since 3.3 */ private class SetDetailPaneAction extends Action { - + private String fPaneID; private Set fPossiblePaneIDs; - + public SetDetailPaneAction(String name, String paneID, Set possiblePaneIDs) { super(name,AS_RADIO_BUTTON); fPaneID = paneID; fPossiblePaneIDs = possiblePaneIDs; } - + @Override public void run() { // Don't change panes unless the user is selecting a different pane than the one currently displayed @@ -61,26 +61,26 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator { fDetailPaneContainer.refreshDetailPaneContents(); } } - + } - + public AvailableDetailPanesAction(IDetailPaneContainer detailPaneContainer) { fDetailPaneContainer = detailPaneContainer; - setText(DetailMessages.AvailableDetailPanesAction_0); + setText(DetailMessages.AvailableDetailPanesAction_0); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VARIABLES_SELECT_DETAIL_PANE); - + setEnabled(false); setMenuCreator(this); init(); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IAction#run() */ @Override public void run() { } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#dispose() */ @@ -91,7 +91,7 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator { } fAvailableIDs.clear(); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control) */ @@ -99,12 +99,12 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator { public Menu getMenu(Control parent) { return null; } - + protected void addActionToMenu(Menu parent, IAction action) { ActionContributionItem item= new ActionContributionItem(action); item.fill(parent, -1); } - + /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu) */ @@ -124,26 +124,26 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator { name.append(i); name.append(' '); } - + String typeName = DetailPaneManager.getDefault().getNameFromID(currentID); if (typeName != null && typeName.length() > 0){ name.append(typeName); } else { - name.append(currentID); + name.append(currentID); } - + IAction action = new SetDetailPaneAction(name.toString(),currentID,fAvailableIDs); - + if (currentID.equals(fDetailPaneContainer.getCurrentPaneID())){ action.setChecked(true); } - - addActionToMenu(fMenu, action); + + addActionToMenu(fMenu, action); } - + return fMenu; } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java index 823db6fdd..d0c8f7b7f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640) @@ -123,7 +123,7 @@ import com.ibm.icu.text.MessageFormat; * This detail pane uses a source viewer to display detailed information about the current * selection. It incorporates a large number of actions into its context menu. It is the * default detail pane. - * + * * @see DefaultDetailPaneFactory * @since 3.3 * @@ -137,14 +137,14 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane protected static final String DETAIL_SELECT_ALL_ACTION = IDebugView.SELECT_ALL_ACTION + ".SourceDetailPane"; //$NON-NLS-1$ protected static final String DETAIL_PASTE_ACTION = ActionFactory.PASTE.getId(); protected static final String DETAIL_CUT_ACTION = ActionFactory.CUT.getId(); - + protected static final String DETAIL_FIND_REPLACE_TEXT_ACTION = "FindReplaceText"; //$NON-NLS-1$ protected static final String DETAIL_CONTENT_ASSIST_ACTION = "ContentAssist"; //$NON-NLS-1$ protected static final String DETAIL_ASSIGN_VALUE_ACTION = "AssignValue"; //$NON-NLS-1$ - + protected static final String DETAIL_WORD_WRAP_ACTION = IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP; protected static final String DETAIL_MAX_LENGTH_ACTION = "MaxLength"; //$NON-NLS-1$ - + /** * The ID, name and description of this pane are stored in constants so that the class * does not have to be instantiated to access them. @@ -152,20 +152,20 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane public static final String ID = DetailMessages.DefaultDetailPane_0; public static final String NAME = DetailMessages.DefaultDetailPane_1; public static final String DESCRIPTION = DetailMessages.DefaultDetailPane_57; - + /** * Data structure for the position label value. */ private static class PositionLabelValue { - + public int fValue; - + @Override public String toString() { return String.valueOf(fValue); } } - + /** * Internal interface for a cursor listener. I.e. aggregation * of mouse and key listener. @@ -173,26 +173,26 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane */ interface ICursorListener extends MouseListener, KeyListener { } - + /** * Job to compute the details for a selection */ class DetailJob extends Job implements IValueDetailListener { - + private IStructuredSelection fElements; private IDebugModelPresentation fModel; private boolean fFirst = true; // whether a result was collected private boolean fComputed = false; private IProgressMonitor fMonitor; - + public DetailJob(IStructuredSelection elements, IDebugModelPresentation model) { super("compute variable details"); //$NON-NLS-1$ setSystem(true); fElements = elements; fModel = model; } - + /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ @@ -228,7 +228,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane } else { message = c.getOrganizer().getLabel(); } - } + } } // When selecting a index partition, clear the pane if (val instanceof IndexedValuePartition) { @@ -264,7 +264,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane } return Status.OK_STATUS; } - + /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#canceling() */ @@ -330,18 +330,18 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane synchronized (this) { notifyAll(); } - + } } - + /** * The model presentation used to produce the string details for a * selected variable. */ private VariablesViewModelPresentation fModelPresentation; private String fDebugModelIdentifier; - + /** * Controls the status line while the details area has focus. * Displays the current cursor position in the text (line:character). @@ -353,18 +353,18 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane * of selected variables will be displayed. */ private SourceViewer fSourceViewer; - + /** * The last selection displayed in the source viewer. */ private IStructuredSelection fLastDisplayed = null; - + /** * Flag used to track whether source viewer has focus. It helps avoid * resetting global actions incorrectly. */ private boolean fHasFocus = false; - + /** * Variables used to create the detailed information for a selection */ @@ -376,40 +376,40 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane private final Object[] fPositionLabelPatternArguments = new Object[] { fLineLabel, fColumnLabel }; private ICursorListener fCursorListener; - + /** * Handler activation object so that we can use the global content assist command * and properly deactivate it later. */ private IHandlerActivation fContentAssistActivation; - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite) */ @Override public Control createControl(Composite parent) { - + fModelPresentation = new VariablesViewModelPresentation(); - + createSourceViewer(parent); - + if (isInView()){ createViewSpecificComponents(); createActions(); DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); JFaceResources.getFontRegistry().addListener(this); } - + return fSourceViewer.getControl(); } /** * Creates the source viewer in the given parent composite - * + * * @param parent Parent composite to create the source viewer in */ private void createSourceViewer(Composite parent) { - + // Create & configure a SourceViewer fSourceViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL); fSourceViewer.setDocument(getDetailDocument()); @@ -427,7 +427,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane * source viewer when this detail pane is inside a view. */ private void createViewSpecificComponents(){ - + // Add a document listener so actions get updated when the document changes getDetailDocument().addDocumentListener(new IDocumentListener() { @Override @@ -437,7 +437,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane updateSelectionDependentActions(); } }); - + // Add the selection listener so selection dependent actions get updated. fSourceViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() { @Override @@ -445,7 +445,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane updateSelectionDependentActions(); } }); - + // Add a focus listener to update actions when details area gains focus fSourceViewer.getControl().addFocusListener(new FocusAdapter() { @Override @@ -459,13 +459,13 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane setGlobalAction(action.getActionDefinitionId(), action); action = getAction(DETAIL_CONTENT_ASSIST_ACTION); setGlobalAction(action.getActionDefinitionId(),action); - + getViewSite().getActionBars().updateActionBars(); - + updateAction(DETAIL_FIND_REPLACE_TEXT_ACTION); fHasFocus = true; } - + @Override public void focusLost(FocusEvent e) { setGlobalAction(IDebugView.SELECT_ALL_ACTION, null); @@ -475,18 +475,18 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane setGlobalAction(IDebugView.FIND_ACTION, null); setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION).getActionDefinitionId(), null); setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION).getActionDefinitionId(), null); - + getViewSite().getActionBars().updateActionBars(); fHasFocus = false; } }); - + // disposed controls don't get a FocusOut event, make sure all actions // have been deactivated fSourceViewer.getControl().addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { - if (fHasFocus) { + if (fHasFocus) { setGlobalAction(IDebugView.SELECT_ALL_ACTION, null); setGlobalAction(IDebugView.CUT_ACTION, null); setGlobalAction(IDebugView.COPY_ACTION, null); @@ -506,12 +506,12 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane manager.add(fStatusLineItem); fSourceViewer.getTextWidget().addMouseListener(getCursorListener()); fSourceViewer.getTextWidget().addKeyListener(getCursorListener()); - + // Add a context menu to the detail area createDetailContextMenu(fSourceViewer.getTextWidget()); - + } - + /** * Creates the actions to add to the context menu */ @@ -527,54 +527,54 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane IHandlerService handlerService = getViewSite().getService(IHandlerService.class); fContentAssistActivation = handlerService.activateHandler(textAction.getActionDefinitionId(), actionHandler); setAction(DETAIL_CONTENT_ASSIST_ACTION, textAction); - + textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.SELECT_ALL); textAction.configureAction(DetailMessages.DefaultDetailPane_Select__All_5, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING); textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_SELECT_ALL); PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_SELECT_ALL_ACTION); setAction(DETAIL_SELECT_ALL_ACTION, textAction); - + textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.COPY); textAction.configureAction(DetailMessages.DefaultDetailPane__Copy_8, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING); textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY); PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_COPY_ACTION); setAction(DETAIL_COPY_ACTION, textAction); - + textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.CUT); textAction.configureAction(DetailMessages.DefaultDetailPane_Cu_t_11, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING); textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_CUT); PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_CUT_ACTION); setAction(DETAIL_CUT_ACTION, textAction); - + textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.PASTE); textAction.configureAction(DetailMessages.DefaultDetailPane__Paste_14, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING); textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE); PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_PASTE_ACTION); setAction(ActionFactory.PASTE.getId(), textAction); - + setSelectionDependantAction(DETAIL_COPY_ACTION); setSelectionDependantAction(DETAIL_CUT_ACTION); setSelectionDependantAction(DETAIL_PASTE_ACTION); - + // TODO: Still using "old" resource access, find/replace won't work in popup dialogs ResourceBundle bundle= ResourceBundle.getBundle("org.eclipse.debug.internal.ui.views.variables.VariablesViewResourceBundleMessages"); //$NON-NLS-1$ IAction action = new FindReplaceAction(bundle, "find_replace_action_", getWorkbenchPartSite().getShell(), new FindReplaceTargetWrapper(fSourceViewer.getFindReplaceTarget())); //$NON-NLS-1$ action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE); PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IDebugHelpContextIds.DETAIL_PANE_FIND_REPLACE_ACTION); setAction(DETAIL_FIND_REPLACE_TEXT_ACTION, action); - + updateSelectionDependentActions(); - + action = new DetailPaneWordWrapAction(fSourceViewer); setAction(DETAIL_WORD_WRAP_ACTION, action); - + action = new DetailPaneMaxLengthAction(fSourceViewer.getControl().getShell()); setAction(DETAIL_MAX_LENGTH_ACTION,action); - + action = new DetailPaneAssignValueAction(fSourceViewer,getViewSite()); setAction(DETAIL_ASSIGN_VALUE_ACTION, action); } - + /** * Create the context menu particular to the detail pane. Note that anyone * wishing to contribute an action to this menu must use @@ -597,15 +597,15 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane getViewSite().registerContextMenu(IDebugUIConstants.VARIABLE_VIEW_DETAIL_ID, menuMgr, fSourceViewer.getSelectionProvider()); } - + /** * Adds items to the detail pane's context menu including any extension defined * actions. - * + * * @param menu The menu to add the item to. */ protected void fillDetailContextMenu(IMenuManager menu) { - + menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP)); if (isInView()){ menu.add(getAction(DETAIL_ASSIGN_VALUE_ACTION)); @@ -624,43 +624,43 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane menu.add(getAction(DETAIL_WORD_WRAP_ACTION)); menu.add(getAction(DETAIL_MAX_LENGTH_ACTION)); menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - + } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection) */ @Override public void display(IStructuredSelection selection) { - + if (selection == null){ clearSourceViewer(); return; } - + fLastDisplayed = selection; if (isInView()){ fSourceViewer.setEditable(true); } - + if (selection.isEmpty()){ clearSourceViewer(); return; } - + Object firstElement = selection.getFirstElement(); if (firstElement != null && firstElement instanceof IDebugElement) { String modelID = ((IDebugElement)firstElement).getModelIdentifier(); setDebugModel(modelID); } - + if (isInView()){ IAction assignAction = getAction(DETAIL_ASSIGN_VALUE_ACTION); if (assignAction instanceof DetailPaneAssignValueAction){ ((DetailPaneAssignValueAction)assignAction).updateCurrentVariable(selection); } } - + synchronized (this) { if (fDetailJob != null) { fDetailJob.cancel(); @@ -668,9 +668,9 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane fDetailJob = new DetailJob(selection,fModelPresentation); fDetailJob.schedule(); } - + } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#setFocus() */ @@ -682,7 +682,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane } return false; } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.details.AbstractDetailPane#dispose() */ @@ -698,7 +698,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane if (fSourceViewer != null && fSourceViewer.getControl() != null) { fSourceViewer.getControl().dispose(); } - + if (isInView()){ IAction action = getAction(DETAIL_ASSIGN_VALUE_ACTION); if (action != null){ @@ -709,19 +709,19 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane service.deactivateHandler(fContentAssistActivation); fContentAssistActivation = null; } - + disposeUndoRedoAction(ITextEditorActionConstants.UNDO); disposeUndoRedoAction(ITextEditorActionConstants.REDO); - + getViewSite().getActionBars().getStatusLineManager().remove(fStatusLineItem); - + DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); JFaceResources.getFontRegistry().removeListener(this); } - + super.dispose(); } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#getDescription() */ @@ -745,7 +745,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane public String getName() { return NAME; } - + /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @@ -760,7 +760,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane } return null; } - + /** * Lazily instantiate and return a Document for the detail pane text viewer. * @return the singleton {@link Document} for this detail pane @@ -771,7 +771,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane } return fDetailDocument; } - + /** * Clears the source viewer, removes all text. */ @@ -798,7 +798,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane DebugUIPlugin.errorDialog(fSourceViewer.getControl().getShell(), DetailMessages.DefaultDetailPane_Error_1, DetailMessages.DefaultDetailPane_2, e); } } - + if (svc == null) { svc = new SourceViewerConfiguration(); fSourceViewer.setEditable(false); @@ -806,12 +806,12 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane fSourceViewer.unconfigure(); fSourceViewer.configure(svc); //update actions that depend on the configuration of the source viewer - + if (isInView()){ updateAction(DETAIL_ASSIGN_VALUE_ACTION); updateAction(DETAIL_CONTENT_ASSIST_ACTION); } - + if (isInView()){ createUndoRedoActions(); } @@ -821,23 +821,23 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane * @return The formatted string describing cursor position */ protected String getCursorPosition() { - + if (fSourceViewer == null) { return IInternalDebugCoreConstants.EMPTY_STRING; } - + StyledText styledText= fSourceViewer.getTextWidget(); int caret= styledText.getCaretOffset(); IDocument document= fSourceViewer.getDocument(); - + if (document == null) { return IInternalDebugCoreConstants.EMPTY_STRING; } - + try { - + int line= document.getLineOfOffset(caret); - + int lineOffset= document.getLineOffset(line); int tabWidth= styledText.getTabs(); int column= 0; @@ -848,11 +848,11 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane column++; } } - + fLineLabel.fValue= line + 1; fColumnLabel.fValue= column + 1; return MessageFormat.format(fPositionLabelPattern, fPositionLabelPatternArguments); - + } catch (BadLocationException x) { return IInternalDebugCoreConstants.EMPTY_STRING; } @@ -862,30 +862,30 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane * Returns this view's "cursor" listener to be installed on the view's * associated details viewer. This listener is listening to key and mouse button events. * It triggers the updating of the status line. - * + * * @return the listener */ private ICursorListener getCursorListener() { if (fCursorListener == null) { fCursorListener= new ICursorListener() { - + @Override public void keyPressed(KeyEvent e) { fStatusLineItem.setText(getCursorPosition()); } - + @Override public void keyReleased(KeyEvent e) { } - + @Override public void mouseDoubleClick(MouseEvent e) { } - + @Override public void mouseDown(MouseEvent e) { } - + @Override public void mouseUp(MouseEvent e) { fStatusLineItem.setText(getCursorPosition()); @@ -894,11 +894,11 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane } return fCursorListener; } - + /** * Returns the identifier of the debug model being displayed * in this view, or null if none. - * + * * @return debug model identifier */ protected String getDebugModel() { @@ -908,7 +908,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane /** * Sets the identifier of the debug model being displayed * in this view, or null if none. - * + * * @param id debug model identifier of the type of debug * elements being displayed in this view */ @@ -918,7 +918,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane configureDetailsViewer(); } } - + /** * Creates this editor's undo/re-do actions. *

    @@ -932,28 +932,28 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane IUndoContext undoContext= getUndoContext(); if (undoContext != null) { // Use actions provided by global undo/re-do - + // Create the undo action OperationHistoryActionHandler undoAction= new UndoActionHandler(getViewSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(undoAction, IAbstractTextEditorHelpContextIds.UNDO_ACTION); undoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO); setAction(ITextEditorActionConstants.UNDO, undoAction); setGlobalAction(ITextEditorActionConstants.UNDO, undoAction); - + // Create the re-do action. OperationHistoryActionHandler redoAction= new RedoActionHandler(getViewSite(), undoContext); PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION); redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO); setAction(ITextEditorActionConstants.REDO, redoAction); setGlobalAction(ITextEditorActionConstants.REDO, redoAction); - + getViewSite().getActionBars().updateActionBars(); } } - + /** * Disposes of the action with the specified ID - * + * * @param actionId the ID of the action to disposed */ protected void disposeUndoRedoAction(String actionId) { @@ -963,7 +963,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane setAction(actionId, null); } } - + /** * Returns this editor's viewer's undo manager undo context. * @@ -992,7 +992,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane fSourceViewer.getTextWidget().setWordWrap(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP)); getAction(DETAIL_WORD_WRAP_ACTION).setChecked(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP)); } - + } /** @@ -1002,12 +1002,12 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane * on it's own. See bug 178106. */ class FindReplaceTargetWrapper implements IFindReplaceTarget{ - + private IFindReplaceTarget fTarget; - + /** * Constructor - * + * * @param target find/replace target this class will wrap around. */ public FindReplaceTargetWrapper(IFindReplaceTarget target){ @@ -1070,7 +1070,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane fTarget.replaceSelection(text); } } - + /* * @see org.eclipse.debug.ui.IDetailPane2#getSelectionProvider() */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java index cb4ee5c0b..3abc49ffc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java @@ -21,13 +21,13 @@ import org.eclipse.jface.viewers.IStructuredSelection; * The default detail pane factory is contributed to the org.eclipse.debug.ui.detailPaneFactories * extension without an enablement expression so it is always loaded. For any given selection (even * null or empty selections), the factory can produce a SourceDetailsPane - * + * * @since 3.3 */ public class DefaultDetailPaneFactory implements IDetailPaneFactory { public static final String DEFAULT_DETAIL_PANE_ID = DefaultDetailPane.ID; - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#createDetailsArea(java.lang.String) */ @@ -52,7 +52,7 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory { possibleIDs.add(DefaultDetailPane.ID); return possibleIDs; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(java.util.Set, org.eclipse.jface.viewers.IStructuredSelection) */ @@ -75,7 +75,7 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory { } return null; } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDescription(java.lang.String) diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java index 8089a2e0d..03e86262e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java @@ -46,16 +46,16 @@ import org.osgi.service.prefs.BackingStoreException; * Organizes the detail factories contributed through the extension point and keeps * track of the detail panes the factories produce. Accessed as a singleton through * the getDefault() method. - * + * * @see IDetailPaneFactory * @see IDetailPane * @since 3.3 */ public class DetailPaneManager { - + /** * Acts as a proxy between the detail pane manager and the factories contributed - * to the extension point. Only loads information from the plug-in xml and only + * to the extension point. Only loads information from the plug-in xml and only * instantiates the specified factory if required (lazy loading). */ private class DetailPaneFactoryExtension implements IDetailPaneFactory{ @@ -63,12 +63,12 @@ public class DetailPaneManager { private IConfigurationElement fConfigElement; private IDetailPaneFactory fFactory; private Expression fEnablementExpression; - + public DetailPaneFactoryExtension(IConfigurationElement configElement){ - fConfigElement = configElement; + fConfigElement = configElement; } - - /** + + /** * Instantiates the factory and asks it to produce the IDetailPane for * the given ID * @param paneID the identifier of the detail pane to create @@ -82,7 +82,7 @@ public class DetailPaneManager { return null; } - /** + /** * Instantiates the factory and asks it for the set of detail pane * IDs that the factory can produce for the given selection. * @param selection the current view selection @@ -95,8 +95,8 @@ public class DetailPaneManager { } return Collections.EMPTY_SET; } - - /** + + /** * Instantiates the factory and asks it for the detail pane ID * that the factory considers the default for the given selection. * @param selection the current view selection @@ -108,9 +108,9 @@ public class DetailPaneManager { return getFactory().getDefaultDetailPane(selection); } return null; - } + } - /** + /** * Instantiates the factory and asks it to produce the name of the detail pane * for the given ID. * @param paneID the detail pane identifier @@ -123,9 +123,9 @@ public class DetailPaneManager { } return null; } - - /** - * Instantiates the factory and asks it to produce the description of the + + /** + * Instantiates the factory and asks it to produce the description of the * detail pane for the given ID. * @param paneID the detail pane identifier * @return the description of the detail pane or null if the backing {@link IDetailPaneFactory} is null @@ -137,9 +137,9 @@ public class DetailPaneManager { } return null; } - + /** - * Returns the instantiated factory specified by the class property. + * Returns the instantiated factory specified by the class property. * @return the singleton {@link IDetailPaneFactory} */ private IDetailPaneFactory getFactory(){ @@ -152,14 +152,14 @@ public class DetailPaneManager { fFactory = (IDetailPaneFactory)obj; } else { throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "org.eclipse.debug.ui.detailFactories extension failed to load a detail factory because the specified class does not implement org.eclipse.debug.ui.IDetailPaneFactory. Class specified was: " + obj, null)); //$NON-NLS-1$ - } + } } catch (CoreException e){ DebugUIPlugin.log(e.getStatus()); fFactory = null; } return fFactory; } - + /** * Checks if the enablement expression for the factory evaluates to true for the * given selection. @@ -183,13 +183,13 @@ public class DetailPaneManager { } return enabled; } - + /** * Evaluate the given expression within the given context and return * the result. Returns true iff result is either TRUE or NOT_LOADED. * This allows optimistic inclusion of shortcuts before plug-ins are loaded. * Returns false if expression is null. - * + * * @param exp the enablement expression to evaluate or null * @param context the context of the evaluation. Usually, the * user's selection. @@ -208,11 +208,11 @@ public class DetailPaneManager { } return false; } - + /** * Returns an expression that represents the enablement logic for the * detail pane factory or null if none. - * + * * @return an evaluatable expression or null */ private Expression getEnablementExpression(){ @@ -220,7 +220,7 @@ public class DetailPaneManager { if (fEnablementExpression == null) { try{ IConfigurationElement[] elements = fConfigElement.getChildren(ExpressionTagNames.ENABLEMENT); - IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; + IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; if (enablement != null) { fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); } @@ -231,42 +231,42 @@ public class DetailPaneManager { } return fEnablementExpression; } - + } - + /** * There should only ever be once instance of this manager for the workbench. */ private static DetailPaneManager fgSingleton; - + /** * Maps the IDs of types of detail panes to the factory that can create them. * There can currently only be one factory for a given type of details pane. */ private Map fFactoriesByPaneID; - + /** * Maps a Set of detail pane id's to the one detail pane id that is preferred. */ private Map, String> fPreferredDetailPanes; - + /** * The set of all factories that have been loaded from the extension point. */ private List fKnownFactories; - + /** * Preference key for storing the preferred detail panes map. * @see #storePreferredDetailsAreas() * @see #loadPreferredDetailsAreas() */ public static final String PREF_DETAIL_AREAS = "preferredDetailPanes"; //$NON-NLS-1$ - + private DetailPaneManager(){ fFactoriesByPaneID = new HashMap(); fFactoriesByPaneID.put(MessageDetailPane.ID, new DefaultDetailPaneFactory()); } - + public static DetailPaneManager getDefault(){ if (fgSingleton == null) { fgSingleton = new DetailPaneManager(); @@ -276,7 +276,7 @@ public class DetailPaneManager { /** * Returns the ID of the preferred detail pane for the given selection. - * + * * @param selection The selection to display in the detail pane * @return The ID of the preferred detail pane or null */ @@ -285,11 +285,11 @@ public class DetailPaneManager { Set possiblePaneIDs = getPossiblePaneIDs(possibleFactories, selection); return chooseDetailsAreaIDInSet(possiblePaneIDs, possibleFactories, selection); } - + /** * Returns the set of all possible detail panes the can display the given * selection. - * + * * @param selection The selection to display in the detail pane * @return The set of IDs of all possible detail panes for the given selection */ @@ -297,14 +297,14 @@ public class DetailPaneManager { List possibleFactories = getEnabledFactories(selection); return getPossiblePaneIDs(possibleFactories, selection); } - + /** * Given the ID of a details pane, this method will try to find the factory * that creates it and return an instantiation of that area. *

    * This method will not call the init() method of the IDetailsPane. *

    - * + * * @param ID The ID of the requested pane * @return The instantiated pane or null */ @@ -315,11 +315,11 @@ public class DetailPaneManager { } return null; } - + /** * Given the ID of a details pane, this method will try to find the factory * that creates it and ask it for the name of the details pane. - * + * * @param ID The ID of the requested pane * @return The name of the details pane or null */ @@ -330,11 +330,11 @@ public class DetailPaneManager { } return null; } - + /** * Given the ID of a details pane, this method will try to find the factory * that creates it and ask it for the description of the details pane. - * + * * @param ID The ID of the requested pane * @return The description of the details pane or null */ @@ -345,15 +345,15 @@ public class DetailPaneManager { } return null; } - - + + /** * Returns the set of IDetailPaneFactories (they will be DetailPaneFactoryDelegates) that were * contributed to the extension point and are enabled for the given selection - * (enabled if the factory does not have an enablement expression or if the + * (enabled if the factory does not have an enablement expression or if the * enablement expression evaluates to true). * @param selection the current view selection - * + * * @return The factories enabled for the selection or an empty collection. */ private List getEnabledFactories(IStructuredSelection selection) { @@ -366,15 +366,15 @@ public class DetailPaneManager { if (((DetailPaneFactoryExtension)currentFactory).isEnabled(selection)){ factoriesForSelection.add(currentFactory); } - } - } + } + } return factoriesForSelection; } - + /** * Produces the set of IDs for all possible detail panes that can be used to display * the given selection. - * + * * @param factoriesToQuery The collection of factories to check * @param selection The selection to be displayed * @return Set of pane IDs or an empty set @@ -384,8 +384,8 @@ public class DetailPaneManager { for (IDetailPaneFactory currentFactory : factoriesToQuery) { for (String currentAreaTypeID : currentFactory.getDetailPaneTypes(selection)) { fFactoriesByPaneID.put(currentAreaTypeID, currentFactory); - idsForSelection.add(currentAreaTypeID); - } + idsForSelection.add(currentAreaTypeID); + } } return idsForSelection; } @@ -394,7 +394,7 @@ public class DetailPaneManager { * Given a set of possible detail pane IDs, this method will determine which pane is * preferred and should be used to display the selection. This method chooses a pane * by storing previous choices and can be set using a context menu. - * + * * @param possiblePaneIDs The set of possible detail pane IDs * @param enabledFactories the complete listing of enable {@link IDetailPaneFactory}s * @param selection the current selection from the variables view @@ -404,9 +404,9 @@ public class DetailPaneManager { if (possiblePaneIDs == null || possiblePaneIDs.isEmpty()){ return null; } - + String preferredID = getUserPreferredDetailPane(possiblePaneIDs); - + if (preferredID == null){ // If there is no preferred pane already set, check the factories to see there is a default pane for (IDetailPaneFactory currentFactory : enabledFactories) { @@ -416,7 +416,7 @@ public class DetailPaneManager { } } // If the factories don't have a default, try to choose the DefaultDetailPane - if (preferredID == null){ + if (preferredID == null){ Iterator paneIterator = possiblePaneIDs.iterator(); // If the DefaultDetailPane is not in the set, just use the first in the set preferredID = paneIterator.next(); @@ -432,7 +432,7 @@ public class DetailPaneManager { return preferredID; } - + /** * Initializes the collection of known factories from extension point contributions. */ @@ -445,13 +445,13 @@ public class DetailPaneManager { for(int i = 0; i < infos.length; i++) { delegate = new DetailPaneFactoryExtension(infos[i]); fKnownFactories.add(delegate); - } + } } } - + /** * Returns the preferred pane ID from the given set if the mapping has been set. - * + * * @param possibleDetailsAreaIDs Set of possible pane IDs * @return The preferred ID or null */ @@ -460,13 +460,13 @@ public class DetailPaneManager { loadPreferredDetailsAreas(); } return fPreferredDetailPanes.get(possibleDetailsAreaIDs); - + } - + /** * Adds or updates the mapping to set which pane ID is preferred for a certain * set of possible IDs. - * + * * @param possibleDetailsAreaIDs The set of possible IDs * @param preferredDetailsAreaID The preferred ID in the set. */ @@ -482,15 +482,15 @@ public class DetailPaneManager { fPreferredDetailPanes.put(possibleDetailsAreaIDs, preferredDetailsAreaID); storePreferredDetailsAreas(); } - + } - + /** * Stores the map of preferred detail pane IDs to the preference store in the format: - * - * Key1A,Key1B:Value1|Key2A,Key2B,Key2C:Value2| - * - * Where the sub keys (Key1A, Key1B, etc.) are the elements of the set used at the + * + * Key1A,Key1B:Value1|Key2A,Key2B,Key2C:Value2| + * + * Where the sub keys (Key1A, Key1B, etc.) are the elements of the set used at the * key in the mapping and the values are the associated String value in the mapping. */ private void storePreferredDetailsAreas() { @@ -515,15 +515,15 @@ public class DetailPaneManager { } } } - + /** * Loads the map of preferred detail pane IDs from the preference store. - * + * * @see #storePreferredDetailsAreas() */ private void loadPreferredDetailsAreas() { fPreferredDetailPanes = new HashMap, String>(); - String preferenceValue = Platform.getPreferencesService().getString(DebugUIPlugin.getUniqueIdentifier(), + String preferenceValue = Platform.getPreferencesService().getString(DebugUIPlugin.getUniqueIdentifier(), PREF_DETAIL_AREAS, "", //$NON-NLS-1$ null); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java index b7e01ae38..ab1406d07 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442) @@ -37,44 +37,44 @@ import org.eclipse.ui.IWorkbenchPartSite; import com.ibm.icu.text.MessageFormat; /** - * Acts as a proxy between a view and a detail pane. Controls how information is displayed - * in the details pane in a view. Currently used by the variables, registers and expression - * views as well as the inspect popup dialog. The different types of detail panes use the - * detailPaneFactories extension and must implement IDetailPane. This class acts - * as a proxy to the current detail pane, each time the detail pane type changes, this class + * Acts as a proxy between a view and a detail pane. Controls how information is displayed + * in the details pane in a view. Currently used by the variables, registers and expression + * views as well as the inspect popup dialog. The different types of detail panes use the + * detailPaneFactories extension and must implement IDetailPane. This class acts + * as a proxy to the current detail pane, each time the detail pane type changes, this class * disposes of the old pane and creates the new one. Uses a DetailPaneManager to * organize and find the panes to display. - * + * * @see IDetailPane * @see DetailPaneManager * @since 3.3 */ public class DetailPaneProxy implements ISaveablePart { - + /** * The IDetailPane currently being used to display detailed information. */ private IDetailPane fCurrentPane; - + /** * The UI control that the current detail pane is using to display details. */ private Control fCurrentControl; - + /** * Detail pane container that the detail panes will be added to. */ private IDetailPaneContainer fParentContainer; - + /** * Property listeners */ private ListenerList fListeners = new ListenerList<>(); - + /** * Constructor that sets up the detail pane for a view. Note that no default pane * is created, so a control will not be created until display is called. - * + * * @param parent the detail pane container that is holding this detail pane */ public DetailPaneProxy(IDetailPaneContainer parent) { @@ -86,18 +86,18 @@ public class DetailPaneProxy implements ISaveablePart { * Informs the parent container if the type of detail pane changes. * If a null or empty selection is passed and a current pane exists, that view will be cleared. * If a null or empty selection is passed and no pane exists, the default view is created. - * + * * @param selection The selection to display detailed information for */ public void display(IStructuredSelection selection){ - + IDetailPane3 saveable = getSaveable(); boolean clean = false; if (saveable != null && saveable.isDirty() && saveable.isSaveOnCloseNeeded()) { // save the contents before changing saveable.doSave(null); } - + if ((selection == null || selection.isEmpty()) && fCurrentPane != null){ fCurrentPane.display(selection); if (clean) { @@ -105,13 +105,13 @@ public class DetailPaneProxy implements ISaveablePart { } return; } - + String preferredPaneID = DetailPaneManager.getDefault().getPreferredPaneFromSelection(selection); if (preferredPaneID == null) { preferredPaneID = MessageDetailPane.ID; selection = new StructuredSelection(DetailMessages.DetailPaneProxy_1); } - + // Don't change anything if the preferred pane is the current pane if (fCurrentPane != null && preferredPaneID.equals(fCurrentPane.getID())){ fCurrentPane.display(selection); @@ -120,9 +120,9 @@ public class DetailPaneProxy implements ISaveablePart { } return; } - + setupPane(preferredPaneID, selection); - + // Inform the container that a new detail pane is being used fParentContainer.paneChanged(preferredPaneID); if (clean) { @@ -130,7 +130,7 @@ public class DetailPaneProxy implements ISaveablePart { } } - + /** * Fires dirty property change. */ @@ -139,10 +139,10 @@ public class DetailPaneProxy implements ISaveablePart { iPropertyListener.propertyChanged(this, PROP_DIRTY); } } - + /** * Tells the current detail pane (if one exists) that it is gaining focus. - * + * * @return true if the current pane successfully set focus to a control, false otherwise */ public boolean setFocus(){ @@ -151,7 +151,7 @@ public class DetailPaneProxy implements ISaveablePart { } return false; } - + /** * Disposes of the current pane. */ @@ -165,7 +165,7 @@ public class DetailPaneProxy implements ISaveablePart { fCurrentControl = null; } } - + /** * Checks if the current pane supports the IAdaptable framework * and if so, calls its getAdapter() method. @@ -180,22 +180,22 @@ public class DetailPaneProxy implements ISaveablePart { return null; } } - + public Control getCurrentControl(){ return fCurrentControl; } - + public String getCurrentPaneID(){ if (fCurrentPane != null){ return fCurrentPane.getID(); } return null; } - + /** * Finds or creates an initialized detail pane with the given ID. Asks the detail - * pane to create the control and display the selection. - * + * pane to create the control and display the selection. + * * @param paneID the ID of the pane to display in * @param selection the selection to display */ @@ -234,7 +234,7 @@ public class DetailPaneProxy implements ISaveablePart { updateSelectionProvider(false); } }); - } + } } else{ createErrorLabel(DetailMessages.DetailPaneProxy_0); DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_2, new Object[] { fCurrentPane.getID() })))); @@ -250,7 +250,7 @@ public class DetailPaneProxy implements ISaveablePart { /** * Update the selection provider of the current detail pane in the container. - * + * * @param hasFocus whether the detail pane control has the focus */ protected void updateSelectionProvider(boolean hasFocus) { @@ -272,7 +272,7 @@ public class DetailPaneProxy implements ISaveablePart { /** * Creates a label in the detail pane area with the given message. - * + * * @param message The message to display */ private void createErrorLabel(String message){ @@ -344,10 +344,10 @@ public class DetailPaneProxy implements ISaveablePart { } return false; } - + /** * Returns the active saveable part or null if none. - * + * * @return saveable part or null */ IDetailPane3 getSaveable() { @@ -356,7 +356,7 @@ public class DetailPaneProxy implements ISaveablePart { } return null; } - + public void addProperyListener(IPropertyListener listener) { fListeners.add(listener); IDetailPane3 saveable = getSaveable(); @@ -364,7 +364,7 @@ public class DetailPaneProxy implements ISaveablePart { saveable.addPropertyListener(listener); } } - + public void removePropertyListener(IPropertyListener listener) { fListeners.remove(listener); IDetailPane3 saveable = getSaveable(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java index 0c5f5cb49..59a6b3a4a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -15,7 +15,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchPartSite; /** - * Interface for UI elements that contain detail panes. Provides access to + * Interface for UI elements that contain detail panes. Provides access to * information about the current detail pane and allows the container to be * informed of changes. * @@ -27,43 +27,43 @@ public interface IDetailPaneContainer { /** * Returns the string ID of the detail pane currently being displayed. - * + * * @return the ID of the current detail pane */ public String getCurrentPaneID(); - + /** * Returns the selection to be displayed in the detail pane. - * + * * @return the selection to be displayed in the detail pane. */ public IStructuredSelection getCurrentSelection(); - + /** * Returns the composite that detail panes will be added to. - * + * * @return the composite that detail panes will be added to */ public Composite getParentComposite(); - + /** * Returns the workbench part site that the detail pane is in or null * if the detail pane is not in a workbench part site. - * + * * @return the workbench part site the detail pane is in or null */ public IWorkbenchPartSite getWorkbenchPartSite(); - + /** * Refreshes the current detail pane with the current selection. */ public void refreshDetailPaneContents(); - + /** * Informs the container that the type of detail pane being used has changed. - * + * * @param newPaneID ID of the new detail pane */ public void paneChanged(String newPaneID); - + } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java index 22177df57..7357961ea 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java @@ -20,9 +20,9 @@ import org.eclipse.jface.viewers.ISelectionProvider; public interface IDetailPaneContainer2 extends IDetailPaneContainer { /** - * Set the selection provider of the detail pane. Allows the container to + * Set the selection provider of the detail pane. Allows the container to * forward the selection provider events to the container's workbench site. - * + * * @param provider the selection provider or null */ public void setSelectionProvider(ISelectionProvider provider); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java index 609ec9afb..3ea3ba955 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -24,39 +24,39 @@ import org.eclipse.ui.IWorkbenchPartSite; /** * A detail pane that displays a message in a wrapped label. Not contributed by an extension * point - used internally to display messages. - * + * * @since 3.6 */ public class MessageDetailPane implements IDetailPane { - + public static final String ID = IDebugUIConstants.PLUGIN_ID + ".detailpanes.message"; //$NON-NLS-1$ public static final String NAME = DetailMessages.MessageDetailPane_0; public static final String DESCRIPTION = DetailMessages.MessageDetailPane_1; - + /** * Composite that contains the label that has margins. */ private Composite fControlParent; - + /** * Label control */ private Label fLabel; - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite) */ @Override public void init(IWorkbenchPartSite partSite) { } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#dispose() */ @Override public void dispose() { fControlParent.dispose(); - } + } /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite) @@ -68,7 +68,7 @@ public class MessageDetailPane implements IDetailPane { fLabel = SWTFactory.createWrapLabel(fControlParent, "", 1); //$NON-NLS-1$ return fControlParent; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#setFocus() */ @@ -76,7 +76,7 @@ public class MessageDetailPane implements IDetailPane { public boolean setFocus() { return false; } - + /* (non-Javadoc) * @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection) */ -- cgit v1.2.3