KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > IExpressionManager


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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;
12
13
14 import org.eclipse.debug.core.model.IExpression;
15 import org.eclipse.debug.core.model.IWatchExpression;
16 import org.eclipse.debug.core.model.IWatchExpressionDelegate;
17
18 /**
19  * The expression manager manages the collection of registered
20  * expressions in the workspace. An expression is a snippet of code
21  * that can be evaluated to produce a value. Expression creation
22  * and evaluation are client responsibilities.
23  * <p>
24  * Clients interested in expression change notification may
25  * register with the expression manager - see
26  * <code>IExpressionListener</code> and <code>IExpressionsListener</code>.
27  * </p>
28  * <p>
29  * This interface is not intended to be implemented by clients.
30  * </p>
31  * @see org.eclipse.debug.core.model.IExpression
32  * @see org.eclipse.debug.core.IExpressionListener
33  * @see org.eclipse.debug.core.IExpressionsListener
34  * @since 2.0
35  */

36 public interface IExpressionManager {
37     /**
38      * Adds the given expression to the collection of registered expressions
39      * in the workspace and notifies all registered listeners. This has no effect
40      * if the given expression is already registered.
41      *
42      * @param expression the expression to add
43      */

44     public void addExpression(IExpression expression);
45     
46     /**
47      * Adds the given expressions to the collection of registered expressions
48      * in the workspace and notifies all registered listeners. Has no effect
49      * on expressions already registered.
50      *
51      * @param expressions the expressions to add
52      * @since 2.1
53      */

54     public void addExpressions(IExpression[] expressions);
55     
56     /**
57      * Creates and returns a new watch expression with the
58      * given text. The returned expression is <b>not</b> added to
59      * this manager.
60      *
61      * @return new watch expression
62      * @param expressionText the text for the new expression
63      * @since 3.0
64      */

65     public IWatchExpression newWatchExpression(String JavaDoc expressionText);
66         
67     /**
68      * Returns a collection of all registered expressions,
69      * possibly empty.
70      *
71      * @return an array of expressions
72      */

73     public IExpression[] getExpressions();
74     
75     /**
76      * Returns whether there are any registered expressions
77      *
78      * @return whether there are any registered expressions
79      */

80     public boolean hasExpressions();
81     
82     /**
83      * Returns a collection of all expressions registered for the
84      * given debug model,possibly empty.
85      *
86      * @param modelIdentifier identifier of a debug model plug-in
87      * @return an array of expressions
88      */

89     public IExpression[] getExpressions(String JavaDoc modelIdentifier);
90         
91     /**
92      * Removes the given expression from the expression manager,
93      * and notifies all registered listeners. Has no effect if the
94      * given expression is not currently registered.
95      *
96      * @param expression the expression to remove
97      */

98     public void removeExpression(IExpression expression);
99     
100     /**
101      * Removes the given expressions from the collection of registered expressions
102      * in the workspace and notifies all registered listeners. Has no effect
103      * on expressions not already registered.
104      *
105      * @param expressions the expressions to remove
106      * @since 2.1
107      */

108     public void removeExpressions(IExpression[] expressions);
109
110     /**
111      * Adds the given listener to the collection of registered expression listeners.
112      * Has no effect if an identical listener is already registered.
113      *
114      * @param listener the listener to add
115      */

116     public void addExpressionListener(IExpressionListener listener);
117
118     /**
119      * Removes the given listener from the collection of registered expression listeners.
120      * Has no effect if an identical listener is not already registered.
121      *
122      * @param listener the listener to remove
123      */

124     public void removeExpressionListener(IExpressionListener listener);
125     
126     /**
127      * Adds the given listener to the collection of registered expression listeners.
128      * Has no effect if an identical listener is already registered.
129      *
130      * @param listener the listener to add
131      * @since 2.1
132      */

133     public void addExpressionListener(IExpressionsListener listener);
134
135     /**
136      * Removes the given listener from the collection of registered expression listeners.
137      * Has no effect if an identical listener is not already registered.
138      *
139      * @param listener the listener to remove
140      * @since 2.1
141      */

142     public void removeExpressionListener(IExpressionsListener listener);
143     
144     /**
145      * Returns a new watch expression delegate for the given debug
146      * model or <code>null</code> if no delegate is available.
147      *
148      * @param id the unique identifier of a debug model for which a
149      * watch expression delegate has been contributed
150      * @return a watch expression delegate associated with the given model
151      * or <code>null</code> if none
152      * @since 3.0
153      * @see IWatchExpressionDelegate
154      */

155     public IWatchExpressionDelegate newWatchExpressionDelegate(String JavaDoc id);
156     
157     /**
158      * Returns whether a watch expression delegate has been contributed for
159      * the given debug model.
160      *
161      * @param id the unique identifier of a debug model
162      * @return whether a watch expression delegate has been contributed for
163      * the given debug model
164      * @since 3.1
165      * @see IWatchExpressionDelegate
166      */

167     public boolean hasWatchExpressionDelegate(String JavaDoc id);
168 }
169
170
171
Popular Tags