|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.controls.completionfield.CompletionPopupHandler
public class CompletionPopupHandler
CompletionPopupHandler is a general class providing the ability to display a completion list over a text component. In many ways, this behaves like the code insight support provided by the code editor
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.
Field Summary | |
---|---|
static java.lang.String |
SHOW_INSIGHT_ACTION_NAME The action to trigger display of insight in the ActionMap of this component. |
Constructor Summary | |
---|---|
CompletionPopupHandler(javax.swing.text.JTextComponent textComponent) |
Method Summary | |
---|---|
void |
acquireInsightLock() Acquire a lock on the insight popup. |
java.awt.Color |
getCompletionBackground() Returns the background color for the completion popup list. |
java.awt.Component |
getInsightList() |
javax.swing.text.JTextComponent |
getTextComponent() Get the text component this handler is handling. |
protected int |
getVerticalPopupOffset(java.awt.Component component) Get the vertical offset (from the top of the component) of the popup window. |
int |
getVisibleRowCount() Get the visible row count of the list in the popup. |
boolean |
isAlignWithField() Get whether the insight popup of the component should be left aligned with the text component. |
boolean |
isInsightVisible() Determine whether the insight list is currently visible. |
boolean |
isRegisteredInsightProvider(FieldInsightProvider provider) Ask whether a given insight provider is registered. |
boolean |
isWidthConstrained() Get whether the width of the popup for the component should be constrained to the component width, |
boolean |
isWidthOfField() 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) Register an insight provider with this field. |
void |
setAlignWithField(boolean isAlignWithField) Set whether the insight popup of the component should be left aligned with the text component. |
void |
setCompletionBackground(java.awt.Color insightBackground) Sets the background color for the completion popup list. |
void |
setInsightVisible(boolean isVisible) Programmatically show or hide the insight list. |
void |
setVisibleRowCount(int visibleRowCount) Set the visible row count of the list in the popup. |
void |
setWidthConstrained(boolean isWidthConstrained) Set whether the width of the popup for the component should be constrained to the component width, |
void |
setWidthOfField(boolean isWidthOfField) 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) Unregister an insight provider from the field. |
void |
yieldInsightLock() Release a lock on the insight popup. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 );
Constructor Detail |
---|
public CompletionPopupHandler(javax.swing.text.JTextComponent textComponent)
Method Detail |
---|
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.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |