diff options
author | Darin Wright | 2005-02-10 19:46:10 +0000 |
---|---|---|
committer | Darin Wright | 2005-02-10 19:46:10 +0000 |
commit | e9ac447df2808036e0c0095fa6df90bba36125bc (patch) | |
tree | dffa6577407c641a84b0ff8ba5fed9fa4cc157f0 | |
parent | 1dcc33f095ff10b92e0ac5d9f7eb81d89b40ded0 (diff) | |
download | eclipse.platform.debug-e9ac447df2808036e0c0095fa6df90bba36125bc.tar.gz eclipse.platform.debug-e9ac447df2808036e0c0095fa6df90bba36125bc.tar.xz eclipse.platform.debug-e9ac447df2808036e0c0095fa6df90bba36125bc.zip |
Bug 84870 - add a way to disable primary selection clipboard
2 files changed, 21 insertions, 9 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java index 63a1fcd01..7e150fa60 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java @@ -73,17 +73,15 @@ public class PasteBreakpointsAction extends BreakpointSelectionAction { } /** - * The <code>PasteAction</code> implementation of this - * <code>SelectionListenerAction</code> method enables this action if - * a resource compatible with what is on the clipboard is selected. - * - * -Clipboard must have IResource or java.io.File - * -Projects can always be pasted if they are open - * -Workspace folder may not be copied into itself - * -Files and folders may be pasted to a single selected folder in open - * project or multiple selected files in the same folder + * Returns whether this action should be enabled based on the selection + * in the clipboard. Only updates when the breakpoints view has focus. */ protected boolean updateSelection(IStructuredSelection selection) { + // only update when view has focus + if (!getBreakpointsView().getViewer().getControl().isFocusControl()) { + return false; + } + // can't paste into "Others" (only move) Object target = getTarget(); if (target instanceof BreakpointContainer) { 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 71f30efd9..e01c034a2 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 @@ -866,4 +866,18 @@ public class BreakpointsView extends AbstractDebugView implements ISelectionList public boolean isShowingGroups() { return fContentProvider.isShowingGroups(); } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPart#setFocus() + */ + public void setFocus() { + super.setFocus(); + PasteBreakpointsAction action = (PasteBreakpointsAction) getAction(IWorkbenchActionDefinitionIds.PASTE); + if (action != null) { + action.selectionChanged((IStructuredSelection) getSite().getSelectionProvider().getSelection()); + } + + } + + } |