Committing changes needed for the 1.2.0 release build. Removed addition of compat...
[phpeclipse.git] / net.sourceforge.phpeclipse.externaltools / src / net / sourceforge / phpdt / externaltools / variable / ResourceProjectExpander.java
1 package net.sourceforge.phpdt.externaltools.variable;
2
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
8  �
9  Contributors:
10  **********************************************************************/
11
12 import org.eclipse.core.resources.IResource;
13
14 /**
15  * Expands a resource's project type variable into the desired result format.
16  * <p>
17  * This class is not intended to be extended by clients.
18  * </p>
19  */
20 public class ResourceProjectExpander extends ResourceExpander {
21
22         /**
23          * Create an instance
24          */
25         public ResourceProjectExpander() {
26                 super();
27         }
28
29         /*
30          * (non-Javadoc) Method declared on ResourceExpander.
31          */
32         /* package */IResource expandUsingContext(ExpandVariableContext context) {
33                 return context.getProject();
34         }
35
36         /*
37          * (non-Javadoc) Method declared on ResourceExpander.
38          */
39         /* package */IResource expandToMember(String varValue) {
40                 IResource member = super.expandToMember(varValue);
41                 if (member != null)
42                         return member.getProject();
43                 else
44                         return null;
45         }
46 }