aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2013-01-16 13:12:28 (EST)
committerDani Megert2013-01-18 04:20:17 (EST)
commit600c40cc2aa48880381806d90296c4b5591c6705 (patch)
tree7da75b4e5abf3a1c315022a97fe64fc9b0b155f5
parent08ea79a6dc4d3b1bdb2a9f89832063c7f9b51a6c (diff)
downloadeclipse.platform.debug-600c40cc2aa48880381806d90296c4b5591c6705.zip
eclipse.platform.debug-600c40cc2aa48880381806d90296c4b5591c6705.tar.gz
eclipse.platform.debug-600c40cc2aa48880381806d90296c4b5591c6705.tar.bz2
Bug 396356 - [variables] Ctrl-C accelerator doesn't work in Variables view
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java32
5 files changed, 48 insertions, 21 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java
index 879939d..a37a520 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2013 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
@@ -22,13 +22,13 @@ import org.eclipse.debug.core.IBreakpointsListener;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.viewers.model.VirtualCopyToClipboardActionDelegate;
import org.eclipse.debug.ui.AbstractDebugView;
+import org.eclipse.debug.ui.IDebugView;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.util.LocalSelectionTransfer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionFactory;
/**
* Copies breakpoint labels to the text clipboard and breakpoint objects
@@ -46,7 +46,7 @@ public class CopyBreakpointsActionDelegate extends VirtualCopyToClipboardActionD
LocalSelectionTransfer.getTransfer().setSelection(getSelection());
fStamp = System.currentTimeMillis();
LocalSelectionTransfer.getTransfer().setSelectionSetTime(fStamp);
- IAction pasteAction = ((AbstractDebugView)getView()).getAction(ActionFactory.PASTE.getCommandId());
+ IAction pasteAction = ((AbstractDebugView)getView()).getAction(IDebugView.PASTE_ACTION);
// update the enablement of the paste action
// workaround since the clipboard does not suppot callbacks
if (pasteAction instanceof PasteBreakpointsAction) {
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 7791d4f..123e351 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
@@ -1,5 +1,5 @@
/*****************************************************************
- * Copyright (c) 2009, 2012 Texas Instruments and others
+ * Copyright (c) 2009, 2013 Texas Instruments 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
@@ -244,7 +244,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
setAction(PASTE_ACTION, paste);
paste.setActionDefinitionId(ActionFactory.PASTE.getCommandId());
//actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
- setGlobalAction(ActionFactory.PASTE.getId(), paste);
+ setGlobalAction(PASTE_ACTION, paste);
getViewer().addSelectionChangedListener(paste);
paste.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
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 77b1a13..54f3d96 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -191,7 +191,7 @@ public class ExpressionView extends VariablesView {
*/
private void configure(IAction action, String defId, String globalId,
String imgId) {
- setAction(defId, action);
+ setAction(globalId, action);
action.setActionDefinitionId(defId);
setGlobalAction(globalId, action);
if (imgId != 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 caf555f..1099bc0 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -69,6 +69,7 @@ import org.eclipse.debug.ui.AbstractDebugView;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.IDebugView;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextService;
@@ -704,6 +705,24 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
getViewSite().getActionBars().updateActionBars();
}
+ /**
+ * Save the global actions from action bar so they are not overriden by
+ * the detail pane.
+ */
+ protected void createContextMenu(Control menuControl) {
+ super.createContextMenu(menuControl);
+ IActionBars actionBars = getViewSite().getActionBars();
+ if (!fGlobalActionMap.containsKey(SELECT_ALL_ACTION)) {
+ setGlobalAction(IDebugView.SELECT_ALL_ACTION, actionBars.getGlobalActionHandler(SELECT_ALL_ACTION));
+ }
+ if (!fGlobalActionMap.containsKey(COPY_ACTION)) {
+ setGlobalAction(COPY_ACTION, actionBars.getGlobalActionHandler(COPY_ACTION));
+ }
+ if (!fGlobalActionMap.containsKey(PASTE_ACTION)) {
+ setGlobalAction(PASTE_ACTION, actionBars.getGlobalActionHandler(PASTE_ACTION));
+ }
+ }
+
private void clearGlobalActions() {
for (Iterator keyItr = fGlobalActionMap.keySet().iterator(); keyItr.hasNext();) {
String id = (String)keyItr.next();
@@ -945,7 +964,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/**
* Adds the given action to the set of global actions managed by this
- * variables view. Global actions are cleard and reset whenever the detail
+ * 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.
*
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 09a6ba8..bde6a9a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -345,6 +345,12 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
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
*/
private IDocument fDetailDocument;
@@ -437,7 +443,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
getViewSite().getActionBars().updateActionBars();
updateAction(DETAIL_FIND_REPLACE_TEXT_ACTION);
-
+ fHasFocus = true;
}
public void focusLost(FocusEvent e) {
@@ -450,7 +456,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION).getActionDefinitionId(), null);
getViewSite().getActionBars().updateActionBars();
-
+ fHasFocus = false;
}
});
@@ -458,15 +464,17 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
// have been deactivated
fSourceViewer.getControl().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
- setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
- setGlobalAction(IDebugView.CUT_ACTION, null);
- setGlobalAction(IDebugView.COPY_ACTION, null);
- setGlobalAction(IDebugView.PASTE_ACTION, null);
- setGlobalAction(IDebugView.FIND_ACTION, null);
- setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION)
- .getActionDefinitionId(), null);
- setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION)
- .getActionDefinitionId(), null);
+ if (fHasFocus) {
+ setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
+ setGlobalAction(IDebugView.CUT_ACTION, null);
+ setGlobalAction(IDebugView.COPY_ACTION, null);
+ setGlobalAction(IDebugView.PASTE_ACTION, null);
+ setGlobalAction(IDebugView.FIND_ACTION, null);
+ setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION)
+ .getActionDefinitionId(), null);
+ setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION)
+ .getActionDefinitionId(), null);
+ }
}
});