| Modifier and Type | Class and Description |
|---|---|
static interface |
FilteredList.FilterMatcher
The FilterMatcher is the interface used to check filtering criterea.
|
| Constructor and Description |
|---|
FilteredList(Composite parent,
int style,
ILabelProvider labelProvider,
boolean ignoreCase,
boolean allowDuplicates,
boolean matchEmptyString)
Constructs a new filtered list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectionListener(SelectionListener listener)
Adds a selection listener to the list.
|
boolean |
getAllowDuplicates()
Returns whether or not duplicates are allowed.
|
String |
getFilter()
Returns the filter pattern.
|
Object[] |
getFoldedElements(int index)
Returns all elements which are folded together to one entry in the list.
|
boolean |
getIgnoreCase()
Returns whether or not case should be ignored.
|
ILabelProvider |
getLabelProvider()
Returns the label provider for the items.
|
boolean |
getMatchEmptyString()
Returns whether empty filter strings should filter everything or nothing.
|
Object[] |
getSelection()
Returns an array of the selected elements.
|
int |
getSelectionIndex()
Returns the selection of the list.
|
int[] |
getSelectionIndices()
Returns the selection of the list.
|
boolean |
isEmpty()
Tests if the list (before folding and filtering) is empty.
|
void |
removeSelectionListener(SelectionListener listener)
Removes a selection listener from the list.
|
void |
setAllowDuplicates(boolean allowDuplicates)
Sets whether or not duplicates are allowed.
|
void |
setComparator(Comparator comparator)
Sets a custom comparator for sorting the list.
|
void |
setElements(Object[] elements)
Sets the list of elements.
|
void |
setFilter(String filter)
Sets the filter pattern.
|
void |
setFilterMatcher(FilteredList.FilterMatcher filterMatcher)
Sets the filter matcher.
|
void |
setIgnoreCase(boolean ignoreCase)
Sets whether or not case should be ignored If this value is set the items
should be set again for this value to take effect.
|
void |
setLabelProvider(ILabelProvider labelProvider)
Sets the label provider.
|
void |
setMatchEmptyString(boolean matchEmptyString)
Sets whether empty filter strings should filter everything or nothing.
|
void |
setSelection(int[] selection)
Sets the selection of the list.
|
void |
setSelection(Object[] elements)
Sets the selection of the list.
|
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabListcomputeTrim, getClientArea, getHorizontalBar, getVerticalBaraddControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, updateaddDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toStringpublic FilteredList(Composite parent, int style, ILabelProvider labelProvider, boolean ignoreCase, boolean allowDuplicates, boolean matchEmptyString)
parent - the parent compositestyle - the widget stylelabelProvider - the label rendererignoreCase - specifies whether sorting and folding is case sensitiveallowDuplicates - specifies whether folding of duplicates is desiredmatchEmptyString - specifies whether empty filter strings should filter
everything or nothingpublic void setElements(Object[] elements)
elements - the elements to be shown in the list.public boolean isEmpty()
true if the list is empty,
false otherwise.public void setFilterMatcher(FilteredList.FilterMatcher filterMatcher)
filterMatcher - public void setComparator(Comparator comparator)
comparator - public void addSelectionListener(SelectionListener listener)
listener - the selection listener to be added.public void removeSelectionListener(SelectionListener listener)
listener - the selection listener to be removed.public void setSelection(int[] selection)
selection - an array of indices specifying the selection.public int[] getSelectionIndices()
public int getSelectionIndex()
getSelectionIndices().public void setSelection(Object[] elements)
elements - the array of elements to be selected.public Object[] getSelection()
setElements. The array does not contain the rendered
strings.public void setFilter(String filter)
filter - the filter pattern.public String getFilter()
public Object[] getFoldedElements(int index)
index - the index selecting the entry in the list.null
if index is out of range.public boolean getAllowDuplicates()
true indicates duplicates are allowedpublic void setAllowDuplicates(boolean allowDuplicates)
allowDuplicates - true indicates duplicates are allowedpublic boolean getIgnoreCase()
true if case should be ignoredpublic void setIgnoreCase(boolean ignoreCase)
ignoreCase - true if case should be ignoredpublic boolean getMatchEmptyString()
true for the empty string to match all items,
false to match nonepublic void setMatchEmptyString(boolean matchEmptyString)
matchEmptyString - true for the empty string to match all items,
false to match nonepublic ILabelProvider getLabelProvider()
public void setLabelProvider(ILabelProvider labelProvider)
labelProvider - the label providerGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.