diff options
author | Pawel Piech | 2009-09-02 21:00:00 +0000 |
---|---|---|
committer | Pawel Piech | 2009-09-02 21:00:00 +0000 |
commit | 3032ffd71a57d1818a759fa1fb21788fd1ad8381 (patch) | |
tree | c562057f0bb38395dc483165f3b2dbf713316b32 /org.eclipse.debug.ui/ui | |
parent | 41d00a6636352205da39b5597e55fb43db282026 (diff) | |
download | eclipse.platform.debug-3032ffd71a57d1818a759fa1fb21788fd1ad8381.tar.gz eclipse.platform.debug-3032ffd71a57d1818a759fa1fb21788fd1ad8381.tar.xz eclipse.platform.debug-3032ffd71a57d1818a759fa1fb21788fd1ad8381.zip |
Bug 287334 - Problem with pasting expressions in Expressions view
Diffstat (limited to 'org.eclipse.debug.ui/ui')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java | 30 |
1 files changed, 28 insertions, 2 deletions
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 0b6db0ec9..bdd9de2b0 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 @@ -42,6 +42,9 @@ 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; @@ -54,6 +57,8 @@ import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds; */ public class ExpressionView extends VariablesView { + private PasteWatchExpressionsAction fPasteAction; + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId() */ @@ -159,8 +164,8 @@ public class ExpressionView extends VariablesView { */ protected void createActions() { super.createActions(); - PasteWatchExpressionsAction paste = new PasteWatchExpressionsAction(this); - configure(paste, IWorkbenchActionDefinitionIds.PASTE, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE); + fPasteAction = new PasteWatchExpressionsAction(this); + configure(fPasteAction, IWorkbenchActionDefinitionIds.PASTE, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE); } /** @@ -200,6 +205,27 @@ 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 * |