@Deprecated
public class CompletionPopupHandler
extends java.lang.Object
The completion provided by the field is configured via one or more
pluggable FieldInsightProvider
instances. Each insight provider
describes when to trigger insight, which items appear in the insight
list for a given position in the field, how to complete insight when
requested by the user, and how items in the insight list should appear.
It's acceptible to register multiple FieldInsightProviders with a CompletionPopupHandler. Each provider will be queried in turn whenever a character is typed into the field.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SHOW_INSIGHT_ACTION_NAME
Deprecated.
The action to trigger display of insight in the ActionMap of this
component.
|
Constructor and Description |
---|
CompletionPopupHandler(javax.swing.text.JTextComponent textComponent)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
acquireInsightLock()
Deprecated.
Acquire a lock on the insight popup.
|
java.awt.Color |
getCompletionBackground()
Deprecated.
Returns the background color for the completion popup list.
|
java.awt.Component |
getInsightList()
Deprecated.
|
javax.swing.text.JTextComponent |
getTextComponent()
Deprecated.
Get the text component this handler is handling.
|
protected int |
getVerticalPopupOffset(java.awt.Component component)
Deprecated.
Get the vertical offset (from the top of the component) of the popup
window.
|
int |
getVisibleRowCount()
Deprecated.
Get the visible row count of the list in the popup.
|
boolean |
isAlignWithField()
Deprecated.
Get whether the insight popup of the component should be left aligned with
the text component.
|
boolean |
isInsightVisible()
Deprecated.
Determine whether the insight list is currently visible.
|
boolean |
isRegisteredInsightProvider(FieldInsightProvider provider)
Deprecated.
Ask whether a given insight provider is registered.
|
boolean |
isWidthConstrained()
Deprecated.
Get whether the width of the popup for the component should be constrained
to the component width,
|
boolean |
isWidthOfField()
Deprecated.
Get whether the drop down list for the component will be automatically
adjusted so that it is at least as wide as the text component.
|
void |
registerInsightProvider(FieldInsightProvider provider)
Deprecated.
Register an insight provider with this field.
|
void |
setAlignWithField(boolean isAlignWithField)
Deprecated.
Set whether the insight popup of the component should be left aligned with
the text component.
|
void |
setCompletionBackground(java.awt.Color insightBackground)
Deprecated.
Sets the background color for the completion popup list.
|
void |
setInsightVisible(boolean isVisible)
Deprecated.
Programmatically show or hide the insight list.
|
void |
setVisibleRowCount(int visibleRowCount)
Deprecated.
Set the visible row count of the list in the popup.
|
void |
setWidthConstrained(boolean isWidthConstrained)
Deprecated.
Set whether the width of the popup for the component should be constrained
to the component width,
|
void |
setWidthOfField(boolean isWidthOfField)
Deprecated.
Set whether the drop down list for the component will be automatically
adjusted so that it is at least as wide as the text component.
|
void |
unregisterInsightProvider(FieldInsightProvider provider)
Deprecated.
Unregister an insight provider from the field.
|
void |
yieldInsightLock()
Deprecated.
Release a lock on the insight popup.
|
public static final java.lang.String SHOW_INSIGHT_ACTION_NAME
CompletionTextField field = new CompletionTextField(); field.getInputMap().put( KeyStroke.getKeyStroke( "control pressed SPACE" ), CompletionPopupHandler.SHOW_INSIGHT_ACTION_NAME );
public CompletionPopupHandler(javax.swing.text.JTextComponent textComponent)
public final javax.swing.text.JTextComponent getTextComponent()
public java.awt.Component getInsightList()
public final void acquireInsightLock()
public final void yieldInsightLock()
public final java.awt.Color getCompletionBackground()
public final void setCompletionBackground(java.awt.Color insightBackground)
public final void setAlignWithField(boolean isAlignWithField)
isAlignWithField
- if true, the popup will be left aligned with the
text component.public final boolean isAlignWithField()
public final void setWidthOfField(boolean isWidthOfField)
isWidthOfField
- if true, the drop down list width will always be
at least the width of the component.public final boolean isWidthOfField()
public final void setWidthConstrained(boolean isWidthConstrained)
isWidthConstrained
- if true, the drop down list width will always be
no wider than the component.public final boolean isWidthConstrained()
public final void setVisibleRowCount(int visibleRowCount)
visibleRowCount
- the row count value.public final int getVisibleRowCount()
public final void registerInsightProvider(FieldInsightProvider provider)
provider
- the insight provider to register with the field.public final void unregisterInsightProvider(FieldInsightProvider provider)
provider
- the provider to unregister.public final boolean isRegisteredInsightProvider(FieldInsightProvider provider)
provider
- the provider.public final void setInsightVisible(boolean isVisible)
isVisible
- param isVisible whether the insight list should be visiblepublic final boolean isInsightVisible()
protected int getVerticalPopupOffset(java.awt.Component component)
component
- the component the popup is appearing for. If the
component is in a scroll pane, this may be the scrollpane viewport.