|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.core.ui.Mnemonics
A class for creating unique mnemonics per control per window.
Field Summary | |
---|---|
static String |
copyright
|
static char |
MNEMONIC_CHAR
|
Constructor Summary | |
---|---|
Mnemonics()
|
Method Summary | |
---|---|
static String |
applyMnemonic(String label,
char mnemonicChar)
Given a label and mnemonic, this applies that mnemonic to the label. |
void |
clear()
Clear the list for re-use |
int |
findUniqueMnemonic(String label)
Find a uniqe mnemonic char in given string. |
static char |
getMnemonic(String text)
Helper method to return the mnemonic from a string. |
boolean |
isUniqueMnemonic(char currchar)
Determine if given char is a unique mnemonic |
String |
removeAndFreeMnemonic(String text)
Remove and free up mnemonic |
void |
removeMnemonic(Button button)
If a button is removed from a dialog window, call this method to remove its mnemonic from the list for this dialog. |
Mnemonics |
setApplyMnemonicsToPrecedingLabels(boolean apply)
Set whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields. |
void |
setMnemonic(Button button)
Adds a mnemonic to an SWT Button such that the user can select it via Ctrl/Alt+mnemonic. |
void |
setMnemonics(Composite parent)
Given a Composite, this method walks all the children recursively and and sets the mnemonics uniquely for each child control where a mnemonic makes sense (eg, buttons). |
void |
setMnemonicsAndArmListener(Menu menu,
ArmListener listener)
Given a menu, this method walks all the items and assigns each a unique memnonic. |
Mnemonics |
setOnPreferencePage(boolean page)
Set if the mnemonics are for a preference page Preference pages already have a few buttons with mnemonics set by Eclipse We have to make sure we do not use the ones they use |
Mnemonics |
setOnWizardPage(boolean page)
Set if the mnemonics are for a wizard page Wizard pages already have a few buttons with mnemonics set by Eclipse We have to make sure we do not use the ones they use |
String |
setUniqueMnemonic(String label)
Given a string, this starts at the first character and iterates until it finds a character not previously used as a mnemonic on this page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
public static final char MNEMONIC_CHAR
Constructor Detail |
public Mnemonics()
Method Detail |
public void clear()
public String setUniqueMnemonic(String label)
label
- String to which to generate and apply the mnemonic
public static String applyMnemonic(String label, char mnemonicChar)
label
- String to which to apply the mnemonicmnemonicChar
- the character that is to be the mnemonic character
public boolean isUniqueMnemonic(char currchar)
public int findUniqueMnemonic(String label)
public void setMnemonic(Button button)
public void removeMnemonic(Button button)
public String removeAndFreeMnemonic(String text)
public static char getMnemonic(String text)
public void setMnemonics(Composite parent)
public void setMnemonicsAndArmListener(Menu menu, ArmListener listener)
Also, since while we are at it, this overloaded method also sets a given ArmListener to each menu item, perhaps for the purpose of displaying tooltip text. It makes sense to do this when doing mnemonics because both must be done for every menu item with text and must be done exactly once for each.
Call this after populating the menu.
public Mnemonics setOnPreferencePage(boolean page)
public Mnemonics setOnWizardPage(boolean page)
public Mnemonics setApplyMnemonicsToPrecedingLabels(boolean apply)
false
if it does not work
in your dialog, wizard, preference or property page, i.e. you have labels preceding these
widgets that do not necessarily refer to them.
apply
- true
to apply mnemonic to preceding labels, false
otherwise.
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |