Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer Class Reference

Inherits DefaultTableCellRenderer.

Public Member Functions

Component getTableCellRendererComponent (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
 

Static Public Member Functions

static CellMouseListener getMouseListener ()
 

Protected Member Functions

Component getTableCellRendererComponent (JLabel defaultCell, GuiCellModel cellModel)
 

Static Private Attributes

static final int DEFAULT_ALIGNMENT = JLabel.LEFT
 
static final Border DEFAULT_BORDER = BorderFactory.createEmptyBorder(2, 4, 2, 4)
 
static final CellMouseListener DEFAULT_CELL_MOUSE_LISTENER
 
static final long serialVersionUID = 1L
 

Detailed Description

A Table cell renderer that renders a cell of a table based off of the CellModel interface provided within this class.

Definition at line 40 of file CellModelTableCellRenderer.java.

Member Function Documentation

static CellMouseListener org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.getMouseListener ( )
static
Component org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.getTableCellRendererComponent ( JTable  table,
Object  value,
boolean  isSelected,
boolean  hasFocus,
int  row,
int  column 
)

Definition at line 47 of file CellModelTableCellRenderer.java.

Component org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.getTableCellRendererComponent ( JLabel  defaultCell,
GuiCellModel  cellModel 
)
protected

Customizes the jlabel to match the column model and cell model provided.

Parameters
defaultCellThe cell to customize that will be displayed in the jtable.
cellModelThe cell model for this cell.
Returns
The provided defaultCell.

Definition at line 68 of file CellModelTableCellRenderer.java.

References org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModel.getHorizontalAlignment(), org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModel.HorizontalAlign.getJLabelAlignment(), org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModel.getText(), and org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModel.getTooltip().

Member Data Documentation

final int org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.DEFAULT_ALIGNMENT = JLabel.LEFT
staticprivate

Definition at line 43 of file CellModelTableCellRenderer.java.

final Border org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.DEFAULT_BORDER = BorderFactory.createEmptyBorder(2, 4, 2, 4)
staticprivate

Definition at line 44 of file CellModelTableCellRenderer.java.

final CellMouseListener org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.DEFAULT_CELL_MOUSE_LISTENER
staticprivate
Initial value:
= new CellMouseListener() {
@Override
public void mouseClicked(CellMouseEvent cellEvent) {
if (cellEvent.getCellValue() instanceof GuiCellModel && cellEvent.getMouseEvent().getButton() != MouseEvent.BUTTON1) {
cellEvent.getTable().setRowSelectionInterval(cellEvent.getRow(), cellEvent.getRow());
GuiCellModel cellModel = (GuiCellModel) cellEvent.getCellValue();
List<MenuItem> menuItems = cellModel.getPopupMenu();
if (CollectionUtils.isNotEmpty(menuItems)) {
final JPopupMenu popupMenu = new JPopupMenu();
for (MenuItem mItem : menuItems) {
JMenuItem jMenuItem = new JMenuItem(mItem.getTitle());
if (mItem.getAction() != null) {
jMenuItem.addActionListener((evt) -> mItem.getAction().run());
}
popupMenu.add(jMenuItem);
}
popupMenu.show(cellEvent.getTable(), cellEvent.getMouseEvent().getX(), cellEvent.getMouseEvent().getY());
}
}
}
}

The default cell mouse listener that triggers popups for non-primary button events.

Definition at line 85 of file CellModelTableCellRenderer.java.

Referenced by org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.getMouseListener().

final long org.sleuthkit.autopsy.datasourcesummary.uiutils.CellModelTableCellRenderer.serialVersionUID = 1L
staticprivate

Definition at line 42 of file CellModelTableCellRenderer.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Thu Sep 29 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.