Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 72c1611351f3519b700fff35c7eea7e7e98c71b2 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*******************************************************************************
 * Copyright (c) 2000, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.core;


import org.eclipse.debug.core.model.IExpression;
import org.eclipse.debug.core.model.IWatchExpression;
import org.eclipse.debug.core.model.IWatchExpressionDelegate;

/**
 * The expression manager manages the collection of registered
 * expressions in the workspace. An expression is a snippet of code
 * that can be evaluated to produce a value. Expression creation
 * and evaluation are client responsibilities.
 * <p>
 * Clients interested in expression change notification may
 * register with the expression manager - see
 * <code>IExpressionListener</code> and <code>IExpressionsListener</code>.
 * </p>
 * @see org.eclipse.debug.core.model.IExpression
 * @see org.eclipse.debug.core.IExpressionListener
 * @see org.eclipse.debug.core.IExpressionsListener
 * @since 2.0
 * @noimplement This interface is not intended to be implemented by clients.
 * @noextend This interface is not intended to be extended by clients.
 */
public interface IExpressionManager {
	/**
	 * Adds the given expression to the collection of registered expressions
	 * in the workspace and notifies all registered listeners. This has no effect
	 * if the given expression is already registered.
	 *
	 * @param expression the expression to add
	 */
	public void addExpression(IExpression expression);

	/**
	 * Adds the given expressions to the collection of registered expressions
	 * in the workspace and notifies all registered listeners. Has no effect
	 * on expressions already registered.
	 *
	 * @param expressions the expressions to add
	 * @since 2.1
	 */
	public void addExpressions(IExpression[] expressions);

	/**
	 * Creates and returns a new watch expression with the
	 * given text. The returned expression is <b>not</b> added to
	 * this manager.
	 *
	 * @return new watch expression
	 * @param expressionText the text for the new expression
	 * @since 3.0
	 */
	public IWatchExpression newWatchExpression(String expressionText);

	/**
	 * Returns a collection of all registered expressions,
	 * possibly empty.
	 *
	 * @return an array of expressions
	 */
	public IExpression[] getExpressions();

	/**
	 * Returns whether there are any registered expressions
	 *
	 * @return whether there are any registered expressions
	 */
	public boolean hasExpressions();

	/**
	 * Returns a collection of all expressions registered for the
	 * given debug model,possibly empty.
	 *
	 * @param modelIdentifier identifier of a debug model plug-in
	 * @return an array of expressions
	 */
	public IExpression[] getExpressions(String modelIdentifier);

	/**
	 * Removes the given expression from the expression manager,
	 * and notifies all registered listeners. Has no effect if the
	 * given expression is not currently registered.
	 *
	 * @param expression the expression to remove
	 */
	public void removeExpression(IExpression expression);

	/**
	 * Removes the given expressions from the collection of registered expressions
	 * in the workspace and notifies all registered listeners. Has no effect
	 * on expressions not already registered.
	 *
	 * @param expressions the expressions to remove
	 * @since 2.1
	 */
	public void removeExpressions(IExpression[] expressions);

	/**
	 * Adds the given listener to the collection of registered expression listeners.
	 * Has no effect if an identical listener is already registered.
	 *
	 * @param listener the listener to add
	 */
	public void addExpressionListener(IExpressionListener listener);

	/**
	 * Removes the given listener from the collection of registered expression listeners.
	 * Has no effect if an identical listener is not already registered.
	 *
	 * @param listener the listener to remove
	 */
	public void removeExpressionListener(IExpressionListener listener);

	/**
	 * Adds the given listener to the collection of registered expression listeners.
	 * Has no effect if an identical listener is already registered.
	 *
	 * @param listener the listener to add
	 * @since 2.1
	 */
	public void addExpressionListener(IExpressionsListener listener);

	/**
	 * Removes the given listener from the collection of registered expression listeners.
	 * Has no effect if an identical listener is not already registered.
	 *
	 * @param listener the listener to remove
	 * @since 2.1
	 */
	public void removeExpressionListener(IExpressionsListener listener);

	/**
	 * Returns a new watch expression delegate for the given debug
	 * model or <code>null</code> if no delegate is available.
	 *
	 * @param id the unique identifier of a debug model for which a
	 *  watch expression delegate has been contributed
	 * @return a watch expression delegate associated with the given model
	 * 		or <code>null</code> if none
	 * @since 3.0
	 * @see IWatchExpressionDelegate
	 */
	public IWatchExpressionDelegate newWatchExpressionDelegate(String id);

    /**
     * Returns whether a watch expression delegate has been contributed for
     * the given debug model.
     *
     * @param id the unique identifier of a debug model
     * @return whether a watch expression delegate has been contributed for
     *    the given debug model
     * @since 3.1
     * @see IWatchExpressionDelegate
     */
    public boolean hasWatchExpressionDelegate(String id);
}


Back to the top