KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > IWatchExpression


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.core.model;
12
13 /**
14  * A watch expression is an expression that is evaluated in the context
15  * of a specific stack frame, thread, debug target, process, or launch.
16  * Generally, a watch expression is a snippet of code that is evaluated
17  * each time a debug target suspends, or when a user provides a context
18  * for an evaluation by selecting a debug target or thread. An expression
19  * updates its value when it is provided with a context in which it
20  * can perform an evaluation.
21  * <p>
22  * Clients are not intended to implement this interface. An implementation
23  * is provided by the debug platform. Clients that support watch expressions
24  * should contribute and implement a watch expression delegate. Watch
25  * expressions can be created via the <code>IExpressionManager</code>.
26  * </p>
27  * @see org.eclipse.debug.core.model.IWatchExpressionDelegate
28  * @see org.eclipse.debug.core.IExpressionManager
29  * @since 3.0
30  */

31 public interface IWatchExpression extends IErrorReportingExpression {
32     
33     /**
34      * Updates this watch expression's value based on the current evaluation
35      * context. This watch expression fires a debug change event when the
36      * evaluation is complete. A watch expression can be asked to
37      * evaluate even when it is disabled. Note that implementations should
38      * generally be asynchronous to avoid blocking the calling thread.
39      */

40     public void evaluate();
41     /**
42      * Sets the context for this watch expression, or <code>null</code> if none.
43      * If the given context is valid for this expression, this expression may
44      * update its value. When the value update is complete, a debug change event is
45      * fired. When <code>null</code> is specified as a context, this expression
46      * may choose to retain its previous value.
47      * <p>
48      * The context is usually one of (but not limited to):
49      * <ul>
50      * <li>a debug target (<code>IDebugTarget</code>)</li>
51      * <li>a thread (<code>IThread</code>)</li>
52      * <li>a stack frame (<code>IStackFrame</code>)</li>
53      * </ul>
54      * </p>
55      *
56      * @param context context in which to update this expression's value, or
57      * <code>null</code> if none
58      */

59     public void setExpressionContext(IDebugElement context);
60     /**
61      * Sets this watch expression's snippet of code. This method
62      * causes the new snippet to be evaluated immediately in
63      * the expression's last context.
64      *
65      * @param expressionText the snippet which will be evaluated
66      */

67     public void setExpressionText(String JavaDoc expressionText);
68     /**
69      * Returns whether the result of this watch expression is pending.
70      * An expression is pending if an evaluation has been requested, but
71      * the value has not yet been returned.
72      *
73      * @return whether this expression's result is pending
74      */

75     public boolean isPending();
76     /**
77      * Returns whether this expression is enabled. An enabled expression will
78      * update its value. A disabled expression will not.
79      *
80      * @return whether this expression is enabled
81      */

82     public boolean isEnabled();
83     /**
84      * Sets this expression's enabled state. This method
85      * causes the new snippet to be evaluated immediately in
86      * the expression's last context.
87      *
88      * @param enabled whether this expression should be enabled
89      */

90     public void setEnabled(boolean enabled);
91
92 }
93
Popular Tags