Class QuickAssistAssistant

    • Constructor Detail

      • QuickAssistAssistant

        public QuickAssistAssistant()
    • Method Detail

      • showPossibleQuickAssists

        public java.lang.String showPossibleQuickAssists()
        Description copied from interface: IQuickAssistAssistant
        Shows all possible quick fixes and quick assists at the viewer's cursor position.
        Specified by:
        showPossibleQuickAssists in interface IQuickAssistAssistant
        Returns:
        an optional error message if no proposals can be computed
      • setQuickAssistProcessor

        public void setQuickAssistProcessor​(IQuickAssistProcessor processor)
        Description copied from interface: IQuickAssistAssistant
        Registers a given quick assist processor for a particular content type. If there is already a processor registered, the new processor is registered instead of the old one.
        Specified by:
        setQuickAssistProcessor in interface IQuickAssistAssistant
        Parameters:
        processor - the quick assist processor to register, or null to remove an existing one
      • canFix

        public boolean canFix​(Annotation annotation)
        Description copied from interface: IQuickAssistAssistant
        Tells whether this assistant has a fix for the given annotation.

        Note: This test must be fast and optimistic i.e. it is OK to return true even though there might be no quick fix.

        Specified by:
        canFix in interface IQuickAssistAssistant
        Parameters:
        annotation - the annotation
        Returns:
        true if the assistant has a fix for the given annotation
      • canAssist

        public boolean canAssist​(IQuickAssistInvocationContext invocationContext)
        Description copied from interface: IQuickAssistAssistant
        Tells whether this assistant has assists for the given invocation context.
        Specified by:
        canAssist in interface IQuickAssistAssistant
        Parameters:
        invocationContext - the invocation context
        Returns:
        true if the assistant has a fix for the given annotation
      • install

        public void install​(ISourceViewer sourceViewer)
        Description copied from interface: IQuickAssistAssistant
        Installs quick assist support on the given source viewer.

        Note: This quick assist assistant will only be able to query the invocation context if sourceViewer also implements ISourceViewerExtension3.

        Specified by:
        install in interface IQuickAssistAssistant
        Parameters:
        sourceViewer - the source viewer on which quick assist will work
      • setRestoreCompletionProposalSize

        public void setRestoreCompletionProposalSize​(IDialogSettings dialogSettings)
        Tells this assistant to open the proposal popup with the size contained in the given dialog settings and to store the control's last valid size in the given dialog settings.

        Note: This API is only valid if the information control implements IInformationControlExtension3. Not following this restriction will later result in an UnsupportedOperationException.

        The constants used to store the values are:

        Parameters:
        dialogSettings - the dialog settings
        Since:
        3.7
      • possibleCompletionsClosed

        protected void possibleCompletionsClosed()
        Callback to signal this quick assist assistant that the presentation of the possible completions has been stopped.
      • setStatusMessage

        public void setStatusMessage​(java.lang.String message)
        Description copied from interface: IQuickAssistAssistant
        Sets the caption message displayed at the bottom of the completion proposal popup.
        Specified by:
        setStatusMessage in interface IQuickAssistAssistant
        Parameters:
        message - the message
      • getHandler

        public final IHandler getHandler​(java.lang.String commandId)
        Returns the handler for the given command identifier.

        The same handler instance will be returned when called a more than once with the same command identifier.

        Specified by:
        getHandler in interface IQuickAssistAssistantExtension
        Parameters:
        commandId - the command identifier
        Returns:
        the handler for the given command identifier
        Since:
        3.4
      • hide

        protected void hide()
        Hides any open pop-ups.
        Since:
        3.4
      • enableColoredLabels

        public void enableColoredLabels​(boolean isEnabled)
        Enables the support for colored labels in the proposal popup.

        Completion proposals can implement ICompletionProposalExtension6 to provide colored proposal labels.

        Specified by:
        enableColoredLabels in interface IQuickAssistAssistantExtension
        Parameters:
        isEnabled - if true the support for colored labels is enabled in the proposal popup
        Since:
        3.4