nl.coderight.jazz.form.field
Class TableField<V>
java.lang.Object
nl.coderight.jazz.form.FormField<V>
nl.coderight.jazz.form.FormControl<V>
nl.coderight.jazz.form.field.scrollable.ScrollableField<V>
nl.coderight.jazz.form.field.selectable.SelectableField<V>
nl.coderight.jazz.form.field.selectable.ListSelectableField<V>
nl.coderight.jazz.form.field.TableField<V>
- All Implemented Interfaces:
- Selection<V>
- Direct Known Subclasses:
- CheckTableField, TreeTableField
public class TableField<V>
- extends ListSelectableField<V>
- implements Selection<V>
Implementation of a JTable.
- See Also:
JTable
| Methods inherited from class nl.coderight.jazz.form.field.selectable.ListSelectableField |
createSortComparator, delete, getFilterCount, getIndex, getListOfValues, getValue, getValueAt, getValueCount, insert, onFilterChanged, onRebuildFinished, onRebuildProgress, onRebuildStart, setListOfValues, setValueAt, sort, update |
| Methods inherited from class nl.coderight.jazz.form.field.selectable.SelectableField |
addFilter, dispose, filter, getBindID, getFilters, getRelationID, getSelectID, getSelectionBackground, getSelectionForeground, getSortComparator, getSortID, getSortOrder, getValue, isSortingEnabled, onFocusGained, onPopup, onSearchFinished, onSearchProgress, onSearchStart, search, search, searchAll, setOnChangeEvent, setOnSelectAction, setOnSelectCondition, setOnSelectEvent, setOnSelectGroup, setRelationID, setSelectID, setSortComparator, setSortID, setSortingEnabled, setSortOrder, setValue |
| Methods inherited from class nl.coderight.jazz.form.field.scrollable.ScrollableField |
getComponent, getFocusComponent, getPreferredSize, getViewportSize, isOpaque, isScrollable, onViewportChanged, setBackground, setBackgroundImage, setBorder, setColumnHeader, setComponent, setComponent, setCorner, setEnabled, setForeground, setOpaque, setPreferredSize, setRowHeader, setScrollable, setScrollBarPolicy, setTitle |
| Methods inherited from class nl.coderight.jazz.form.FormField |
dispatchEvent, focusNextField, focusPreviousField, getBackground, getBorder, getCursor, getDataBinding, getForeground, getForm, getLabel, getParent, getToolTipText, isBindable, isChanged, isEnabled, isFocusable, isReadonly, isShowing, isValueChanged, isVisible, onClick, onFocusLost, onMouseEnter, onMouseLeave, setBindID, setChanged, setCursor, setDataBinding, setFocusable, setOnFocusGainedEvent, setOnFocusLostEvent, setPopupMenu, setReadonly, setToolTipText, setVisible, translate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TableField
public TableField(String bindID,
String selectID)
createField
protected JTable createField()
getField
protected JTable getField()
getColumnCount
public int getColumnCount()
addColumn
public void addColumn(String title,
String displayID)
addColumn
public void addColumn(TableFieldColumn column)
getColumn
public TableFieldColumn getColumn(int columnIndex)
setColumnVisible
public void setColumnVisible(TableFieldColumn column,
boolean visible)
- Show/hide column.
- Since:
- 1.6
setAutofitColumn
public void setAutofitColumn(int columnIndex)
- Since:
- 1.5
setAutofitColumn
public void setAutofitColumn(String title)
- Since:
- 1.5
getSortColumnIndex
public int getSortColumnIndex()
sort
public void sort(int columnIndex,
SortOrder order)
onChange
protected void onChange()
- Overrides:
onChange in class SelectableField<V>
isAlternatingColorsEnabled
public boolean isAlternatingColorsEnabled()
setAlternatingColorsEnabled
public void setAlternatingColorsEnabled(boolean enabled)
getSelectedIndex
public int getSelectedIndex()
- Specified by:
getSelectedIndex in class SelectableField<V>
setSelectedIndex
public void setSelectedIndex(int index)
- Specified by:
setSelectedIndex in class SelectableField<V>
isSelectedIndex
public boolean isSelectedIndex(int index)
isSelectionEnabled
public boolean isSelectionEnabled()
setSelectionEnabled
public void setSelectionEnabled(boolean enabled)
getSelectionMode
public Selection.SelectionMode getSelectionMode()
- Specified by:
getSelectionMode in interface Selection<V>
setSelectionMode
public void setSelectionMode(Selection.SelectionMode selectionMode)
- Specified by:
setSelectionMode in interface Selection<V>
getSelectionCount
public int getSelectionCount()
- Specified by:
getSelectionCount in interface Selection<V>- Overrides:
getSelectionCount in class SelectableField<V>
getSelectionIndices
public int[] getSelectionIndices()
- Specified by:
getSelectionIndices in interface Selection<V>
select
public void select(int index)
- Specified by:
select in interface Selection<V>
deselect
public void deselect(int index)
- Specified by:
deselect in interface Selection<V>
select
public void select(int startIndex,
int endIndex)
- Specified by:
select in interface Selection<V>
deselect
public void deselect(int startIndex,
int endIndex)
- Specified by:
deselect in interface Selection<V>
select
public void select(int[] indices)
- Specified by:
select in interface Selection<V>
deselect
public void deselect(int[] indices)
- Specified by:
deselect in interface Selection<V>
selectAll
public void selectAll()
- Specified by:
selectAll in interface Selection<V>
deselectAll
public void deselectAll()
- Specified by:
deselectAll in interface Selection<V>
getSelectionValues
public List<V> getSelectionValues()
- Returns selected values or empty list if none are selected.
- Specified by:
getSelectionValues in interface Selection<V>
- Returns:
- List
- Since:
- 1.1
setSelectionValues
public void setSelectionValues(List<V> values)
- Select values.
- Specified by:
setSelectionValues in interface Selection<V>
- Parameters:
values - - Since:
- 1.3
setVisibleRowCount
public void setVisibleRowCount(int visibleRowCount)
getPreferredViewportSize
protected Dimension getPreferredViewportSize()
- Overrides:
getPreferredViewportSize in class ScrollableField<V>
setFillsViewportHeight
public void setFillsViewportHeight(boolean fillsViewportHeight)
- Since:
- 1.4
locationToIndex
public int locationToIndex(Point point)
- Specified by:
locationToIndex in class SelectableField<V>
getAutoResizeMode
public TableField.AutoResizeMode getAutoResizeMode()
setAutoResizeMode
public void setAutoResizeMode(TableField.AutoResizeMode autoResizeMode)
setHeaderVisible
public void setHeaderVisible(boolean visible)
getTableHeader
public JTableHeader getTableHeader()
setTableHeader
public void setTableHeader(JTableHeader header)
getIntercellSpacing
public Dimension getIntercellSpacing()
setIntercellSpacing
public void setIntercellSpacing(Dimension intercellSpacing)
getRowHeight
public int getRowHeight()
setRowHeight
public void setRowHeight(int rowHeight)
getRowMargin
public int getRowMargin()
setRowMargin
public void setRowMargin(int rowMargin)
setShowGrid
public void setShowGrid(boolean showGrid)
getGridColor
public Color getGridColor()
setGridColor
public void setGridColor(Color gridColor)
getShowHorizontalLines
public boolean getShowHorizontalLines()
setShowHorizontalLines
public void setShowHorizontalLines(boolean showHorizontalLines)
getShowVerticalLines
public boolean getShowVerticalLines()
setShowVerticalLines
public void setShowVerticalLines(boolean showVerticalLines)
setRenderer
public void setRenderer(TableCellRenderer renderer)
setSelectionBackground
public void setSelectionBackground(Color selectionBackground)
- Overrides:
setSelectionBackground in class SelectableField<V>
setSelectionForeground
public void setSelectionForeground(Color selectionForeground)
- Overrides:
setSelectionForeground in class SelectableField<V>
setOnEditEvent
public void setOnEditEvent(Event onEditEvent)
setOnEditAction
public void setOnEditAction(Action onEditAction)
- Since:
- 1.3
setOnEditCondition
public void setOnEditCondition(EditCondition<V> condition)
- Since:
- 1.4
onDoubleClick
protected void onDoubleClick()
- Overrides:
onDoubleClick in class FormField<V>
onEdit
protected void onEdit()
onSelect
protected void onSelect()
- Overrides:
onSelect in class SelectableField<V>
setDefaults
protected void setDefaults()
getDisplayID
public final String getDisplayID(int columnIndex)
- Returns displayID for column.
- Parameters:
columnIndex -
- Returns:
- displayID
- Since:
- 1.2
getTooltipID
public final String getTooltipID(int columnIndex)
- Returns tooltipID for column.
- Parameters:
columnIndex -
- Returns:
- tooltipID
- Since:
- 1.6
backupSelection
protected void backupSelection()
- Overrides:
backupSelection in class ListSelectableField<V>
restoreSelection
protected void restoreSelection()
- Overrides:
restoreSelection in class ListSelectableField<V>
notifyDataChanged
protected void notifyDataChanged()
- Specified by:
notifyDataChanged in class ListSelectableField<V>
Copyright 2010 CodeRight, All rights reserved.