newest quantum CVS sources
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / editors / SQLContentAssistProcessor.java
diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentAssistProcessor.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentAssistProcessor.java
new file mode 100644 (file)
index 0000000..bf225cf
--- /dev/null
@@ -0,0 +1,69 @@
+package com.quantum.editors;
+
+import com.quantum.ImageStore;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+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.IContextInformationValidator;
+
+
+/**
+ * @author BC
+ */
+public class SQLContentAssistProcessor implements IContentAssistProcessor {
+
+       private String text;
+       /**
+        * @param string
+        */
+       public SQLContentAssistProcessor(String text) {
+               this.text = text;
+       }
+
+       public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+               
+               ICompletionProposal proposal = new CompletionProposal("select", 
+                               offset, 0, 6, ImageStore.getImage(ImageStore.TEMPLATE), 
+                               "select - select columns from a table or view", null, null);
+System.out.println(this.text);
+               // complete a key word
+
+               // complete a function
+
+               // provide a template
+
+               // TODO Auto-generated method stub
+               return new ICompletionProposal[] { proposal };
+       }
+
+       /**
+        * BCH: I have no idea what the difference is between context information and 
+        * completion proposals.
+        */
+       public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
+               return null;
+       }
+
+       /**
+        * Unless this method includes a space character, the standard Ctrl-Space key doesn't
+        * provide content assist.
+        */
+       public char[] getCompletionProposalAutoActivationCharacters() {
+               return new char[] { ' ' };
+       }
+
+       public char[] getContextInformationAutoActivationCharacters() {
+               return null;
+       }
+
+       public String getErrorMessage() {
+               return null;
+       }
+
+       public IContextInformationValidator getContextInformationValidator() {
+               return null;
+       }
+}