001package jmri.jmrix.maple.assignment;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import jmri.jmrix.maple.MapleSystemConnectionMemo;
006import org.slf4j.Logger;
007import org.slf4j.LoggerFactory;
008
009/**
010 * Swing action to create and register a ListFrame object
011 *
012 * @author Dave Duchamp Copyright (C) 2006
013 */
014public class ListAction extends AbstractAction {
015
016    private MapleSystemConnectionMemo _memo = null;
017
018    public ListAction(String s, MapleSystemConnectionMemo memo) {
019        super(s);
020        _memo = memo;
021    }
022
023    public ListAction(MapleSystemConnectionMemo memo) {
024        this(Bundle.getMessage("MenuItemAssignments"), memo);
025    }
026
027    @Override
028    public void actionPerformed(ActionEvent e) {
029        ListFrame f = new ListFrame(_memo);
030        try {
031            f.initComponents();
032        } catch (Exception ex) {
033            log.error("Exception: {}", ex.toString());
034        }
035        f.setVisible(true);
036    }
037
038    private final static Logger log = LoggerFactory.getLogger(ListAction.class);
039
040}