Package com.thecoderscorner.menu.domain
Class EditableTextMenuItem
- java.lang.Object
-
- com.thecoderscorner.menu.domain.MenuItem<java.lang.String>
-
- com.thecoderscorner.menu.domain.EditableTextMenuItem
-
public class EditableTextMenuItem extends MenuItem<java.lang.String>
An implementation of menu item that can store text strings. Currently, the are always stored in RAM on the Arduino so choose the size carefully.
-
-
Field Summary
-
Fields inherited from class com.thecoderscorner.menu.domain.MenuItem
eepromAddress, functionName, id, localOnly, name, readOnly, visible
-
-
Constructor Summary
Constructors Constructor Description EditableTextMenuItem()EditableTextMenuItem(java.lang.String name, int id, int eepromAddress, java.lang.String functionName, int length, EditItemType itemType, boolean readOnly, boolean localOnly, boolean visible)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(MenuItemVisitor visitor)booleanequals(java.lang.Object o)EditItemTypegetItemType()intgetTextLength()inthashCode()MenuState<java.lang.String>newMenuState(java.lang.String value, boolean changed, boolean active)Returns a new String current value that can be used as the current value in the Menutree-
Methods inherited from class com.thecoderscorner.menu.domain.MenuItem
getEepromAddress, getFunctionName, getId, getName, hasChildren, isLocalOnly, isReadOnly, isVisible, toString
-
-
-
-
Constructor Detail
-
EditableTextMenuItem
public EditableTextMenuItem()
-
EditableTextMenuItem
public EditableTextMenuItem(java.lang.String name, int id, int eepromAddress, java.lang.String functionName, int length, EditItemType itemType, boolean readOnly, boolean localOnly, boolean visible)
-
-
Method Detail
-
getTextLength
public int getTextLength()
- Returns:
- The maximum length allowable.
-
getItemType
public EditItemType getItemType()
- Returns:
- the type of values that can be represented by this control.
- See Also:
EditItemType
-
newMenuState
public MenuState<java.lang.String> newMenuState(java.lang.String value, boolean changed, boolean active)
Returns a new String current value that can be used as the current value in the Menutree- Specified by:
newMenuStatein classMenuItem<java.lang.String>- Parameters:
value- the new valuechanged- if the value has changedactive- if the value is active.- Returns:
- the new menu state object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
accept
public void accept(MenuItemVisitor visitor)
-
-