001package jmri.jmrit.operations.locations.tools; 002 003import java.awt.event.ActionEvent; 004 005import javax.swing.AbstractAction; 006 007import jmri.jmrit.operations.locations.gui.TrackEditFrame; 008 009/** 010 * Action to launch edit of track comments. 011 * 012 * @author Daniel Boudreau Copyright (C) 2013 013 */ 014public class TrackEditCommentsAction extends AbstractAction { 015 016 private TrackEditFrame _tef; 017 private TrackEditCommentsFrame _tecf; 018 019 public TrackEditCommentsAction(TrackEditFrame tef) { 020 super(Bundle.getMessage("MenuItemComments")); 021 _tef = tef; 022 } 023 024 @Override 025 public void actionPerformed(ActionEvent e) { 026 if (_tecf != null) { 027 _tecf.dispose(); 028 } 029 _tecf = new TrackEditCommentsFrame(_tef._track); 030 } 031}