net.coderazzi.filters.gui
Interface IFilterEditor


public interface IFilterEditor

Public interface of the editors associated to each table's column.


Method Summary
 AutoChoices getAutoChoices()
          Returns the autoChoices mode.
 Comparator getComparator()
          Returns the associated Comparator, which can nver be null.
 Object getContent()
          Returns the current editor's content.
 Set<CustomChoice> getCustomChoices()
          Returns the current choices.
 IFilter getFilter()
          Returns the IFilter associated to the editor's content
The returned instance can then be used to enable or disable the filter and its GUI component.
 Format getFormat()
          Returns the associated Format.
 Look getLook()
          Returns the current editor's look.
 int getMaxHistory()
          Returns the maximum history size, as defined by the user.
This is not the real maximum history size, as it depends on the max number of visible rows and whether the popup contains only history or also choices
 Class<?> getModelClass()
          Returns the class associated to the editor on the model.
 int getModelIndex()
          Returns the model position associated to this editor.
 ChoiceRenderer getRenderer()
          Returns the associated ChoiceRenderer.
 boolean isEditable()
          Returns the editable flag.
 boolean isIgnoreCase()
          Returns the ignore case flag.
 void resetFilter()
          Resets the filter, which implies set its content to empty and reset its history choices.
 void setAutoChoices(AutoChoices mode)
          Using autoChoices, the choices displayed on the popup menu are automatically extracted from the associated TableModel.
For editors associated to boolean or short enumerations, setting the AutoChoices automatically changes the editable flag: it is set to true for DISABLED values, false otherwise.
 void setComparator(Comparator comparator)
          Sets the Comparator required to compare (and sort) instances of the associated class in the table model.
It is initially retrieved from the IParserModel, and set also in the underlying TableRowSorter associated to the table.
Setting a comparator to null resets the used comparator (i.e: the comparator is never null)
 void setContent(Object content)
          Sets the content, adapted to the editors' type.
 void setCustomChoices(Set<CustomChoice> choices)
          Sets the available choices, shown on the popup menu.
 void setEditable(boolean enable)
          Defines the editor, if text based -i.e., without associated ChoiceRenderer, as editable: this flag means that the user can enter any text, not being limited to the existing choices
 void setFormat(Format format)
          Sets the Format required by the editor to handle the user's input when the associated class is not a String
It is initially retrieved from the IParserModel.
 void setIgnoreCase(boolean set)
          Sets the ignore case flag.
 void setMaxHistory(int size)
          Limits the history size.
This limit is only used when the popup contains also choices.
 void setRenderer(ChoiceRenderer renderer)
          Sets the ChoiceRenderer for the choices / history.
 

Method Detail

getModelIndex

int getModelIndex()
Returns the model position associated to this editor.


getModelClass

Class<?> getModelClass()
Returns the class associated to the editor on the model.


getFilter

IFilter getFilter()
Returns the IFilter associated to the editor's content
The returned instance can then be used to enable or disable the filter and its GUI component.


resetFilter

void resetFilter()
Resets the filter, which implies set its content to empty and reset its history choices.


setContent

void setContent(Object content)
Sets the content, adapted to the editors' type.


getContent

Object getContent()
Returns the current editor's content.


setAutoChoices

void setAutoChoices(AutoChoices mode)
Using autoChoices, the choices displayed on the popup menu are automatically extracted from the associated TableModel.
For editors associated to boolean or short enumerations, setting the AutoChoices automatically changes the editable flag: it is set to true for DISABLED values, false otherwise.


getAutoChoices

AutoChoices getAutoChoices()
Returns the autoChoices mode.


setCustomChoices

void setCustomChoices(Set<CustomChoice> choices)
Sets the available choices, shown on the popup menu.


getCustomChoices

Set<CustomChoice> getCustomChoices()
Returns the current choices.


setEditable

void setEditable(boolean enable)
Defines the editor, if text based -i.e., without associated ChoiceRenderer, as editable: this flag means that the user can enter any text, not being limited to the existing choices


isEditable

boolean isEditable()
Returns the editable flag.

See Also:
setEditable(boolean)

setIgnoreCase

void setIgnoreCase(boolean set)
Sets the ignore case flag.


isIgnoreCase

boolean isIgnoreCase()
Returns the ignore case flag.


setFormat

void setFormat(Format format)
Sets the Format required by the editor to handle the user's input when the associated class is not a String
It is initially retrieved from the IParserModel.


getFormat

Format getFormat()
Returns the associated Format.


setComparator

void setComparator(Comparator comparator)
Sets the Comparator required to compare (and sort) instances of the associated class in the table model.
It is initially retrieved from the IParserModel, and set also in the underlying TableRowSorter associated to the table.
Setting a comparator to null resets the used comparator (i.e: the comparator is never null)


getComparator

Comparator getComparator()
Returns the associated Comparator, which can nver be null.


setMaxHistory

void setMaxHistory(int size)
Limits the history size.
This limit is only used when the popup contains also choices. Otherwise, the maximum history size is to the maximum number of visible rows
The max history cannot be greater than the max visible rows


getMaxHistory

int getMaxHistory()
Returns the maximum history size, as defined by the user.
This is not the real maximum history size, as it depends on the max number of visible rows and whether the popup contains only history or also choices


setRenderer

void setRenderer(ChoiceRenderer renderer)
Sets the ChoiceRenderer for the choices / history.

It also affectes to how the content is rendered
If not null, the content cannot be text-edited anymore

Parameters:
renderer -

getRenderer

ChoiceRenderer getRenderer()
Returns the associated ChoiceRenderer.


getLook

Look getLook()
Returns the current editor's look.



Copyright © 2011 coderazzi. All Rights Reserved.