Changes:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / php / HTMLCompletionProcessor.java
index 493021f..95360b8 100644 (file)
@@ -33,7 +33,7 @@ import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.swt.graphics.Image;
 
 /**
- * Example PHP completion processor.
+ * HTML completion processor.
  */
 public class HTMLCompletionProcessor implements IContentAssistProcessor {
 
@@ -111,6 +111,7 @@ public class HTMLCompletionProcessor implements IContentAssistProcessor {
 
   protected IContextInformationValidator fValidator = new Validator();
   private TemplateEngine fTemplateEngine;
+  private char[] fProposalAutoActivationSet;
   private PHPCompletionProposalComparator fComparator;
   private int fNumberOfComputedResults = 0;
 
@@ -122,6 +123,7 @@ public class HTMLCompletionProcessor implements IContentAssistProcessor {
 
     fComparator = new PHPCompletionProposalComparator();
   }
+  
   /* (non-Javadoc)
    * Method declared on IContentAssistProcessor
    */
@@ -209,13 +211,32 @@ public class HTMLCompletionProcessor implements IContentAssistProcessor {
     return proposals;
   }
 
-  /* (non-Javadoc)
-   * Method declared on IContentAssistProcessor
+  /**
+   * Tells this processor to order the proposals alphabetically.
+   * 
+   * @param order <code>true</code> if proposals should be ordered.
+   */
+  public void orderProposalsAlphabetically(boolean order) {
+    fComparator.setOrderAlphabetically(order);
+  }
+  
+  /**
+   * @see IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
    */
   public char[] getCompletionProposalAutoActivationCharacters() {
-    return new char[] { '<', '&', '#' };
+    return fProposalAutoActivationSet;
   }
-
+  
+  /**
+   * Sets this processor's set of characters triggering the activation of the
+   * completion proposal computation.
+   * 
+   * @param activationSet the activation set
+   */
+  public void setCompletionProposalAutoActivationCharacters(char[] activationSet) {
+    fProposalAutoActivationSet= activationSet;
+  }
+  
   /* (non-Javadoc)
    * Method declared on IContentAssistProcessor
    */