Class TableView

All Implemented Interfaces:
Serializable, EntityContainer, overit.geocall.clipboard.XClip, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, AjaxableComponent, Badgeable, DBViewManager, DraggableDroppable, Hideable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable
Direct Known Subclasses:
ResourceView, ServerTableView, TableViewDD, overit.geocallapp.wfm.ui.container.TreeModelTableView, TVGanttTest

@Component public class TableView extends Container implements DBViewManager, Hideable, AjaxableComponent, DraggableDroppable, overit.geocall.clipboard.XClip, Serializable, EntityContainer
The class extends Container and implements a table, the user interface element that allows to arranges the data in tabular format and manages the behaviors of the child components, that are mainly columns and some particular kind of buttons.
The TableView keeps all its data in memory, so it can be considered as a "client" component and must be used when the amount of data is not excessive.
The ServerTableView (that is an extension of the TableView) it's the "server" component that, in addition to the functionalities of the TableView, don't keeps all the data in memory but load the data on demand. Furthermore the ServerTableView, being managed on server side, provides a whole series of additional interactions and better user interface behaviours that make it the right object to use in all cases, both when the data is loaded in memory, and when they are saved in database and loaded on demand.
See Also:
GCApi:
component
  • Field Details

    • TABLE_OBJ_TEMP_PREFIX

      public static final String TABLE_OBJ_TEMP_PREFIX
      See Also:
    • TABLE_WIDGET_STATE_CLASS

      public static final String TABLE_WIDGET_STATE_CLASS
      See Also:
    • TABLE_WIDGET_ATTRIBUTES_OBJECT

      public static final String TABLE_WIDGET_ATTRIBUTES_OBJECT
      See Also:
    • TABLE_FIELDS_OBJECT_NAME

      public static final String TABLE_FIELDS_OBJECT_NAME
      See Also:
    • PARAM_KEY

      public static final String PARAM_KEY
      See Also:
    • TABLE_CONFIGURABILITY_PANEL_PATH

      public static final String TABLE_CONFIGURABILITY_PANEL_PATH
      See Also:
    • NOT_IDENTIFIED_COLUMN_PLACEHOLDER

      public static final String NOT_IDENTIFIED_COLUMN_PLACEHOLDER
      See Also:
    • _dbv

      protected DBView _dbv
    • _changedMetaData

      protected boolean _changedMetaData
    • _columns

      protected Column[] _columns
    • _columnsOrigin

      protected Column[] _columnsOrigin
    • _alTableMessages

      protected ArrayList _alTableMessages
    • _alRowMessages

      protected ArrayList _alRowMessages
    • _alTableOrders

      protected ArrayList _alTableOrders
    • _from

      protected int _from
    • _to

      protected int _to
    • _query

      protected int _query
    • _fullsize

      protected boolean _fullsize
    • _rows

      protected int _rows
    • configurableRows

      protected Set<Integer> configurableRows
    • _page

      protected int _page
    • _begin

      protected int _begin
    • _end

      protected int _end
    • _forceFirstPage

      protected int _forceFirstPage
    • _footerLastRow

      protected boolean _footerLastRow
      Uesed to define wheter the footer is positioned immediatly after the last row of the active page.
    • _activeMode

      protected String _activeMode
      Used to store the active ordering on the content
    • _requestedMode

      protected String _requestedMode
      Support variable used to request a setMODE even when there is a repopulation of the data
    • _visible

      protected SetPredicate _visible
    • _selectname

      protected String _selectname
    • _selectset

      protected boolean _selectset
    • _cutname

      protected String _cutname
    • _selection

      protected TableView.Selection _selection
    • _cutting

      protected TableView.Selection _cutting
    • _selectionRow

      protected HashGetter _selectionRow
      Used to manage the cut and paste operations when there isn't a selection enabled
    • _cuttingRow

      protected HashGetter _cuttingRow
    • _xclass

      protected String _xclass
      Filter attribute used in copy and paste and drag and drop actions. We can paste / drop the content only if the origin object has the same xclass of the destination object
    • _lastSelected

      protected int _lastSelected
    • _event

      protected String _event
    • _event2

      protected String _event2
    • _eventr

      protected String _eventr
    • _msg

      protected String _msg
    • _msg2

      protected String _msg2
    • _msgr

      protected String _msgr
    • _param

      protected String _param
    • _param2

      protected String _param2
    • _paramr

      protected String _paramr
    • _eventmode

      protected String _eventmode
    • _bkgColorName

      protected String _bkgColorName
    • _bkgColorSwitch

      protected String _bkgColorSwitch
    • _height

      protected int _height
    • _anchor

      protected String _anchor
    • _footerValues

      protected HashGetter _footerValues
    • _titleFormat

      protected MapFormat _titleFormat
    • _somethingHidden

      protected boolean _somethingHidden
    • _hiddenCols

      protected HashSet<String> _hiddenCols
    • hiddenProfileCols

      protected HashSet<String> hiddenProfileCols
    • _someThingDraggable

      protected boolean _someThingDraggable
    • _advancedLayout

      protected boolean _advancedLayout
    • _draggable

      protected String _draggable
    • _droppable

      protected String _droppable
    • _contentFrame

      protected boolean _contentFrame
    • _minWidth

      protected int _minWidth
    • editable

      protected boolean editable
    • extensionTabIndex

      protected int extensionTabIndex
  • Constructor Details

    • TableView

      public TableView()
      Creates a new instance of TableView
    • TableView

      public TableView(overit.geocall.ux.configurability.UiPropertiesConfigurabilityService uiPropertiesConfigurabilityService, overit.geocall.ux.configurability.ConfigurabilityService configurabilityService, overit.geocall.ux.edm.ComponentCreator componentCreator, overit.geocall.ux.configurability.ConfigurabilityUtilsService configurabilityUtilsService)
  • Method Details

    • setFooterValues

      public void setFooterValues(HashGetter hg)
      Sets the HashGetter that contains the footer values (usually the totals) of the table
      Parameters:
      hg - The map that contains the footer values of the table
    • setANCHOR

      public void setANCHOR(String s)
      Adds the anchor html attribute to the table
      Parameters:
      s - The string that defines the value of the anchor attribute
    • setPARAM

      public void setPARAM(String s)
      Sets the parameter that will be passed to the event (setEVENT(s)) triggered when the user click (touch) over a record of the table
      Parameters:
      s - The parameter passed to the event
    • setPARAM2

      public void setPARAM2(String s)
      Sets the parameter that will be passed to the event (setEVENT2(s)) triggered when the user makes a double click (double touch) over a record of the table
      Parameters:
      s - The parameter passed to the event
    • setPARAMR

      public void setPARAMR(String s)
      Sets the parameter that will be passed to the event (setEVENTR(s)) triggered when the user makes a right click (in touch devices that is mapped in a longpress) over a record of the table
      Parameters:
      s - The parameter passed to the event
    • setHEIGHT

      public void setHEIGHT(String s)
      Sets the height of the table.
      If the total number of the rows cannot be entirely displayed by the given height, it will appear a scrollbar.
      Use this method as an alternative to setROWS() which instead is used to set the number of rows to be displayed
      Parameters:
      s - The height, expressed in pixels
    • setXCLASS

      public void setXCLASS(String xclass)
      Sets a particular xclass to the table; this string is used to limit the operations of copy / cut / paste / drag / drop that can be executed only between objects that have the same xclass attribute. If no value is specified, there aren't restriction imposed; otherwise a value can be pasted / dropped on the table only if the source component has the same xclass value
      Parameters:
      xclass - The string that defines the xclass for the table
    • setENTITY

      public void setENTITY(@NotNull @NotNull String s)
      Sets the entities related to this grid
      Parameters:
      s - The list of the entities separated by a comma
    • collectEntities

      public void collectEntities(String[] entities)
      Description copied from interface: EntityContainer
      Collects all the entities related to the container
      Specified by:
      collectEntities in interface EntityContainer
      Parameters:
      entities - The entities to collect
    • getEntityValidator

      public EntityValidator getEntityValidator()
      Description copied from interface: EntityContainer
      Gets the EntityValidator related to the container.
      Specified by:
      getEntityValidator in interface EntityContainer
      Returns:
      The EntityValidator related to the container.
    • getEntities

      public Set<String> getEntities()
      Gets the list of the entities related to the grid.
      Specified by:
      getEntities in interface EntityContainer
      Returns:
      the list of the entities related to the grid.
    • setup

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

      protected void setupSelection()
    • setDRAGGABLE

      public void setDRAGGABLE(String s)
      Specifies if the rows of the table (and therefore all their values) can be dragged to another (droppable) component
      Parameters:
      s - A string that defines if the rows of the table are draggable, and the behavior of the dragging. The possible accepted values are:
      "+" the drag operation copies the row values;
      "-" the drag operation removes the row from the table;
      "+-" the drag operation copies or removes the rows depending on whether the CTRL key is pressed or not during the drag operation.
    • setDROPPABLE

      public void setDROPPABLE(String s)
      Specifies if the user can drop some values from another (draggable) component into the table
      Parameters:
      s - A string that defines if the table accepts the drop of values from another component. The possible value are:
      "table": it is possible to drop on the table's header or on the body of the table (but not on a row, i.e. when the table is empty). The dragged component will be added as last row of the table. "row": it is possible to drop on the table's rows. The dragged component will be added before the row over which the mouse is positioned at the moment of the drop
    • setFULLSIZE

      public void setFULLSIZE(String s)
      Indicates if the table 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
    • setVISIBLE

      public void setVISIBLE(String s)
      Defines if the table should be rendered or not
      Specified by:
      setVISIBLE in interface Hideable
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0") or a function.
      If the string is not recognized as a boolean value, it is considered as a user function with this meaning: if the user currently logged in the application has the function, the table will be rendered, otherwise it will not
    • isVisible

      public boolean isVisible()
      Checks if the table is rendered for the user currently logged in the application, or not (see getBoolean(visible,id,true))
      Specified by:
      isVisible in interface Hideable
      Returns:
      true if the table is visible, false otherwise
    • setSELECTNAME

      public void setSELECTNAME(String s)
      Sets the column name that will be used in the rows selection mechanism of the table.
      The meaning of this attribute depends on the value assigned to the selectset variable, with setSELECTSET.
      If selectset is true, the string passed as parameter to this method should contains the name of the column used to decide which record select; for this reason, the field must be a key field (usually the ID field), which identificate uniquely one record among the others, to prevent unwanted multiple selection with a single choice.
      If selectset is false, the string contains the name of a column to which can be assigned boolean values only (true if the record is selected, false otherwise). In this case te selection depends on the boolean value of the column, i.e. if the value is true the row is selected.
      Parameters:
      s - The name of a column of the table
    • getSELECTNAME

      public String getSELECTNAME()
      Returns the name of the column used by the row selection mechanism of the table
      Returns:
      The name of the column of the table used by the selection mechanism
    • setSELECTSET

      public void setSELECTSET(String s)
      Enables or not the selection of a row using an index column rather than a boolean column that maintains the selection status of the row. The column to be used for selection is defined with setSELECTNAME(s)
      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 false
    • setCUTNAME

      public void setCUTNAME(String s)
      Sets the column name used to decide which record cut. If not specified, the column is the same to the one used for the selection (see setSELECTNAME(s))
      Parameters:
      s - The name of a column of the table
    • getCUTNAME

      public String getCUTNAME()
      Returns the name of the column used by the cut mechanism of the table
      Returns:
      The name of the column of the table used by the cutting mechanism
    • isSelectSet

      public boolean isSelectSet()
      Checks if the selection mechanism uses a selectset or not (see setSELECTSET())
      Returns:
      true if the selection mechanism uses a selectset, false otherwise
    • isCutSet

      public boolean isCutSet()
      Checks if the cutting mechanism uses a selectset or not (see setSELECTSET())
      Returns:
      true if the cutting mechanism uses a selectset, false otherwise
    • setEVENTMODE

      public void setEVENTMODE(String s)
      Defines the behaviour of the events set with setEVENT(s), setEVENT2(s), setEVENTR(s). In particular with this method it is possible to specify wheter the event affects the entire rows or the single cells.
      The possible values are:
      "row": the event receives an integere parameter "row", that indicates the number of the clicked row "cell": the event receives an integer parameter "row" that indicates the number of the clicked row and a string parameter "column" that indicates the name of the clicked column
      Parameters:
      s - One chosen from the strings "row" or "cell"
    • setEVENT

      public void setEVENT(String s)
      Sets the string that contains the name of the event that will be triggered when the user makes a left click (or single touch) on a table's row
      Parameters:
      s - The name of the event
    • setEVENT2

      public void setEVENT2(String s)
      Sets the string that contains the name of the event that will be triggered when the user makes a double click (or double touch) on a table's row
      Parameters:
      s - The name of the event
    • setEVENTR

      public void setEVENTR(String s)
      Sets the string that contains the name of the event that will be triggered when the user makes a right click (or a longpress on touch devices) on a table's row
      Parameters:
      s - The name of the event
    • setMSG

      public void setMSG(String s)
      Sets the message that appear when is triggered the event associated to the click (touch) over a record of the table (see setEVENT())
      Parameters:
      s - The message that will appear before the execution of the event
    • setMSG2

      public void setMSG2(String s)
      Sets the message that appear when is triggered the event associated to the double click (double touch) over a record of the table (see setEVENT2())
      Parameters:
      s - The message that will appear before the execution of the event
    • setMSGR

      public void setMSGR(String s)
      Sets the message that appear when is triggered the event associated to the right click (longpress on touch devices) over a record of the table (see setEVENTR())
      Parameters:
      s - The message that will appear before the execution of the event
    • setMODE

      public void setMODE(String s)
      Defines the initial sorting of the data of the table.
      It is possible to indicate the name of the field used to sort all the records in ascending or descending order and can be obtained even a sorting on multiple fields.
      Parameters:
      s - The name of a single column to obtain an ascending order based on that field (for example "AUSEID").
      The name of a single column preceded by the exclamation mark to obtain a descending order based on that column (for example "!AUSEID").
      A comma separated list of column names to obtain a sorting on multiple fields (for example "AUTESURNAME,!AUTENAME").
    • setROWS

      public void setROWS(String s)
      Sets the number of the rows of the table to be displayed.
      If the total number of rows in the table is greater than the number of rows set by this method, the table will be paginated and will appear the arrows with the possibility to browse through the pages.
      If the table is paginated, it is possible to define multiple values for the number of rows to be displayed for every page, using the comma as separator. Defining multiple values will allow the user to select the number of rows to be displayed for each page at runtime. Use this method as an alternative to setHEIGHT() which instead is used to set the height of the table, expressed in pixel
      Parameters:
      s - The number of rows to be displayed (on every page)
    • setBKGCOLORNAME

      public void setBKGCOLORNAME(String s)
      Sets the column name used to define the background color of the rows of the table.
      If it is not defined a value for the bkgColorSwitch attribute (see setBKGCOLORSWITCH()), the background color of the column is defined by the value contained in the column set by this method (the value must be compliant to css color rules). Otherwise the color is defined based on the decoding of the value of the bkgColorSwitch attribute
      Parameters:
      s - The name of the column used to select the background color
    • setBKGCOLORSWITCH

      public void setBKGCOLORSWITCH(String s)
      Defines the coding of a value taken by the column (whose name corresponds to the one indicated in the bkgColorName attribute (see setBKGCOLORNAME())) in the corresponding color.
      Parameters:
      s - The parameter must be compliant to this format: "value,color,value,color,..." where value is a possible value of the field, and color is the corresponding color. Here are some usage examples:
      "1,#FF0000,2,#00FF002": if the value of the field defined in bkgColorName is equals to 1, then the background color will be #FF0000. Otherwise if it's equals to 2, then the color will be #00FF00
      "1,red,,blue": if the value of the field defined in bkgColorName is equals to 1, then the background color will be red, otherwise will be blue
      "1,red,0,": if the value of the field defined in bkgColorName is equals to 1, then the background color will be red, otherwise if it's 0, no color will be applied
    • setTITLEFORMAT

      public void setTITLEFORMAT(String s)
      Sets the title to show when the mouse is placed over a row of the table. It is possible to compose static titles or dynamic ones (using the MapFormat mechanism, so adding the name of the desired columns enclosed in braces). It is also possible use html code paying attention to write special characters (like <,>,&, etc.) using the html coding (>,<,&, etc.).
      Parameters:
      s - The string tho show. Example: "{AUSEID} - Username: {AUSEUSERNAME}"
    • setCONTENTFRAME

      public void setCONTENTFRAME(String s)
      Enables or not the horizontal scroll of the table's content when it is wider than the available space.
      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 false
    • setMINWIDTH

      public void setMINWIDTH(String s)
      Number indicating the table’s minimum width (in pixel).
      Parameters:
      s - The minimum width of the table
    • setEDITABLE

      public void setEDITABLE(String s)
      Enables or disables the possibility to edit the table. When set to false, the edit icons (configurability icon and column visibility icon) will not appear.
      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 true (default)
    • setSelectSet

      public void setSelectSet(Set s)
      Forcibly sets a selectSet
      Parameters:
      s - The set of the selected rows
    • getSelection

      public TableView.Selection getSelection()
      Returns the specific selection TableView.Selection for this table, the object that manages the selection mechanism
      Returns:
      The object that manages the selection of the rows of the table
    • getCutting

      public TableView.Selection getCutting()
      Returns the specific cutting TableView.Selection for this table, the object that manages the cutting mechanism
      Returns:
      The object that manages the cutting of the rows of the table
    • getSelectSet

      public Set getSelectSet()
      Returns the selectSet
      Returns:
      The Set of the selected rows of the table, or null if there isn't a selection
    • getCutSet

      public Set getCutSet()
      Returns the Set of the cutted rows of the table
      Returns:
      The Set of the cutted rows of the table, or null if there aren't cutted rows
    • getStateConf

      protected State.Conf getStateConf()
    • getProfileStateConf

      protected State.Conf getProfileStateConf()
    • getStateConfFields

      protected State.Conf getStateConfFields()
    • getProfileStateConfFields

      protected State.Conf getProfileStateConfFields()
    • getStateConfAttributes

      protected State.Conf getStateConfAttributes()
    • setFOOTERLASTROW

      public void setFOOTERLASTROW(String s)
      Sets if the footer must be positioned on the bottom of the table or not.
      Parameters:
      s - true if the footer must be positioned on the bottom, false otherwise.
    • getFOOTERLASTROW

      public boolean getFOOTERLASTROW()
      Gets if the footer must be positioned on the bottom of the table, or not.
      The default value is false so the footer will be placed on the bottom unless differently specified.
      Returns:
      true if the footer must be positioned on the bottom, false otherwise.
    • onOpen

      public void onOpen(Object o)
      Description copied from class: Container
      Method called when is executed the WindowManager.push(overit.geocall.basic.ui.Window, java.lang.Object) of the Window that contains the Container. It calls the onOpen(o) method of all the Container's childrens.
      If a page is opened through the process of a route, it is possible that the route was called with params to pass to the page.
      The route params could be passed specifying them like query string's param on the url, using commas or the '=' character, to separate the keys and the values. Valid syntaxs are: "&params=KEY1,VAL1,KEY2,VAL2" or "&params=KEY1=VAL1,KEY2=VAL2"
      In that case it is possible to retrieve those params via the WindowManager.getRouteParams() method that returns an HashGetter with the params passed as parameters.
      For example it's possible to retrieve and use the params in this way: HashGetter hg = getWM().getRouteParams();
      String val1 = hg.getString("key1",null);
      String val2 = hg.getString("key2",null);
      Overrides:
      onOpen in class Container
      Parameters:
      o - Object received from the caller
    • setupTableColumns

      public void setupTableColumns()
    • getFieldsProfileVisibilityList

      public List<String> getFieldsProfileVisibilityList()
    • getFieldsUserVisibilityList

      public List<String> getFieldsUserVisibilityList()
    • setDBView

      public void setDBView(DBView dbv)
      Sets the DBView, i.e. the logical view of a portion of a database table usually obtained as a result of a query and manteined in memory, to the TableView.
      Implements the DBViewManager interface.
      Specified by:
      setDBView in interface DBViewManager
      Parameters:
      dbv - The DBView that we want to set to the table
    • getDBView

      public DBView getDBView()
      Returns the DBView of the table
      Specified by:
      getDBView in interface DBViewManager
      Returns:
      The DBView associated to the table
    • setFROM

      public void setFROM(int i)
      Sets the index of the first record to show. This attribute is effective only in a paginated table.
      Specified by:
      setFROM in interface DBViewManager
      Parameters:
      i - The index of the first record to show
    • setTO

      public void setTO(int i)
      Sets the index of the last record to show. This attribute is effective only in a paginated table.
      Specified by:
      setTO in interface DBViewManager
      Parameters:
      i - The index of the last record to show
    • getCurrentPage

      public int getCurrentPage()
      Returns the current shown page of a paginated table
      Returns:
      The index of the current page
    • needsNavBar

      protected boolean needsNavBar(int pages)
    • getNavBarHtml

      protected org.apache.ecs.Element getNavBarHtml(EntitySet es, int pages, int page)
    • getNavBar

      protected org.apache.ecs.Element getNavBar(EntitySet es, int n, int pages)
    • addPageSizeLookup

      protected void addPageSizeLookup(org.apache.ecs.html.Div d)
    • getPage

      protected org.apache.ecs.Element getPage(EntitySet es, int n, int pages)
    • getRows

      @Deprecated protected List<org.apache.ecs.Element> getRows(EntitySet es, int begin, int end, Boolean someThingDraggable)
      Parameters:
      es - The EntitySet
      begin - The begin of the row
      end - The end of the row
      someThingDraggable - Boolean indicating is something is draggable
      Returns:
      A list of the element of the rows
    • getRows

      protected List<org.apache.ecs.Element> getRows(EntitySet es, int begin, int end)
    • getExtensionRow

      protected org.apache.ecs.Element getExtensionRow(int end)
    • getTitle

      protected String getTitle(ArrayList al)
    • getTR

      protected org.apache.ecs.html.TR getTR(EntitySet es, int row, int pagerow, ArrayList al, boolean selected)
    • setupMetaData

      public void setupMetaData(DBView dbv)
      Called to init all the field starting form the DBView. Setup the Selection, sets the value of the position of the column used to select and the field position.
      Parameters:
      dbv - The DBView used to populate all the field
    • onBodyClick

      protected void onBodyClick(org.apache.ecs.html.Div d)
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Returns the html code of the table
      Overrides:
      getHtml in class Container
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the table
    • changed

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

      public overit.geocall.ux.servlet.processor.Change getDefaultChange()
      Defines the default Change object for the table.
      Implements the AjaxableComponent interface.
      Specified by:
      getDefaultChange in interface AjaxableComponent
      Returns:
      The default Change object that defines the default morphing type of the table
    • getFrameHtml

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

      public boolean getRo()
      Returns the boolean value that indicates if the table is in readonly state
      Specified by:
      getRo in interface DBViewManager
      Returns:
      true if the table is in readonly state, false otherwise
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Every component can add a script to the StringBuilder, script executed when the component is created The method add the script that manage the creation of the pages of the table
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • buildLoadPageScript

      protected void buildLoadPageScript(StringBuilder sb)
    • buildDisplayScript

      public void buildDisplayScript(StringBuilder sb)
      Every component can add a script to the StringBuilder, script executed when the component is displayed The method add the script that manage the position of the scrollbar of the table
      Overrides:
      buildDisplayScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • buildScrollTopScript

      @Deprecated protected void buildScrollTopScript(StringBuilder sb)
      Deprecated.
      Don't use this method, use buildScrollScript(StringBuilder) instead.
      Don't use this method, use buildScrollScript(StringBuilder) instead.
      Parameters:
      sb - Don't use this method, use buildScrollScript(StringBuilder) instead.
    • buildScrollScript

      protected void buildScrollScript(StringBuilder sb)
    • buildStuckScript

      protected void buildStuckScript(StringBuilder sb)
    • setRo

      public void setRo(boolean ro)
      Sets the readonly state of the table
      Specified by:
      setRo in interface DBViewManager
      Parameters:
      ro - true if the table must be in readonly state, false otherwise
    • setMsg

      public void setMsg(String s)
      Sets the message that appear when is triggered the event associated to the click (touch) over a record of the table (see setEVENT())
      Parameters:
      s - The message that will appear before the execution of the event
    • setMsg2

      public void setMsg2(String s)
      Sets the message that appear when is triggered the event associated to the double click (double touch) over a record of the table (see setEVENT2())
      Parameters:
      s - The message that will appear before the execution of the event
    • setMsgR

      public void setMsgR(String s)
      Sets the message that appear when is triggered the event associated to the right click (longpress on touch devices) over a record of the table (see setEVENTR())
      Parameters:
      s - The message that will appear before the execution of the event
    • onSelect

      @Deprecated public boolean onSelect(Object o)
      Deprecated.
      Use onSelect(uim) instead
      Parameters:
      o - Use onSelect(uim) instead
      Returns:
      Use onSelect(uim) instead
    • onSelect

      public boolean onSelect(UIMessage uim)
      Makes a multiple selection of the rows of the table. It is the "classical" selection method. Using this method, on every click on a record, the corresponding row it's added to the Set of the selected rows. If the user is pressing the SHIFT button during the selection (during the click), it is performed a range multiple selection.
      Parameters:
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • onAutoSelect

      public boolean onAutoSelect(UIMessage uim)
      Makes an enhanced selection of the rows of the table. Using this method, every click is considered as a single selection, so on every click the Set of selected rows contains only one element, i.e. the current selected element. If the user is pressing the CTRL button during the selection (during the click), it is performed a multiple selection, so the row clicked in this case is added to the Set of the selected ones. If the user is pressing the SHIFT button during the selection (during the click), it is performed a range multiple selection.
      Parameters:
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • chooseSelectAction

      protected void chooseSelectAction(UIMessage uim, boolean auto)
      Chooses the selection type
      Parameters:
      uim - The UIMessage that contains values, parameters and control values
      auto - Defines the use of the new method (multiple with control keys) or the old one
    • onSingleSelect

      @Deprecated public boolean onSingleSelect(Object o)
      Deprecated.
      Makes a single selection of the rows of the table. Using this method, every click is considered as a single selection, so on every click the Set of selected rows contains only one element, i.e. the current selected element.
      Parameters:
      o - The map that contains the number of the selected row
      Returns:
      false
    • onSingleSelect

      public boolean onSingleSelect(UIMessage uim)
      Makes a single selection of the rows of the table. Using this method, every click is considered as a single selection, so on every click the Set of selected rows contains only one element, i.e. the current selected element.
      Parameters:
      uim - The map that contains the number of the selected row
      Returns:
      false
    • selectAction

      protected boolean selectAction(int row, boolean shift, boolean ctrl)
      Does the selection
      Parameters:
      row - Number of the selected row
      shift - true if the shift button was pressed during the selection, false otherwise
      ctrl - true if the ctrl button was pressed during the selection, false otherwise
      Returns:
      true if something is changed, false otherwise
    • onSelectAll

      public boolean onSelectAll(Object o)
      Selects all the rows of the table (usually used in association with a TableButton)
      Parameters:
      o - Not used
      Returns:
      false
    • onSelectTable

      public boolean onSelectTable(Object o)
    • onSelectNone

      public boolean onSelectNone(Object o)
      Deselects all the rows of the table (usually used in association with a TableButton)
      Parameters:
      o - Not used
      Returns:
      false
    • onOrder

      public boolean onOrder(HashGetter hg)
      Orders the data of the table (see setMode())
      Parameters:
      hg - The map used to retrieve the parameter for the setMode() event
      Returns:
      true
    • getMode

      public String getMode()
      Returns the current active mode of the table (see setMode(mode))
      Specified by:
      getMode in interface DBViewManager
      Returns:
      The string that defines the current active mode of the table
    • setMode

      public void setMode(String mode)
      Defines the sorting of the data of the table.
      It is possible to indicate the name of the field used to sort all the records in ascending or descending order and can be obtained even a sorting on multiple fields.
      Specified by:
      setMode in interface DBViewManager
      Parameters:
      mode - The name of a single column to obtain an ascending order based on that field (for example "AUSEID").
      The name of a single column preceded by the exclamation mark to obtain a descending order based on that column (for example "!AUSEID").
      A comma separated list of column names to obtain a sorting on multiple fields (for example "AUTESURNAME,!AUTENAME").
      A null value will reset the sorting.
    • changedMetaData

      public boolean changedMetaData()
      Specified by:
      changedMetaData in interface DBViewManager
    • getCaption

      protected org.apache.ecs.Element getCaption(EntitySet es)
    • hasTableOrders

      protected boolean hasTableOrders()
    • clickOnControlMenu

      protected boolean clickOnControlMenu()
    • clickOnControlLightMenu

      protected boolean clickOnControlLightMenu()
    • getDropDownMenu

      protected org.apache.ecs.Element getDropDownMenu(EntitySet es)
    • onControlMenu

      public boolean onControlMenu(UIMessage hg)
      Creates the column control menu, the menu that appear when the user click on the icon in the upper left corner of the table and it can be used to rearrange the visibility and the position of the columns
      Parameters:
      hg - Not used
      Returns:
      true
    • onControlLightMenu

      public boolean onControlLightMenu(UIMessage uim)
    • onSaveLightTableCustomization

      public boolean onSaveLightTableCustomization(UIMessage uim)
    • onTableOrdersMenu

      public boolean onTableOrdersMenu(HashGetter hg)
      Creates the menu that is used to sort the data of the table (see TableOrder); there will be one row for every function enabled TableOrder item
      Parameters:
      hg - Not used
      Returns:
      true
    • setupUserHiddenColumns

      protected void setupUserHiddenColumns()
    • onOpenPage

      public boolean onOpenPage(Object o)
      Manages the event of opening a page
      Parameters:
      o - HashGetter with the param of the row
      Returns:
      false
    • getColumnByName

      public Column getColumnByName(String name)
    • getColumnByLayoutName

      public Column getColumnByLayoutName(String name)
    • dragDrop

      public void dragDrop(DragDrop.Part source, DragDrop.Part destination, boolean moving)
      Implements the operation of drag and drop on the same table (DraggableDroppable interface)
      Specified by:
      dragDrop in interface DraggableDroppable
      Parameters:
      source - The source object, from where we are dragging
      destination - The destination object, where we are dropping
      moving - true if the operation removes the values dragged from the source (like a cut operation), false otherwise (like a copy operation)
    • drag

      public Object drag(DragDrop.Part source) throws DragDropException
      Implements the operation of drag from the table (implements the DraggableDroppable)
      Specified by:
      drag in interface DraggableDroppable
      Parameters:
      source - The table element from which we are dragging
      Returns:
      null
      Throws:
      DragDropException - If an error occurs during the drag operation, a DragDropException is raised
    • drop

      public Object drop(DragDrop.Part source, DragDrop.Part destination, Object toDrop) throws DragDropException
      Implements the operation of drop on the table (implements the DraggableDroppable interface)
      Specified by:
      drop in interface DraggableDroppable
      Parameters:
      source - The source object from which we are dragging
      destination - The destination object, the table element on which we are dropping
      toDrop - The object that we want to drop on the table
      Returns:
      The object dropped, or null if the operation of drop is not possible
      Throws:
      DragDropException - If an error occurs during the drop operation, a DragDropException is raised
    • dragged

      public void dragged(DragDrop.Part source, DragDrop.Part destination, Object dragged, boolean moved) throws DragDropException
      Called when the object is dropped (implements the DraggableDroppable interface)
      Specified by:
      dragged in interface DraggableDroppable
      Parameters:
      source - The source object, from which we are dragging
      destination - The destination object, the table element on which we are dropping
      dragged - The object that we want to drop on the table
      moved - true if the operation removes the values dragged from the source (like a cut operation), false otherwise (like a copy operation)
      Throws:
      DragDropException - f an error occurs during the operation, a DragDropException is raised
    • getSelectionSize

      public int getSelectionSize()
      Returns the number of the rows currently selected on the table
      Returns:
      The number of the rows currently selected
    • getCuttingSize

      public int getCuttingSize()
      Returns the number of the rows currently cutted on the table
      Returns:
      The number of the rows currently cutted
    • isSelected

      public boolean isSelected(int row)
      Checks if a row is currently selected
      Parameters:
      row - The number of the row
      Returns:
      true if the row is selected, false otherwise
    • isCutted

      public boolean isCutted(int row)
      Checks if a row is currently cutted
      Parameters:
      row - The number of the row
      Returns:
      true if the row is cutted, false otherwise
    • onCopy

      @Deprecated public boolean onCopy(Object o)
      Deprecated.
      Parameters:
      o - Use onCopy(uim)
      Returns:
      Use onCopy(uim)
    • onCopy

      public boolean onCopy(UIMessage uim)
      Copies a row of the table (see XBoard)
      Parameters:
      uim - UIMessage containing the row to copy
      Returns:
      false
    • doCopy

      protected boolean doCopy(int row, UIMessage uim)
      Copies a row of the table (see XBoard)
      Parameters:
      row - The number of the row to copy
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • onCut

      @Deprecated public boolean onCut(Object o)
      Deprecated.
      Parameters:
      o - Use onCut(uim)
      Returns:
      Use onCut(uim)
    • onCut

      public boolean onCut(UIMessage uim)
      Cuts a row of the table (see XBoard)
      Parameters:
      uim - UIMessage containing the row to cut
      Returns:
      false
    • doCut

      protected boolean doCut(int row, UIMessage uim)
      Cuts a row of the table (see XBoard)
      Parameters:
      row - The number of the row to cut
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • onPaste

      @Deprecated public boolean onPaste(Object o)
      Deprecated.
      Parameters:
      o - Use onPaste(uim)
      Returns:
      Use onPaste(uim)
    • onPaste

      public boolean onPaste(UIMessage uim)
      Pastes a row on the table (see XBoard)
      Parameters:
      uim - UIMessage containing the row to paste
      Returns:
      false
    • doPaste

      protected boolean doPaste(int row, UIMessage uim)
      Pastes a row on the table (see XBoard)
      Parameters:
      row - The number of the row to paste
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • canPaste

      public boolean canPaste()
      Checks if the desired content can be pasted on the table (see setXCLASS(x) and XBoard)
      Returns:
      If it is possible to paste the desired content on this table
    • pasteContent

      protected ArrayList pasteContent(int row, Serializable s, boolean local)
    • onRemove

      @Deprecated public boolean onRemove(Object o)
      Deprecated.
      Parameters:
      o - Use onRemove(uim)
      Returns:
      Use onRemove(uim)
    • onRemove

      public boolean onRemove(UIMessage uim)
      Removes a row of the table
      Parameters:
      uim - UIMessage containing the row to remove
      Returns:
      false
    • doRemove

      protected boolean doRemove(int row, UIMessage uim)
      Removes a row of the table
      Parameters:
      row - The number of the row to remove
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • freeClip

      public void freeClip(boolean delete)
      Used in drop phase and manage the deletion of the record of the dbv if the drag operation was a cutting one.
      Implements the XClip interface
      Specified by:
      freeClip in interface overit.geocall.clipboard.XClip
      Parameters:
      delete - Boolean value that indicates if the deletion of the record must be performed
    • onToggle

      public boolean onToggle(UIMessage uim)
      Used in association with a ColumnBoolean, called when the user click on a boolean value of the column to switch from true to false and the other way around
      Parameters:
      uim - The UIMessage that contains values, parameters and control values, used to retrieve the clicked row, column, and boolean value
      Returns:
      false
    • onColumnMove

      public boolean onColumnMove(UIMessage uim)
      Changes the position of the columns of the table
      Parameters:
      uim - UIMessage with the parameters
      Returns:
      true
    • moveColumn

      protected boolean moveColumn(Column from, Column to, boolean after)
      Moves a column before or after another column
      Parameters:
      from - starting column
      to - destination column
      after - true to move the origin column after the destination one, false to move the origin column right before the destination one
      Returns:
      true if something was moved, false otherwise
    • updateStateConf

      protected void updateStateConf(Column from, Column to, boolean after)
    • findColumnGroup

      protected List<Column> findColumnGroup(Column col)
      Finds the column group of the one passed as parameter
      Parameters:
      col - Reference column from which to extract the group of (a group is a set of columns that share the label). It must not have a labelSpan.
      Returns:
      List of columns that share the label
    • stuckColumnsEnabled

      protected boolean stuckColumnsEnabled()
    • userIsAllowedToEditTables

      protected boolean userIsAllowedToEditTables()
    • getUserComponentAttributesMap

      public Map<String,Map<String,Serializable>> getUserComponentAttributesMap()
    • invalidateComponentsAttributeMap

      public void invalidateComponentsAttributeMap()
      Invalidates the map that contains all the user's component customization and force it to be reloaded.
    • getColumns

      public Column[] getColumns()
      Gets the children columns of the table.
      Returns:
      The children columns of the table.
    • getOriginalColumns

      public Column[] getOriginalColumns()
      Gets the original children columns of the table.
      The Original columns are the children column without any user customization and movement (only with those applied by the profile).
      Returns:
      The original children columns of the table.
    • getXmlColumns

      public List<Column> getXmlColumns()
      Gets the original children columns of the table.
      The Original columns are the children column without any user or profile customization and movement.
      Returns:
      The original children columns of the table.
    • getUserLayoutCustomizations

      public Set<String> getUserLayoutCustomizations()
      Gets the user layout customizations like columns movements and hidden columns
      Returns:
      The user layout customizations like columns movements and hidden columns
    • getProfileLayoutCustomizations

      public Set<String> getProfileLayoutCustomizations()
      Gets the profile layout customizations like columns movements and hidden columns
      Returns:
      The profile layout customizations like columns movements and hidden columns
    • onChangeRows

      public boolean onChangeRows(UIMessage uim)
    • updateCurrentRowsForPage

      protected void updateCurrentRowsForPage(int newRows)