|
||||||||||
| 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
javax.swing.JTable
org.base.apps.beans.view.swing.SortableTable<T>
public class SortableTable<T>
Wrapper around a table to add sorting and filtering by default.
| Nested Class Summary | |
|---|---|
static class |
SortableTable.SimpleRowFilter<D>
|
static class |
SortableTable.TableAttr
|
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
| 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 | |
|---|---|
SortableTable(BaseTableModel<T> model)
|
|
| Method Summary | |
|---|---|
protected BaseTableModel<T> |
getBaseModel()
|
boolean |
getScrollableTracksViewportHeight()
The following method copied from: http://elliotth.blogspot.com/2006/05/making-jtable-look-more-at-home-on-mac.html Changes the behavior of a table in a JScrollPane to be more like the behavior of JList, which expands to fill the available space. |
int |
getSelectedIndex()
Returns the model index of the selected row, if any. |
T |
getSelectedItem()
Returns the currently selected item in the table. |
protected void |
initialize(BaseTableModel<T> model)
Initializes this table with the given model. |
boolean |
isSortable()
Returns true if this table's data is sortable. |
void |
setModel(BaseTableModel<T> dataModel)
Sets the data model for this table. |
void |
setModel(TableModel dataModel)
Sets the data model for this table, which must be a subclass of BaseTableModel. |
void |
setScrollableTracksViewportHeight(boolean useViewport)
Sets flag to indicate that the height of the viewport does not determine the height of the table. |
void |
setSelectedItem(T item)
|
void |
setSortable(boolean sortable)
|
void |
unsetScrollableTracksViewportHeight()
Unsets flag to indicate that the height of the viewport does not determine the height of the table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SortableTable(BaseTableModel<T> model)
model - The underlying table model.| Method Detail |
|---|
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface ScrollablegetScrollableTracksViewportHeight in class JTableJTable.getScrollableTracksViewportHeight()public void setScrollableTracksViewportHeight(boolean useViewport)
public void unsetScrollableTracksViewportHeight()
public int getSelectedIndex()
public T getSelectedItem()
public boolean isSortable()
true if this table's data is sortable.
true if this table's data is sortable, else false..public void setSortable(boolean sortable)
sortable - the sortable to setpublic final void setModel(TableModel dataModel)
BaseTableModel.
setModel in class JTableIllegalArgumentException - if the given model is not a BaseTableModel.JTable.setModel(javax.swing.table.TableModel)public final void setModel(BaseTableModel<T> dataModel)
dataModel - setModel(TableModel),
JTable.setModel(javax.swing.table.TableModel)public void setSelectedItem(T item)
protected BaseTableModel<T> getBaseModel()
protected void initialize(BaseTableModel<T> model)
model - A table model.
|
Please visit Base Apps, hosted on Sourceforge.net. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||