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

49 lines
1.6 KiB
Java
Raw Normal View History

2015-06-01 09:35:51 +00:00
package com.bytezone.diskbrowser.gui;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.util.prefs.Preferences;
import javax.swing.Action;
import javax.swing.JFrame;
import javax.swing.KeyStroke;
2020-06-26 04:39:05 +00:00
import com.bytezone.diskbrowser.utilities.DefaultAction;
2015-06-01 09:35:51 +00:00
2018-07-30 08:44:29 +00:00
// ********** not currently used ***********
2020-02-08 22:20:08 +00:00
// -----------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
public class PreferencesAction extends DefaultAction
2020-02-08 22:20:08 +00:00
// -----------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
{
JFrame owner;
Preferences prefs;
2020-02-08 22:20:08 +00:00
// ---------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
public PreferencesAction (JFrame owner, Preferences prefs)
2020-02-08 22:20:08 +00:00
// ---------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
{
super ("Preferences...", "Set preferences", "/com/bytezone/diskbrowser/icons/");
putValue (Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke ("alt P"));
putValue (Action.MNEMONIC_KEY, KeyEvent.VK_P);
setIcon (Action.LARGE_ICON_KEY, "script_gear_32.png");
this.owner = owner;
this.prefs = prefs;
}
2020-02-08 22:20:08 +00:00
// ---------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
@Override
public void actionPerformed (ActionEvent e)
2020-02-08 22:20:08 +00:00
// ---------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
{
prefs ();
}
2020-02-08 22:20:08 +00:00
// ---------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
public void prefs ()
2020-02-08 22:20:08 +00:00
// ---------------------------------------------------------------------------------//
2015-06-01 09:35:51 +00:00
{
new PreferencesDialog (owner, prefs);
}
}