public class MnemonicInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected MnemonicConfig |
cfg
The
MnemonicConfig instance to update. |
private boolean |
defaultFirst
Flag, denoting using of the first character as a mnemonic if it wasn't
assigned manually (using correct '&' sequence).
|
private java.lang.Integer |
mnemIdx
Integer index in a config.label string, pointing to a mnemonic character.
|
private java.lang.Character |
mnemonic
Hot key for menu calling.
|
private java.lang.String |
prepLabel
Preprocessed label without unnecessary '&'
|
Constructor and Description |
---|
MnemonicInfo()
Default constructor.
|
MnemonicInfo(boolean defaultFirst)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getMnemIdx()
Get mnemonic index in a prepared label.
|
java.lang.Character |
getMnemonic()
Get mnemonic character.
|
java.lang.String |
getPrepLabel()
Get prepared title.
|
void |
init(MnemonicConfig cfg)
Set the
mnemonic config associated with this info. |
protected java.lang.String |
prepare(java.lang.String title)
Initialized fields with new menu item label
|
protected boolean |
processSequence(int start,
int end,
java.lang.StringBuilder result,
boolean mnemAssnd)
|
protected void |
setMnemIdx(java.lang.Integer mnemIdx)
Set mnemonic index in a prepared label.
|
protected void |
setMnemonic(java.lang.Character mnemonic)
Set mnemonic in a prepared label.
|
protected void |
setPrepLabel(java.lang.String prepLabel)
Set the preprocessed label.
|
private java.lang.String prepLabel
private java.lang.Character mnemonic
private java.lang.Integer mnemIdx
private final boolean defaultFirst
protected MnemonicConfig cfg
MnemonicConfig
instance to update. May be null
.public MnemonicInfo()
public MnemonicInfo(boolean defaultFirst)
defaultFirst
- true
if first character is a default mnemonic.public void init(MnemonicConfig cfg)
mnemonic config
associated with this info.cfg
- The MnemonicConfig
instance.protected java.lang.String prepare(java.lang.String title)
title
- New menu item label.public java.lang.String getPrepLabel()
public java.lang.Character getMnemonic()
protected void setMnemonic(java.lang.Character mnemonic)
mnemonic
- New mnemonic.public java.lang.Integer getMnemIdx()
protected void setMnemIdx(java.lang.Integer mnemIdx)
mnemIdx
- New mnemonic index.protected void setPrepLabel(java.lang.String prepLabel)
prepLabel
- The preprocessed label.protected boolean processSequence(int start, int end, java.lang.StringBuilder result, boolean mnemAssnd)
start
- the first '&' index from the right.end
- the last '&' index from the right.mnemAssnd
- true means that a sequence of '&' of odd length was met, wherein
mnemonic wasn't necessarily being assigned.result
- Resulting string buffer.