Added auto activation for HTML characters (i.e. <&#) in the Preference Page
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / php / HTMLCompletionProcessor.java
index 9323dae..1f712a3 100644 (file)
@@ -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;
 
@@ -209,13 +210,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
    */