01: /*******************************************************************************
02: * Copyright (c) 2005 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;
11:
12: import java.util.Map;
13:
14: /**
15: * <p>
16: * A listener to changes in a particular source of information. This listener is
17: * notified as the source changes. Typically, workbench services will implement
18: * this interface, and register themselves as listeners to the
19: * <code>ISourceProvider</code> instances that are registered with them.
20: * </p>
21: *
22: * @since 3.1
23: * @see org.eclipse.ui.ISources
24: * @see org.eclipse.ui.ISourceProvider
25: */
26: public interface ISourceProviderListener {
27:
28: /**
29: * Handles a change to multiple sources. The source priority should be a bit
30: * mask indicating the sources. The map will be used to construct the
31: * variables on an <code>IEvaluationContext</code>
32: *
33: * @param sourcePriority
34: * A bit mask of all the source priorities that have changed.
35: * @param sourceValuesByName
36: * A mapping of the source names (<code>String</code>) to the
37: * source values (<code>Object</code>). The names should
38: * never be <code>null</code>, but the values may be. The map
39: * must not be <code>null</code>, and should contain at least
40: * two elements (one for each source).
41: * @see org.eclipse.core.expressions.IEvaluationContext
42: * @see ISources
43: */
44: public void sourceChanged(final int sourcePriority,
45: final Map sourceValuesByName);
46:
47: /**
48: * Handles a change to one source. The source priority should indicate the
49: * source, and the name-value pair will be used to create an
50: * <code>IEvaluationContext</code> with a single variable.
51: *
52: * @param sourcePriority
53: * A bit mask of all the source priorities that have changed.
54: * @param sourceName
55: * The name of the source that changed; must not be
56: * <code>null</code>.
57: * @param sourceValue
58: * The new value for that source; may be <code>null</code>.
59: * @see org.eclipse.core.expressions.IEvaluationContext
60: * @see ISources
61: */
62: public void sourceChanged(final int sourcePriority,
63: final String sourceName, final Object sourceValue);
64: }
|