Class EditableTextMenuItem

java.lang.Object
com.thecoderscorner.menu.domain.MenuItem<String>
com.thecoderscorner.menu.domain.EditableTextMenuItem

public class EditableTextMenuItem extends MenuItem<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.
  • Constructor Details

    • EditableTextMenuItem

      public EditableTextMenuItem()
    • EditableTextMenuItem

      public EditableTextMenuItem(String name, String varName, int id, int eepromAddress, String functionName, int length, EditItemType itemType, boolean readOnly, boolean localOnly, boolean visible)
  • Method Details

    • 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<String> newMenuState(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:
      newMenuState in class MenuItem<String>
      Parameters:
      value - the new value
      changed - if the value has changed
      active - if the value is active.
      Returns:
      the new menu state object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • accept

      public void accept(MenuItemVisitor visitor)
      Specified by:
      accept in class MenuItem<String>