Class JavaCodeCompletion

  • All Implemented Interfaces:
    org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer

    public class JavaCodeCompletion
    extends java.lang.Object
    implements org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
    The Code Completion for Java code that handles String's and Annotations.
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      ConstructorDescription
      JavaCodeCompletion()
      Default Eclipse constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.util.List<org.eclipse.jface.text.contentassist.ICompletionProposal>computeCompletionProposals​(org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
      Returns a list of completion proposals valid at the given invocation context.
      java.util.List<org.eclipse.jface.text.contentassist.IContextInformation>computeContextInformation​(org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
      Returns context information objects valid at the given invocation context.
      java.lang.StringgetErrorMessage()
      Returns the reason why this computer was unable to produce any completion proposals or context information.
      voidsessionEnded()
      Informs the computer that a content assist session has ended.
      voidsessionStarted()
      Informs the computer that a content assist session has started.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaCodeCompletion

        public JavaCodeCompletion()
        Default Eclipse constructor.
    • Method Detail

      • sessionStarted

        public void sessionStarted()
        Informs the computer that a content assist session has started. This call will always be followed by a sessionEnded() call, but not necessarily by calls to computeCompletionProposals or computeContextInformation.
        Specified by:
        sessionStarted in interface org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
      • computeCompletionProposals

        public java.util.List<org.eclipse.jface.text.contentassist.ICompletionProposal> computeCompletionProposals​(org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext context,
                                                                                                                   org.eclipse.core.runtime.IProgressMonitor monitor)
        Returns a list of completion proposals valid at the given invocation context.
        Specified by:
        computeCompletionProposals in interface org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
        Parameters:
        context - the context of the content assist invocation
        monitor - a progress monitor to report progress. The monitor is private to this invocation, i.e. there is no need for the receiver to spawn a sub monitor.
        Returns:
        a list of completion proposals (element type: ICompletionProposal)
      • computeContextInformation

        public java.util.List<org.eclipse.jface.text.contentassist.IContextInformation> computeContextInformation​(org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext context,
                                                                                                                  org.eclipse.core.runtime.IProgressMonitor monitor)
        Returns context information objects valid at the given invocation context.
        Specified by:
        computeContextInformation in interface org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
        Parameters:
        context - the context of the content assist invocation
        monitor - a progress monitor to report progress. The monitor is private to this invocation, i.e. there is no need for the receiver to spawn a sub monitor.
        Returns:
        A list of context information objects (element type: IContextInformation).
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Returns the reason why this computer was unable to produce any completion proposals or context information.
        Specified by:
        getErrorMessage in interface org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
        Returns:
        An error message or null if no error occurred.
      • sessionEnded

        public void sessionEnded()
        Informs the computer that a content assist session has ended. This call will always be after any calls to computeCompletionProposals and computeContextInformation.
        Specified by:
        sessionEnded in interface org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer