KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > actions > IVariableValueEditor


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial implementation
10  *******************************************************************************/

11 package org.eclipse.debug.ui.actions;
12
13 import org.eclipse.debug.core.model.IVariable;
14 import org.eclipse.swt.widgets.Shell;
15
16 /**
17  * A variable value editor allows the user to edit a variable's value.
18  * Variable value editors are contributed for a debug model via the
19  * <code>org.eclipse.debug.ui.variableValueEditors</code> extension point.
20  * <p>
21  * Following is example plug-in XML for contributing a variable value editor.
22  * <pre>
23  * &lt;extension point="org.eclipse.debug.ui.variableValueEditors"&gt;
24  * &lt;variableEditor
25  * modelId="com.examples.myDebugModel"
26  * class="com.examples.variables.MyVariableValueEditor"/&gt;
27  * &lt;/extension&gt;
28  * </pre>
29  * The attributes are specified as follows:
30  * <ul>
31  * <li><code>modelId</code> the debug model identifier for which the given
32  * variable value editor is applicable</li>
33  * <li><code>class</code> fully qualified name of a class that implements
34  * {@link IVariableValueEditor}</li>
35  * </ul>
36  * </p>
37  * <p>
38  * Clients may implement this interface.
39  * </p>
40  * @since 3.1
41  */

42 public interface IVariableValueEditor {
43
44     /**
45      * Edits the given variable, if appropriate. If this editor does not apply to
46      * the given variable this method returns false, which indicates that the
47      * Debug Platform's default variable edit dialog should be used.
48      *
49      * @param variable the variable to edit
50      * @param shell the currently active shell, which can be used to open a dialog
51      * for the user
52      * @return whether this editor has completed the edit operation for the given variable.
53      * <code>true</code> if no more work should be done, <code>false</code> if the debug
54      * platform should prompt the user to edit the given variable using the default
55      * variable editor
56      */

57     public boolean editVariable(IVariable variable, Shell shell);
58     
59     /**
60      * Saves the given expression to the given variable, if appropriate. If this
61      * editor does not set the given variable's value from the given expression, this
62      * method returns false. Returning false indicates that the Debug Platform should
63      * perform the default operation to set a variable's value based on a String.
64      *
65      * @param variable the variable to edit
66      * @param expression the expression to assign to the given variable
67      * @param shell the currently active shell, which can be used to report errors to the
68      * user. May be <code>null</code> if no active shell could be found.
69      * @return whether this editor has completed the save operation for the given variable.
70      * <code>true</code> if no more work should be done, <code>false</code> if the debug
71      * platform should perform the default save operation
72      */

73     public boolean saveVariable(IVariable variable, String JavaDoc expression, Shell shell);
74 }
75
Popular Tags