|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.grid.ShrinkSearchableSupport com.jidesoft.grid.ListShrinkSearchableSupport
public class ListShrinkSearchableSupport
ListShrinkSearchableSupport
is a subclass of ShrinkSearchableSupport
to make ListSearchable
shrinkable while searching.
Field Summary | |
---|---|
protected FilterableListModel |
_filterableListModel
|
Fields inherited from class com.jidesoft.grid.ShrinkSearchableSupport |
---|
_searchable, CLIENT_PROPERTY_SHRINK_SEARCHABLE_SUPPORT |
Constructor Summary | |
---|---|
ListShrinkSearchableSupport(Searchable searchable)
|
Method Summary | |
---|---|
protected void |
applyFilter(String searchingText)
Update the filterable model, usually applying filter, based on the latest Searchable searching text. |
protected int |
getActualIndexAt(int viewIndex)
Get actual index from the visual index. |
protected int |
getVisualIndexAt(int actualIndex)
Get visual index from the actual index. |
void |
installFilterableModel()
Install a filterable model for the component where Searchable installed in. |
protected boolean |
needReinstallFilterableModel(PropertyChangeEvent event)
Checks if the filterable model should be reinstalled if the model is changed. |
void |
uninstallFilterableModel()
Uninstall the filterable model installed by installFilterableModel . |
Methods inherited from class com.jidesoft.grid.ShrinkSearchableSupport |
---|
convertElementToString, propertyChange, searchableEventFired |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FilterableListModel _filterableListModel
Constructor Detail |
---|
public ListShrinkSearchableSupport(Searchable searchable)
Method Detail |
---|
protected boolean needReinstallFilterableModel(PropertyChangeEvent event)
ShrinkSearchableSupport
return event.getNewValue() != _filterableListModel.
needReinstallFilterableModel
in class ShrinkSearchableSupport
event
- the property change event
public void installFilterableModel()
ShrinkSearchableSupport
installFilterableModel
in class ShrinkSearchableSupport
public void uninstallFilterableModel()
ShrinkSearchableSupport
installFilterableModel
.
If you are extending this class to create your customized ShrinkSearchableSupport class, please make sure you
will invoke _searchable.getComponent().removePropertyChangeListener("model", this); to remove the property change
listener. Otherwise the filterable model may not be removed.
uninstallFilterableModel
in class ShrinkSearchableSupport
protected void applyFilter(String searchingText)
ShrinkSearchableSupport
ShrinkSearchableSupport.convertElementToString(Object)
. Below is one sample
implementation while creating the filter.
WildcardFilter wildcardFilter = new WildcardFilter(searchingText) {
protected String convertElementToString(Object value) {
String stringValue = TableShrinkSearchableSupport.this.convertElementToString(value);
return stringValue != null ? stringValue : super.convertElementToString(value);
}
};
applyFilter
in class ShrinkSearchableSupport
searchingText
- current searching textprotected int getActualIndexAt(int viewIndex)
ShrinkSearchableSupport
applyFilter
so
that we can get the current selection information hence we are able to set the selection back after the filter is
applied.
getActualIndexAt
in class ShrinkSearchableSupport
viewIndex
- the visual index
protected int getVisualIndexAt(int actualIndex)
ShrinkSearchableSupport
applyFilter
so
that we can set the selection back.
getVisualIndexAt
in class ShrinkSearchableSupport
actualIndex
- the actual index
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |