|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.win.swing.component.LyJAutoCompletionViewer
public class LyJAutoCompletionViewer
This class implements an auto-completion system for text components.
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static java.lang.String |
BEAN_KEY_EVENT
|
static java.lang.String |
EMPTY_VALUE
Value used to store empty values in the auto-completion list. |
static long |
KEY_PRESSED_TIMER
Timer used to send keyboard events (in milliseconds). |
Constructor Summary | |
---|---|
LyJAutoCompletionViewer(javax.swing.text.JTextComponent text,
javax.swing.JButton button,
java.lang.String[] internalValues,
java.lang.String[] displayedValues,
java.lang.String[] displayedShortValues,
boolean automaticCompletion,
int nMax,
LyEnvironment environment)
Constructor. |
Method Summary | |
---|---|
void |
addValue(java.lang.String internalValue,
java.lang.String displayedValue,
java.lang.String displayedShortValue,
int pos)
Adds a value to the list of values used for auto-completion. |
boolean |
componentIsMine(java.awt.Component c)
This method test Component c is member of this class |
java.lang.String |
getDisplayedShortValue(java.lang.String internalValue)
Returns the displayed short value corresponding to a given internal value. |
java.lang.String[] |
getDisplayedShortValues()
Returns the list of displayed short values for auto-completion. |
java.lang.String |
getDisplayedValue(java.lang.String internalValue)
Returns the displayed value corresponding to a given internal value. |
java.lang.String[] |
getDisplayedValues()
Returns the list of displayed values for auto-completion. |
LyJListComponent |
getListField()
Returns the list component associated with this auto-completion viewer. |
int |
getSelectedIndex()
Returns the index of selected value. |
java.lang.String |
getSelectedValue()
Returns the internal selected value if any. |
javax.swing.text.JTextComponent |
getTextField()
Returns the text component associated with this auto-completion viewer. |
void |
hideWindow()
Hides the completion window. |
boolean |
isWindowVisible()
Indicates whether the completion window is visible or not. |
void |
removeValue(java.lang.String internalValue)
Removes a value from the list of values used for auto-completion. |
void |
removeValueAt(int pos)
Removes a value from the list of values used for auto-completion. |
void |
selectionPerformed(LySelectionEvent selectionEvent)
Implementation of the LySelectionListener interface. |
void |
setActionListener(LyActionListener actionListener)
Sets the action listener to be used. |
void |
setCurrentText(java.lang.String currentText,
int startIndex,
int endIndex)
Set the value of the currently typed |
void |
setLocation(int x,
int y)
Set the popup menu location |
void |
setMutli(boolean isMulti)
Set if the popup menu is for a multilines text on not |
void |
setPopupWidth(int popupWidth)
Sets the fixed width of the popup. |
void |
setShowOnKeyType(boolean show)
indicate whether the autocompletion list is shown when keys are typed |
void |
setTextValue(int index,
boolean notify)
Sets the value of the text component. |
void |
setValues(int nMax,
java.lang.String[] internalValues,
java.lang.String[] displayedValues,
java.lang.String[] displayedShortValues)
Set the list of values used for auto-completion. |
void |
setValues(java.lang.String[] internalValues,
java.lang.String[] displayedValues,
java.lang.String[] displayedShortValues)
Set the list of values used for auto-completion. |
boolean |
wasEnterPressed()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final java.lang.String EMPTY_VALUE
public static long KEY_PRESSED_TIMER
public static final java.lang.String BEAN_KEY_EVENT
Constructor Detail |
---|
public LyJAutoCompletionViewer(javax.swing.text.JTextComponent text, javax.swing.JButton button, java.lang.String[] internalValues, java.lang.String[] displayedValues, java.lang.String[] displayedShortValues, boolean automaticCompletion, int nMax, LyEnvironment environment)
text
- text component used for auto-completionbutton
- button component used to open / close auto-completion windowinternalValues
- list of internal values used for auto-completiondisplayedValues
- list of displayed values used for auto-completiondisplayedValues
- list of displayed short values used for auto-completionautomaticCompletion
- indicates whether text value is updated automatically when focus is lostnMax
- maximum number of values displayed in the auto-completion listenvironment
- current environmentMethod Detail |
---|
public void setValues(java.lang.String[] internalValues, java.lang.String[] displayedValues, java.lang.String[] displayedShortValues)
internalValues
- the new list of internal values for auto-completion.displayedValues
- the new list of displayed values for auto-completion.displayedShortValues
- the new list of displayed short values for auto-completion.public void setShowOnKeyType(boolean show)
show
- if true, the completion list is shown when keys are typedpublic void setValues(int nMax, java.lang.String[] internalValues, java.lang.String[] displayedValues, java.lang.String[] displayedShortValues)
nMax
- max values displayedinternalValues
- the new list of internal values for auto-completion.displayedValues
- the new list of displayed values for auto-completion.displayedShortValues
- the new list of displayed short values for auto-completion.public void addValue(java.lang.String internalValue, java.lang.String displayedValue, java.lang.String displayedShortValue, int pos)
internalValue
- the new internal value to be added.displayedValue
- the new displayed value to be added.displayedShortValue
- the new displayed short value to be added.pos
- the position of the value to be added.public void removeValue(java.lang.String internalValue)
internalValue
- the internal value to be removed.public void removeValueAt(int pos)
pos
- the position of the value to be removed.public int getSelectedIndex()
public java.lang.String getSelectedValue()
public java.lang.String getDisplayedValue(java.lang.String internalValue)
internalValue
- the internal value to be used to retrieve displayed value.
public java.lang.String getDisplayedShortValue(java.lang.String internalValue)
internalValue
- the internal value to be used to retrieve displayed value.
public boolean componentIsMine(java.awt.Component c)
c
- Component to test
public java.lang.String[] getDisplayedValues()
public java.lang.String[] getDisplayedShortValues()
public javax.swing.text.JTextComponent getTextField()
public LyJListComponent getListField()
public void setCurrentText(java.lang.String currentText, int startIndex, int endIndex)
currentText
- text valuestartIndex
- start index in the text componentendIndex
- end index in the text componentpublic void selectionPerformed(LySelectionEvent selectionEvent)
selectionPerformed
in interface LySelectionListener
selectionEvent
- description of the selection which has occuredpublic void setLocation(int x, int y)
x
- x coordinatey
- y coordinatepublic void setMutli(boolean isMulti)
isMulti
- public void setTextValue(int index, boolean notify)
index
- the index of the new text value to be set.notify
- indicates if action listener must be notified.public void setActionListener(LyActionListener actionListener)
actionListener
- the new action listener that must be notified when changing
text value.public void setPopupWidth(int popupWidth)
popupWidth
- the fixed width of the popup.public void hideWindow()
public boolean isWindowVisible()
public boolean wasEnterPressed()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |