public class MatchItemComboViewer
extends org.eclipse.jface.viewers.ComboViewer
ComboViewer
that allows typed text to be matched against
the combo viewer's items and also allows setting the selection via arrow keys.Constructor and Description |
---|
MatchItemComboViewer(org.eclipse.swt.custom.CCombo combo)
Constructor.
|
MatchItemComboViewer(org.eclipse.swt.widgets.Composite area,
int style)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addToBuffer(Character character)
Append a character to the search buffer.
|
int |
getClosestMatchIndex(String str)
Returns the index of the closest match.
|
protected void |
init()
Initializes this viewer.
|
boolean |
isEmptyBuffer()
Whether the search buffer is empty.
|
protected boolean |
keyPressTimedOut()
Whether the key press timeout has been hit.
|
void |
onEnter(int selectedIndex)
Callback that is called when the enter key is released.
|
void |
resetBuffer()
Clears the search buffer.
|
protected void |
resetKeyPressedTimeout()
Reset the key pressed timeout.
|
void |
resetKeyPressedTimer()
Reset the key pressed timer.
|
protected void |
setClosestMatch(String s)
Set the closest match based on the given String.
|
getCCombo, getCombo, getControl, listAdd, listDeselectAll, listGetItemCount, listGetSelectionIndices, listRemove, listRemoveAll, listSetItem, listSetItems, listSetSelection, listShowSelection, reveal
add, add, doFindInputItem, doFindItem, doUpdateItem, getElementAt, getLabelProvider, getSelectionFromWidget, indexForElement, inputChanged, insert, internalRefresh, listGetTopIndex, listSetTopIndex, remove, remove, setLabelProvider, setSelectionToWidget
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertContentProviderType, assertElementsNotNull, associate, buildLabel, disassociate, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getItem, getRawChildren, getRoot, getSelection, getSortedChildren, getSorter, getStructuredSelection, handleDispose, handleDoubleSelect, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, hookControl, internalRefresh, internalUpdate, mapElement, needsRefilter, preservingSelection, refresh, refresh, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setContentProvider, setFilters, setInput, setSelection, setSelectionToWidget, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, update, updateItem, updateSelection, usingElementMap
getContentProvider, getInput, labelProviderChanged
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
public MatchItemComboViewer(org.eclipse.swt.custom.CCombo combo)
combo
- the CCombo
to be wrappedpublic MatchItemComboViewer(org.eclipse.swt.widgets.Composite area, int style)
area
- the parent Composite
style
- SWT style bitspublic void onEnter(int selectedIndex)
selectedIndex
- the index of the item that is the closest matchprotected void init()
public int getClosestMatchIndex(String str)
str
- the String to be matchedprotected void setClosestMatch(String s)
s
- the String the closest match should be selected byprotected boolean keyPressTimedOut()
true
, if the timeout has been hit, false
otherwisepublic void resetKeyPressedTimer()
protected void resetKeyPressedTimeout()
public void addToBuffer(Character character)
character
- the Character
to be appendedpublic void resetBuffer()
public boolean isEmptyBuffer()
true
, in case the buffer is empty, false
otherwiseCopyright © 2017. All rights reserved.