|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wisc.ssec.mcidasv.startupmanager.options.AbstractOption
edu.wisc.ssec.mcidasv.startupmanager.options.LoggerLevelOption
public class LoggerLevelOption
Representation of a choice allowing the user to select the global McIDAS-V logging level.
Field Summary | |
---|---|
private JComboBox |
comboBox
JComboBox that will eventually contain logging levels to
select. |
private String |
currentChoice
String representation of the user's selection, or the default
value provided to the constructor. |
private static String |
DEBUG
String representation of Logback's "DEBUG" logging
level. |
private static String |
ERROR
String representation of Logback's "ERROR" logging
level. |
private static String |
INFO
String representation of Logback's "INFO" logging
level. |
private static String |
OFF
String representation of Logback's "OFF" logging
level. |
private static String |
TRACE
String representation of Logback's "TRACE" logging
level. |
private static String |
WARN
String representation of Logback's "WARN" logging
level. |
Constructor Summary | |
---|---|
LoggerLevelOption(String id,
String label,
String defaultValue,
OptionMaster.OptionPlatform optionPlatform,
OptionMaster.Visibility optionVisibility)
Create a startup option that allows the user to manipulate the global McIDAS-V logging level. |
Method Summary | |
---|---|
JComboBox |
getComponent()
Builds a JComboBox containing the logging levels to select. |
String |
getValue()
Returns the user's current selection (or the default value). |
private static boolean |
isValidValue(String value)
Tests a String value to see if it has a corresponding logging
level. |
void |
setValue(String value)
Stores the user's selected logging level. |
private static ch.qos.logback.classic.Level |
stringToLogback(String value)
Converts a String value to the corresponding logging level. |
String |
toString()
String representation of the user's logging level selection. |
Methods inherited from class edu.wisc.ssec.mcidasv.startupmanager.options.AbstractOption |
---|
fromPrefsFormat, getLabel, getOptionId, getOptionPlatform, getOptionType, getOptionVisibility, onValidPlatform, toPrefsFormat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final String TRACE
String
representation of Logback's "TRACE" logging
level.
private static final String DEBUG
String
representation of Logback's "DEBUG" logging
level.
private static final String INFO
String
representation of Logback's "INFO" logging
level.
private static final String WARN
String
representation of Logback's "WARN" logging
level.
private static final String ERROR
String
representation of Logback's "ERROR" logging
level.
private static final String OFF
String
representation of Logback's "OFF" logging
level.
private JComboBox comboBox
JComboBox
that will eventually contain logging levels to
select. May be null
.
private String currentChoice
String
representation of the user's selection, or the default
value provided to the constructor.
Constructor Detail |
---|
public LoggerLevelOption(String id, String label, 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.
IllegalArgumentException
- if defaultValue
failed isValidValue(String)
.Method Detail |
---|
public JComboBox getComponent()
JComboBox
containing the logging levels to select. Defaults to the String
specified
in the constructor.
getComponent
in interface Option
getComponent
in class AbstractOption
JComboBox
to present to the user.public String getValue()
getValue
in interface Option
getValue
in class AbstractOption
public void setValue(String value)
JComboBox.setSelectedItem(Object)
behavior that does not generate ItemEvents
if the selection did not actually change.
setValue
in interface Option
setValue
in class AbstractOption
value
- String
representation of the desired logging
level. Should not be null
.
IllegalArgumentException
- if value
failed isValidValue(String)
.private static ch.qos.logback.classic.Level stringToLogback(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.
IllegalArgumentException
- if value
did not have a
corresponding logging level.private static boolean isValidValue(String value)
String
value to see if it has a corresponding logging
level.
value
- Value to test.
true
if-and-only-if passes a
String.equalsIgnoreCase(String)
check against TRACE
,
DEBUG
, INFO
, WARN
, ERROR
, or
OFF
.public String toString()
String
representation of the user's logging level selection.
toString
in interface Option
toString
in class AbstractOption
String
that looks something like
"[LoggerLevel@7825114a: currentChoice=INFO]".TextOption.toString()
,
BooleanOption.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |