Class GridFrame

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

@Component public class GridFrame extends Control implements Arrangeable, Hideable, AjaxableComponent
This class serves as a container for multiple components derivated of the Grid (see ArrangingGrid, ContainerGrid and ControlGrid).
Each Grid elements added to the mask aligns without considering the alignement of the elements belonging to the objects external to it. Inserting the Grid elements inside a GridFrame the fields of each grid align with each other.
Another important use of GridFrame is to make the grids cloasable. In effect, if one grid is set as closable, it is not possible to close it if it isn't inserted in a GridFrame.
See Also:
GCApi:
component
  • Field Details

    • _visible

      protected SetPredicate _visible
    • _event

      protected String _event
    • _param

      protected String _param
    • _msg

      protected String _msg
    • _fullsize

      protected boolean _fullsize
    • _border

      protected int _border
    • _cols

      protected int _cols
    • _cellsize

      protected byte _cellsize
    • _spacing

      protected String _spacing
  • Constructor Details

    • GridFrame

      public GridFrame()
      Creates a new instance of GridFrame with the space sets to arranging mode.
  • Method Details

    • setSPACING

      public void setSPACING(String s)
      Sets the mode to be set for spacing. It is usually set by the theme used.
      Parameters:
      s - The string that rappresents the name of the mode to use for the spacing. The standard names mode are: control, container, arranging.
    • setBORDER

      public void setBORDER(String s)
      Sets the size of the grid border. The default is 0 because this method is usally used in debugging to understand the occupation of the grid.
      Parameters:
      s - String containing an integer corresponding to the thickness of the border.
    • setVISIBLE

      public void setVISIBLE(String s)
      Sets if the component must be shown on the screen.
      Specified by:
      setVISIBLE in interface Hideable
      Parameters:
      s - The string containing the boolean value to set as visibility of the component.
    • getVISIBLE

      public boolean getVISIBLE()
      Deprecated.
      Specified by:
      getVISIBLE in interface Hideable
      Returns:
      Use Hideable.isVisible()
    • isVisible

      public boolean isVisible()
      Return if the component is visible on the screen.
      Specified by:
      isVisible in interface Hideable
      Returns:
      Boolean indicating the visibility of the object. If it is true, the object is visible. If it is false the object is not visible.
    • setEVENT

      public void setEVENT(String s)
      Sets the event to be launched from grid. When the event is set, a button outside the grid is shown to launch it. The button hasn't set an icon, so it must be defined. This component can be used on any grid except for direct child grids of gridFrame.
      Parameters:
      s - Name of the event to launch
    • setMSG

      public void setMSG(String s)
      Sets the string that appears as a message for the event associated to the grid.
      If there is a message, when the user launch the event a javascript alert will appear, containing the message and two buttons; by pressing one of the two the event will be triggered, while pressing the other will not. Therefore usually this alert is used to request confirmation of proceeding to the user.
      Using this method the message will be translated by the Teacher.
      Parameters:
      s - A string that represents the message contained in the alert that will appears when the user clicks the Button
    • setPARAM

      public void setPARAM(String s)
      Sets one (or more) parameter for the events associated to the grid (see setEVENT()).
      For the association event - parameter, it counts the position in which the attributes appear. If the parameters are fewer than the events, the last parameter of the list is associated with all the remaining events.
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the param attribute of an event associated to the field
    • setFULLSIZE

      public void setFULLSIZE(String s)
      Sets the horizontal size of the grid to fullsize. So, when it is sets to true, the width of the grid will occupy all the space possible
      Parameters:
      s - String containing the boolean value to enable fullsize mode or not.
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the html code that represents the active part of the component, i.e. the field and the validation scripts
      Specified by:
      getContentHtml in interface Arrangeable
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the component
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the hidden but active html part of an hidden component
      Specified by:
      getHiddenHtml in interface Arrangeable
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the hidden part of the component
    • getDescriptionHtml

      public org.apache.ecs.Element getDescriptionHtml(Object generationhandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the html code that represents the component description i.e. the formatted label of the field
      Specified by:
      getDescriptionHtml in interface Arrangeable
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the label of the field
    • getGenerationHandle

      public Object getGenerationHandle()
      Description copied from interface: Arrangeable
      Returns the object to generate when the Arrangeable element is composed by more than one element
      Specified by:
      getGenerationHandle in interface Arrangeable
      Returns:
      The Object to generate
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • getEventButton

      public org.apache.ecs.Element getEventButton()
      Method that creates a button that launches the event associeted to the grid. If the grid is read-only, the event is not added to the button. Otherwise the event that button will launch will be the one associeted via the method setEVENT() with parameters and message set via the methods setPARAM() and setMSG().
      Returns:
      Return the Button element with the event associeted.
    • addSectionRow

      protected void addSectionRow(int cols, org.apache.ecs.html.TBody tb, Grid g, int sectionnumber, boolean closed, boolean ro, boolean ena, boolean roclosed)
    • addEndSectionRow

      protected void addEndSectionRow(int cols, org.apache.ecs.html.TBody tb)
    • onOpenClose

      public boolean onOpenClose(HashGetter hg)
      Method that deals with opening and closing of the Grid elements set to closable.
      Parameters:
      hg - HashGetter containing the section number to close or open. The value is inside the "param" key.
      Returns:
      false
    • getFrameHtml

      public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change changed, EntitySet es)
      Description copied from interface: AjaxableComponent
      Defines the html part of the element that changes when an Ajax interaction occurs
      Specified by:
      getFrameHtml in interface AjaxableComponent
      Parameters:
      changed - The Change object that defines the specific morphing type for the element
      es - The EntitySet to which the element belongs
      Returns:
      The html part of the element that changes when an Ajax interaction occurs
    • changedGrid

      public void changedGrid(int n)
      Defines the Change object for the grid.
      Parameters:
      n - Number containing the section number of the grid
    • changed

      public void changed(overit.geocall.ux.servlet.processor.Change change)
      Description copied from interface: AjaxableComponent
      Defines the morphing of the element that occurs when there is an Ajax interaction
      Specified by:
      changed in interface AjaxableComponent
      Parameters:
      change - The Change object that defines the specific morphing type for the element
    • getDefaultChange

      public overit.geocall.ux.servlet.processor.Change getDefaultChange()
      Description copied from interface: AjaxableComponent
      Defines the default Change object for the element
      Specified by:
      getDefaultChange in interface AjaxableComponent
      Returns:
      The default Change object that defines the default morphing type of the element
    • setMsg

      public void setMsg(String s)
      Sets the string that appears as a message for the event associated to the grid.
      If there is a message, when the user launch the event a javascript alert will appear, containing the message and two buttons; by pressing one of the two the event will be triggered, while pressing the other will not. Therefore usually this alert is used to request confirmation of proceeding to the user.
      Using this method the message will not be translated by the Teacher.
      Parameters:
      s - A string that represents the message contained in the alert that will appears when the user clicks the Button
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is created.
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script