Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a78704bf1ccd58a1b76da47b176e1f7a3a914694 (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
/*******************************************************************************
 * Copyright (c) 2000, 2003 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.core.variables;

import org.eclipse.core.runtime.CoreException;

/**
 * A dynamic variable is a variable whose value is computed dynamically
 * by a resolver at the time a string substitution is performed. A dynamic
 * variable is contributed by an extension.
 * <p>
 * The following is a definition of a dynamic variable that resolves to the name of the selected resource:
 * <pre>
 *  &lt;extension point="org.eclipse.core.variables.dynamicVariables"&gt;
 *    &lt;variable 
 *       name="resource_name"
 *       expanderClass="com.example.ResourceNameExpander"
 *       description="The name of the selected resource"&gt;
 *    &lt;/variable&gt;
 *  &lt;/extension&gt;
 * </pre>
 * </p>
 * 
 * @since 3.0
 */
public interface IDynamicVariable extends IStringVariable {

	/**
	 * Returns the value of this variable when referenced with the given
	 * argument, possibly <code>null</code>.
	 * 
	 * @param argument argument present in variable expression or <code>null</code>
	 *   if none
	 * @return value of this variable when referenced with the given argument, possibly
	 *   <code>null</code>
	 * @throws CoreException if unable to resolve a value for this variable
	 */
	public String getValue(String argument) throws CoreException;
}

Back to the top