Improved auto completion
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / template / IdentifierProposal.java
index 39b98e3..8e7502e 100644 (file)
@@ -37,7 +37,8 @@ public class IdentifierProposal implements IJavaCompletionProposal {
   private final String fTemplate;
   private final TemplateContext fContext;
   private final ITextViewer fViewer;
-  //   private final Image fImage;
+  private final Image fImage_fun;
+  private final Image fImage_var;
   private final IRegion fRegion;
 
   //private TemplateBuffer fTemplateBuffer;
@@ -50,7 +51,7 @@ public class IdentifierProposal implements IJavaCompletionProposal {
    * @param context   the context in which the template was requested.
    * @param image     the icon of the proposal.
    */
-  public IdentifierProposal(String template, TemplateContext context, IRegion region, ITextViewer viewer) { //, Image image) {
+  public IdentifierProposal(String template, TemplateContext context, IRegion region, ITextViewer viewer, Image image_fun, Image image_var) {
     //         Assert.isNotNull(template);
     //         Assert.isNotNull(context);
     //         Assert.isNotNull(region);
@@ -59,7 +60,8 @@ public class IdentifierProposal implements IJavaCompletionProposal {
     fTemplate = template;
     fContext = context;
     fViewer = viewer;
-    //         fImage= image;
+       fImage_fun= image_fun;
+    fImage_var= image_var;
     fRegion = region;
   }
 
@@ -159,8 +161,10 @@ public class IdentifierProposal implements IJavaCompletionProposal {
    * @see ICompletionProposal#getImage()
    */
   public Image getImage() {
-    //         return fImage;
-    return null;
+    if (fTemplate.charAt(0)=='$') {
+      return fImage_var;
+    }
+               return fImage_fun;
   }
 
   /*