dmolony-DiskBrowser/src/com/bytezone/diskbrowser/gui/DebuggingAction.java
2016-03-15 09:35:22 +11:00

29 lines
746 B
Java

package com.bytezone.diskbrowser.gui;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
public class DebuggingAction extends AbstractAction
{
private final DataPanel owner;
public DebuggingAction (DataPanel owner)
{
super ("Debugging");
putValue (Action.SHORT_DESCRIPTION, "Show debugging information");
putValue (Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke ("alt G"));
putValue (Action.MNEMONIC_KEY, KeyEvent.VK_G);
this.owner = owner;
}
@Override
public void actionPerformed (ActionEvent e)
{
owner.setDebug (((JMenuItem) e.getSource ()).isSelected ());
}
}