1 package com.quantum.editors;
3 import com.quantum.ImageStore;
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;
16 public class SQLContentAssistProcessor implements IContentAssistProcessor {
22 public SQLContentAssistProcessor(String text) {
26 public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
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
34 // complete a function
38 // TODO Auto-generated method stub
39 return new ICompletionProposal[] { proposal };
43 * BCH: I have no idea what the difference is between context information and
44 * completion proposals.
46 public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
51 * Unless this method includes a space character, the standard Ctrl-Space key doesn't
52 * provide content assist.
54 public char[] getCompletionProposalAutoActivationCharacters() {
55 return new char[] { ' ' };
58 public char[] getContextInformationAutoActivationCharacters() {
62 public String getErrorMessage() {
66 public IContextInformationValidator getContextInformationValidator() {