|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.dialog.AbstractPage com.jidesoft.dialog.AbstractDialogPage com.jidesoft.grid.TableCustomFilterEditor
public class TableCustomFilterEditor
TableCustomFilterEditor
adds additional controls to create a list of FilterItems and they can be added
to FilterableTableModel
. To get the list of FilterItem
s, you can call getFilterItems()
method.
Nested Class Summary | |
---|---|
class |
TableCustomFilterEditor.FilterPanel
It's one line of FilterPanel contains several components. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
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 | |
---|---|
protected JButton |
_addButton
The button displayed on the right and above the _list . |
protected JToggleButton |
_andButton
The label displayed on the left and below the _list . |
protected JButton |
_applyButton
The button displayed on the right and below the _list . |
protected JButton |
_clearButton
The button displayed on the left of _applyButton It is only used if getStyle() returns STYLE_FILTER_LIST . |
protected CustomFilterEditor |
_editor
The CustomFilterEditor, which contains a column selection JComboBox, a condition JComboBox and the ValueEditors. |
protected List<TableCustomFilterEditor.FilterPanel> |
_filterPanels
The FilterPanel list currently visible. |
protected JLabel |
_filtersLabel
The label displayed on the left and above the _list . |
protected JList |
_list
The existing filter list, which contains a list of current existing filters. |
protected JButton |
_removeButton
The button displayed on the left of _clearButton It is only used if getStyle() returns STYLE_FILTER_LIST . |
protected JButton |
_replaceButton
The button displayed on the left of _addButton . |
protected int |
_style
|
static int |
BUTTON_ALL
|
static int |
BUTTON_APPLY_FILTER
|
static int |
BUTTON_CLEAR_FILTER
|
static int |
BUTTON_COMPOUND_METHOD
|
static int |
BUTTON_REMOVE_ITEM
|
String |
PROPERTY_COLLAPSED
|
String |
PROPERTY_COLLAPSIBLE
|
static int |
STYLE_FILTER_LIST
|
static int |
STYLE_INLINE_EDITOR
|
Fields inherited from class com.jidesoft.dialog.AbstractDialogPage |
---|
_buttonEvent, _description, _icon, _pageEnabled, _parentPage, _title, DESCRIPTION_PROPERTY, ICON_PROPERTY, PROPERTY_PAGE_ENABLED, TITLE_PROPERTY |
Fields inherited from class com.jidesoft.dialog.AbstractPage |
---|
_pageEvent, INVOKE_ON_ALL, INVOKE_ON_NONE, INVOKE_ON_PAINT, INVOKE_ON_REPAINT, INVOKE_ON_UPDATE, INVOKE_ON_VALIDATE |
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 | |
---|---|
TableCustomFilterEditor(TableModel tableModel)
Creates a TableCustomFilterEditor from a table model. |
|
TableCustomFilterEditor(TableModel tableModel,
int style)
Creates a TableCustomFilterEditor from a table model. |
Method Summary | |
---|---|
protected JComboBox |
createColumnComboBox(String[] columnNames)
|
protected CustomFilterEditor |
createCustomFilterEditor(FilterFactoryManager filterFactoryManager,
Class type,
ConverterContext converterContext,
Object[] possibleValues)
Creates a CustomFilterEditor. |
protected IFilterableTableModel |
createFilterableTableModel(TableModel tableModel)
Creates the FilterableTableModel. |
protected FilterFactoryManager |
createFilterFactoryManager()
Creates the FilterFactoryManager used by this TableCustomFilterEditor. |
protected Component |
createFilterItemPanel(IFilterableTableModel.FilterItem item,
int index,
int total)
Creates the filter item panel. |
protected Component |
createListPanel()
|
protected ValueEditor |
createValueEditor(Class type,
ConverterContext converterContext,
Object[] possibleValues)
Creates the ValueEditor. |
ActionListener |
getApplyFilterActionListener()
Gets the action listener to apply the filters defined by this editor to a FilterableTableModel. |
ActionListener |
getClearFilterActionListener()
Gets the action listener to clear the filters defined by this editor to a FilterableTableModel. |
int[] |
getColumnIndex()
Deprecated. replaced by setColumnIndices(int[]) |
int[] |
getColumnIndices()
Get the column indexes |
protected String |
getColumnName(TableModel tableModel,
int columnIndex)
Gets the table column name. |
IFilterableTableModel |
getFilterableTableModel()
Gets the filterable table model. |
FilterFactoryManager |
getFilterFactoryManager()
Gets the FilterFactoryManager used by this TableCustomFilterEditor . |
ListModel |
getFilterItemModel()
Gets the filter item model used in STYLE_FILTER_LIST . |
IFilterableTableModel.FilterItem[] |
getFilterItems()
Gets the FilterItems defined in this TableCustomFilterEditor . |
Filter[] |
getFilters()
Gets the filters from the FilterEditor. |
ObjectGrouper |
getObjectGrouper()
Gets the current ObjectGrouper instance. |
protected String |
getResourceString(String key)
|
int |
getStyle()
|
int |
getVisibleButtons()
Get visible buttons |
protected void |
initComponents()
|
boolean |
isAnd()
Gets the relation of the filters when there are multiple filters. |
boolean |
isCollapsed()
|
boolean |
isCollapsible()
|
void |
lazyInitialize()
This method must be implemented by any child class. |
void |
saveFilterItems()
|
void |
setAnd(boolean and)
Sets the relation of the filters when there are multiple filters. |
void |
setApplyFilterActionListener(ActionListener applyFilterActionListener)
Sets the action listener that applies the filters defined by this editor to a FilterableTableModel. |
void |
setClearFilterActionListener(ActionListener clearFilterActionListener)
Sets the action listener that clears the filters defined by this editor to a FilterableTableModel. |
void |
setCollapsed(boolean collapsed)
Sets the filter editor into collapsed mode so that only the first filter editor is visible. |
void |
setCollapsible(boolean collapsible)
Sets the collapsible property. |
void |
setColumnIndex(int[] columnIndex)
Deprecated. replaced by setColumnIndices(int[]) |
void |
setColumnIndices(int[] columnIndices)
Set the column indexes |
void |
setFilterItems(IFilterableTableModel.FilterItem[] filterItems)
Sets the FilterItems. |
void |
setFilters(Filter[] filters)
Sets the filters to the FilterEditor, which will update the JComponent accordingly. |
void |
setObjectGrouper(ObjectGrouper objectGrouper)
Sets the current ObjectGrouper instance. |
void |
setStyle(int style)
Changes the way how the filters are defined. |
void |
setVisibleButtons(int visibleButtons)
Set visible buttons |
protected boolean |
shouldClearButtonBeVisible(int index,
int total)
Checks if the clear button should be visible. |
protected boolean |
shouldGoButtonBeVisible(int index,
int total)
Checks if the go button should be visible. |
void |
tableChanged(TableModelEvent e)
|
Methods inherited from class com.jidesoft.dialog.AbstractDialogPage |
---|
addButtonListener, fireButtonEvent, fireButtonEvent, fireButtonEvent, focusDefaultFocusComponent, getButtonListeners, getDefaultFocusComponent, getDescription, getFullTitle, getIcon, getParentPage, getTitle, isPageEnabled, removeButtonListener, setDefaultFocusComponent, setDescription, setIcon, setPageEnabled, setParentPage, setTitle |
Methods inherited from class com.jidesoft.dialog.AbstractPage |
---|
addPageListener, allowClosing, firePageEvent, firePageEvent, getInvokeCondition, getPageListeners, initialize, invalidate, paint, paintAll, paintComponents, removePageListener, repaint, repaint, repaint, repaint, reset, revalidate, setAllowClosing, setInvokeCondition, update |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected CustomFilterEditor _editor
getStyle()
returns STYLE_FILTER_LIST
.
protected JList _list
getStyle()
returns STYLE_FILTER_LIST
.
protected JLabel _filtersLabel
_list
. It is only used if getStyle()
returns
STYLE_FILTER_LIST
.
protected JButton _replaceButton
_addButton
. It is only used if getStyle()
returns STYLE_FILTER_LIST
.
protected JButton _removeButton
_clearButton
It is only used if getStyle()
returns STYLE_FILTER_LIST
.
protected JButton _applyButton
_list
. It is only used if getStyle()
returns
STYLE_FILTER_LIST
.
protected JButton _addButton
_list
. It is only used if getStyle()
returns
STYLE_FILTER_LIST
.
protected JButton _clearButton
_applyButton
It is only used if getStyle()
returns STYLE_FILTER_LIST
.
protected int _style
public static final int STYLE_FILTER_LIST
public static final int STYLE_INLINE_EDITOR
protected List<TableCustomFilterEditor.FilterPanel> _filterPanels
getStyle()
returns STYLE_INLINE_EDITOR
.
protected JToggleButton _andButton
_list
. It is only used if getStyle()
returns
STYLE_FILTER_LIST
.
public final String PROPERTY_COLLAPSIBLE
public final String PROPERTY_COLLAPSED
public static final int BUTTON_ALL
public static final int BUTTON_CLEAR_FILTER
public static final int BUTTON_APPLY_FILTER
public static final int BUTTON_COMPOUND_METHOD
public static final int BUTTON_REMOVE_ITEM
Constructor Detail |
---|
public TableCustomFilterEditor(TableModel tableModel)
tableModel
- the table model.public TableCustomFilterEditor(TableModel tableModel, int style)
tableModel
- the table model.style
- the style.Method Detail |
---|
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
public void lazyInitialize()
Laziness
lazyInitialize
in interface Laziness
protected void initComponents()
protected IFilterableTableModel createFilterableTableModel(TableModel tableModel)
tableModel
- the table model.
public Filter[] getFilters()
getFilters
in interface FilterEditor
public void setFilters(Filter[] filters)
setFilters
in interface FilterEditor
filters
- the filters@Deprecated public int[] getColumnIndex()
setColumnIndices(int[])
@Deprecated public void setColumnIndex(int[] columnIndex)
setColumnIndices(int[])
columnIndex
- public int[] getColumnIndices()
public void setColumnIndices(int[] columnIndices)
columnIndex
- public int getVisibleButtons()
visibleButtons
- public void setVisibleButtons(int visibleButtons)
visibleButtons
- public ObjectGrouper getObjectGrouper()
public void setObjectGrouper(ObjectGrouper objectGrouper)
setObjectGrouper
in interface FilterEditor
objectGrouper
- the grouperprotected boolean shouldGoButtonBeVisible(int index, int total)
index
- the index of the rowtotal
- the total rows
protected boolean shouldClearButtonBeVisible(int index, int total)
index
- the index of the rowtotal
- the total rows
public boolean isCollapsible()
public void setCollapsible(boolean collapsible)
STYLE_INLINE_EDITOR
.
collapsible
- true or false.public boolean isCollapsed()
public void setCollapsed(boolean collapsed)
STYLE_INLINE_EDITOR
.
collapsed
- true or false.protected Component createFilterItemPanel(IFilterableTableModel.FilterItem item, int index, int total)
item
- the filter itemindex
- the index of the filter item paneltotal
- the count of all visible filter item panels
public void saveFilterItems()
protected JComboBox createColumnComboBox(String[] columnNames)
protected FilterFactoryManager createFilterFactoryManager()
protected String getColumnName(TableModel tableModel, int columnIndex)
tableModel
- the table model.columnIndex
- the column index.
protected CustomFilterEditor createCustomFilterEditor(FilterFactoryManager filterFactoryManager, Class type, ConverterContext converterContext, Object[] possibleValues)
filterFactoryManager
- the FilterFactoryManager.type
- the type.converterContext
- the ConverterContext.possibleValues
- the possible values.
protected ValueEditor createValueEditor(Class type, ConverterContext converterContext, Object[] possibleValues)
type
- the type.converterContext
- the ConverterContext.possibleValues
- the possible values.
protected Component createListPanel()
public IFilterableTableModel.FilterItem[] getFilterItems()
TableCustomFilterEditor
.
TableCustomFilterEditor
.public void setFilterItems(IFilterableTableModel.FilterItem[] filterItems)
filterItems
- the FilterItems defined this TableCustomFilterEditor
.public ListModel getFilterItemModel()
STYLE_FILTER_LIST
.
public IFilterableTableModel getFilterableTableModel()
public FilterFactoryManager getFilterFactoryManager()
TableCustomFilterEditor
.
protected String getResourceString(String key)
public int getStyle()
public void setStyle(int style)
STYLE_INLINE_EDITOR
. Please note, calling this method will clear the filters that are already defined.
style
- the new style;.public ActionListener getApplyFilterActionListener()
public void setApplyFilterActionListener(ActionListener applyFilterActionListener)
applyFilterActionListener
- a new listener.public ActionListener getClearFilterActionListener()
public void setClearFilterActionListener(ActionListener clearFilterActionListener)
clearFilterActionListener
- a new listener.public boolean isAnd()
public void setAnd(boolean and)
and
- true or false. True means AND and false means OR.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |