public class MustTable extends javax.swing.JTable implements AnySelectionSpeaker, AppTextResource, MustTableCellRenderer.AdditionalRendering
Modifier and Type | Class and Description |
---|---|
static class |
MustTable.LayoutData |
javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,CellProperties> |
props |
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MustTable() |
MustTable(javax.swing.table.AbstractTableModel tableModel) |
Modifier and Type | Method and Description |
---|---|
void |
addAnySelectionListener(AnySelectionListener l)
Adds a selection listener to be notified about selection changed events.
|
protected void |
columnLayoutChangeEvent() |
int |
convertRowIndexToModel(int viewRowIndex) |
protected javax.swing.table.JTableHeader |
createDefaultTableHeader() |
void |
ensureIndexIsVisible(int index) |
void |
fireSelectionChanged() |
java.lang.String |
getAppResStr(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale specific resource bundle.
|
javax.swing.table.TableCellRenderer |
getCellRenderer(int row,
int column) |
boolean |
getColumnLayoutChangedAndReset()
Returns true if column layout has been changed by user and resets the flag.
|
java.lang.String |
getColumnLayoutXMLString()
Returns the column layout representing user's new column model as XML String.
|
java.util.Vector<java.lang.String> |
getColumnToolTipText() |
java.lang.String |
getColumnToolTipText(int colIndex) |
javax.swing.table.TableCellRenderer |
getDefaultRenderer(java.lang.Class<?> columnClass) |
Identifier |
getIdentifier(int listIndex)
Returns the identifier of the specified item.
|
Identifier |
getSelectedIdentifier()
Returns the selected identifier.
|
java.util.Vector<Identifier> |
getSelectedIdentifiers()
Returns the selected identifiers.
|
int |
getSelectedRow() |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e) |
void |
removeAnySelectionListener(AnySelectionListener l)
Removes a selection listener to be notified about selection changed events.
|
void |
render(MustTableCellRenderer renderer,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) |
void |
resetCellProperties() |
void |
restoreColumnLayout(java.io.InputStream in)
Restores column layout using specified input stream
|
void |
restoreColumnLayout(java.lang.String xmlString)
Restores column layout using specified XML String
|
void |
saveColumnLayout(java.io.OutputStream out)
Saves the column layout into the specified output stream
|
void |
setCellProperty(int column,
CellProperties prop) |
void |
setColumnToolTipText(java.lang.String columnToolTipTextValue,
int colIndex) |
void |
setColumnToolTipText(java.util.Vector<java.lang.String> columnToolTipText) |
void |
setPopupReceiver(java.awt.event.ActionListener actionListener,
MustPopupMenu.PopupReceiver receiver)
Sets the pop up receiver to listen to events requesting a pop up menu.
|
void |
setPopupReceiver(MustPopupMenu.PopupReceiver receiver)
Sets the pop up receiver to listen to events requesting a pop up menu.
|
void |
setPopupTriggerCallback(Callback callback)
Adds a listener for context menu request and calls back if a context menu is requested.
|
void |
valueChanged(javax.swing.event.ListSelectionEvent e) |
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected java.util.HashMap<java.lang.String,CellProperties> props
public MustTable()
public MustTable(javax.swing.table.AbstractTableModel tableModel)
protected javax.swing.table.JTableHeader createDefaultTableHeader()
createDefaultTableHeader
in class javax.swing.JTable
public java.util.Vector<java.lang.String> getColumnToolTipText()
public void setColumnToolTipText(java.util.Vector<java.lang.String> columnToolTipText)
public void setColumnToolTipText(java.lang.String columnToolTipTextValue, int colIndex)
public java.lang.String getColumnToolTipText(int colIndex)
public void render(MustTableCellRenderer renderer, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
render
in interface MustTableCellRenderer.AdditionalRendering
public javax.swing.table.TableCellRenderer getCellRenderer(int row, int column)
getCellRenderer
in class javax.swing.JTable
public javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class<?> columnClass)
getDefaultRenderer
in class javax.swing.JTable
public int convertRowIndexToModel(int viewRowIndex)
convertRowIndexToModel
in class javax.swing.JTable
public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
getToolTipText
in class javax.swing.JTable
public java.lang.String getAppResStr(java.lang.String resourceKey)
AppTextResource
getAppResStr
in interface AppTextResource
resourceKey
- the key of the resource to retrievepublic int getSelectedRow()
getSelectedRow
in class javax.swing.JTable
public Identifier getSelectedIdentifier()
public java.util.Vector<Identifier> getSelectedIdentifiers()
public Identifier getIdentifier(int listIndex)
listIndex
- the index of the itempublic void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
valueChanged
in class javax.swing.JTable
public void addAnySelectionListener(AnySelectionListener l)
addAnySelectionListener
in interface AnySelectionSpeaker
l
- the selection listener to be notifiedpublic void removeAnySelectionListener(AnySelectionListener l)
removeAnySelectionListener
in interface AnySelectionSpeaker
l
- the selection listenerpublic void fireSelectionChanged()
public void setPopupReceiver(MustPopupMenu.PopupReceiver receiver)
receiver
- the receiver of the pop up menupublic void setPopupReceiver(java.awt.event.ActionListener actionListener, MustPopupMenu.PopupReceiver receiver)
actionListener
- the listener for action caused by the pop up menureceiver
- the receiver of the pop up menupublic void setPopupTriggerCallback(Callback callback)
callback
- the callback to call back if context menu is requestedpublic void ensureIndexIsVisible(int index)
public void restoreColumnLayout(java.lang.String xmlString)
xmlString
- the XML content representing the column layout to buildpublic void restoreColumnLayout(java.io.InputStream in)
in
- the input stream representing the column layout to buildpublic void resetCellProperties()
public void setCellProperty(int column, CellProperties prop)
protected void columnLayoutChangeEvent()
public boolean getColumnLayoutChangedAndReset()
public void saveColumnLayout(java.io.OutputStream out)
out
- the output stream to save the layoutpublic java.lang.String getColumnLayoutXMLString()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de