Package jaxx.runtime.swing.renderer
Class FilteredDecoratorListCellRenderer
java.lang.Object
jaxx.runtime.swing.renderer.DecoratorListCellRenderer
jaxx.runtime.swing.renderer.FilteredDecoratorListCellRenderer
- All Implemented Interfaces:
javax.swing.ListCellRenderer
public class FilteredDecoratorListCellRenderer extends DecoratorListCellRenderer
A
ListCellRenderer which compute text with the given DecoratorListCellRenderer.decorator,
highlights a part of the rendered text,
and leave the hand to the DecoratorListCellRenderer.delegate to perform the visual renderer.- Since:
- 2.5.11
- Author:
- Kevin Morin - morin@codelutin.com
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringfilterTexttext to highlightprotected booleanhighlightFilterTextprotected java.util.regex.PatternpatternFields inherited from class jaxx.runtime.swing.renderer.DecoratorListCellRenderer
decorator, delegate -
Constructor Summary
Constructors Constructor Description FilteredDecoratorListCellRenderer(javax.swing.ListCellRenderer delegate, org.nuiton.decorator.Decorator<?> decorator)FilteredDecoratorListCellRenderer(javax.swing.ListCellRenderer delegate, org.nuiton.decorator.Decorator<?> decorator, boolean highlightFilterText)FilteredDecoratorListCellRenderer(org.nuiton.decorator.Decorator<?> decorator) -
Method Summary
Modifier and Type Method Description protected voidcomputePattern()java.lang.StringgetFilterText()java.awt.ComponentgetListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)booleanisHighlightFilterText()voidsetFilterText(java.lang.String filterText)voidsetHighlightFilterText(boolean highlightFilterText)Methods inherited from class jaxx.runtime.swing.renderer.DecoratorListCellRenderer
decorateValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
filterText
protected java.lang.String filterTexttext to highlight -
pattern
protected java.util.regex.Pattern pattern -
highlightFilterText
protected boolean highlightFilterText
-
-
Constructor Details
-
FilteredDecoratorListCellRenderer
public FilteredDecoratorListCellRenderer(org.nuiton.decorator.Decorator<?> decorator) -
FilteredDecoratorListCellRenderer
public FilteredDecoratorListCellRenderer(javax.swing.ListCellRenderer delegate, org.nuiton.decorator.Decorator<?> decorator) -
FilteredDecoratorListCellRenderer
public FilteredDecoratorListCellRenderer(javax.swing.ListCellRenderer delegate, org.nuiton.decorator.Decorator<?> decorator, boolean highlightFilterText)
-
-
Method Details
-
getFilterText
public java.lang.String getFilterText() -
setFilterText
public void setFilterText(java.lang.String filterText) -
isHighlightFilterText
public boolean isHighlightFilterText() -
setHighlightFilterText
public void setHighlightFilterText(boolean highlightFilterText) -
getListCellRendererComponent
public java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)- Specified by:
getListCellRendererComponentin interfacejavax.swing.ListCellRenderer- Overrides:
getListCellRendererComponentin classDecoratorListCellRenderer
-
computePattern
protected void computePattern()
-