Class Grid

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Arrangeable, Badgeable, Hideable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable
Direct Known Subclasses:
ArrangingGrid, ContainerGrid, ControlGrid

public abstract class Grid extends Control implements Arrangeable, Hideable
This is an abstract class that must be extended to implements a component to use to position the elements within the window. The purpose of this class is to provide the methods and behaviours of a generic container element.
See Also:
  • 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
    • _align

      protected char _align
    • _valign

      protected char _valign
    • _mode

      protected String _mode
    • _childrenMatrix

      protected SimpleMatrix _childrenMatrix
    • _ref

      protected String _ref
    • _closable

      protected boolean _closable
    • _closed

      protected boolean _closed
    • _roclosed

      protected boolean _roclosed
    • _cellsize

      protected byte _cellsize
    • _spacing

      protected String _spacing
    • _conf

      protected State.Conf _conf
    • layoutCache

      protected boolean layoutCache
  • Constructor Details

    • Grid

      public Grid()
  • Method Details

    • setREF

      public void setREF(String s)
      Defines the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax event
      Parameters:
      s - The name of the reference that must correspond to the name of an anchor
    • 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.
    • 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.
    • 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
    • setALIGN

      public void setALIGN(String s)
      Sets the horizontal align the components inside the grid. If isn't set, the default value is left. It's possible override this value for each item contained using the method setGRIDALIGN().
      Parameters:
      s - The character indicating which horizontal align to use. The possible value are:
      • 'l': left
      • 'c': center
      • 'r': right
    • setVALIGN

      public void setVALIGN(String s)
      Sets the vertical align the components inside the grid. If isn't set, the default value is left. It's possible override this value for each item contained using the method setGRIDVALIGN().
      Parameters:
      s - The character indicating which horizontal align to use. The possible value are:
      • 't': top
      • 'c': center
      • 'b': bottom
    • 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.
    • 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.
    • setMODE

      public void setMODE(String s)
      Sets the tiling mode of the colums created (using the tag <break> when a column is finished and must start a new column). The possible mode are "from left to right" or "from top to bottom". In the first mode each column is composed by inserting the elements one below the other, and the columns are placed side by side starting from the left. In the second mode each column is composed by inserting the elements one next to the other, and the columns (in this case it would be more correct to speak of lines) are one below the other starting from the top.
      Parameters:
      s - String containing the value of the mode to be set. The accepted values are:
      • 'lr': from left to right
      • 'tp': from top to bottom
    • setCLOSABLE

      public void setCLOSABLE(String s)
      Sets the possibility to closed the grid, as long as this is inside a GridFrame. Moreover it is necessary to set a label to the grid (see setLABEL()) to enable the possibility to close it. If you don't want to write anything into the label, it is possible to leave empty the label value.
      Parameters:
      s - String containing the boolean value to enable closable mode or not.
    • setCLOSED

      public void setCLOSED(String s)
      If the grid is closable, set the status of the grid at first time you visit the page having it. The next time the status will be recovered from the database to restore the last active state.
      Parameters:
      s - String containing the boolean value to set the grid in the closed state or not.
    • setROCLOSED

      public void setROCLOSED(String s)
      Sets the grid to closed when it is read-only.
      Parameters:
      s - String containing the boolean value to set the grid in the closed state when it is read-only.
    • setLAYOUTCACHE

      public void setLAYOUTCACHE(String enable)
      Set this grid should cache the internal row/columns structure or must re-evaluate them every time.
      Parameters:
      enable - set false if the children of this Grid are dynamically added via API; true otherwise
    • getRef

      public String getRef()
      Returns the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax event
      Returns:
      s The name of the reference, that correspond to the name of an anchor
    • getClosable

      public boolean getClosable()
      Get if the grid is closable.
      Returns:
      The boolean to know if the grid is closable.
    • getROClosed

      public boolean getROClosed()
      Get if the grid is set to closed when it is in read-only mode.
      Returns:
      The boolean to know if the grid is set to closed in read-only mode.
    • getClosed

      public boolean getClosed()
      Get if the grid is set to closed at first time you visit the page having it. Obviously, the grid must be closable.
      Returns:
      The boolean to know if the grid is set to closed at first time you visit the page having it.
    • setClosed

      public void setClosed(boolean b)
      Set the grid to closed or open based on parameter passed. Obviously the grid must be set to closable, otherwise you recive the NullPointerException. This method refresh automatically the user's window.
      Parameters:
      b - The boolean to use to set the grid in closed or open mode.
    • setRo

      public void setRo(boolean ro)
      Set the grid in read-only mode based on parameter passed and refresh automatically the user's window. If the grid is set to unclosable, using this method has no effect.
      Parameters:
      ro - The boolean to use to set the grid in closed or open mode when it is in read-only state.
    • setMsg

      public void setMsg(String s)
      Sets programmatically the string that appears as a message for the event associated to the grid.
      Using this method the message will not be translated by the Teacher.
      See setMSG(java.lang.String) for the meaning of the attribute.
      Parameters:
      s - A string that represents the message contained in the alert that will appears when the user launch the event assacieted to the grid.
    • setup

      protected void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class Component
    • getChildrenMatrix

      protected SimpleMatrix getChildrenMatrix()
    • addStructureRow

      protected static void addStructureRow(org.apache.ecs.html.THead t, int cols, int cellsize, String spacing)
    • 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
    • fillBodyRows

      protected void fillBodyRows(int cols, int cellsize, org.apache.ecs.html.TBody tb, int indent, EntitySet es)
    • 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
    • createTD

      protected org.apache.ecs.html.TD createTD(int colspan, int rowspan, char align, char valign)
    • 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.
    • getPublishedChildrenList

      public List getPublishedChildrenList()
      Description copied from class: Component
      Returns the published childs. Those that are not published are not even searched to be synchronized via Ajax
      Overrides:
      getPublishedChildrenList in class Component
      Returns:
      The List of published childs
    • buildDisplayScript

      public void buildDisplayScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is displayed.
      Overrides:
      buildDisplayScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • 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
    • getFullHeightChilds

      protected int getFullHeightChilds()