001package jmri.jmrit.beantable;
002
003import java.awt.event.ActionEvent;
004
005import javax.annotation.Nonnull;
006
007import jmri.InstanceManager;
008import jmri.IdTag;
009import jmri.RailComManager;
010
011import org.slf4j.Logger;
012import org.slf4j.LoggerFactory;
013
014/**
015 * Swing action to create and register a RailCommTable GUI.
016 *
017 * @author  Bob Jacobsen Copyright (C) 2003
018 * @author  Matthew Harris Copyright (C) 2011
019 * @since 2.11.4
020 */
021public class RailComTableAction extends AbstractTableAction<IdTag> {
022
023    /**
024     * Create an action with a specific title.
025     * <p>
026     * Note that the argument is the Action title, not the title of the
027     * resulting frame. Perhaps this should be changed?
028     *
029     * @param actionName title of the action
030     */
031    public RailComTableAction(String actionName) {
032        super(actionName);
033
034        includeAddButton = false;
035    }
036
037    @Nonnull
038    protected RailComManager tagManager = InstanceManager.getDefault(RailComManager.class);
039
040    public RailComTableAction() {
041        this("Rail Com Table");
042    }
043
044    /**
045     * Create the JTable DataModel, along with the changes for the specific case
046     * of RailComm objects
047     */
048    @Override
049    protected void createModel() {
050        m = new RailComTableDataModel(tagManager);
051    }
052
053    @Override
054    protected void setTitle() {
055        f.setTitle(Bundle.getMessage("TitleRailComTable"));
056    }
057
058    @Override
059    protected String helpTarget() {
060        return "package.jmri.jmrit.beantable.RailComTable";
061    }
062
063    @Override
064    protected void addPressed(ActionEvent e) {
065    }
066
067    @Override
068    public String getClassDescription() {
069        return Bundle.getMessage("TitleRailComTable");
070    }
071
072    @Override
073    public void addToFrame(BeanTableFrame<IdTag> f) {
074        log.debug("Added CheckBox in addToFrame method");
075    }
076
077    @Override
078    public void addToPanel(AbstractTableTabAction<IdTag> f) {
079        log.debug("Added CheckBox in addToPanel method");
080    }
081
082    @Override
083    protected String getClassName() {
084        return RailComTableAction.class.getName();
085    }
086    private static final Logger log = LoggerFactory.getLogger(RailComTableAction.class);
087}