|
||||||||||
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.Type
private final OptionMaster.OptionPlatform optionPlatform
OptionMaster.OptionPlatform
private 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 Option
OptionMaster.Type
public OptionMaster.OptionPlatform getOptionPlatform()
getOptionPlatform
in interface Option
OptionMaster.OptionPlatform
public OptionMaster.Visibility getOptionVisibility()
getOptionVisibility
in interface Option
OptionMaster.Visibility
public String getOptionId()
getOptionId
in interface Option
public String getLabel()
getLabel
in interface Option
public void fromPrefsFormat(String text)
fromPrefsFormat
in interface Option
text
- 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 Option
isValidPrefFormat(String)
public abstract JComponent getComponent()
BooleanOption
s are represented by a JCheckBox
, while
TextOption
s appear as a JTextField
.
getComponent
in interface Option
public abstract String getValue()
BooleanOption
s
return either "0" or "1".
getValue
in interface Option
public abstract void setValue(String value)
BooleanOption
s accept either "0", or "1".
setValue
in interface Option
value
- New value to use.public abstract String toString()
toString
in interface Option
toString
in class Object
TextOption.toString()
,
BooleanOption.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |