01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.internal.services;
11:
12: import org.eclipse.core.expressions.Expression;
13: import org.eclipse.jface.util.IPropertyChangeListener;
14:
15: /**
16: * @since 3.3
17: *
18: */
19: public class EvaluationReference extends EvaluationResultCache
20: implements IEvaluationReference {
21:
22: private IPropertyChangeListener listener;
23: private String property;
24: private boolean postingChanges = true;
25: private IEvaluationReference targetReference;
26:
27: /**
28: * @param expression
29: */
30: public EvaluationReference(Expression expression,
31: IPropertyChangeListener listener, String property,
32: IEvaluationReference targetReference) {
33: super (expression);
34: this .listener = listener;
35: this .property = property;
36: this .targetReference = targetReference;
37: }
38:
39: /*
40: * (non-Javadoc)
41: *
42: * @see org.eclipse.ui.internal.services.IEvaluationReference#getListener()
43: */
44: public IPropertyChangeListener getListener() {
45: return listener;
46: }
47:
48: public String getProperty() {
49: return property;
50: }
51:
52: /* (non-Javadoc)
53: * @see org.eclipse.ui.internal.services.IEvaluationReference#setFlopping(boolean)
54: */
55: public void setPostingChanges(boolean evaluationEnabled) {
56: this .postingChanges = evaluationEnabled;
57: }
58:
59: /* (non-Javadoc)
60: * @see org.eclipse.ui.internal.services.IEvaluationReference#isFlopping()
61: */
62: public boolean isPostingChanges() {
63: return postingChanges;
64: }
65:
66: public IEvaluationReference getTargetReference() {
67: return targetReference;
68: }
69:
70: /* (non-Javadoc)
71: * @see org.eclipse.ui.internal.services.IEvaluationReference#setTargetReference(org.eclipse.ui.internal.services.IEvaluationReference)
72: */
73: public void setTargetReference(IEvaluationReference targetReference) {
74: this.targetReference = targetReference;
75: }
76: }
|