KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > java > HippieProposalComputer


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.text.java;
12
13 import java.util.Arrays JavaDoc;
14 import java.util.List JavaDoc;
15
16 import org.eclipse.core.runtime.IProgressMonitor;
17
18 import org.eclipse.ui.texteditor.HippieProposalProcessor;
19
20 import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
21 import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
22
23
24 /**
25  * A computer wrapper for the hippie processor.
26  *
27  * @since 3.2
28  */

29 public final class HippieProposalComputer implements IJavaCompletionProposalComputer {
30     /** The wrapped processor. */
31     private final HippieProposalProcessor fProcessor= new HippieProposalProcessor();
32
33     /**
34      * Default ctor to make it instantiatable via the extension mechanism.
35      */

36     public HippieProposalComputer() {
37     }
38     
39     /*
40      * @see org.eclipse.jface.text.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.jface.text.contentassist.TextContentAssistInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
41      */

42     public List JavaDoc computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
43         return Arrays.asList(fProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset()));
44     }
45
46     /*
47      * @see org.eclipse.jface.text.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.jface.text.contentassist.TextContentAssistInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
48      */

49     public List JavaDoc computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
50         return Arrays.asList(fProcessor.computeContextInformation(context.getViewer(), context.getInvocationOffset()));
51     }
52
53     /*
54      * @see org.eclipse.jface.text.contentassist.ICompletionProposalComputer#getErrorMessage()
55      */

56     public String JavaDoc getErrorMessage() {
57         return fProcessor.getErrorMessage();
58     }
59
60     /*
61      * @see org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer#sessionStarted()
62      */

63     public void sessionStarted() {
64     }
65
66     /*
67      * @see org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer#sessionEnded()
68      */

69     public void sessionEnded() {
70     }
71 }
72
Popular Tags