001package jmri.jmrit.operations.trains.tools;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007import jmri.InstanceManager;
008import jmri.jmrit.operations.trains.TrainManager;
009
010/**
011 * Swing action to toggle the show location hyphened name in full.
012 *
013 * @author Bob Jacobsen Copyright (C) 2001
014 * @author Daniel Boudreau Copyright (C) 2020
015 */
016public class ToggleShowFullLocationName extends AbstractAction {
017
018    public ToggleShowFullLocationName() {
019        super(Bundle.getMessage("ToggleLocationName"));
020    }
021
022    @Override
023    public void actionPerformed(ActionEvent e) {
024        TrainManager trainManager = InstanceManager.getDefault(TrainManager.class);
025        trainManager.setShowLocationHyphenNameEnabled(!trainManager.isShowLocationHyphenNameEnabled());
026    }
027}
028
029