public class LoggerLevelOption extends AbstractOption
| Modifier and Type | Field and Description |
|---|---|
private javax.swing.JComboBox<java.lang.String> |
comboBox
JComboBox that will eventually contain logging levels to
select. |
private java.lang.String |
currentChoice
String representation of the user's selection, or the default
value provided to the constructor. |
private static java.lang.String |
DEBUG
String representation of Logback's "DEBUG" logging
level. |
private static java.lang.String |
ERROR
String representation of Logback's "ERROR" logging
level. |
private static java.lang.String |
INFO
String representation of Logback's "INFO" logging
level. |
private static java.lang.String |
OFF
String representation of Logback's "OFF" logging
level. |
private static java.lang.String |
TRACE
String representation of Logback's "TRACE" logging
level. |
private static java.lang.String |
WARN
String representation of Logback's "WARN" logging
level. |
| Constructor and Description |
|---|
LoggerLevelOption(java.lang.String id,
java.lang.String label,
java.lang.String defaultValue,
OptionMaster.OptionPlatform optionPlatform,
OptionMaster.Visibility optionVisibility)
Create a startup option that allows the user to manipulate the global
McIDAS-V logging level.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.JComboBox<java.lang.String> |
getComponent()
Builds a
JComboBox containing the logging levels to select. |
java.lang.String |
getValue()
Returns the user's current selection (or the default value).
|
private static boolean |
isValidValue(java.lang.String value)
Tests a
String value to see if it has a corresponding logging
level. |
void |
setValue(java.lang.String value)
Stores the user's selected logging level.
|
private static ch.qos.logback.classic.Level |
stringToLogback(java.lang.String value)
Converts a
String value to the corresponding logging level. |
java.lang.String |
toString()
String representation of the user's logging level selection. |
fromPrefsFormat, getLabel, getOptionId, getOptionPlatform, getOptionType, getOptionVisibility, isValidPrefFormat, onValidPlatform, toPrefsFormatprivate static final java.lang.String TRACE
String representation of Logback's "TRACE" logging
level.private static final java.lang.String DEBUG
String representation of Logback's "DEBUG" logging
level.private static final java.lang.String INFO
String representation of Logback's "INFO" logging
level.private static final java.lang.String WARN
String representation of Logback's "WARN" logging
level.private static final java.lang.String ERROR
String representation of Logback's "ERROR" logging
level.private static final java.lang.String OFF
String representation of Logback's "OFF" logging
level.private javax.swing.JComboBox<java.lang.String> comboBox
JComboBox that will eventually contain logging levels to
select. May be null.private java.lang.String currentChoice
String representation of the user's selection, or the default
value provided to the constructor.public LoggerLevelOption(java.lang.String id, java.lang.String label, java.lang.String defaultValue, OptionMaster.OptionPlatform optionPlatform, OptionMaster.Visibility optionVisibility)
null is not a permitted
value for any of this constructor's parameters.id - Identifier for this startup option.label - Brief description suitable for a GUI label.defaultValue - Default value for this startup option.optionPlatform - Platforms where this option may be applied.optionVisibility - Whether or not the option is presented via the GUI.java.lang.IllegalArgumentException - if defaultValue failed isValidValue(String).public javax.swing.JComboBox<java.lang.String> getComponent()
JComboBox containing the logging levels to select.
Defaults to the String specified in the constructor.getComponent in interface OptiongetComponent in class AbstractOptionJComboBox to present to the user.public java.lang.String getValue()
getValue in interface OptiongetValue in class AbstractOptionpublic void setValue(java.lang.String value)
JComboBox.setSelectedItem(Object)
behavior that does not generate ItemEvents if
the selection did not actually change.setValue in interface OptionsetValue in class AbstractOptionvalue - String representation of the desired logging
level. Should not be null.java.lang.IllegalArgumentException - if value failed
isValidValue(String).private static ch.qos.logback.classic.Level stringToLogback(java.lang.String value)
String value to the corresponding logging level.
This functionality is similar to
Level.toLevel(String, Level), but for this use case it is
preferable to know if an invalid value was provided.
value - Value to convert.java.lang.IllegalArgumentException - if value did not have a
corresponding logging level.private static boolean isValidValue(java.lang.String value)
String value to see if it has a corresponding logging
level.public java.lang.String toString()
String representation of the user's logging level selection.toString in interface OptiontoString in class AbstractOptionString that looks something like
"[LoggerLevel@7825114a: currentChoice=INFO]".TextOption.toString(),
BooleanOption.toString()