|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.coderazzi.filters.gui.CustomChoice
public abstract class CustomChoice
Class to specify a custom filter in the choices list.
A custom choice allows to specify custom filters that can be selected as a
choice in the filter editor. A custom choice is associated always to a text,
which the user can input to select the given choice.
It is also possible to specify how the custom filter is rendered; by
default it is displayed the icon -if provided-, and the text, unless the user
provides a custom renderer.
The order of the custom choices on the choices list can be modified with the precedence attribute. By default, custom choices are sorted by their textual representation.
Field Summary | |
---|---|
static int |
DEFAULT_PRECEDENCE
|
static CustomChoice |
MATCH_ALL
Empty filter, returns all entries. |
static int |
MATCH_ALL_PRECEDENCE
|
static CustomChoice |
MATCH_EMPTY
Special empty filter, returns all entries with null or empty values. |
Constructor Summary | |
---|---|
CustomChoice(String representation)
Creates a custom choice without associated icon, and with default precedence, to be handled exclusively as text. |
|
CustomChoice(String representation,
Icon icon)
Creates a custom choice with associated icon and default precedence. |
|
CustomChoice(String representation,
Icon icon,
int precedence)
Full constructor. |
Method Summary | |
---|---|
void |
decorateComponent(IFilterEditor editor,
boolean isSelected,
JComponent c,
Graphics g)
Decorates the choice on the given editor. |
Color |
getBackground(IFilterEditor editor,
boolean isSelected)
Returns the background color, or null to use the default one. |
abstract RowFilter |
getFilter(IFilterEditor editor)
Returns the associated filter. |
Font |
getFont(IFilterEditor editor,
boolean isSelected)
Returns the font, or null to use the default one. |
Color |
getForeground(IFilterEditor editor,
boolean isSelected)
Returns the foreground color, or null to use the default one. |
Icon |
getIcon()
Returns the associated icon, if any. |
int |
getPrecedence()
Returns the precedence value. |
String |
toString()
Returns the string representation of the filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PRECEDENCE
public static final int MATCH_ALL_PRECEDENCE
public static final CustomChoice MATCH_ALL
public static final CustomChoice MATCH_EMPTY
Constructor Detail |
---|
public CustomChoice(String representation, Icon icon, int precedence)
public CustomChoice(String representation)
public CustomChoice(String representation, Icon icon)
Method Detail |
---|
public Color getBackground(IFilterEditor editor, boolean isSelected)
editor
- the editor where the choice is usedisSelected
- true if the choice is selected
public Color getForeground(IFilterEditor editor, boolean isSelected)
editor
- the editor where the choice is usedisSelected
- true if the choice is selected
public Font getFont(IFilterEditor editor, boolean isSelected)
editor
- the editor where the choice is usedisSelected
- true if the choice is selected
public Icon getIcon()
public void decorateComponent(IFilterEditor editor, boolean isSelected, JComponent c, Graphics g)
editor
- the editor where the choice is usedisSelected
- true if the choice is selectedc
- the component to decorateg
- the decoration contextpublic int getPrecedence()
public abstract RowFilter getFilter(IFilterEditor editor)
public final String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |