|
||||||||||
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.JScrollPane
org.knime.core.node.tableview.TableView
public class TableView
Panel containing a table view on a generic DataTable
. The
table is located in a scroll pane and row and column headers are visible and
fixed.
For the caching strategy used in the table refer to
TableContentModel
.
Nested Class Summary | |
---|---|
static class |
TableView.TableAction
Action associate with the table. |
Nested classes/interfaces inherited from class javax.swing.JScrollPane |
---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
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.JScrollPane |
---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
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 | |
---|---|
TableView()
Creates new empty TableView . |
|
TableView(DataTable table)
Creates new instance of a TableView based on a
DataTable . |
|
TableView(DataTable table,
HiLiteHandler propHdl)
Creates new instance of a TableView based on a
DataTable . |
|
TableView(TableContentModel model)
Constructs new View by calling this(new TableContentView(model)) . |
|
TableView(TableContentView contentView)
Creates new instance of a TableView given a content view. |
Method Summary | |
---|---|
void |
cancelRowCountingInBackground()
Delegate method to cancel row counting. |
void |
countRowsInBackground()
Delegate method to start row counting. |
JMenu |
createHiLiteMenu()
Get a new menu to control hiliting for this view. |
(package private) Collection<JMenuItem> |
createHiLiteMenuItems()
Helper function to create new JMenuItems that are in the hilite menu. |
JMenu |
createNavigationMenu()
Create the navigation menu for this table view. |
JMenu |
createViewMenu()
Get a new menu with view controllers (row height, etc.) for this view. |
protected void |
find(String search,
boolean idOnly)
Find cells (or row IDs) that match the search string. |
JViewport |
getColumnHeader()
Delegates to super implementation but sets an appropriate preferred size before returning. |
int |
getColumnHeaderViewHeight()
Get the height of the column header view or -1 if none has been set (no data available). |
int |
getColumnWidth()
Returns the width of the first column or -1 if there are no columns. |
TableContentModel |
getContentModel()
Get reference to underlying TableContentModel . |
TableContentView |
getContentTable()
Get reference to table view that is in the scroll pane's view port. |
TableRowHeaderView |
getHeaderTable()
Get reference to row header table, that is the column displaying the row keys from the underlying table. |
int |
getRowHeight()
Get row height from table. |
void |
gotoCell(int row,
int col)
Scrolls to the given coordinate cell. |
boolean |
hasData()
This table "has data" when there is valid input, i.e. |
boolean |
hasHiLiteHandler()
Checks if a property handler is registered. |
void |
hiliteSelected()
Sends a request to the content table to hilite all currently selected rows. |
boolean |
isColumnHeaderResizingAllowed()
Whether or not the resizing of the column header height is allowed. |
boolean |
isShowColorInfo()
Is color icon shown? |
boolean |
isShowIconInColumnHeader()
Get the status if the icon in the column header is shown. |
TableView.TableAction |
registerFindAction()
Creates and registers the "Find ..." action on this component. |
TableView.TableAction |
registerFindNextAction()
Creates and registers the "Find Next" action on this component. |
TableView.TableAction |
registerGotoRowAction()
Creates and registers the "Go to Row" action on this component. |
void |
registerNavigationActions()
Registers all actions for navigation on the table, namely "Find...", "Find Next" and "Go to Row...". |
void |
resetHilite()
Sends a request to the content table to reset (unhilite) all rows. |
void |
setColumnHeaderResizingAllowed(boolean isColumnHeaderResizingAllowed)
Enable or disable the resizing of the column header height. |
void |
setColumnHeaderViewHeight(int newHeight)
Set the height of the column header view. |
void |
setColumnWidth(int width)
Sets an equal width in all columns. |
void |
setCorner(String key,
Component corner)
Overwritten to add (north-south) resize listener to upper left corner. |
void |
setDataTable(DataTable data)
Sets a new DataTable as content. |
void |
setHiLiteHandler(HiLiteHandler hiLiteHdl)
Sets a new HiLiteHandler this view talks to. |
void |
setRowHeight(int newHeight)
Set a new row height in the table. |
void |
setShowColorInfo(boolean showIt)
Shall row header encode the color information in an icon? |
void |
setShowIconInColumnHeader(boolean show)
Set whether or not the icon in the column header is to be displayed. |
void |
showHiLitedOnly(boolean showOnlyHilite)
Deprecated. Implementors should refer to getContentModel().setTableContentFilter(TableContentFilter) |
protected void |
showPopup(Point p)
Opens the popup menu on the row header. |
boolean |
showsHiLitedOnly()
Deprecated. Implementors should refer to getContentModel().getTableContentFilter() |
void |
unHiliteSelected()
Sends a request to the content table to unhilite all currently selected rows. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableView()
TableView
. Content and handlers are set
using the appropriate methods, that is,
setDataTable(DataTable)
and
setHiLiteHandler(HiLiteHandler)
. The model for this
view, however, is not null
. That is, it's completely legal
to do getContentModel()
right after calling this
constructor.
public TableView(TableContentView contentView)
TableView
given a content view.
A row header is created and displayed. There is no property handler
connected to this view at this time.
contentView
- view to display.
NullPointerException
- if contentView is null
public TableView(TableContentModel model)
this(new TableContentView(model))
.
model
- model to be displayed.
NullPointerException
- if model
is null
.TableView(TableContentView)
public TableView(DataTable table)
TableView
based on a
DataTable
. A row header is created and displayed.
table
- table to be displayed
NullPointerException
- if table
is null
.public TableView(DataTable table, HiLiteHandler propHdl)
TableView
based on a
DataTable
. A row header is created and displayed.
table
- table to be displayedpropHdl
- used to connect other views, may be null
NullPointerException
- if table
is null
Method Detail |
---|
public TableContentView getContentTable()
public TableContentModel getContentModel()
TableContentModel
. This call
is identical to calling
(TableContentModel)(getContentTable().getModel())
.
public TableRowHeaderView getHeaderTable()
public JViewport getColumnHeader()
getColumnHeader
in class JScrollPane
public void setCorner(String key, Component corner)
setCorner
in class JScrollPane
public final boolean hasHiLiteHandler()
true
if global hiliting is possible (property
handler is available).TableContentModel.hasHiLiteHandler()
public boolean hasData()
DataTable
to display is not null
. The
status may changed during runtime by calling the model's
setDataTable(DataTable)
method.
true
when there is data to display,
false
otherwiseTableContentModel.hasData()
public void hiliteSelected()
TableContentView.hiliteSelected()
public void unHiliteSelected()
TableContentView.unHiliteSelected()
public void resetHilite()
TableContentView.resetHilite()
public void setDataTable(DataTable data)
DataTable
as content.
data
- new data to be shown; may be null
to have an
empty table.TableContentModel.setDataTable(DataTable)
public void setHiLiteHandler(HiLiteHandler hiLiteHdl)
HiLiteHandler
this view talks to.
The argument may be null
to disconnect from the
current HiLiteHandler
.
hiLiteHdl
- the new HiLiteHandler
.@Deprecated public final void showHiLitedOnly(boolean showOnlyHilite)
getContentModel().setTableContentFilter(TableContentFilter)
showOnlyHilite
- true
Filter and display only
rows whose hilite status is set.TableContentModel.getTableContentFilter()
@Deprecated public boolean showsHiLitedOnly()
getContentModel().getTableContentFilter()
true
: only hilited rows are shown,
false
: all rows are shown.TableContentModel.getTableContentFilter()
public void cancelRowCountingInBackground()
TableContentModel.cancelRowCountingInBackground()
public void countRowsInBackground()
TableContentModel.countRowsInBackground()
public int getRowHeight()
JTable.getRowHeight()
public int getColumnWidth()
public void setColumnWidth(int width)
width
- the new width.TableColumn.setPreferredWidth(int)
public int getColumnHeaderViewHeight()
public void setColumnHeaderViewHeight(int newHeight)
newHeight
- The new height.public void setRowHeight(int newHeight)
newHeight
- the new heightJTable.setRowHeight(int)
public void setShowColorInfo(boolean showIt)
showIt
- true
for show icon (and thus the color),
false
ignore colorsTableRowHeaderView.setShowColorInfo(boolean)
public boolean isShowColorInfo()
true
if it is, false
otherwiseTableRowHeaderView.isShowColorInfo()
public void setShowIconInColumnHeader(boolean show)
setShowColorInfo(boolean)
.
show
- Whether or not this icon should be shown.public boolean isShowIconInColumnHeader()
isShowColorInfo()
.
public boolean isColumnHeaderResizingAllowed()
false
.
setColumnHeaderResizingAllowed(boolean)
public void setColumnHeaderResizingAllowed(boolean isColumnHeaderResizingAllowed)
isColumnHeaderResizingAllowed
- If true
resizing is
allowed.protected void find(String search, boolean idOnly)
search
- The search string.idOnly
- If only the ID column should be searched.
NullPointerException
- If search
argument is null.public void gotoCell(int row, int col)
row
- the row to scroll tocol
- the col to scroll to (negative for row key)protected void showPopup(Point p)
p
- location where to open the popuppublic JMenu createNavigationMenu()
JMenu
with navigation controllers.public JMenu createHiLiteMenu()
Collection<JMenuItem> createHiLiteMenuItems()
public JMenu createViewMenu()
public void registerNavigationActions()
public TableView.TableAction registerFindAction()
registerNavigationActions()
public TableView.TableAction registerFindNextAction()
registerNavigationActions()
public TableView.TableAction registerGotoRowAction()
registerNavigationActions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |