001package apps.startup;
002
003import jmri.util.startup.StartupModel;
004import javax.swing.table.DefaultTableCellRenderer;
005
006/**
007 * Render a {@link StartupModel} in a table.
008 *
009 * @author Randall Wood Copyright (C) 2015, 2016
010 */
011class StartupModelCellRenderer extends DefaultTableCellRenderer {
012
013    @Override
014    protected void setValue(Object value) {
015        // null anything is rendered as an empty cell.
016        if (value != null) {
017            String text = ((StartupModel) value).getName();
018            setText(text != null ? text : value.toString()); // NOI18N
019        } else {
020            setText(""); // NOI18N
021        }
022    }
023}