diff options
author | Darin Wright | 2010-03-18 14:36:10 +0000 |
---|---|---|
committer | Darin Wright | 2010-03-18 14:36:10 +0000 |
commit | fbba645f295d261222f3437e993cc69662fecacd (patch) | |
tree | b5557cd68c3ba35b7baf621618edb453ff1acce0 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal | |
parent | ac20917fa9322e3c953cd972c279e3649d060c1f (diff) | |
download | eclipse.platform.debug-fbba645f295d261222f3437e993cc69662fecacd.tar.gz eclipse.platform.debug-fbba645f295d261222f3437e993cc69662fecacd.tar.xz eclipse.platform.debug-fbba645f295d261222f3437e993cc69662fecacd.zip |
Bug 306368 - The command ("paste") is undefined
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal')
2 files changed, 9 insertions, 46 deletions
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 b77bec40d..e03abaed3 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 @@ -73,6 +73,7 @@ import org.eclipse.ui.IMemento; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.actions.SelectionListenerAction; /** @@ -227,7 +228,11 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager fClipboard = new Clipboard(getSite().getShell().getDisplay()); PasteBreakpointsAction paste = new PasteBreakpointsAction(this); - configure(paste, PASTE_ACTION, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE); + setAction(PASTE_ACTION, paste); + paste.setActionDefinitionId(ActionFactory.PASTE.getCommandId()); + getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.PASTE.getId(), 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); @@ -370,24 +375,6 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager } } - /** - * Configures the action to override the global action, registers - * the action for selection change notification, and registers - * the action with this view. - * - * @param action selection action - * @param defId action definition id - * @param globalId global action id - * @param imgId image identifier - */ - private void configure(SelectionListenerAction action, String defId, String globalId, String imgId) { - setAction(defId, action); - action.setActionDefinitionId(defId); - getViewSite().getActionBars().setGlobalActionHandler(globalId, action); - getViewer().addSelectionChangedListener(action); - action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imgId)); - } - /** * Initializes drag and drop for the breakpoints viewer */ 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 895a644be..f2c515c38 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, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 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 @@ -44,14 +44,11 @@ import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.TextTransfer; import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchCommandConstants; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds; /** * Displays expressions and their values with a detail @@ -164,7 +161,7 @@ public class ExpressionView extends VariablesView { protected void createActions() { super.createActions(); fPasteAction = new PasteWatchExpressionsAction(this); - configure(fPasteAction, IWorkbenchActionDefinitionIds.PASTE, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE); + configure(fPasteAction, IWorkbenchCommandConstants.EDIT_PASTE, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE); } /** @@ -203,27 +200,6 @@ public class ExpressionView extends VariablesView { } return false; } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createTreeViewer(org.eclipse.swt.widgets.Composite) - */ - protected TreeModelViewer createTreeViewer(Composite parent) { - TreeModelViewer viewer = super.createTreeViewer(parent); - viewer.getTree().addFocusListener(new FocusListener() { - public void focusLost(FocusEvent e) { - if (fPasteAction != null) { - getViewSite().getActionBars().setGlobalActionHandler(PASTE_ACTION, null); - } - } - - public void focusGained(FocusEvent e) { - if (fPasteAction != null) { - getViewSite().getActionBars().setGlobalActionHandler(PASTE_ACTION, fPasteAction); - } - } - }); - return viewer; - } /** * Pastes the selection into the given target |