1 package net.sourceforge.phpdt.externaltools.internal.registry;
3 /**********************************************************************
4 Copyright (c) 2002 IBM Corp. and others. All rights reserved.
5 This file is made available under the terms of the Common Public License v1.0
6 which accompanies this distribution, and is available at
7 http://www.eclipse.org/legal/cpl-v10.html
10 **********************************************************************/
12 import org.eclipse.core.resources.IResource;
13 import org.eclipse.core.runtime.IConfigurationElement;
14 import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext;
15 import net.sourceforge.phpdt.externaltools.variable.IVariableResourceExpander;
18 * Represents the variable for a refresh scope.
20 public final class RefreshScopeVariable extends ExternalToolVariable {
21 private static final DefaultResourceExpander defaultExpander = new DefaultResourceExpander();
23 private IVariableResourceExpander expander = null;
26 * Creates a refresh scope variable
28 * @param tag the variable tag
29 * @param description a short description of what the variable will expand to
30 * @param element the configuration element
32 /*package*/ RefreshScopeVariable(String tag, String description, IConfigurationElement element) {
33 super(tag, description, element);
37 * Returns the object that can expand the variable
40 public IVariableResourceExpander getExpander() {
41 if (expander == null) {
42 expander = (IVariableResourceExpander) createObject(ExternalToolVariableRegistry.TAG_EXPANDER_CLASS);
44 expander = defaultExpander;
51 * Default variable resource expander implementation which does
52 * not expand variables, but just returns <code>null</code>.
54 private static final class DefaultResourceExpander implements IVariableResourceExpander {
56 * Method declared on IVariableResourceExpander.
58 public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) {