public class TablePanelCellRenderer
extends javax.swing.table.DefaultTableCellRenderer
TableCellRenderer
interface for the TablePanel
class.
This renderer is called whenever a cell from the parent class is to be rendered. The user may
specify specific renderers on a per-column basis instead of the per-class basis provided
by the JTable
class. This is more flexible since large tables may have one and
the same column classes used by multiple columns.
Also this class is not nailed to fixed types per colum but calls appropriate sub-renderers
base don the object type to be renderer. This means that cells of one single column may contain
objects of different type. If the user registered special renderer for this column, then
these renderers are delegated to do the work.
javax.swing.table.DefaultTableCellRenderer.UIResource
javax.swing.JLabel.AccessibleJLabel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable<java.lang.String,javax.swing.table.TableCellRenderer> |
cacheDedicatedRenderers
The dedicated renderers used for the various columns (optional).
|
protected java.util.Hashtable<java.lang.String,javax.swing.table.TableCellRenderer> |
cacheDefaultRenderers
Remembers the default renderers used for the table.
|
protected TablePanel |
parent
The parental component.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
TablePanelCellRenderer()
Constructor method for i18n purposes only.
|
TablePanelCellRenderer(TablePanel parent)
Constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
protected javax.swing.table.TableCellRenderer |
chooseRenderer(java.lang.String key,
java.lang.Object value)
Determines a renderer for the given key.
|
protected javax.swing.table.TableCellRenderer |
createDefaultTableCellRenderer(java.lang.Class clazz)
Creates a renderer implementation instance based on a type.
|
protected javax.swing.table.TableCellRenderer |
createDefaultTableCellRenderer(java.lang.String type)
Creates a renderer implementation instance based on a type.
|
protected void |
finalize()
Clean-up method to help the gc.
|
protected void |
flushDedicatedTableCellRenderer()
Removes the dedicated cell renderer implementation instance if such is installed.
|
protected void |
flushDefaultTableCellRenderer()
Removes the shared cell renderer implementation instance if such is installed.
|
protected javax.swing.table.TableCellRenderer |
getDedicatedTableCellRenderer(java.lang.String key)
Provides the dedicated cell renderer implementation instance if such is installed.
|
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Method with rendering functionality.
|
protected boolean |
hasDedicatedTableCellRenderer(java.lang.String type)
Determines whether a dedicated cell renderer implementation instance has already been created.
|
protected boolean |
hasDefaultTableCellRenderer(java.lang.Class clazz)
Determines whether a shared cell renderer implementation instance has already been created.
|
protected boolean |
hasDefaultTableCellRenderer(java.lang.String type)
Determines whether a shared cell renderer implementation instance has already been created.
|
protected void |
setDedicatedTableCellRenderer(java.lang.String key,
javax.swing.table.TableCellRenderer renderer)
Sets a cell renderer for a specific column.
|
protected void |
updateRenderer(CellSearchHighlighter highlighter,
Configuration config)
Updates the renderer implementing the
CellSearchHighlighter interface. |
protected void |
updateRenderers(Configuration config)
Updates the renderers implementing the
CellSearchHighlighter interface. |
firePropertyChange, firePropertyChange, invalidate, isOpaque, repaint, repaint, repaint, revalidate, setBackground, setForeground, setValue, updateUI, validate
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, 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, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, 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, 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, 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, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected TablePanel parent
protected java.util.Hashtable<java.lang.String,javax.swing.table.TableCellRenderer> cacheDefaultRenderers
protected java.util.Hashtable<java.lang.String,javax.swing.table.TableCellRenderer> cacheDedicatedRenderers
public TablePanelCellRenderer() throws java.lang.InstantiationException
I18NExtractor
).
java.lang.InstantiationException
- Error indicationpublic TablePanelCellRenderer(TablePanel parent)
parent
- The parental componentprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- Error indicationpublic java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
getTableCellRendererComponent
in class javax.swing.table.DefaultTableCellRenderer
table
- The table to render a cellvalue
- The value to displayisSelected
- The selection statehasFocus
- Is it focussed?row
- The row to rendercolumn
- The column to renderprotected javax.swing.table.TableCellRenderer createDefaultTableCellRenderer(java.lang.String type)
type
- Fully qualified class type like "java.lang.String"null
java.lang.NullPointerException
- If type = null
createDefaultTableCellRenderer(Class)
protected javax.swing.table.TableCellRenderer createDefaultTableCellRenderer(java.lang.Class clazz)
clazz
- Class typenull
java.lang.NullPointerException
- If clazz = null
createDefaultTableCellRenderer(String)
protected void flushDefaultTableCellRenderer()
protected boolean hasDefaultTableCellRenderer(java.lang.String type)
type
- Fully qualified class type like "java.lang.String"java.lang.NullPointerException
- If type = null
hasDefaultTableCellRenderer(Class)
protected boolean hasDefaultTableCellRenderer(java.lang.Class clazz)
clazz
- Class typejava.lang.NullPointerException
- If clazz = null
hasDefaultTableCellRenderer(String)
protected void updateRenderers(Configuration config)
CellSearchHighlighter
interface.
Here, the on-the-fly highlighting feature is activated.
config
- Configuration from the TableSearchOptionsPanel
protected void updateRenderer(CellSearchHighlighter highlighter, Configuration config)
CellSearchHighlighter
interface.
Here, the on-the-fly highlighting feature is activated.
highlighter
- The highlighting rendererconfig
- Configuration from the TableSearchOptionsPanel
protected void setDedicatedTableCellRenderer(java.lang.String key, javax.swing.table.TableCellRenderer renderer)
key
- The column key (internal identifier) e.g. from SQLrenderer
- The renderer for the columnjava.lang.NullPointerException
- If the parameters are null
protected void flushDedicatedTableCellRenderer()
protected boolean hasDedicatedTableCellRenderer(java.lang.String type)
type
- Fully qualified class type like "java.lang.String"java.lang.NullPointerException
- If type = null
hasDefaultTableCellRenderer(Class)
protected javax.swing.table.TableCellRenderer getDedicatedTableCellRenderer(java.lang.String key)
key
- The column key (internal identifier) e.g. from SQLnull
protected javax.swing.table.TableCellRenderer chooseRenderer(java.lang.String key, java.lang.Object value)
key
- The column key (internal identifier) e.g. from SQLvalue
- The data object to be renderednull
java.lang.NullPointerException
- If the parameters are null
Copyright © 2005-2023 Leisenfels GmbH. All rights reserved.