Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.jface.text.contentassist
Class ContentAssistant  view ContentAssistant download ContentAssistant.java

java.lang.Object
  extended byorg.eclipse.jface.text.contentassist.ContentAssistant
All Implemented Interfaces:
IContentAssistant, IContentAssistantExtension, org.eclipse.jface.text.IWidgetTokenKeeper, org.eclipse.jface.text.IWidgetTokenKeeperExtension

public class ContentAssistant
extends java.lang.Object
implements IContentAssistant, IContentAssistantExtension, org.eclipse.jface.text.IWidgetTokenKeeper, org.eclipse.jface.text.IWidgetTokenKeeperExtension

The standard implementation of the IContentAssistant interface. Usually, clients instantiate this class and configure it before using it.


Nested Class Summary
(package private)  class ContentAssistant.AutoAssistListener
          An implementation of IContentAssistListener, this class is used to monitor key events in support of automatic activation of the content assistant.
(package private)  class ContentAssistant.Closer
          A generic closer class used to monitor various interface events in order to determine whether content-assist should be terminated and all associated windows closed.
(package private)  class ContentAssistant.InternalListener
          Internal key listener and event consumer.
(package private)  class ContentAssistant.LayoutManager
          The layout manager layouts the various windows associated with the content assistant based on the settings of the content assistant.
 
Field Summary
(package private) static int CONTEXT_INFO_POPUP
           
(package private) static int CONTEXT_SELECTOR
           
private static int DEFAULT_AUTO_ACTIVATION_DELAY
           
private  int fAutoActivationDelay
           
private  ContentAssistant.AutoAssistListener fAutoAssistListener
           
private  ContentAssistant.Closer fCloser
           
private  org.eclipse.jface.contentassist.IContentAssistSubjectControl fContentAssistSubjectControl
          The content assist subject control.
private  ContentAssistSubjectControlAdapter fContentAssistSubjectControlAdapter
          The content assist subject control adapter.
private  ContextInformationPopup fContextInfoPopup
           
private  org.eclipse.swt.graphics.Color fContextInfoPopupBackground
           
private  org.eclipse.swt.graphics.Color fContextInfoPopupForeground
           
private  int fContextInfoPopupOrientation
           
private  org.eclipse.swt.graphics.Color fContextSelectorBackground
           
private  org.eclipse.swt.graphics.Color fContextSelectorForeground
           
private  org.eclipse.jface.dialogs.IDialogSettings fDialogSettings
          The dialog settings for the control's bounds.
private  org.eclipse.jface.text.IInformationControlCreator fInformationControlCreator
           
private  ContentAssistant.InternalListener fInternalListener
           
private  boolean fIsAutoActivated
           
private  boolean fIsAutoInserting
           
private  boolean fIsPrefixCompletionEnabled
          Prefix completion setting.
private  java.lang.String fLastErrorMessage
           
private  ContentAssistant.LayoutManager fLayoutManager
           
private  IContentAssistListener[] fListeners
           
private  java.lang.String fPartitioning
          The partitioning.
private  java.util.Map fProcessors
           
private  CompletionProposalPopup fProposalPopup
           
private  int fProposalPopupOrientation
           
private  org.eclipse.swt.graphics.Color fProposalSelectorBackground
           
private  org.eclipse.swt.graphics.Color fProposalSelectorForeground
           
private  boolean fVerifyKeyListenerHooked
          Flag which tells whether a verify key listener is hooked.
private  org.eclipse.jface.text.ITextViewer fViewer
           
(package private) static int PROPOSAL_SELECTOR
           
static java.lang.String STORE_SIZE_X
          Dialog store constants.
static java.lang.String STORE_SIZE_Y
           
static int WIDGET_PRIORITY
          The popup priority: > linked position proposals and hover pop-ups.
 
Fields inherited from interface org.eclipse.jface.text.contentassist.IContentAssistant
CONTEXT_INFO_ABOVE, CONTEXT_INFO_BELOW, PROPOSAL_OVERLAY, PROPOSAL_REMOVE, PROPOSAL_STACKED
 
Constructor Summary
ContentAssistant()
          Creates a new content assistant.
 
Method Summary
private  boolean acquireWidgetToken(int type)
          Returns whether the widget token could be acquired.
(package private)  boolean addContentAssistListener(IContentAssistListener listener, int type)
          Registers a content assist listener.
(package private)  void addToLayout(java.lang.Object popup, org.eclipse.swt.widgets.Shell shell, int type, int visibleOffset)
          Adds the given shell of the specified type to the layout.
 java.lang.String completePrefix()
          Inserts the common prefix of the available completions.
(package private)  ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns an array of completion proposals computed based on the specified document position.
(package private)  ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns an array of completion proposals computed based on the specified document position.
(package private)  IContextInformation[] computeContextInformation(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns an array of context information objects computed based on the specified document position.
(package private)  IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns an array of context information objects computed based on the specified document position.
protected  void contextInformationClosed()
          Callback to signal this content assistant that the presentation of the context information has been stopped.
 void enableAutoActivation(boolean enabled)
          Enables the content assistant's auto activation mode.
 void enableAutoInsert(boolean enabled)
          Enables the content assistant's auto insertion mode.
 void enablePrefixCompletion(boolean enabled)
          Sets the prefix completion property.
(package private)  char[] getCompletionProposalAutoActivationCharacters(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns the characters which when typed by the user should automatically initiate proposing completions.
(package private)  char[] getCompletionProposalAutoActivationCharacters(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns the characters which when typed by the user should automatically initiate proposing completions.
 IContentAssistProcessor getContentAssistProcessor(java.lang.String contentType)
          Returns the content assist processor to be used for the given content type.
(package private)  char[] getContextInformationAutoActivationCharacters(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns the characters which when typed by the user should automatically initiate the presentation of context information.
(package private)  char[] getContextInformationAutoActivationCharacters(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns the characters which when typed by the user should automatically initiate the presentation of context information.
(package private)  org.eclipse.swt.graphics.Color getContextInformationPopupBackground()
          Returns the background of the context information popup.
(package private)  org.eclipse.swt.graphics.Color getContextInformationPopupForeground()
          Returns the foreground of the context information popup.
(package private)  IContextInformationPresenter getContextInformationPresenter(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns the context information presenter that should be used to display context information.
(package private)  IContextInformationPresenter getContextInformationPresenter(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns the context information presenter that should be used to display context information.
(package private)  IContextInformationValidator getContextInformationValidator(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns the context information validator that should be used to determine when the currently displayed context information should be dismissed.
(package private)  IContextInformationValidator getContextInformationValidator(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns the context information validator that should be used to determine when the currently displayed context information should be dismissed.
(package private)  org.eclipse.swt.graphics.Color getContextSelectorBackground()
          Returns the background of the context selector.
(package private)  org.eclipse.swt.graphics.Color getContextSelectorForeground()
          Returns the foreground of the context selector.
 java.lang.String getDocumentPartitioning()
          Returns the document partitioning this content assistant is using.
(package private)  java.lang.String getErrorMessage()
          Returns the current content assist error message.
private  int getNumberOfListeners()
          Returns the number of listeners.
private  IContentAssistProcessor getProcessor(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl, int offset)
          Returns the content assist processor for the content type of the specified document position.
private  IContentAssistProcessor getProcessor(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Returns the content assist processor for the content type of the specified document position.
(package private)  org.eclipse.swt.graphics.Color getProposalSelectorBackground()
          Returns the background of the proposal selector.
(package private)  org.eclipse.swt.graphics.Color getProposalSelectorForeground()
          Returns the foreground of the proposal selector.
(package private)  int getSelectionOffset()
          Returns the offset of the selection relative to the offset of the visible region.
 boolean hasProposalPopupFocus()
          Returns whether the content assistant proposal popup has the focus.
protected  void hide()
          Hides any open pop-ups.
protected  void install()
           
protected  void install(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl)
           
 void install(org.eclipse.jface.text.ITextViewer textViewer)
          Installs content assist support on the given text viewer.
private  void installKeyListener()
          Installs a key listener on the text viewer's widget.
(package private)  boolean isAutoInserting()
          Returns whether this content assistant is in the auto insertion mode or not.
(package private)  void layout(int type, int visibleOffset)
          Layouts the registered popup of the given type relative to the given offset.
private  void manageAutoActivation(boolean start)
          Installs and uninstall the listeners needed for auto-activation.
(package private)  void popupFocusLost(org.eclipse.swt.events.FocusEvent e)
          Notifies the controller that a popup has lost focus.
protected  void possibleCompletionsClosed()
          Callback to signal this content assistant that the presentation of the possible completions has been stopped.
private  void promoteKeyListener()
          Re-promotes the key listener to the first position, using prependVerifyKeyListener.
private  void releaseWidgetToken(int type)
          Releases the previously acquired widget token if the token is no longer necessary.
(package private)  void removeContentAssistListener(IContentAssistListener listener, int type)
          Unregisters a content assist listener.
 boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner)
          The given widget token owner requests the widget token from this token keeper.
 boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner, int priority)
          The given widget token owner requests the widget token from this token keeper.
protected  org.eclipse.swt.graphics.Point restoreCompletionProposalPopupSize()
          Restores the content assist pop-up's size.
 void setAutoActivationDelay(int delay)
          Sets the delay after which the content assistant is automatically invoked if the cursor is behind an auto activation character.
 void setContentAssistProcessor(IContentAssistProcessor processor, java.lang.String contentType)
          Registers a given content assist processor for a particular content type.
 void setContextInformationPopupBackground(org.eclipse.swt.graphics.Color background)
          Sets the context information popup's background color.
 void setContextInformationPopupForeground(org.eclipse.swt.graphics.Color foreground)
          Sets the context information popup's foreground color.
 void setContextInformationPopupOrientation(int orientation)
          Sets the context information popup's orientation.
 void setContextSelectorBackground(org.eclipse.swt.graphics.Color background)
          Sets the context selector's background color.
 void setContextSelectorForeground(org.eclipse.swt.graphics.Color foreground)
          Sets the context selector's foreground color.
 void setDocumentPartitioning(java.lang.String partitioning)
          Sets the document partitioning this content assistant is using.
 boolean setFocus(org.eclipse.jface.text.IWidgetTokenOwner owner)
          Requests the receiver to give focus to its popup shell, hover, or similar.
 void setInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator creator)
          Sets the information control creator for the additional information control.
 void setProposalPopupOrientation(int orientation)
          Sets the proposal pop-ups' orientation.
 void setProposalSelectorBackground(org.eclipse.swt.graphics.Color background)
          Sets the proposal selector's background color.
 void setProposalSelectorForeground(org.eclipse.swt.graphics.Color foreground)
          Sets the proposal's foreground color.
 void setRestoreCompletionProposalSize(org.eclipse.jface.dialogs.IDialogSettings dialogSettings)
          Tells this information control manager to open the information control with the values contained in the given dialog settings and to store the control's last valid size in the given dialog settings.
 java.lang.String showContextInformation()
          Shows context information for the content at the viewer's cursor position.
(package private)  void showContextInformation(IContextInformation contextInformation, int offset)
          Requests that the specified context information to be shown.
 java.lang.String showPossibleCompletions()
          Shows all possible completions of the content at the viewer's cursor position.
protected  void storeCompletionProposalPopupSize()
          Stores the content assist pop-up's size.
 void uninstall()
          Uninstalls content assist support from the text viewer it has previously be installed on.
private  void uninstallVerifyKeyListener()
          Uninstall the key listener from the text viewer's widget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STORE_SIZE_X

public static final java.lang.String STORE_SIZE_X
Dialog store constants.

Since:
3.0
See Also:
Constant Field Values

STORE_SIZE_Y

public static final java.lang.String STORE_SIZE_Y
See Also:
Constant Field Values

CONTEXT_SELECTOR

static final int CONTEXT_SELECTOR
See Also:
Constant Field Values

PROPOSAL_SELECTOR

static final int PROPOSAL_SELECTOR
See Also:
Constant Field Values

CONTEXT_INFO_POPUP

static final int CONTEXT_INFO_POPUP
See Also:
Constant Field Values

WIDGET_PRIORITY

public static final int WIDGET_PRIORITY
The popup priority: > linked position proposals and hover pop-ups. Default value: 20;

Since:
3.0
See Also:
Constant Field Values

DEFAULT_AUTO_ACTIVATION_DELAY

private static final int DEFAULT_AUTO_ACTIVATION_DELAY
See Also:
Constant Field Values

fInformationControlCreator

private org.eclipse.jface.text.IInformationControlCreator fInformationControlCreator

fAutoActivationDelay

private int fAutoActivationDelay

fIsAutoActivated

private boolean fIsAutoActivated

fIsAutoInserting

private boolean fIsAutoInserting

fProposalPopupOrientation

private int fProposalPopupOrientation

fContextInfoPopupOrientation

private int fContextInfoPopupOrientation

fProcessors

private java.util.Map fProcessors

fPartitioning

private java.lang.String fPartitioning
The partitioning.

Since:
3.0

fContextInfoPopupBackground

private org.eclipse.swt.graphics.Color fContextInfoPopupBackground

fContextInfoPopupForeground

private org.eclipse.swt.graphics.Color fContextInfoPopupForeground

fContextSelectorBackground

private org.eclipse.swt.graphics.Color fContextSelectorBackground

fContextSelectorForeground

private org.eclipse.swt.graphics.Color fContextSelectorForeground

fProposalSelectorBackground

private org.eclipse.swt.graphics.Color fProposalSelectorBackground

fProposalSelectorForeground

private org.eclipse.swt.graphics.Color fProposalSelectorForeground

fViewer

private org.eclipse.jface.text.ITextViewer fViewer

fLastErrorMessage

private java.lang.String fLastErrorMessage

fCloser

private ContentAssistant.Closer fCloser

fLayoutManager

private ContentAssistant.LayoutManager fLayoutManager

fAutoAssistListener

private ContentAssistant.AutoAssistListener fAutoAssistListener

fInternalListener

private ContentAssistant.InternalListener fInternalListener

fProposalPopup

private CompletionProposalPopup fProposalPopup

fContextInfoPopup

private ContextInformationPopup fContextInfoPopup

fVerifyKeyListenerHooked

private boolean fVerifyKeyListenerHooked
Flag which tells whether a verify key listener is hooked.

Since:
3.0

fListeners

private IContentAssistListener[] fListeners

fContentAssistSubjectControl

private org.eclipse.jface.contentassist.IContentAssistSubjectControl fContentAssistSubjectControl
The content assist subject control.

Since:
3.0

fContentAssistSubjectControlAdapter

private ContentAssistSubjectControlAdapter fContentAssistSubjectControlAdapter
The content assist subject control adapter.

Since:
3.0

fDialogSettings

private org.eclipse.jface.dialogs.IDialogSettings fDialogSettings
The dialog settings for the control's bounds.

Since:
3.0

fIsPrefixCompletionEnabled

private boolean fIsPrefixCompletionEnabled
Prefix completion setting.

Since:
3.0
Constructor Detail

ContentAssistant

public ContentAssistant()
Creates a new content assistant. The content assistant is not automatically activated, overlays the completion proposals with context information list if necessary, and shows the context information above the location at which it was activated. If auto activation will be enabled, without further configuration steps, this content assistant is activated after a 500 milli-seconds delay. It uses the default partitioning.

Method Detail

setDocumentPartitioning

public void setDocumentPartitioning(java.lang.String partitioning)
Sets the document partitioning this content assistant is using.

Since:
3.0

getDocumentPartitioning

public java.lang.String getDocumentPartitioning()
Description copied from interface: IContentAssistantExtension
Returns the document partitioning this content assistant is using.

Specified by:
getDocumentPartitioning in interface IContentAssistantExtension

setContentAssistProcessor

public void setContentAssistProcessor(IContentAssistProcessor processor,
                                      java.lang.String contentType)
Registers a given content assist processor for a particular content type. If there is already a processor registered for this type, the new processor is registered instead of the old one.


getContentAssistProcessor

public IContentAssistProcessor getContentAssistProcessor(java.lang.String contentType)
Description copied from interface: IContentAssistant
Returns the content assist processor to be used for the given content type.

Specified by:
getContentAssistProcessor in interface IContentAssistant

enableAutoActivation

public void enableAutoActivation(boolean enabled)
Enables the content assistant's auto activation mode.


enableAutoInsert

public void enableAutoInsert(boolean enabled)
Enables the content assistant's auto insertion mode. If enabled, the content assistant inserts a proposal automatically if it is the only proposal. In the case of ambiguities, the user must make the choice.

Since:
2.0

isAutoInserting

boolean isAutoInserting()
Returns whether this content assistant is in the auto insertion mode or not.

Since:
2.0

manageAutoActivation

private void manageAutoActivation(boolean start)
Installs and uninstall the listeners needed for auto-activation.

Since:
2.0

setAutoActivationDelay

public void setAutoActivationDelay(int delay)
Sets the delay after which the content assistant is automatically invoked if the cursor is behind an auto activation character.


setProposalPopupOrientation

public void setProposalPopupOrientation(int orientation)
Sets the proposal pop-ups' orientation. The following values may be used:
  • PROPOSAL_OVERLAY

    proposal popup windows should overlay each other

  • PROPOSAL_REMOVE

    any currently shown proposal popup should be closed

  • PROPOSAL_STACKED

    proposal popup windows should be vertical stacked, with no overlap, beneath the line containing the current cursor location


setContextInformationPopupOrientation

public void setContextInformationPopupOrientation(int orientation)
Sets the context information popup's orientation. The following values may be used:
  • CONTEXT_ABOVE

    context information popup should always appear above the line containing the current cursor location

  • CONTEXT_BELOW

    context information popup should always appear below the line containing the current cursor location


setContextInformationPopupBackground

public void setContextInformationPopupBackground(org.eclipse.swt.graphics.Color background)
Sets the context information popup's background color.


getContextInformationPopupBackground

org.eclipse.swt.graphics.Color getContextInformationPopupBackground()
Returns the background of the context information popup.

Since:
2.0

setContextInformationPopupForeground

public void setContextInformationPopupForeground(org.eclipse.swt.graphics.Color foreground)
Sets the context information popup's foreground color.

Since:
2.0

getContextInformationPopupForeground

org.eclipse.swt.graphics.Color getContextInformationPopupForeground()
Returns the foreground of the context information popup.

Since:
2.0

setProposalSelectorBackground

public void setProposalSelectorBackground(org.eclipse.swt.graphics.Color background)
Sets the proposal selector's background color.

Since:
2.0

getProposalSelectorBackground

org.eclipse.swt.graphics.Color getProposalSelectorBackground()
Returns the background of the proposal selector.

Since:
2.0

setProposalSelectorForeground

public void setProposalSelectorForeground(org.eclipse.swt.graphics.Color foreground)
Sets the proposal's foreground color.

Since:
2.0

getProposalSelectorForeground

org.eclipse.swt.graphics.Color getProposalSelectorForeground()
Returns the foreground of the proposal selector.

Since:
2.0

setContextSelectorBackground

public void setContextSelectorBackground(org.eclipse.swt.graphics.Color background)
Sets the context selector's background color.

Since:
2.0

getContextSelectorBackground

org.eclipse.swt.graphics.Color getContextSelectorBackground()
Returns the background of the context selector.

Since:
2.0

setContextSelectorForeground

public void setContextSelectorForeground(org.eclipse.swt.graphics.Color foreground)
Sets the context selector's foreground color.

Since:
2.0

getContextSelectorForeground

org.eclipse.swt.graphics.Color getContextSelectorForeground()
Returns the foreground of the context selector.

Since:
2.0

setInformationControlCreator

public void setInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator creator)
Sets the information control creator for the additional information control.

Since:
2.0

install

protected void install(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl)

install

public void install(org.eclipse.jface.text.ITextViewer textViewer)
Description copied from interface: IContentAssistant
Installs content assist support on the given text viewer.

Specified by:
install in interface IContentAssistant

install

protected void install()

uninstall

public void uninstall()
Description copied from interface: IContentAssistant
Uninstalls content assist support from the text viewer it has previously be installed on.

Specified by:
uninstall in interface IContentAssistant

addToLayout

void addToLayout(java.lang.Object popup,
                 org.eclipse.swt.widgets.Shell shell,
                 int type,
                 int visibleOffset)
Adds the given shell of the specified type to the layout. Valid types are defined by LayoutManager.

Since:
2.0

layout

void layout(int type,
            int visibleOffset)
Layouts the registered popup of the given type relative to the given offset. The offset is relative to the offset of the viewer's visible region. Valid types are defined by LayoutManager.

Since:
2.0

popupFocusLost

void popupFocusLost(org.eclipse.swt.events.FocusEvent e)
Notifies the controller that a popup has lost focus.


getSelectionOffset

int getSelectionOffset()
Returns the offset of the selection relative to the offset of the visible region.

Since:
2.0

acquireWidgetToken

private boolean acquireWidgetToken(int type)
Returns whether the widget token could be acquired. The following are valid listener types:
  • AUTO_ASSIST
  • CONTEXT_SELECTOR
  • PROPOSAL_SELECTOR
  • CONTEXT_INFO_POPUP

Since:
2.0

addContentAssistListener

boolean addContentAssistListener(IContentAssistListener listener,
                                 int type)
Registers a content assist listener. The following are valid listener types:
  • AUTO_ASSIST
  • CONTEXT_SELECTOR
  • PROPOSAL_SELECTOR
  • CONTEXT_INFO_POPUP
Returns whether the listener could be added successfully. A listener can not be added if the widget token could not be acquired.


promoteKeyListener

private void promoteKeyListener()
Re-promotes the key listener to the first position, using prependVerifyKeyListener. This ensures no other instance is filtering away the keystrokes underneath, if we've been up for a while (e.g. when the context info is showing.

Since:
3.0

installKeyListener

private void installKeyListener()
Installs a key listener on the text viewer's widget.


releaseWidgetToken

private void releaseWidgetToken(int type)
Releases the previously acquired widget token if the token is no longer necessary. The following are valid listener types:
  • AUTO_ASSIST
  • CONTEXT_SELECTOR
  • PROPOSAL_SELECTOR
  • CONTEXT_INFO_POPUP

Since:
2.0

removeContentAssistListener

void removeContentAssistListener(IContentAssistListener listener,
                                 int type)
Unregisters a content assist listener.


uninstallVerifyKeyListener

private void uninstallVerifyKeyListener()
Uninstall the key listener from the text viewer's widget.

Since:
3.0

getNumberOfListeners

private int getNumberOfListeners()
Returns the number of listeners.

Since:
2.0

showPossibleCompletions

public java.lang.String showPossibleCompletions()
Description copied from interface: IContentAssistant
Shows all possible completions of the content at the viewer's cursor position.

Specified by:
showPossibleCompletions in interface IContentAssistant

completePrefix

public java.lang.String completePrefix()
Description copied from interface: IContentAssistantExtension
Inserts the common prefix of the available completions. If no common prefix can be computed it is identical to IContentAssistant.showPossibleCompletions() 55 .

Specified by:
completePrefix in interface IContentAssistantExtension

possibleCompletionsClosed

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

Since:
2.1

showContextInformation

public java.lang.String showContextInformation()
Description copied from interface: IContentAssistant
Shows context information for the content at the viewer's cursor position.

Specified by:
showContextInformation in interface IContentAssistant

contextInformationClosed

protected void contextInformationClosed()
Callback to signal this content assistant that the presentation of the context information has been stopped.

Since:
2.1

showContextInformation

void showContextInformation(IContextInformation contextInformation,
                            int offset)
Requests that the specified context information to be shown.

Since:
2.0

getErrorMessage

java.lang.String getErrorMessage()
Returns the current content assist error message.


getProcessor

private IContentAssistProcessor getProcessor(org.eclipse.jface.text.ITextViewer viewer,
                                             int offset)
Returns the content assist processor for the content type of the specified document position.

Since:
3.0

getProcessor

private IContentAssistProcessor getProcessor(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                             int offset)
Returns the content assist processor for the content type of the specified document position.

Since:
3.0

computeCompletionProposals

ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                                 int offset)
Returns an array of completion proposals computed based on the specified document position. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

computeCompletionProposals

ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer,
                                                 int offset)
Returns an array of completion proposals computed based on the specified document position. The position is used to determine the appropriate content assist processor to invoke.


computeContextInformation

IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer,
                                                int offset)
Returns an array of context information objects computed based on the specified document position. The position is used to determine the appropriate content assist processor to invoke.


computeContextInformation

IContextInformation[] computeContextInformation(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                                int offset)
Returns an array of context information objects computed based on the specified document position. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

getContextInformationValidator

IContextInformationValidator getContextInformationValidator(org.eclipse.jface.text.ITextViewer viewer,
                                                            int offset)
Returns the context information validator that should be used to determine when the currently displayed context information should be dismissed. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

getContextInformationValidator

IContextInformationValidator getContextInformationValidator(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                                            int offset)
Returns the context information validator that should be used to determine when the currently displayed context information should be dismissed. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

getContextInformationPresenter

IContextInformationPresenter getContextInformationPresenter(org.eclipse.jface.text.ITextViewer viewer,
                                                            int offset)
Returns the context information presenter that should be used to display context information. The position is used to determine the appropriate content assist processor to invoke.

Since:
2.0

getContextInformationPresenter

IContextInformationPresenter getContextInformationPresenter(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                                            int offset)
Returns the context information presenter that should be used to display context information. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

getCompletionProposalAutoActivationCharacters

char[] getCompletionProposalAutoActivationCharacters(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                                     int offset)
Returns the characters which when typed by the user should automatically initiate proposing completions. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

getCompletionProposalAutoActivationCharacters

char[] getCompletionProposalAutoActivationCharacters(org.eclipse.jface.text.ITextViewer viewer,
                                                     int offset)
Returns the characters which when typed by the user should automatically initiate proposing completions. The position is used to determine the appropriate content assist processor to invoke.


getContextInformationAutoActivationCharacters

char[] getContextInformationAutoActivationCharacters(org.eclipse.jface.text.ITextViewer viewer,
                                                     int offset)
Returns the characters which when typed by the user should automatically initiate the presentation of context information. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

getContextInformationAutoActivationCharacters

char[] getContextInformationAutoActivationCharacters(org.eclipse.jface.contentassist.IContentAssistSubjectControl contentAssistSubjectControl,
                                                     int offset)
Returns the characters which when typed by the user should automatically initiate the presentation of context information. The position is used to determine the appropriate content assist processor to invoke.

Since:
3.0

requestWidgetToken

public boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner)
Description copied from interface: org.eclipse.jface.text.IWidgetTokenKeeper
The given widget token owner requests the widget token from this token keeper. Returns true if the token is released by this token keeper. Note, the keeper must not call releaseWidgetToken(IWidgetTokenKeeper) explicitly.

Replaced by IWidgetTokenKeeperExtension.requestWidgetToken(IWidgetTokenOwner, int)>IWidgetTokenKeeperExtension.requestWidgetToken(IWidgetTokenOwner, int) 55 .

Specified by:
requestWidgetToken in interface org.eclipse.jface.text.IWidgetTokenKeeper

requestWidgetToken

public boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner,
                                  int priority)
Description copied from interface: org.eclipse.jface.text.IWidgetTokenKeeperExtension
The given widget token owner requests the widget token from this token keeper. Returns true if the token is released by this token keeper. Note, the keeper must not call releaseWidgetToken(IWidgetTokenKeeper) explicitly.

The general contract is that the receiver should release the token if priority exceeds the receiver's priority.

Specified by:
requestWidgetToken in interface org.eclipse.jface.text.IWidgetTokenKeeperExtension

setFocus

public boolean setFocus(org.eclipse.jface.text.IWidgetTokenOwner owner)
Description copied from interface: org.eclipse.jface.text.IWidgetTokenKeeperExtension
Requests the receiver to give focus to its popup shell, hover, or similar. There is no assumption made whether the receiver actually succeeded in taking the focus. The return value gives a hint whether the receiver tried to take focus.

Specified by:
setFocus in interface org.eclipse.jface.text.IWidgetTokenKeeperExtension

hide

protected void hide()
Hides any open pop-ups.

Since:
3.0

setRestoreCompletionProposalSize

public void setRestoreCompletionProposalSize(org.eclipse.jface.dialogs.IDialogSettings dialogSettings)
Tells this information control manager to open the information control with the values 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 org.eclipse.jface.text.IInformationControlExtension3. Not following this restriction will later result in an java.lang.UnsupportedOperationException.

The constants used to store the values are:

Since:
3.0

storeCompletionProposalPopupSize

protected void storeCompletionProposalPopupSize()
Stores the content assist pop-up's size.


restoreCompletionProposalPopupSize

protected org.eclipse.swt.graphics.Point restoreCompletionProposalPopupSize()
Restores the content assist pop-up's size.

Since:
3.0

enablePrefixCompletion

public void enablePrefixCompletion(boolean enabled)
Sets the prefix completion property. If enabled, content assist delegates completion to prefix completion.


hasProposalPopupFocus

public boolean hasProposalPopupFocus()
Returns whether the content assistant proposal popup has the focus.

Since:
3.0