Show line numbers (other than 1) in problems view for errors and warnings
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / externaltools / variable / ResourceContainerExpander.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 container type variable into the desired
16  * result format.
17  * <p>
18  * This class is not intended to be extended by clients.
19  * </p>
20  */
21 public class ResourceContainerExpander extends ResourceExpander {
22
23         /**
24          * Create an instance
25          */
26         public ResourceContainerExpander() {
27                 super();
28         }
29
30         /* (non-Javadoc)
31          * Method declared on ResourceExpander.
32          */
33         /*package*/ IResource expand(String varValue, ExpandVariableContext context) {
34                 IResource resource = super.expand(varValue, context);
35                 if (resource != null)
36                         return resource.getParent();
37                 else
38                         return null;
39         }
40 }