net.sourceforge.rssowl.util.shop
Class HotkeyShop

java.lang.Object
  extended bynet.sourceforge.rssowl.util.shop.HotkeyShop

public class HotkeyShop
extends Object

Factory class for hotkey concerns in RSSOwl *

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
static Hashtable hotKeys
          Hotkeys for common tasks.
static String NULL_ACCELERATOR_NAME
          Default name for a NULL Accelerator
static int NULL_ACCELERATOR_VALUE
          Setting the null accelerator to a MenuItem will remove the accelerator from the item.
 
Constructor Summary
private HotkeyShop()
          This utility class constructor is hidden
 
Method Summary
static String getHotkeyName(String itemName)
          Get the name of a hotkey for the given item.
static int getHotkeyValue(String itemName)
          Get the value of a hotkey for the given item.
static void initDefaultAccelerators()
          Assign application default hotkeys.
static boolean isHotkeySet(String itemName)
          Check if a hotkey is set for the given item.
static boolean isPrintableAccelerator(int value)
          This Method returns TRUE in case the given accelerator is printable, e.g.
static void setHotkey(String itemName, String keyName, int keyValue)
          Set a hotkey to the item.
static void setHotkey(String itemName, String keyName, String keyValue)
          Set a hotkey to the item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hotKeys

public static Hashtable hotKeys
Hotkeys for common tasks.
The key of each item in the Hashtable is the I18N name of the item the hotkey is set to (e.g. "MENU_EDIT_COPY").
The value is a String[] with the length 2.
String[0] contains the hotkeyName (e.g. "Ctrl+B")
String[1] contains the hotkeyValue (e.g. "22332")


NULL_ACCELERATOR_NAME

public static final String NULL_ACCELERATOR_NAME
Default name for a NULL Accelerator

See Also:
Constant Field Values

NULL_ACCELERATOR_VALUE

public static final int NULL_ACCELERATOR_VALUE
Setting the null accelerator to a MenuItem will remove the accelerator from the item.

See Also:
Constant Field Values
Constructor Detail

HotkeyShop

private HotkeyShop()
This utility class constructor is hidden

Method Detail

getHotkeyName

public static String getHotkeyName(String itemName)
Get the name of a hotkey for the given item.

Parameters:
itemName - The name of the item.
Returns:
String The name of the hotkey, e.g. "Ctrl+B"

getHotkeyValue

public static int getHotkeyValue(String itemName)
Get the value of a hotkey for the given item.

Parameters:
itemName - The name of the item.
Returns:
int The value of the hotkey, e.g. 22330

initDefaultAccelerators

public static void initDefaultAccelerators()
Assign application default hotkeys.


isHotkeySet

public static boolean isHotkeySet(String itemName)
Check if a hotkey is set for the given item.

Parameters:
itemName - The name of the item.
Returns:
boolean TRUE if a hotkey is set for the item.

isPrintableAccelerator

public static boolean isPrintableAccelerator(int value)
This Method returns TRUE in case the given accelerator is printable, e.g. inside a form. Accelerators being printable are not written into an input field in case typed. Instead the connected menuitem will be selected. Therefor all printable accelerators have to be removed as soon as the user has entered an input field.

Parameters:
value - The key value to check.
Returns:
boolean TRUE in case the key value is printable.

setHotkey

public static void setHotkey(String itemName,
                             String keyName,
                             int keyValue)
Set a hotkey to the item.

Parameters:
itemName - The I18N name of the item
keyName - The name of the hotkey (e.g. "CTRL+B")
keyValue - The value of the hotkey (e.g. 22330)

setHotkey

public static void setHotkey(String itemName,
                             String keyName,
                             String keyValue)
Set a hotkey to the item.

Parameters:
itemName - The I18N name of the item
keyName - The name of the hotkey (e.g. "CTRL+B")
keyValue - The value of the hotkey (e.g. "22330")


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo