misc
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / php / PHPCompletionProcessor.java
index 98f40cb..c0bdd55 100644 (file)
@@ -40,6 +40,7 @@ import net.sourceforge.phpdt.internal.corext.template.php.JavaContext;
 import net.sourceforge.phpdt.internal.corext.template.php.JavaContextType;
 import net.sourceforge.phpdt.internal.ui.text.PHPCodeReader;
 import net.sourceforge.phpdt.internal.ui.text.java.IPHPCompletionProposal;
+import net.sourceforge.phpdt.internal.ui.text.java.JavaParameterListValidator;
 import net.sourceforge.phpdt.internal.ui.text.java.PHPCompletionProposalComparator;
 import net.sourceforge.phpdt.internal.ui.text.template.BuiltInEngine;
 import net.sourceforge.phpdt.internal.ui.text.template.DeclarationEngine;
@@ -59,12 +60,10 @@ import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextPresentation;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.jface.text.contentassist.IContextInformationExtension;
-import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
 import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.jface.text.templates.TemplateContextType;
 import org.eclipse.swt.graphics.Image;
@@ -82,30 +81,30 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
   /**
    * Simple content assist tip closer. The tip is valid in a range of 5 characters around its popup location.
    */
-  protected static class Validator implements IContextInformationValidator, IContextInformationPresenter {
-    protected int fInstallOffset;
-
-    /*
-     * @see IContextInformationValidator#isContextInformationValid(int)
-     */
-    public boolean isContextInformationValid(int offset) {
-      return Math.abs(fInstallOffset - offset) < 5;
-    }
-
-    /*
-     * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int)
-     */
-    public void install(IContextInformation info, ITextViewer viewer, int offset) {
-      fInstallOffset = offset;
-    }
-
-    /*
-     * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation)
-     */
-    public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
-      return false;
-    }
-  };
+//  protected static class Validator implements IContextInformationValidator, IContextInformationPresenter {
+//    protected int fInstallOffset;
+//
+//    /*
+//     * @see IContextInformationValidator#isContextInformationValid(int)
+//     */
+//    public boolean isContextInformationValid(int offset) {
+//      return Math.abs(fInstallOffset - offset) < 5;
+//    }
+//
+//    /*
+//     * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int)
+//     */
+//    public void install(IContextInformation info, ITextViewer viewer, int offset) {
+//      fInstallOffset = offset;
+//    }
+//
+//    /*
+//     * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation)
+//     */
+//    public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
+//      return false;
+//    }
+//  };
 
   private static class ContextInformationWrapper implements IContextInformation, IContextInformationExtension {
     private final IContextInformation fContextInformation;
@@ -177,7 +176,7 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
 
   private char[] fProposalAutoActivationSet;
 
-  protected IContextInformationValidator fValidator = new Validator();
+  protected IContextInformationValidator fValidator = null;// = new Validator();
 
   private TemplateEngine fTemplateEngine;
 
@@ -971,13 +970,15 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
    * (non-Javadoc) Method declared on IContentAssistProcessor
    */
   public char[] getContextInformationAutoActivationCharacters() {
-    return new char[] {};
+       return null;
   }
 
   /*
    * (non-Javadoc) Method declared on IContentAssistProcessor
    */
   public IContextInformationValidator getContextInformationValidator() {
+               if (fValidator == null)
+                       fValidator= new JavaParameterListValidator();
     return fValidator;
   }