AbilityParameters.AbilityParmEditor
protected abstract class CMAbleParms.AbilityParmEditorImpl extends java.lang.Object implements AbilityParameters.AbilityParmEditor
Modifier and Type | Field | Description |
---|---|---|
protected PairList<java.lang.String,java.lang.String> |
choices |
Constructor | Description |
---|---|
AbilityParmEditorImpl(java.lang.String fieldName,
java.lang.String shortHeader,
AbilityParameters.ParmType type) |
Modifier and Type | Method | Description |
---|---|---|
int |
appliesToClass(java.lang.Object o) |
Returns how much this editor applies as the appropriate editor to the
given object.
|
PairList<java.lang.String,java.lang.String> |
choices() |
Creates key/display pairs whose identity depends entirely on this editor.
|
java.lang.String |
colHeader() |
The displayable name of this column.
|
java.lang.String |
commandLinePrompt(MOB mob,
java.lang.String oldVal,
int[] showNumber,
int showFlag) |
Presents the given mob player the official command line prompt for this editor and
lets them enter a value or values before returning the final value as a result.
|
java.lang.String |
commandLineValue(java.lang.String oldVal) |
When building a display table for the command line interface, this will
return the desired display value for the desired field and old value.
|
boolean |
confirmValue(java.lang.String oldVal) |
Returns whether the given value constitutes a valid value for this editor.
|
PairList<java.lang.String,java.lang.String> |
createBinaryChoices(java.lang.String[] S) |
|
abstract void |
createChoices() |
|
PairList<java.lang.String,java.lang.String> |
createChoices(java.lang.String[] S) |
Creates key/display pairs from a list of strings whose identity
depends entirely on this editor.
|
PairList<java.lang.String,java.lang.String> |
createChoices(java.util.Enumeration<? extends java.lang.Object> e) |
Creates key/display pairs from an enumeration of objects whose identity
depends entirely on this editor.
|
PairList<java.lang.String,java.lang.String> |
createChoices(java.util.List<? extends java.lang.Object> V) |
Creates key/display pairs from a list of objects whose identity
depends entirely on this editor.
|
PairList<java.lang.String,java.lang.String> |
createNumberedChoices(java.lang.String[] S) |
|
java.lang.String[] |
fakeUserInput(java.lang.String oldVal) |
Presents fake user input for testing.
|
java.lang.String |
ID() |
The code-word/identifier for this editor.
|
int |
maxColWidth() |
The maximum width to give this column when building a table
This is a nominal value, so Integer.MAX_VALUE would be a
good default.
|
int |
minColWidth() |
The minimum width to give this column when building a table
This is a nominal value, so 0 would be a
good default.
|
AbilityParameters.ParmType |
parmType() |
The general type of data being manipulated by the editor.
|
java.lang.String |
prompt() |
The display prompt used for command line editors.
|
java.lang.String |
webField(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq,
java.util.Map<java.lang.String,java.lang.String> parms,
java.lang.String oldVal,
java.lang.String fieldName) |
Returns the html tag field, complete with current value, for this editor
|
java.lang.String |
webTableField(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq,
java.util.Map<java.lang.String,java.lang.String> parms,
java.lang.String oldVal) |
The current web value of this field, sufficient to be put into the overview table
showing the value of all the fields.
|
java.lang.String |
webValue(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq,
java.util.Map<java.lang.String,java.lang.String> parms,
java.lang.String oldVal,
java.lang.String fieldName) |
The current web value of this field, sufficient to be put into the VALUE field
of a text or hidden tag.
|
convertFromItem, defaultValue
protected PairList<java.lang.String,java.lang.String> choices
public AbilityParmEditorImpl(java.lang.String fieldName, java.lang.String shortHeader, AbilityParameters.ParmType type)
public java.lang.String ID()
AbilityParameters.AbilityParmEditor
ID
in interface AbilityParameters.AbilityParmEditor
public AbilityParameters.ParmType parmType()
AbilityParameters.AbilityParmEditor
parmType
in interface AbilityParameters.AbilityParmEditor
AbilityParameters.ParmType
public java.lang.String prompt()
AbilityParameters.AbilityParmEditor
prompt
in interface AbilityParameters.AbilityParmEditor
public java.lang.String colHeader()
AbilityParameters.AbilityParmEditor
colHeader
in interface AbilityParameters.AbilityParmEditor
public int maxColWidth()
AbilityParameters.AbilityParmEditor
maxColWidth
in interface AbilityParameters.AbilityParmEditor
public int minColWidth()
AbilityParameters.AbilityParmEditor
minColWidth
in interface AbilityParameters.AbilityParmEditor
public boolean confirmValue(java.lang.String oldVal)
AbilityParameters.AbilityParmEditor
confirmValue
in interface AbilityParameters.AbilityParmEditor
oldVal
- the data to checkpublic java.lang.String[] fakeUserInput(java.lang.String oldVal)
AbilityParameters.AbilityParmEditor
fakeUserInput
in interface AbilityParameters.AbilityParmEditor
oldVal
- the current valuepublic java.lang.String commandLinePrompt(MOB mob, java.lang.String oldVal, int[] showNumber, int showFlag) throws java.io.IOException
AbilityParameters.AbilityParmEditor
commandLinePrompt
in interface AbilityParameters.AbilityParmEditor
mob
- the player who is being promptedoldVal
- the old/previous value for this fieldshowNumber
- the arbitrary number of this field 1, 2, 3..showFlag
- same as shownumber to edit, -1 to display, -999 to always editjava.io.IOException
- typically means a dropped carrierpublic java.lang.String webValue(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq, java.util.Map<java.lang.String,java.lang.String> parms, java.lang.String oldVal, java.lang.String fieldName)
AbilityParameters.AbilityParmEditor
webValue
in interface AbilityParameters.AbilityParmEditor
httpReq
- the request objects, containing access to url parametersparms
- the tag url parameters mapoldVal
- the original previous value of this fieldfieldName
- the name of the fieldpublic java.lang.String webTableField(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq, java.util.Map<java.lang.String,java.lang.String> parms, java.lang.String oldVal)
AbilityParameters.AbilityParmEditor
webTableField
in interface AbilityParameters.AbilityParmEditor
httpReq
- the request objects, containing access to url parametersparms
- the tag url parameters mapoldVal
- the original previous value of this fieldpublic java.lang.String commandLineValue(java.lang.String oldVal)
AbilityParameters.AbilityParmEditor
commandLineValue
in interface AbilityParameters.AbilityParmEditor
oldVal
- the current valuepublic java.lang.String webField(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq, java.util.Map<java.lang.String,java.lang.String> parms, java.lang.String oldVal, java.lang.String fieldName)
AbilityParameters.AbilityParmEditor
webField
in interface AbilityParameters.AbilityParmEditor
httpReq
- the request objects, containing access to url parametersparms
- the tag url parameters mapoldVal
- the original previous value of this fieldfieldName
- the name of the fieldpublic abstract void createChoices()
public PairList<java.lang.String,java.lang.String> createChoices(java.util.Enumeration<? extends java.lang.Object> e)
AbilityParameters.AbilityParmEditor
createChoices
in interface AbilityParameters.AbilityParmEditor
e
- the enumeration of objects to create choices frompublic PairList<java.lang.String,java.lang.String> createChoices(java.util.List<? extends java.lang.Object> V)
AbilityParameters.AbilityParmEditor
createChoices
in interface AbilityParameters.AbilityParmEditor
V
- the list of objects to create choices frompublic PairList<java.lang.String,java.lang.String> createChoices(java.lang.String[] S)
AbilityParameters.AbilityParmEditor
createChoices
in interface AbilityParameters.AbilityParmEditor
S
- the array of strings to create choices frompublic PairList<java.lang.String,java.lang.String> createBinaryChoices(java.lang.String[] S)
public PairList<java.lang.String,java.lang.String> createNumberedChoices(java.lang.String[] S)
public PairList<java.lang.String,java.lang.String> choices()
AbilityParameters.AbilityParmEditor
choices
in interface AbilityParameters.AbilityParmEditor
public int appliesToClass(java.lang.Object o)
AbilityParameters.AbilityParmEditor
appliesToClass
in interface AbilityParameters.AbilityParmEditor
o
- the object to check and see if this is an editor of