public abstract class AbstractListIntelliHints extends AbstractIntelliHints
AbstractListIntelliHints
extends AbstractIntelliHints and further implement most of the methods in
interface IntelliHints
. In this class, it assumes the hints can be represented as a JList,
so it used JList in the hints popup.Modifier and Type | Field and Description |
---|---|
protected javax.swing.KeyStroke[] |
_keyStrokes |
CLIENT_PROPERTY_INTELLI_HINTS
Constructor and Description |
---|
AbstractListIntelliHints(javax.swing.text.JTextComponent textComponent)
Creates a Completion for JTextComponent
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JComponent |
createHintsComponent()
Creates the component which contains hints.
|
protected javax.swing.JList |
createList()
Creates the list to display the hints.
|
javax.swing.JComponent |
getDelegateComponent()
Gets the delegate component in the hint popup.
|
javax.swing.KeyStroke[] |
getDelegateKeyStrokes()
Gets the delegate keystrokes.
|
protected javax.swing.JList |
getList()
Gets the list.
|
java.lang.Object |
getSelectedHint()
Gets the selected value.
|
protected void |
setListData(java.lang.Object[] objects)
Sets the list data.
|
protected void |
setListData(java.util.Vector<?> objects)
Sets the list data.
|
acceptHint, createPopup, getCaretPositionForPopup, getCaretRectangleForPopup, getContext, getIntelliHints, getShowHintsKeyStroke, getTextComponent, hideHintsPopup, isAutoPopup, isFollowCaret, isHintsPopupVisible, isMultilineTextComponent, setAutoPopup, setFollowCaret, setHintsEnabled, showHints, showHintsPopup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateHints
public AbstractListIntelliHints(javax.swing.text.JTextComponent textComponent)
textComponent
- public javax.swing.JComponent createHintsComponent()
IntelliHints
IntelliHints.updateHints(Object)
will update the content.protected javax.swing.JList createList()
return new JList() {
public int getVisibleRowCount() {
int size = getModel().getSize();
return size < super.getVisibleRowCount() ? size : super.getVisibleRowCount();
}
public Dimension getPreferredScrollableViewportSize() {
if (getModel().getSize() == 0) {
return new Dimension(0, 0);
}
else {
return super.getPreferredScrollableViewportSize();
}
}
};
protected javax.swing.JList getList()
protected void setListData(java.lang.Object[] objects)
objects
- protected void setListData(java.util.Vector<?> objects)
objects
- public java.lang.Object getSelectedHint()
IntelliHints
public javax.swing.JComponent getDelegateComponent()
AbstractIntelliHints
getDelegateComponent
in class AbstractIntelliHints
public javax.swing.KeyStroke[] getDelegateKeyStrokes()
getDelegateKeyStrokes
in class AbstractIntelliHints