public class CompletionProposalAdapter extends java.lang.Object implements ICompletionListener
ContentProposalAdapter that delegates
the popup to a CompletionProposal managed by a
IContentAssistant.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG
Flag that controls the printing of debug info.
|
| Constructor and Description |
|---|
CompletionProposalAdapter(Control control,
IContentAssistant contentAssistant,
KeyStroke keyStroke,
char[] autoActivationCharacters)
This adapter installs listener on the given control and delegates the
completion proposal popup request to the given
IContentAssistant. |
| Modifier and Type | Method and Description |
|---|---|
void |
addContentProposalListener(ICompletionProposalListener listener)
Add the specified listener to the list of content proposal listeners that
are notified when a content proposal popup is opened or closed.
|
void |
assistSessionEnded(ContentAssistEvent event) |
void |
assistSessionStarted(ContentAssistEvent event) |
char[] |
getAutoActivationCharacters()
Return the array of characters on which the popup is autoactivated.
|
int |
getAutoActivationDelay()
Set the delay, in milliseconds, used before any autoactivation is
triggered.
|
Control |
getControl()
Get the control on which the content proposal adapter is installed.
|
boolean |
isEnabled()
Return a boolean indicating whether the receiver is enabled.
|
boolean |
isProposalPopupOpen()
Answers a boolean indicating whether the main proposal popup is open.
|
protected void |
openProposalPopup()
Open the proposal popup and display the proposals provided by the
proposal provider.
|
void |
removeContentProposalListener(ICompletionProposalListener listener)
Remove the specified listener from the list of content proposal listeners
that are notified when a content proposal popup is opened or closed.
|
void |
selectionChanged(ICompletionProposal proposal,
boolean smartToggle) |
void |
setAutoActivationCharacters(char[] autoActivationCharacters)
Set the array of characters that will trigger autoactivation of the
popup.
|
void |
setAutoActivationDelay(int delay)
Set the delay, in milliseconds, used before autoactivation is triggered.
|
void |
setEnabled(boolean enabled)
Set the boolean flag that determines whether the adapter is enabled.
|
public static final boolean DEBUG
public CompletionProposalAdapter(Control control, IContentAssistant contentAssistant, KeyStroke keyStroke, char[] autoActivationCharacters)
This adapter installs listener on the given control and delegates the
completion proposal popup request to the given IContentAssistant.
FIXME: Parameter autoActivationCharacters is untested.
control - contentAssistant - keyStroke - autoActivationCharacters - public Control getControl()
public boolean isEnabled()
true if the adapter is enabled, and
false if it is not.public char[] getAutoActivationCharacters()
null, then only a specified keyStroke will invoke
content proposal. If this value is null and the
keyStroke value is null, then all alphanumeric
characters will auto-activate content proposal.public void setAutoActivationCharacters(char[] autoActivationCharacters)
autoActivationCharacters - An array of characters that trigger auto-activation of content
proposal. If specified, these characters will trigger
auto-activation of the proposal popup, regardless of whether
an explicit invocation keyStroke was specified. If this
parameter is null, then only a specified
keyStroke will invoke content proposal. If this parameter is
null and the keyStroke value is null
, then all alphanumeric characters will auto-activate content
proposal.public int getAutoActivationDelay()
public void setAutoActivationDelay(int delay)
delay - the time in milliseconds that will pass before a popup is
automatically openedpublic void setEnabled(boolean enabled)
enabled - true if the adapter is enabled and responding to
user input, false if it is ignoring user input.public void addContentProposalListener(ICompletionProposalListener listener)
public void removeContentProposalListener(ICompletionProposalListener listener)
protected void openProposalPopup()
public boolean isProposalPopupOpen()
true if the proposal popup is open, and
false if it is not.public void assistSessionStarted(ContentAssistEvent event)
assistSessionStarted in interface ICompletionListenerpublic void assistSessionEnded(ContentAssistEvent event)
assistSessionEnded in interface ICompletionListenerpublic void selectionChanged(ICompletionProposal proposal, boolean smartToggle)
selectionChanged in interface ICompletionListener