Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: acca1d12d54155bee0bf60fd08bcb29a5e805fb3 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * Copyright (c) 2004, 2005 IBM Corporation 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:
 *     IBM Corporation - initial implementation
 *******************************************************************************/
package org.eclipse.debug.ui.actions;

import org.eclipse.debug.core.model.IVariable;
import org.eclipse.swt.widgets.Shell;

/**
 * A variable value editor allows the user to edit a variable's value. Variable
 * value editors are contributed for a debug model via the
 * <code>org.eclipse.debug.ui.variableValueEditors</code> extension point.
 * <p>
 * Following is example plug-in XML for contributing a variable value editor.
 * </p>
 *
 * <pre>
 * &lt;extension point="org.eclipse.debug.ui.variableValueEditors"&gt;
 *    &lt;variableEditor
 *       modelId="com.examples.myDebugModel"
 *       class="com.examples.variables.MyVariableValueEditor"/&gt;
 * &lt;/extension&gt;
 * </pre>
 *
 * The attributes are specified as follows:
 * <ul>
 * <li><code>modelId</code> the debug model identifier for which the given
 * variable value editor is applicable</li>
 * <li><code>class</code> fully qualified name of a class that implements
 * {@link IVariableValueEditor}</li>
 * </ul>
 * <p>
 * Clients may implement this interface.
 * </p>
 *
 * @since 3.1
 */
public interface IVariableValueEditor {

	/**
	 * Edits the given variable, if appropriate. If this editor does not apply to
	 * the given variable this method returns false, which indicates that the
	 * Debug Platform's default variable edit dialog should be used.
	 *
	 * @param variable the variable to edit
	 * @param shell the currently active shell, which can be used to open a dialog
	 *  for the user
	 * @return whether this editor has completed the edit operation for the given variable.
	 *  <code>true</code> if no more work should be done, <code>false</code> if the debug
	 *  platform should prompt the user to edit the given variable using the default
	 *  variable editor
	 */
	boolean editVariable(IVariable variable, Shell shell);

	/**
	 * Saves the given expression to the given variable, if appropriate. If this
	 * editor does not set the given variable's value from the given expression, this
	 * method returns false. Returning false indicates that the Debug Platform should
	 * perform the default operation to set a variable's value based on a String.
	 *
	 * @param variable the variable to edit
	 * @param expression the expression to assign to the given variable
	 * @param shell the currently active shell, which can be used to report errors to the
	 *  user. May be <code>null</code> if no active shell could be found.
	 * @return whether this editor has completed the save operation for the given variable.
	 *  <code>true</code> if no more work should be done, <code>false</code> if the debug
	 *  platform should perform the default save operation
	 */
	boolean saveVariable(IVariable variable, String expression, Shell shell);
}

Back to the top