|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.helper.MnemonicHelper
public class MnemonicHelper
MnemonicHelper provides a way to easily set mnemonics to UI components, without having to bother with remembering which ones have already been assigned to another component.
To use it: simply create a new instance and keep calling getMnemonic(String)
to get mnemonics from the giving pieces of text.
| Constructor Summary | |
|---|---|
MnemonicHelper()
Creates a new blank MnemonicHelper. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears any previously registered mnemonics by getMnemonic(String). |
char |
getMnemonic(javax.swing.JButton button)
Convenience method that returns a mnemonic for the specified button. |
char |
getMnemonic(java.lang.String text)
Finds and returns first character in the given string that's not already as a mnemonic. |
boolean |
isMnemonicUsed(char ch)
Returns true if the specified character has already been previously
used as a mnemonic, returned by getMnemonic(String). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MnemonicHelper()
| Method Detail |
|---|
public char getMnemonic(java.lang.String text)
Returned mnemonic will be added to current internal list of taken mnemonics and won't ever be used again by this instance.
text - text to get a mnemonic from.
null string is passed.public char getMnemonic(javax.swing.JButton button)
getMnemonic(String) were called with JButton.getText().
button - the button to get a mnemonic for
null string is passed.public boolean isMnemonicUsed(char ch)
true if the specified character has already been previously
used as a mnemonic, returned by getMnemonic(String).
ch - the character which will be tested for an existing mnemonic.
public void clear()
getMnemonic(String).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard