fixed Bug 1024299
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / editors / SQLContentAssistProcessor.java
1 package com.quantum.editors;
2
3 import com.quantum.ImageStore;
4
5 import org.eclipse.jface.text.ITextViewer;
6 import org.eclipse.jface.text.contentassist.CompletionProposal;
7 import org.eclipse.jface.text.contentassist.ICompletionProposal;
8 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
9 import org.eclipse.jface.text.contentassist.IContextInformation;
10 import org.eclipse.jface.text.contentassist.IContextInformationValidator;
11
12
13 /**
14  * @author BC
15  */
16 public class SQLContentAssistProcessor implements IContentAssistProcessor {
17
18         private String text;
19         /**
20          * @param string
21          */
22         public SQLContentAssistProcessor(String text) {
23                 this.text = text;
24         }
25
26         public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
27                 
28                 ICompletionProposal proposal = new CompletionProposal("select", 
29                                 offset, 0, 6, ImageStore.getImage(ImageStore.TEMPLATE), 
30                                 "select - select columns from a table or view", null, null);
31 //System.out.println(this.text);
32                 // complete a key word
33
34                 // complete a function
35
36                 // provide a template
37
38                 // TODO Auto-generated method stub
39                 return new ICompletionProposal[] { proposal };
40         }
41
42         /**
43          * BCH: I have no idea what the difference is between context information and 
44          * completion proposals.
45          */
46         public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
47                 return null;
48         }
49
50         /**
51          * Unless this method includes a space character, the standard Ctrl-Space key doesn't
52          * provide content assist.
53          */
54         public char[] getCompletionProposalAutoActivationCharacters() {
55                 return new char[] { ' ' };
56         }
57
58         public char[] getContextInformationAutoActivationCharacters() {
59                 return null;
60         }
61
62         public String getErrorMessage() {
63                 return null;
64         }
65
66         public IContextInformationValidator getContextInformationValidator() {
67                 return null;
68         }
69 }