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 net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext;
13 import net.sourceforge.phpdt.externaltools.variable.IVariableResourceExpander;
15 import org.eclipse.core.resources.IResource;
16 import org.eclipse.core.runtime.IConfigurationElement;
19 * Represents the variable for a refresh scope.
21 public final class RefreshScopeVariable extends ExternalToolVariable {
22 private static final DefaultResourceExpander defaultExpander = new DefaultResourceExpander();
24 private IVariableResourceExpander expander = null;
27 * Creates a refresh scope variable
29 * @param tag the variable tag
30 * @param description a short description of what the variable will expand to
31 * @param element the configuration element
33 /*package*/ RefreshScopeVariable(String tag, String description, IConfigurationElement element) {
34 super(tag, description, element);
38 * Returns the object that can expand the variable
41 public IVariableResourceExpander getExpander() {
42 if (expander == null) {
43 expander = (IVariableResourceExpander) createObject(ExternalToolVariableRegistry.TAG_EXPANDER_CLASS);
45 expander = defaultExpander;
52 * Default variable resource expander implementation which does
53 * not expand variables, but just returns <code>null</code>.
55 private static final class DefaultResourceExpander implements IVariableResourceExpander {
57 * Method declared on IVariableResourceExpander.
59 public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) {