Class SortableGridComponents

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, AjaxableComponent, Badgeable, ValueValidator, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable
Direct Known Subclasses:
SortableGenericGridComponents, SortableListComponents

@Component public class SortableGridComponents extends Control implements ValueValidator, AjaxableComponent
See Also:
  • Field Details

    • TOOLTIP_ATTRIBUTE

      protected static final String TOOLTIP_ATTRIBUTE
      See Also:
    • TABINDEX_ATTRIBUTE

      protected static final String TABINDEX_ATTRIBUTE
      See Also:
    • CURSOR_POINTER_CSS_ATTRIBUTE

      protected static final String CURSOR_POINTER_CSS_ATTRIBUTE
      See Also:
    • ff

      protected ForeignField ff
    • l

      protected Layout l
    • columns

      protected int columns
    • rows

      protected int rows
    • maxRows

      protected Integer maxRows
    • minRows

      protected Integer minRows
    • fullSize

      protected boolean fullSize
    • isForResponsiveGridFrame

      protected boolean isForResponsiveGridFrame
    • width

      protected int width
    • height

      protected int height
    • minWidth

      protected int minWidth
    • minHeight

      protected int minHeight
    • componentsAttributes

      protected Map<String,Map<String,Serializable>> componentsAttributes
    • dragAndDrop

      protected boolean dragAndDrop
    • resizableItems

      protected boolean resizableItems
    • editableItems

      protected boolean editableItems
    • hideableItems

      protected boolean hideableItems
    • verifyImportantFields

      protected boolean verifyImportantFields
    • restoreEvent

      protected String restoreEvent
    • tempComponentVisibility

      protected Collection<String> tempComponentVisibility
    • fixedComponents

      protected Collection<String> fixedComponents
  • Constructor Details

    • SortableGridComponents

      public SortableGridComponents()
  • Method Details

    • setTempComponentVisibility

      public void setTempComponentVisibility(Collection<String> tempComponentVisibility)
      Sets the temporary component visibility set that will be used to display the component with their visibility without change the real visibility of the component on the Form.
      Parameters:
      tempComponentVisibility - the temporary component visibility Set
    • clearTempComponentVisibility

      public void clearTempComponentVisibility()
      Clear the temporary component visibility map that will be used to display the component with their visibility without change the real visibility of the component on the Form.
    • setFixedComponents

      public void setFixedComponents(Collection<String> fixedComponents)
      Sets the fixed components set that will be used to display the items into the sortable grid with a specific graphic in order to let the user knows that component is fixed in the current layout saved on db (for the user customization)
      Parameters:
      fixedComponents - the fixed components set to set
    • setNAME

      public void setNAME(String s)
      Description copied from class: Component
      Sets the name of the component.
      During the submit actions, the Input objects depends on the value of this attribute to add the parameter at the form values; for this reason, this attribute is mandatory for every Input component
      Overrides:
      setNAME in class Component
      Parameters:
      s - The name of the component, used for the submit actions
    • setFULLSIZE

      public void setFULLSIZE(String s)
      Indicates if the component has to occupy all the available space in width
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setCOLUMNS

      public void setCOLUMNS(String columns)
      Sets the number of column for the grid.
      Parameters:
      columns - the number of rows for the grid.
    • setROWS

      public void setROWS(String rows)
      Sets the number of rows for the grid.
      Parameters:
      rows - the number of rows for the grid.
    • setMAXROWS

      public void setMAXROWS(String maxRows)
      Sets the maximun number of rows for the grid.
      Parameters:
      maxRows - the maximun number of rows for the grid.
    • setMINROWS

      public void setMINROWS(String minRows)
      Sets the minimum number of rows for the grid.
      Parameters:
      minRows - the minimum number of rows for the grid.
    • getWidth

      public int getWidth()
      Gets the width of the component.
      Returns:
      the width of the component.
    • setWIDTH

      public void setWIDTH(String s)
      Sets the width of the component.
      Parameters:
      s - the width of the component.
    • getHeight

      public int getHeight()
      Gets the height of the component.
      Returns:
      the height of the component.
    • setHEIGHT

      public void setHEIGHT(String s)
      Sets the height of the component.
      Parameters:
      s - the height of the component.
    • setMINHEIGHT

      public void setMINHEIGHT(String s)
      Sets the min height of the component.
      Parameters:
      s - the min height of the component.
    • setMINWIDTH

      public void setMINWIDTH(String s)
      Sets the min width of the component.
      Parameters:
      s - the min width of the component.
    • setDRAGANDDROP

      public void setDRAGANDDROP(String s)
      Sets if the drag and drop feature is enabled or not.
      Parameters:
      s - true if the drag and drop feature is enabled, false otherwise
    • setRESIZABLEITEMS

      public void setRESIZABLEITEMS(String s)
      Sets if the items resizable feature is enabled or not.
      Parameters:
      s - true if the items resizable feature is enabled, false otherwise
    • setVERIFYIMPORTANTFIELDS

      public void setVERIFYIMPORTANTFIELDS(String s)
      Sets if the sortable grid must verify if a component is important or not, in order to allow the user to hide/display the component.
      Parameters:
      s - true if the sortable grid must verify if a component is important or not, in order to allow the user to hide/display the component, false otherwise
    • isDragAndDropAllowed

      public boolean isDragAndDropAllowed()
      Gets if the drag and drop feature is enabled or not.
      Returns:
      true if the drag and drop feature is enabled, false otherwise
    • isResizableItemsAllowed

      public boolean isResizableItemsAllowed()
      Gets if the resizable feature is enabled or not.
      Returns:
      true if the resizable feature is enabled, false otherwise
    • mustVerifyImportantFields

      public boolean mustVerifyImportantFields()
      Gets if the sortable grid must verify if a component is important or not, in order to allow the user to hide/display the component.
      Returns:
      true if the sortable grid must verify if a component is important or not, in order to allow the user to hide/display the component., false otherwise
    • setEDITABLEITEMS

      public void setEDITABLEITEMS(String b)
      Sets if the feature to edit items properties is enabled or not.
      Parameters:
      b - true if the feature to edit items properties is enabled, false otherwise
    • setHIDEABLEITEMS

      public void setHIDEABLEITEMS(String b)
      Sets if the feature to change items visibility is enabled or not.
      Parameters:
      b - true if the feature to change items visibility is enabled, false otherwise
    • areItemsEditable

      public boolean areItemsEditable()
      Gets if it's possible to edit the items properties or not.
      Returns:
      true if it's possible to edit the items properties, false otherwise
    • areItemsHideable

      public boolean areItemsHideable()
      Gets if it's possible to change the items visibility or not.
      Returns:
      true if it's possible to change the items visibility, false otherwise
    • setRESTOREEVENT

      public void setRESTOREEVENT(String s)
      Sets the name of the event to call when user use the restore feature.
      Parameters:
      s - the name of the event to call when user use the restore feature.
    • setLayout

      public void setLayout(Layout l)
      Sets the Layout from which create the grid.
      Parameters:
      l - the Layout from which create the grid.
    • setComponentsAttributes

      public void setComponentsAttributes(Map<String,Map<String,Serializable>> map)
      Sets the Map of the components attributes user customization.
      This map will be used to define if a specific component must show the edit icon highlighted or not.
      Parameters:
      map - Sets the Map of the components attributes user customization.
    • setUnknownExtendedComponents

      public void setUnknownExtendedComponents(List<Component> components)
    • setOnTheFlyExtendedComponent

      public void setOnTheFlyExtendedComponent(Set<String> components)
    • getLayout

      public Layout getLayout()
      Gets the Layout from which create the grid.
      Returns:
      the Layout from which create the grid.
    • setIsForResponsiveGridFrame

      public void setIsForResponsiveGridFrame(boolean b)
      Sets if the sortable grid component it's working for responsiveGridFrame.
      For the ResponsiveGridFrame will not possible to add or remove columns due to avoid layouts columns inconsistency between ResponsiveGrids.
      Parameters:
      b - true, or false.
    • setSelectedComponent

      public void setSelectedComponent(String componentId)
      Sets the id of the component that is selected to edit its attributes.
      When a component is selected the attributes section of the configurability panel is visible, and it's possible to edit the attributes of the component. The item that represent the component into the SortableGridComponent is highlighted to make clear to the user which component he's editing.
      Parameters:
      componentId - the id of the component that is selected to edit its attributes.
    • setGridHasLayoutsChanges

      public void setGridHasLayoutsChanges(boolean gridHasLayoutsChanges)
    • setup

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

      protected void connect()
      Overrides:
      connect in class Component
    • registerValidators

      protected void registerValidators()
    • prepareName

      protected String prepareName()
    • prepareValue

      protected String prepareValue()
    • publish

      protected void publish(String name, String v)
    • 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
    • getFrameHtml

      public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change c, 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:
      c - 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
    • getColumnOuterContainer

      protected org.apache.ecs.Element getColumnOuterContainer(org.apache.ecs.Element sortableGridOuterContainer)
    • insertItemsInGrid

      protected void insertItemsInGrid(org.apache.ecs.html.Div gridContainer)
    • getExtendedIcon

      protected org.apache.ecs.html.Div getExtendedIcon(String content)
    • getManageVisibilityJSCallback

      protected String getManageVisibilityJSCallback()
    • getLabelForSortableItem

      public String getLabelForSortableItem(Component c)
    • getIcon

      protected IconHD getIcon(String icon, boolean isVisibilityIcon)
    • getLeftOptionButtonsSection

      protected org.apache.ecs.Element getLeftOptionButtonsSection()
    • getRightOptionButtonsSection

      protected org.apache.ecs.Element getRightOptionButtonsSection()
    • getManageShowsAllVisibilityJSCallback

      protected String getManageShowsAllVisibilityJSCallback()
    • getManageHideAllVisibilityJSCallback

      protected String getManageHideAllVisibilityJSCallback()
    • createOptionButton

      protected org.apache.ecs.Element createOptionButton(Icon icon, String tooltip, String onclick, String id)
    • 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
    • validateValue

      public void validateValue(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Description copied from interface: ValueValidator
      Makes the validation to avoid tampering values of a component and it's value.
      When a submit event to the server is triggered, is checked that the component is in the validator set, the value is not changed (if the component is RO), the value is changed with an allow value ecc ecc.
      Specified by:
      validateValue in interface ValueValidator
      Parameters:
      name - The name associated to the component to validate.
      value - The value to validate
      strong - Defines if the validation must be strong or not (for not null component).
      arriving - A Map with all the components (and their values) arriving from submit.
      Throws:
      ValidationException - Raised if the validation failed.
    • validateUnchangingValue

      protected void validateUnchangingValue(String name, Object value, Object published) throws ValidationException
      Throws:
      ValidationException
    • getCorrectImportantTooltip

      protected String getCorrectImportantTooltip(Component c, boolean isImportantComponent)
    • 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