|
Oracle® WebCenter Content Remote Intradoc Client (RIDC) Java API Reference 11g Release 1 (11.1) E17274-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.stellent.ridc.i18n.utils.MnemonicUtil
public class MnemonicUtil
Mnemonic utility class
Field Summary | |
---|---|
static char |
CLOSING_PARENTHESIS Constant for the closing parenthesis (=right parenthesis) ')'. |
static char |
MNEMONIC_INDICATOR Constant for the mnemonic indicator '&'. |
static char |
OPENING_PARENTHESIS Constant for the opening parenthesis (=left parenthesis) '('. |
Constructor Summary | |
---|---|
MnemonicUtil() |
Method Summary | |
---|---|
static java.lang.String |
addMnemonicToLabel(java.lang.String label, char mnemonic) Returns label text with mnemonic character enclosed in parenthesis. |
static java.lang.String |
extractLabelTextWithMnemonic(java.lang.String labelAndMnemonic) Extracts label text by removing non-displayable mnemonic indicator (conventionally ampersand ('&')) from label text and mnemonic resource. |
static java.lang.String |
extractLabelTextWithoutMnemonic(java.lang.String labelAndMnemonic) Extracts label text by removing mnemonic characters (e.g., "(F)" and "(&F)") from label text resource containing mnemonic. |
static int |
getMnemonicCharacter(java.lang.String labelAndMnemonic) Gets the keyboard mnemonic from label and mnemonic text. |
static int |
getMnemonicIndex(java.lang.String labelAndMnemonic) Gets the index of the mnemonic from label and mnemonic text. |
static MnemonicKeyValidator |
getMnemonicKeyValidator() |
static boolean |
isValidMnemonicKey(int key) Returns true if key is an valid mnemonic key based on mnemonic key validator associated with thid class. |
static void |
setLabelAndTextFor(javax.swing.JLabel label, java.awt.Component labelFor, LocaleMessage labelText) |
static void |
setMnemonicKeyValidator(MnemonicKeyValidator mnemonicKeyValidator) |
static void |
setTextAndMnemonic(javax.swing.AbstractButton button, LocaleMessage buttonText) Set label text and keyboard mnemonic of specified this component |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char MNEMONIC_INDICATOR
public static final char OPENING_PARENTHESIS
public static final char CLOSING_PARENTHESIS
Constructor Detail |
---|
public MnemonicUtil()
Method Detail |
---|
public static int getMnemonicCharacter(java.lang.String labelAndMnemonic) throws java.lang.NullPointerException
Gets the keyboard mnemonic from label and mnemonic text. Mnemonic character is indicated by MNEMONIC_INDICATOR. If label and mnemonic text contains two or more mnemonic indicator, second and after appearance of mnemonic indicators are ignored.
For example,
From To &File → F ファイル(&F) → F
labelAndMnemonic
- label text containing mnemonicjava.lang.NullPointerException
- if labelAndMnemonic is nullpublic static int getMnemonicIndex(java.lang.String labelAndMnemonic) throws java.lang.NullPointerException
Gets the index of the mnemonic from label and mnemonic text.
For example,
From To &File → F ファイル(&F) → F
labelAndMnemonic
- label text containing mnemonicjava.lang.NullPointerException
- if labelAndMnemonic is nullpublic static java.lang.String extractLabelTextWithMnemonic(java.lang.String labelAndMnemonic) throws java.lang.NullPointerException
Extracts label text by removing non-displayable mnemonic indicator (conventionally ampersand ('&')) from label text and mnemonic resource. If label and mnemonic text contains two or more mnemonic indicator, second and after appearance of mnemonic indicators are ignored.
For example,
From To &File → File ファイル(&F) → ファイル(F)
labelAndMnemonic
- label text containing mnemonicjava.lang.NullPointerException
- if labelAndMnemonic is nullpublic static java.lang.String addMnemonicToLabel(java.lang.String label, char mnemonic) throws java.lang.NullPointerException
Returns label text with mnemonic character enclosed in parenthesis. If the label does not contain mnemonic character (ignoring case), mnemonic character is enclosed in parenthesis and added end of menu label. If mnemonic is not a valid character for mnemonic key, only label will be returned.
When you need menu label for CJK translation (or translated menu label does not contain mnemonic character), you have to add mnemonic label after menu label text. The mnemonic character should be enclosed in parenthesis and added end of menu label for CJK translation.
For example,
From To F + ファイル → ファイル(F)
label
-mnemonic
-java.lang.NullPointerException
- if labelAndMnemonic is nullpublic static java.lang.String extractLabelTextWithoutMnemonic(java.lang.String labelAndMnemonic) throws java.lang.NullPointerException
Extracts label text by removing mnemonic characters (e.g., "(F)" and "(&F)") from label text resource containing mnemonic.
For example,
From To &File → File ファイル(&F) → ファイル ファイル(F) → ファイル
Conventionally, mnemonic indicator is ampersand ('&') and mnemonic character for CJK translation is enclosed by OPENING_PARENTHESIS ('(') and CLOSING_PARENTHESIS (')').
If label and mnemonic text contains two or more mnemonic indicator, second and after appearance of mnemonic indicators are ignored.
If parenthesis are not enclosing only mnemonic character, parenthesis are not removed.
If mnemonic indicator is not found in CJK translation resource, last occurrence of the parenthesis and enclosed mnemonic character will be removed.
labelAndMnemonic
-java.lang.NullPointerException
- if labelAndMnemonic is nullpublic static void setTextAndMnemonic(javax.swing.AbstractButton button, LocaleMessage buttonText)
button
- component to set label text and mnemonicbuttonText
- label text with mnemonic characterpublic static void setLabelAndTextFor(javax.swing.JLabel label, java.awt.Component labelFor, LocaleMessage labelText)
public static boolean isValidMnemonicKey(int key)
key
- mnemonic keypublic static void setMnemonicKeyValidator(MnemonicKeyValidator mnemonicKeyValidator)
public static MnemonicKeyValidator getMnemonicKeyValidator()
|
Oracle® WebCenter Content Remote Intradoc Client (RIDC) Java API Reference 11g Release 1 (11.1) E17274-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |