|
||||||||||
| 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
public abstract class AbstractOption
| Field Summary | |
|---|---|
private String |
label
Brief description of the option. |
private String |
optionId
A unique identifier for an option. |
private OptionMaster.OptionPlatform |
optionPlatform
|
private OptionMaster.Type |
optionType
|
private OptionMaster.Visibility |
optionVisibility
|
| Constructor Summary | |
|---|---|
AbstractOption(String id,
String label,
OptionMaster.Type optionType,
OptionMaster.OptionPlatform optionPlatform,
OptionMaster.Visibility optionVisibility)
Creates an option that can hold a specified sort of data and that applies to a given platform. |
|
| Method Summary | |
|---|---|
void |
fromPrefsFormat(String text)
Initializes the current option using a relevant variable from the startup script. |
abstract JComponent |
getComponent()
Returns the GUI component that represents the option. |
String |
getLabel()
Returns a brief description of this option. |
String |
getOptionId()
Returns the ID used when referring to this option. |
OptionMaster.OptionPlatform |
getOptionPlatform()
Returns the platform(s) to which this option applies. |
OptionMaster.Type |
getOptionType()
Returns this option's type. |
OptionMaster.Visibility |
getOptionVisibility()
Returns whether or not this option represents a visible UI element. |
abstract String |
getValue()
Returns the value of the option. |
private boolean |
isValidPrefFormat(String text)
Tests the specified string to see if it's valid for the current platform. |
protected boolean |
onValidPlatform()
Determines if the option applies to the current platform. |
abstract void |
setValue(String value)
Forces the value of the option to the data specified. |
String |
toPrefsFormat()
Returns a string representation of the current option that is suitable for use in the startup script. |
abstract String |
toString()
Friendly string representation of the option. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final String optionId
private final String label
private final OptionMaster.Type optionType
OptionMaster.Typeprivate final OptionMaster.OptionPlatform optionPlatform
OptionMaster.OptionPlatformprivate final OptionMaster.Visibility optionVisibility
OptionMaster.Visibility| Constructor Detail |
|---|
public AbstractOption(String id,
String label,
OptionMaster.Type optionType,
OptionMaster.OptionPlatform optionPlatform,
OptionMaster.Visibility optionVisibility)
id - ID used to refer to this option.label - Text that'll be used as the GUI label for this optionoptionType - Type of data this option will represent.optionPlatform - Platform(s) where this option is applicable.optionVisibility - Visibility behavior of this option.| Method Detail |
|---|
protected boolean onValidPlatform()
true if this option is applicable, false
otherwise.private boolean isValidPrefFormat(String text)
text - The string to test.
public OptionMaster.Type getOptionType()
getOptionType in interface OptionOptionMaster.Typepublic OptionMaster.OptionPlatform getOptionPlatform()
getOptionPlatform in interface OptionOptionMaster.OptionPlatformpublic OptionMaster.Visibility getOptionVisibility()
getOptionVisibility in interface OptionOptionMaster.Visibilitypublic String getOptionId()
getOptionId in interface Optionpublic String getLabel()
getLabel in interface Optionpublic void fromPrefsFormat(String text)
fromPrefsFormat in interface Optiontext - Line from the startup script that represents the current
option.
IllegalArgumentException - if text is not in the proper
format for the current platform.public String toPrefsFormat()
toPrefsFormat in interface OptionisValidPrefFormat(String)public abstract JComponent getComponent()
BooleanOptions are represented by a JCheckBox, while
TextOptions appear as a JTextField.
getComponent in interface Optionpublic abstract String getValue()
BooleanOptions
return either "0" or "1".
getValue in interface Optionpublic abstract void setValue(String value)
BooleanOptions accept either "0", or "1".
setValue in interface Optionvalue - New value to use.public abstract String toString()
toString in interface OptiontoString in class ObjectTextOption.toString(),
BooleanOption.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||