|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
net.coderazzi.filters.gui.editor.FilterEditor
public class FilterEditor
Custom component to handle the filter' editors
It includes:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
FilterEditor()
|
Method Summary | |
---|---|
void |
addOptions(Collection<?> options)
Adds the options to the current set. |
void |
clearOptions()
Clears any options currently defined, including the current history |
void |
detach()
Diposes the editor, not to be used again |
Object |
getContent()
Returns the current editor's content |
Color |
getDisabledForeground()
Returns the color used to represent disabled state |
Color |
getErrorForeground()
Returns the color used to show filter's errors |
IFilter |
getFilter()
Returns the IFilter associated to the editor's content |
int |
getFilterPosition()
Returns the filter position associated to this editor |
ListCellRenderer |
getListCellRenderer()
Returns the associated ListCellRenderer |
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 also options or only history |
int |
getMaxVisibleRows()
Returns the maximum number of visible rows in the popup menu |
IFilterTextParser |
getTextParser()
Returns the associated IFilterTextParser |
boolean |
isAutoOptions()
Returns true if the editor is using autoOptions |
boolean |
isEditable()
Returns the editable flag |
void |
resetFilter()
Resets the filter, which implies: Content set to empty If it has autooptions, they are recreated Without autooptions, if there is a renderer, nothing else is done Without autoptions, and with no renderer: History is lost Options are removed It becomes editable |
void |
setAutoOptions(TableModel tableModel)
Using autoOptions, the options displayed on the popup menu are automatically extracted from the associated TableModel . |
void |
setBackground(Color bg)
|
void |
setContent(Object content)
Sets the content, adapted to the editors' type |
void |
setDisabledForeground(Color fg)
Sets the color used to represent disabled state |
void |
setEditable(boolean enable)
Defines the editor, if text based -i.e., without associated ListCellRenderer ,
as editable: this flag means that the user can enter any text, not being limited to the
existing options |
void |
setEnabled(boolean enabled)
Enabled/Disables the editor, and the associate filter |
void |
setErrorForeground(Color fg)
Sets the color used to show filter's errors (invalid syntax) |
void |
setFilterPosition(int filterPosition)
Defines the filter position associated to this editor. |
void |
setFont(Font font)
|
void |
setForeground(Color fg)
|
void |
setFormat(Format format)
Defines the format, used in the options list to convert content into strings -if needed- |
void |
setListCellRenderer(ListCellRenderer renderer)
Sets the ListCellRenderer for the options / history. |
void |
setMaxHistory(int size)
Limits the history size. |
void |
setMaxVisibleRows(int maxVisibleRows)
Sets the maximum number of visible rows in the popup menu (a minimum is always enforced) |
void |
setOptions(Collection<?> options)
Sets the available options, shown on the popup menu |
void |
setTextParser(IFilterTextParser parser)
Sets the IFilterTextParser ; if the editor does not have a
ListCellRenderer , a parser is mandatory |
void |
unsetAutoOptions()
Unsets the autoOptions flag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FilterEditor()
Method Detail |
---|
public void setMaxVisibleRows(int maxVisibleRows)
public int getMaxVisibleRows()
public void setMaxHistory(int size)
PopupComponent.setMaxVisibleRows(int)
public int getMaxHistory()
public IFilter getFilter()
IFilter
associated to the editor's content
public Object getContent()
public void setContent(Object content)
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
public void setBackground(Color bg)
setBackground
in class JComponent
public void setErrorForeground(Color fg)
public Color getErrorForeground()
public void setDisabledForeground(Color fg)
public Color getDisabledForeground()
public void setForeground(Color fg)
setForeground
in class JComponent
public void setFont(Font font)
setFont
in class JComponent
public void detach()
public void resetFilter()
public void setTextParser(IFilterTextParser parser)
IFilterTextParser
; if the editor does not have a
ListCellRenderer
, a parser is mandatory
public IFilterTextParser getTextParser()
IFilterTextParser
public void setFilterPosition(int filterPosition)
public int getFilterPosition()
public void setFormat(Format format)
public void setOptions(Collection<?> options)
public void addOptions(Collection<?> options)
ListCellRenderer
defined,
the content is stringfied and sorted.
public void clearOptions()
public void setListCellRenderer(ListCellRenderer renderer)
ListCellRenderer
for the options / history.
It also affectes to how the content is rendered
If not null, the content cannot be text-edited anymore
renderer
- public ListCellRenderer getListCellRenderer()
ListCellRenderer
public void setEditable(boolean enable)
ListCellRenderer
,
as editable: this flag means that the user can enter any text, not being limited to the
existing options
public boolean isEditable()
setEditable(boolean)
public void setAutoOptions(TableModel tableModel)
TableModel
.
tableModel
- can be set to null unset the flagpublic boolean isAutoOptions()
public void unsetAutoOptions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |