Class InputColorBar

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Arrangeable, Badgeable, ValueValidator, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable

@Component public class InputColorBar extends Input
This class implements an Input component that shows a palette of 64 predefined colors (COLORS).
The selection of one of these is translated into the corresponding RGB code when the form is submitted.
See Also:
GCApi:
component
  • Field Details

    • _color

      protected String _color
  • Constructor Details

    • InputColorBar

      public InputColorBar()
      Creates an InputColorBar
  • Method Details

    • getColor

      public static String getColor(int pos)
      Returns the rgb string that defines the color in the desired position of the array of colors (COLORS)
      Parameters:
      pos - The position of the array
      Returns:
      The rgb of the defined
    • getColorsNumber

      public static int getColorsNumber()
      Returns the number of colors, ie the length of the COLORS array
      Returns:
      The nuymber of colors
    • setVALUE

      public void setVALUE(String s)
      Sets the value for the field
      Overrides:
      setVALUE in class Input
      Parameters:
      s - A string that defines an rgb code; the string must start with the # character (if not, the character is added automatically) and must be 7 characters long, # included
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      Description copied from class: Input
      Implements the interface Arrangeable. It returns the html code that represents the active part of the input field, i.e. the field and the validation scripts
      Specified by:
      getContentHtml in interface Arrangeable
      Overrides:
      getContentHtml in class Input
      Parameters:
      generationhandle - The handle of the generation
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the input field or null if the field don't have a graphical representation
    • getImageBoX

      protected org.apache.ecs.Element getImageBoX()
    • buildDisplayScript

      public void buildDisplayScript(StringBuilder sb)
      Every component can add a script to the StringBuilder, script executed when the component is displayed. This method does nothing
      Overrides:
      buildDisplayScript in class Input
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • createColorBox

      protected org.apache.ecs.html.Div createColorBox()
    • createColorsList

      protected org.apache.ecs.html.IMG createColorsList(String idBox, String idField)