|
Holger's Java API |
|||||||||
| 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
com.antelmann.util.table.JFilteredTableComponent
public class JFilteredTableComponent
a component that filters and sorts a given TableModel. This component uses a BorderLayout that contains a JScrollPane with a JTable in its center and uses a JTableFilterTextField at BorderLayout.NORTH as well as a status statusLabel at BorderLayout.SOUTH. In addition, the embedded JTable is also generically sortable, i.e. the given model is embedded into a FilteredTableModel which is then embedded into a SortableTableModel, which is used by the JTable.
JTableFilterTextField,
Serialized Form| 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 | |
|---|---|
JFilteredTableComponent(TableModel model)
|
|
JFilteredTableComponent(TableModel model,
Integer... columnsToCheck)
|
|
JFilteredTableComponent(TableModel model,
SimpleTableRowFilter filter)
|
|
JFilteredTableComponent(TableModel model,
SimpleTableRowFilter filter,
boolean immediateSearch)
|
|
| Method Summary | |
|---|---|
FilteredTableModel |
getFilteredTableModel()
this model is embedded by the SortableTableModel and embeds the original model |
JTableFilterTextField |
getFilterField()
allows also access to the filter in use |
int |
getOriginalRowFor(int row)
returns the corresponding row of the original TableModel for the given row in the model of the table (a SortableTableModel embedding a FilteredTableModel). |
List<TableRow> |
getRelevantList()
returns the currently selected rows |
String |
getRelevantListDescription()
|
TableRow |
getRelevantValue()
returns the relevant value for this instance at the time of calling |
int |
getRowPosition(int originalRow)
returns the corresponding row of the currently visible view given the row of the original model; may return a negative number if the row is not currently visible due to filtering. |
JScrollPane |
getScrollPane()
|
SortableTableModel |
getSortableTableModel()
this model is the model of the table; it embeds the FilteredTableModel |
JLabel |
getStatusLabel()
|
JTable |
getTable()
returns the JTable in use for customization; the table uses a SortableTableModel |
TableModel |
getTableModel()
returns the original model given |
void |
replaceFilterActionListener(ActionListener al)
convenience method to alter the behavior of the filter field that is defined in this context |
void |
setImmediateUpdate(boolean flag)
shortcut to the corresponding method in the embedded JTableFilterTextField |
protected void |
updateStatusLabelText(int selectedRows,
int totalRows)
allows for a subclass to override how the status label is written (so that additional information from other filtering criteria may be written into the label as well). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JFilteredTableComponent(TableModel model)
public JFilteredTableComponent(TableModel model,
Integer... columnsToCheck)
public JFilteredTableComponent(TableModel model,
SimpleTableRowFilter filter)
public JFilteredTableComponent(TableModel model,
SimpleTableRowFilter filter,
boolean immediateSearch)
| Method Detail |
|---|
protected void updateStatusLabelText(int selectedRows,
int totalRows)
public int getOriginalRowFor(int row)
public int getRowPosition(int originalRow)
public FilteredTableModel getFilteredTableModel()
public SortableTableModel getSortableTableModel()
public TableModel getTableModel()
public JTable getTable()
public JScrollPane getScrollPane()
public JTableFilterTextField getFilterField()
public void replaceFilterActionListener(ActionListener al)
getFilterField()public JLabel getStatusLabel()
public void setImmediateUpdate(boolean flag)
public TableRow getRelevantValue()
throws IOException
ValueRetriever
getRelevantValue in interface ValueRetriever<TableRow>IOException - if any resource to fulfill the request is not accessible
public List<TableRow> getRelevantList()
throws IOException
getRelevantList in interface ListRetriever<TableRow>IOExceptionpublic String getRelevantListDescription()
getRelevantListDescription in interface ListRetriever<TableRow>
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||