Class GTable

  • All Implemented Interfaces:
    KeyStrokeConsumer, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.RowSorterListener, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable
    Direct Known Subclasses:
    FVTable, GhidraTable

    public class GTable
    extends javax.swing.JTable
    implements KeyStrokeConsumer
    A sub-class of JTable that provides navigation and auto-lookup. By default, both of these features are disabled.

    Auto-lookup is only supported on one column and must be specified using the setAutoLookupColumn() method.

    Auto-lookup allows a user to begin typing the first few letters of a desired row. The table will attempt to locate the first row that contains the letters typed up to that point. There is an 800ms timeout between typed letters, at which point the list of typed letters will be flushed.

    Auto-lookup is much faster if the underlying table model implements SortedTableModel, because a binary search can used to locate the desired row. A linear search is used if the model is not sorted.

    Other features provided:

    • Column hiding/showing
    • Multi-column sorting
    • Column settings
    • Column state saving (visibility, size, positioning, sort values)
    • Selection management (saving/restoring selection when used with a filter panel)
    See Also:
    GTableFilterPanel, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JTable

        javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<javax.swing.table.TableCellRenderer> defaultGTableRendererList
      A list of default renderers created by this table
      static long KEY_TIMEOUT  
      • Fields inherited from class javax.swing.JTable

        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
      • Fields inherited from class javax.swing.JComponent

        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

        accessibleContext, 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

      Constructors 
      Constructor Description
      GTable()
      Constructs a new GTable
      GTable​(javax.swing.table.TableModel dm)
      Constructs a new GTable using the specified table model.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void columnAdded​(javax.swing.event.TableColumnModelEvent e)  
      void columnRemoved​(javax.swing.event.TableColumnModelEvent e)  
      protected javax.swing.table.TableColumnModel createDefaultColumnModel()  
      void createDefaultColumnsFromModel()
      Overridden in order to set the column header renderer on newly created columns.
      protected <T> SelectionManager createSelectionManager​(javax.swing.table.TableModel model)  
      static void createSharedActions​(DockingTool tool, ToolActions toolActions, java.lang.String owner)  
      void dispose()
      Call this when the table will no longer be used
      boolean editCellAt​(int row, int column)
      If you just begin typing into an editable cell in a JTable, then the cell editor will be displayed.
      javax.swing.table.TableCellRenderer getCellRenderer​(int row, int col)  
      javax.swing.table.TableCellRenderer getCellRendererOverride​(int row, int col)
      Performs custom work to locate renderers for special table model types.
      ConfigurableColumnTableModel getConfigurableColumnTableModel()
      Returns the underlying ConfigurableColumnTableModel if one is in-use
      javax.swing.table.TableCellRenderer getDefaultRenderer​(java.lang.Class<?> columnClass)  
      java.lang.String getPreferenceKey()  
      java.awt.Dimension getPreferredScrollableViewportSize()  
      SelectionManager getSelectionManager()
      Returns the SelectionManager in use by this GTable.
      javax.swing.JPopupMenu getTableColumnPopupMenu​(int columnIndex)  
      java.lang.String getToolTipText​(java.awt.event.MouseEvent e)  
      protected javax.swing.table.TableModel getUnwrappedTableModel()
      Unrolls the current model by checking if the current model is inside of a wrapper table model.
      java.lang.Object getValueAt​(int row, int column)  
      protected void initDefaultRenderers()
      Installs the default TableCellRenderers for known Ghidra table cell data classes.
      boolean isColumnHeaderPopupEnabled()  
      boolean isKeyConsumed​(javax.swing.KeyStroke keyStroke)
      This method is implemented to signal interest in any typed text that may help the user change the row in the table.
      void notifyTableChanged​(javax.swing.event.TableModelEvent event)
      A method that allows clients to signal to this GTable and its internals that the table model has changed.
      protected boolean processKeyBinding​(javax.swing.KeyStroke ks, java.awt.event.KeyEvent e, int condition, boolean pressed)  
      void savePreferences()
      Signals that the preferences of this table (visible columns, sort order, etc.) should be saved.
      void scrollToSelectedRow()  
      void selectRow​(int row)
      Selects the given row.
      boolean selectRow​(java.awt.event.MouseEvent event)
      Selects the row under the given mouse point.
      void setActionsEnabled​(boolean b)
      Enables the keyboard actions to pass through this table and up the component hierarchy.
      void setAutoEditEnabled​(boolean allowAutoEdit)
      Enables or disables auto-edit.
      void setAutoLookupColumn​(int lookupColumn)
      Sets the column in which auto-lookup will be enabled.
      void setColumnHeaderPopupEnabled​(boolean enabled)  
      void setColumnModel​(javax.swing.table.TableColumnModel columnModel)  
      void setHTMLRenderingEnabled​(boolean enable)
      Enables and disables the rendering of HTML content in this table.
      void setModel​(javax.swing.table.TableModel dataModel)  
      void setPreferenceKey​(java.lang.String preferenceKey)
      Sets the key for saving and restoring column configuration state.
      void setRowHeight​(int height)  
      void setSelectionModel​(javax.swing.ListSelectionModel newModel)  
      void setUserSortingEnabled​(boolean enabled)
      Allows for the disabling of the user's ability to sort an instance of AbstractSortedTableModel by clicking the table's headers.
      void setVisibleRowCount​(int visibleRowCount)  
      protected boolean supportsPopupActions()
      A method that subclasses can override to signal that they wish not to have this table's built-in popup actions.
      void tableChanged​(javax.swing.event.TableModelEvent e)  
      protected javax.swing.table.TableCellRenderer wrapDefaultTableCellRenderer​(javax.swing.table.TableCellRenderer renderer, java.lang.Class<?> columnClass)  
      • Methods inherited from class javax.swing.JTable

        addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAtPoint, columnMarginChanged, columnMoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, 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, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
      • Methods inherited from class javax.swing.JComponent

        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
      • Methods inherited from class java.awt.Container

        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
      • Methods inherited from class java.awt.Component

        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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • defaultGTableRendererList

        protected java.util.List<javax.swing.table.TableCellRenderer> defaultGTableRendererList
        A list of default renderers created by this table
    • Constructor Detail

      • GTable

        public GTable()
        Constructs a new GTable
      • GTable

        public GTable​(javax.swing.table.TableModel dm)
        Constructs a new GTable using the specified table model.
        Parameters:
        dm - the table model
    • Method Detail

      • setVisibleRowCount

        public void setVisibleRowCount​(int visibleRowCount)
      • getPreferredScrollableViewportSize

        public java.awt.Dimension getPreferredScrollableViewportSize()
        Specified by:
        getPreferredScrollableViewportSize in interface javax.swing.Scrollable
        Overrides:
        getPreferredScrollableViewportSize in class javax.swing.JTable
      • tableChanged

        public void tableChanged​(javax.swing.event.TableModelEvent e)
        Specified by:
        tableChanged in interface javax.swing.event.TableModelListener
        Overrides:
        tableChanged in class javax.swing.JTable
      • selectRow

        public void selectRow​(int row)
        Selects the given row. This is a convenience method for JTable.setRowSelectionInterval(int, int).
        Parameters:
        row - The row to select
      • selectRow

        public boolean selectRow​(java.awt.event.MouseEvent event)
        Selects the row under the given mouse point. This method is useful when the user triggers a popup mouse action and you would like to have the table select that row if it is not already selected. This allows you to guarantee that there is always a selection when the user triggers a popup menu.
        Parameters:
        event - The event that triggered the popup menu
        Returns:
        true if the row is selected or was already selected.
      • createDefaultColumnModel

        protected javax.swing.table.TableColumnModel createDefaultColumnModel()
        Overrides:
        createDefaultColumnModel in class javax.swing.JTable
      • setColumnModel

        public void setColumnModel​(javax.swing.table.TableColumnModel columnModel)
        Overrides:
        setColumnModel in class javax.swing.JTable
      • setSelectionModel

        public void setSelectionModel​(javax.swing.ListSelectionModel newModel)
        Overrides:
        setSelectionModel in class javax.swing.JTable
      • setModel

        public void setModel​(javax.swing.table.TableModel dataModel)
        Overrides:
        setModel in class javax.swing.JTable
      • createSelectionManager

        protected <T> SelectionManager createSelectionManager​(javax.swing.table.TableModel model)
      • getSelectionManager

        public SelectionManager getSelectionManager()
        Returns the SelectionManager in use by this GTable. null is returned if the user has installed their own ListSelectionModel.
        Returns:
        the selection manager
      • notifyTableChanged

        public void notifyTableChanged​(javax.swing.event.TableModelEvent event)
        A method that allows clients to signal to this GTable and its internals that the table model has changed. Usually, tableChanged(TableModelEvent) is called, but clients alter the table, but do not do so through the model. In this case, they need a way to signal to the table that the model has been updated.
        Parameters:
        event - the event for the change
      • dispose

        public void dispose()
        Call this when the table will no longer be used
      • setAutoLookupColumn

        public void setAutoLookupColumn​(int lookupColumn)
        Sets the column in which auto-lookup will be enabled.
        Parameters:
        lookupColumn - the column in which auto-lookup will be enabled
      • setActionsEnabled

        public void setActionsEnabled​(boolean b)
        Enables the keyboard actions to pass through this table and up the component hierarchy. Specifically, passing true to this method allows unmodified keystrokes to work in the tool when this table is focused. Modified keystrokes, like Ctrl-C, will work at all times. Finally, if true is passed to this method, then the auto lookup feature is disabled.

        The default state is for actions to be disabled.

        Parameters:
        b - true allows keyboard actions to pass up the component hierarchy.
      • isKeyConsumed

        public boolean isKeyConsumed​(javax.swing.KeyStroke keyStroke)
        This method is implemented to signal interest in any typed text that may help the user change the row in the table. For example, if the user types 'a', then the table will move to the first symbol that begins with the letter 'a'. This method also wants to handle text when the 'shift' key is down. This method will return false if the control key is pressed.
        Specified by:
        isKeyConsumed in interface KeyStrokeConsumer
        Parameters:
        keyStroke - key stroke
        See Also:
        KeyStrokeConsumer.isKeyConsumed(javax.swing.KeyStroke)
      • setAutoEditEnabled

        public void setAutoEditEnabled​(boolean allowAutoEdit)
        Enables or disables auto-edit. When enabled, the user can start typing to trigger an edit of an editable table cell.
        Parameters:
        allowAutoEdit - true for auto-editing
      • setRowHeight

        public void setRowHeight​(int height)
        Overrides:
        setRowHeight in class javax.swing.JTable
      • columnAdded

        public void columnAdded​(javax.swing.event.TableColumnModelEvent e)
        Specified by:
        columnAdded in interface javax.swing.event.TableColumnModelListener
        Overrides:
        columnAdded in class javax.swing.JTable
      • columnRemoved

        public void columnRemoved​(javax.swing.event.TableColumnModelEvent e)
        Specified by:
        columnRemoved in interface javax.swing.event.TableColumnModelListener
        Overrides:
        columnRemoved in class javax.swing.JTable
      • getConfigurableColumnTableModel

        public ConfigurableColumnTableModel getConfigurableColumnTableModel()
        Returns the underlying ConfigurableColumnTableModel if one is in-use
        Returns:
        the underlying ConfigurableColumnTableModel if one is in-use
      • getUnwrappedTableModel

        protected javax.swing.table.TableModel getUnwrappedTableModel()
        Unrolls the current model by checking if the current model is inside of a wrapper table model.
        Returns:
        this class's table model, unwrapped as needed
      • processKeyBinding

        protected boolean processKeyBinding​(javax.swing.KeyStroke ks,
                                            java.awt.event.KeyEvent e,
                                            int condition,
                                            boolean pressed)
        Overrides:
        processKeyBinding in class javax.swing.JTable
      • getDefaultRenderer

        public javax.swing.table.TableCellRenderer getDefaultRenderer​(java.lang.Class<?> columnClass)
        Overrides:
        getDefaultRenderer in class javax.swing.JTable
        See Also:
        JTable.getDefaultRenderer(java.lang.Class)
      • wrapDefaultTableCellRenderer

        protected javax.swing.table.TableCellRenderer wrapDefaultTableCellRenderer​(javax.swing.table.TableCellRenderer renderer,
                                                                                   java.lang.Class<?> columnClass)
      • initDefaultRenderers

        protected void initDefaultRenderers()
        Installs the default TableCellRenderers for known Ghidra table cell data classes. Subclasses can override this method to add additional types or to change the default associations.
      • createDefaultColumnsFromModel

        public void createDefaultColumnsFromModel()
        Overridden in order to set the column header renderer on newly created columns.
        Overrides:
        createDefaultColumnsFromModel in class javax.swing.JTable
        See Also:
        JTable.createDefaultColumnsFromModel()
      • getToolTipText

        public java.lang.String getToolTipText​(java.awt.event.MouseEvent e)
        Overrides:
        getToolTipText in class javax.swing.JTable
        See Also:
        JComponent.getToolTipText(java.awt.event.MouseEvent)
      • setHTMLRenderingEnabled

        public void setHTMLRenderingEnabled​(boolean enable)
        Enables and disables the rendering of HTML content in this table. If enabled, this table will:
        • Wrap tooltip text content with an <html> tag so that it is possible for the content to be formatted in a manner that is easier for the user read, and
        • Enable any default GTableCellRenderer instances to render HTML content, which they do not do by default.

        As mentioned above, this class only enables/disables the HTML rendering on GTableCellRenderer instances that were created by this class (or subclasses) during initialization in initDefaultRenderers() and that have been added to the defaultGTableRendererList. If users of this class have changed or added new renderers, then those renderers will not be changed by calling this method. Typically, this method should be called just after created an instance of this class, which will work as described by this method.

        HTML rendering is disabled by default.

        Parameters:
        enable - true to enable HTML rendering; false to disable it
      • setPreferenceKey

        public void setPreferenceKey​(java.lang.String preferenceKey)
        Sets the key for saving and restoring column configuration state. Use this if you have multiple instances of a table and you want different column settings for each instance.
        Parameters:
        preferenceKey - the unique string to use a key for this instance.
      • getPreferenceKey

        public java.lang.String getPreferenceKey()
        Returns:
        the preference key
        See Also:
        setPreferenceKey(String)
      • savePreferences

        public void savePreferences()
        Signals that the preferences of this table (visible columns, sort order, etc.) should be saved. Most clients never need to call this method, as changes are saved for free when the user manipulates columns. However, sometimes the client can change the state of the columns programmatically, which is not guaranteed to get saved; for example, setting the sort state of a sorted table model programmatically will not get saved.
      • setUserSortingEnabled

        public void setUserSortingEnabled​(boolean enabled)
        Allows for the disabling of the user's ability to sort an instance of AbstractSortedTableModel by clicking the table's headers. The default setting is enabled.
        Parameters:
        enabled - true to enable; false to disable
      • setColumnHeaderPopupEnabled

        public void setColumnHeaderPopupEnabled​(boolean enabled)
      • isColumnHeaderPopupEnabled

        public boolean isColumnHeaderPopupEnabled()
      • getTableColumnPopupMenu

        public javax.swing.JPopupMenu getTableColumnPopupMenu​(int columnIndex)
      • getCellRenderer

        public javax.swing.table.TableCellRenderer getCellRenderer​(int row,
                                                                   int col)
        Overrides:
        getCellRenderer in class javax.swing.JTable
      • getCellRendererOverride

        public final javax.swing.table.TableCellRenderer getCellRendererOverride​(int row,
                                                                                 int col)
        Performs custom work to locate renderers for special table model types. This method allows clients to bypass the getCellRenderer(int, int), which is sometimes overridden by subclasses to return a hard-coded renderer. In that case, some clients still want a way to perform normal cell renderer lookup.
        Parameters:
        row - the row
        col - the column
        Returns:
        the cell renderer
      • editCellAt

        public boolean editCellAt​(int row,
                                  int column)
        If you just begin typing into an editable cell in a JTable, then the cell editor will be displayed. However, the editor component will not have a focus. This method has been overridden to request focus on the editor component.
        Overrides:
        editCellAt in class javax.swing.JTable
        See Also:
        JTable.editCellAt(int, int)
      • scrollToSelectedRow

        public void scrollToSelectedRow()
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int column)
        Overrides:
        getValueAt in class javax.swing.JTable
      • supportsPopupActions

        protected boolean supportsPopupActions()
        A method that subclasses can override to signal that they wish not to have this table's built-in popup actions. Subclasses will almost never need to override this method.
        Returns:
        true if popup actions are supported
      • createSharedActions

        public static void createSharedActions​(DockingTool tool,
                                               ToolActions toolActions,
                                               java.lang.String owner)