intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.js.core / src / net / sourceforge / phpeclipse / js / core / model / JSFunctionElement.java
1 /*
2  * Created on May 15, 2003
3  *========================================================================
4  * Modifications history
5  *========================================================================
6  * $Log: not supported by cvs2svn $
7  * Revision 1.1  2004/02/26 02:25:42  agfitzp
8  * renamed packages to match xml & css
9  *
10  * Revision 1.1  2004/02/05 03:10:08  agfitzp
11  * Initial Submission
12  *
13  * Revision 1.1.2.1  2003/12/12 21:37:24  agfitzp
14  * Experimental work for Classes view
15  *
16  * Revision 1.2  2003/05/30 20:53:09  agfitzp
17  * 0.0.2 : Outlining is now done as the user types. Some other bug fixes.
18  *
19  *========================================================================
20  */
21 package net.sourceforge.phpeclipse.js.core.model;
22
23 import org.eclipse.core.resources.IFile;
24
25 /**
26  * @author fitzpata
27  */
28 public class JSFunctionElement extends JSElement
29 {
30
31         protected String arguments;
32         /**
33          * @param aName
34          * @param offset
35          * @param length
36          */
37         public JSFunctionElement(IFile aFile, String aName, String argumentString, int offset, int length)
38         {
39                 super(aFile, aName, offset, length);
40                 arguments = argumentString;
41         }
42
43         /**
44          * Method declared on IWorkbenchAdapter
45          * @param o
46          * 
47          * @return
48          */
49         public String getLabel(Object o)
50         {
51                 String firstPart = name;
52                 if(firstPart.length() <= 0){
53                         firstPart =  "<anonymous>";
54                 }
55                 
56                 return firstPart + arguments;
57         }
58
59         public int category()
60         {
61                 return FUNCTION;
62         }
63
64         /**
65          * @return
66          */
67         public String getArguments()
68         {
69                 return arguments;
70         }
71
72 }