Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 73c1cf6abf192888299231c0d1c90fa80b9eee0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2009 Adobe Systems, Inc. and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     Adobe Systems, Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.internal.ui.actions.expressions;

import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.views.expression.ExpressionView;
import org.eclipse.ui.actions.SelectionListenerAction;

/**
 * Paste a watch expression into the expressions view.
 */
public class PasteWatchExpressionsAction extends SelectionListenerAction {

	private final ExpressionView fExpressionView;

	public PasteWatchExpressionsAction(ExpressionView expressionView) {
		super(ActionMessages.PasteWatchExpressionsAction_0);
		fExpressionView = expressionView;
//        setToolTipText(BreakpointGroupMessages.PasteWatchExpressionsAction_1);
//        PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.PASTE_WATCH_EXPRESSIONS_ACTION);
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
	 */
	@Override
	public void run() {
		if (fExpressionView.canPaste()) {
			fExpressionView.performPaste();
		}
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.action.Action#isEnabled()
	 */
	@Override
	public boolean isEnabled() {
		return fExpressionView.canPaste();
	}



}

Back to the top