Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-05-16 16:00:27 +0000
committerMichael Rennie2007-05-16 16:00:27 +0000
commitcb31464766c295d5707c5758a4e5eb771a255459 (patch)
treeaaf9525aef1e1f251146ba895a35e7d7c2334dd2 /org.eclipse.debug.ui
parent16488f111db171c80f063f91f846c546fce3e9d2 (diff)
downloadeclipse.platform.debug-cb31464766c295d5707c5758a4e5eb771a255459.tar.gz
eclipse.platform.debug-cb31464766c295d5707c5758a4e5eb771a255459.tar.xz
eclipse.platform.debug-cb31464766c295d5707c5758a4e5eb771a255459.zip
Bug 187171
[Memory View] Reset Monitors action is enabled when there is no monitor
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java54
2 files changed, 30 insertions, 27 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
index 98a1415f3..b305ce1d3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
@@ -103,14 +103,13 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
* Handle help events locally rather than deferring to WorkbenchHelp. This
* allows help specific to the selected config type to be presented.
*
- * @since 2.1
*/
protected void handleHelpRequest(HelpEvent evt) {
if (getViewer().getTree() != evt.getSource()) {
return;
}
String id = computeContextId();
- if (id!=null)
+ if (id != null)
PlatformUI.getWorkbench().getHelpSystem().displayHelp(id);
}
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 9b16ac4cc..1653ea66d 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2007. IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,62 +25,66 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IViewActionDelegate;
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{
private IViewPart fView;
private ArrayList fSelectedMB = new ArrayList();
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
public void init(IViewPart view) {
fView = view;
-
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
public void run(IAction action) {
-
- if (fSelectedMB.isEmpty())
+ if (fSelectedMB.isEmpty()) {
return;
-
+ }
boolean resetVisible = false;
-
String resetPref = DebugUITools.getPreferenceStore().getString(IDebugPreferenceConstants.PREF_RESET_MEMORY_BLOCK);
- if (resetPref.equals(IDebugPreferenceConstants.RESET_VISIBLE))
+ if (resetPref.equals(IDebugPreferenceConstants.RESET_VISIBLE)) {
resetVisible = true;
-
+ }
Iterator iter = fSelectedMB.iterator();
-
- while(iter.hasNext())
- {
+ while(iter.hasNext()) {
IMemoryBlock mb = (IMemoryBlock)iter.next();
- if (fView instanceof MemoryView)
- {
+ if (fView instanceof MemoryView) {
MemoryView memView = (MemoryView)fView;
IMemoryRenderingContainer[] containers = memView.getMemoryRenderingContainers();
- for (int i=0; i<containers.length; i++)
- {
- if (containers[i] instanceof RenderingViewPane)
- {
+ for (int i=0; i<containers.length; i++) {
+ if (containers[i] instanceof RenderingViewPane) {
((RenderingViewPane)containers[i]).resetRenderings(mb, resetVisible);
}
}
}
}
-
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection strucSel = (IStructuredSelection)selection;
+ action.setEnabled(!selection.isEmpty());
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection strucSel = (IStructuredSelection) selection;
Object[] objs = strucSel.toArray();
-
fSelectedMB.clear();
- for (int i=0; i<objs.length; i++)
- {
+ for (int i = 0; i < objs.length; i++) {
if (objs[i] instanceof IMemoryBlock)
fSelectedMB.add(objs[i]);
if (objs[i] instanceof IMemoryRendering)
- fSelectedMB.add(((IMemoryRendering)objs[i]).getMemoryBlock());
+ fSelectedMB.add(((IMemoryRendering) objs[i]).getMemoryBlock());
}
}
}

Back to the top