001package jmri.jmrit.throttle; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import jmri.InstanceManager; 006 007public class ThrottlesListAction extends AbstractAction { 008 009 /** 010 * Constructor 011 * 012 * @param s Name for the action. 013 */ 014 public ThrottlesListAction(String s) { 015 super(s); 016 // disable the ourselves if there is no throttle Manager 017 if (jmri.InstanceManager.getNullableDefault(jmri.ThrottleManager.class) == null) { 018 setEnabled(false); 019 } 020 } 021 022 public ThrottlesListAction() { 023 this("Throttles list"); 024 } 025 026 @Override 027 public void actionPerformed(ActionEvent e) { 028 InstanceManager.getDefault(ThrottleFrameManager.class).showThrottlesList(); 029 } 030}