public class CommandTextInfo extends Object
Constructor and Description |
---|
CommandTextInfo(String text,
int mnemonic,
int dispIdx)
Creates a new CommandTextInfo instance without hint.
|
CommandTextInfo(String text,
int mnemonic,
int dispIdx,
String hint)
Creates a new CommandTextInfo instance.
|
Modifier and Type | Method and Description |
---|---|
static String |
getCommandText(String txt)
Parses a command text description and returns its text part.
|
static String |
getCommandText(String txt,
String... param)
Parses a command text description and returns its text part.
|
static CommandTextInfo |
getCommandTextInfo(String txt)
Returns a
CommandTextInfo object which represents the information in the
string txt , without any argument replacements. |
static CommandTextInfo |
getCommandTextInfo(String txt,
String... param)
Returns a
CommandTextInfo object which represents the information in the
string txt . |
int |
getDisplayedMnemonicIndex()
Returns the displayed mnemonic index of this CommandTextInfo.
|
String |
getHint()
Returns the hint string of this CommandTextInfo.
|
int |
getMnemonic()
Returns the mnemonic of this CommandTextInfo.
|
String |
getText()
Returns the text of this CommandTextInfo.
|
boolean |
hasMnemonic()
Returns whether or not the caption represented by this CommandTextInfo object
has a mnemonic.
|
public CommandTextInfo(String text, int mnemonic, int dispIdx, String hint)
text
- displayed textmnemonic
- mnemonic character of the command, or -1
if
it has no mnemonicdispIdx
- index of the mnemonic character within the command,
or -1
if it has no mnemonichint
- hint of the commandpublic CommandTextInfo(String text, int mnemonic, int dispIdx)
text
- displayed textmnemonic
- mnemonic character of the command, or -1
if
it has no mnemonicdispIdx
- index of the mnemonic character within the command,
or -1
if it has no mnemonicpublic boolean hasMnemonic()
true
if the caption has a mnemonic, false
otherwisepublic String getText()
public int getMnemonic()
public int getDisplayedMnemonicIndex()
public String getHint()
public static CommandTextInfo getCommandTextInfo(String txt, String... param)
CommandTextInfo
object which represents the information in the
string txt
.
The string is parsed as follows:
txt
- string representation of text and mnemonic index, as
present in the resource filesparam
- strings by which the variable placeholders "%1", "%2", etc,
are to be replacedtxt
.public static CommandTextInfo getCommandTextInfo(String txt)
CommandTextInfo
object which represents the information in the
string txt
, without any argument replacements.txt
- the information stringCommandTextInfo
objectgetCommandTextInfo(String, String...)
public static String getCommandText(String txt, String... param)
getCommandText(txt, param).getText()
.txt
- the information stringparam
- the parameter