dmolony-DiskBrowser/src/com/bytezone/diskbrowser/gui/DebuggingAction.java

33 lines
1.2 KiB
Java
Raw Normal View History

2016-03-14 22:35:22 +00:00
package com.bytezone.diskbrowser.gui;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
2020-02-08 10:13:51 +00:00
// -----------------------------------------------------------------------------------//
2016-03-14 22:35:22 +00:00
public class DebuggingAction extends AbstractAction
2020-02-08 10:13:51 +00:00
// -----------------------------------------------------------------------------------//
2016-03-14 22:35:22 +00:00
{
private final DataPanel owner;
2020-02-08 10:13:51 +00:00
// ---------------------------------------------------------------------------------//
2016-03-14 22:35:22 +00:00
public DebuggingAction (DataPanel owner)
2020-02-08 10:13:51 +00:00
// ---------------------------------------------------------------------------------//
2016-03-14 22:35:22 +00:00
{
super ("Debugging");
putValue (Action.SHORT_DESCRIPTION, "Show debugging information");
2018-07-28 12:00:02 +00:00
putValue (Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke ("meta D"));
2016-03-14 22:35:22 +00:00
this.owner = owner;
}
2020-02-08 10:13:51 +00:00
// ---------------------------------------------------------------------------------//
2016-03-14 22:35:22 +00:00
@Override
public void actionPerformed (ActionEvent e)
2020-02-08 10:13:51 +00:00
// ---------------------------------------------------------------------------------//
2016-03-14 22:35:22 +00:00
{
owner.setDebug (((JMenuItem) e.getSource ()).isSelected ());
}
}