Class Tab

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class Tab
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    Session object to work with tabular data.

    Author:
    Javier Paniza, Ana Andrés, Trifon Trifonov, Chungyen Tsai
    See Also:
    Serialized Form
    • Constructor Detail

      • Tab

        public Tab()
      • Tab

        public Tab​(boolean cancelSavingPreferences)
        Creates a tab that will not save the preferences values.
        Parameters:
        cancelSavingPreferences - If the parameter is true, no preferences are stored.
    • Method Detail

      • setRefiner

        public static void setRefiner​(java.lang.Object newRefiner)
      • getMetaProperties

        public java.util.List<MetaProperty> getMetaProperties()
      • isColumnsToAddUntilSecondLevel

        public boolean isColumnsToAddUntilSecondLevel()
        Since:
        5.2
      • setColumnsToAddUntilSecondLevel

        public void setColumnsToAddUntilSecondLevel​(boolean columnsToAddUntilSecondLevel)
        Since:
        5.2
      • setReferencesCollection

        public void setReferencesCollection​(java.lang.String model,
                                            java.lang.String collectionName)
                                     throws XavaException
        This is an alternative to setModelName, and is used when this tab represent a collection of references.
        Throws:
        XavaException
      • setBaseConditionValuesForReference

        public void setBaseConditionValuesForReference​(java.util.Map values)
                                                throws XavaException
        Throws:
        XavaException
      • setDefaultPropertiesNames

        public void setDefaultPropertiesNames​(java.lang.String properties)
        The default properties are the initial ones and those to show when the user reset his customizations.
        Since:
        4.1
      • getPropertiesNamesAsString

        public java.lang.String getPropertiesNamesAsString()
        Returns:
        Comma separate list.

      • getColumnWidth

        public int getColumnWidth​(int columnIndex)
      • friendViewGetDefaultColumnWidth

        public static int friendViewGetDefaultColumnWidth​(MetaProperty p)
      • setColumnWidth

        public void setColumnWidth​(int columnIndex,
                                   int width)
      • getMetaProperty

        public MetaProperty getMetaProperty​(int i)
      • getMetaProperty

        public MetaProperty getMetaProperty​(java.lang.String qualifiedName)
        Since:
        4.3
      • containsProperty

        public boolean containsProperty​(java.lang.String qualifiedName)
        Since:
        5.9
      • getTableModel

        public IXTableModel getTableModel()
        A table model with on-demand data reading.

        Suitable for UI.

      • getAllDataTableModel

        public IXTableModel getAllDataTableModel()
                                          throws java.lang.Exception
        A table model with load all data at once.

        Suitable for report generation (for example).

        Throws:
        java.lang.Exception
      • setTableModel

        public void setTableModel​(IXTableModel tableModel)
      • reset

        public void reset()
      • getSelected

        public int[] getSelected()
        Deprecated.
        use getSelectedKeys
        index of selected rows in the range of load rows Deprecated since 4.7
      • hasSelected

        public boolean hasSelected()
      • setAllSelectedKeys

        public void setAllSelectedKeys​(java.util.Map[] values)
      • setAllSelected

        public void setAllSelected​(int[] values)
        Deprecated.
        use setAllSelectedKeys
        Change all selected.

        Deprecated since 4.7

      • deselect

        public void deselect​(int row)
        Parameters:
        int - row
      • friendExecuteJspDeselect

        public void friendExecuteJspDeselect​(java.lang.String deselect)
        Parameters:
        as - 'ox_OpenXavaTest_Color__xava_tab:4,3,1'
      • deselect

        public void deselect​(java.util.Map key)
        Parameters:
        Map - key
      • setSelected

        public void setSelected​(int[] values)
        Change the selectedKeys only within the current page range.

        Postcondition this.selectedKey == values is not fulfilled

      • isSelected

        public boolean isSelected​(int row)
      • getInitialIndex

        public int getInitialIndex()
      • getFinalIndex

        public int getFinalIndex()
      • isLastPage

        public boolean isLastPage()
      • pageForward

        public void pageForward()
      • isNotResetNextTime

        public boolean isNotResetNextTime()
      • setNotResetNextTime

        public void setNotResetNextTime​(boolean b)
      • getLastPage

        public int getLastPage()
      • pageBack

        public void pageBack()
      • goPage

        public void goPage​(int page)
        1 is the first page
        Parameters:
        page -
      • getPage

        public int getPage()
      • getTotalSize

        public int getTotalSize()
      • clearCondition

        public void clearCondition()
        Since:
        4.7.1
      • setConditionValues

        public void setConditionValues​(java.util.Collection<java.lang.String> values)
                                throws XavaException
        Throws:
        XavaException
        Since:
        4.6
      • setConditionComparators

        public void setConditionComparators​(java.util.Collection<java.lang.String> comparators)
                                     throws XavaException
        Throws:
        XavaException
        Since:
        4.6
      • getConditionValues

        public java.lang.String[] getConditionValues()
      • getConditionValuesTo

        public java.lang.String[] getConditionValuesTo()
      • getConditionComparators

        public java.lang.String[] getConditionComparators()
      • groupBy

        public void groupBy​(java.lang.String property)
      • getGroupBy

        public java.lang.String getGroupBy()
      • getMetaPropertiesGroupBy

        public java.util.Collection<MetaProperty> getMetaPropertiesGroupBy()
      • orderBy

        public void orderBy​(java.lang.String property)
      • getOrderBy

        public java.lang.String getOrderBy()
      • isOrderAscending

        public boolean isOrderAscending​(java.lang.String name)
      • isOrderDescending

        public boolean isOrderDescending​(java.lang.String name)
      • isOrderAscending2

        public boolean isOrderAscending2​(java.lang.String name)
      • isOrderDescending2

        public boolean isOrderDescending2​(java.lang.String name)
      • getModelName

        public java.lang.String getModelName()
      • setModelName

        public void setModelName​(java.lang.String newModelName)
      • reloadMetaModel

        public void reloadMetaModel()
        Since:
        5.6
      • getTabName

        public java.lang.String getTabName()
      • setTabName

        public void setTabName​(java.lang.String newTabName)
      • setRequest

        public void setRequest​(javax.servlet.http.HttpServletRequest request)
      • filter

        public void filter()
        Since:
        5.9
      • setConditionParameters

        public void setConditionParameters()
        Since:
        5.9
      • setTabObject

        public void setTabObject​(java.lang.String tabObject)
      • getPreferencesNodeName

        public java.lang.String getPreferencesNodeName​(java.lang.String prefix)
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
      • isTitleVisible

        public boolean isTitleVisible()
      • setTitleVisible

        public void setTitleVisible​(boolean b)
      • setTitleArgument

        public void setTitleArgument​(java.lang.Object v1)
      • setTitleArguments

        public void setTitleArguments​(java.lang.Object v1,
                                      java.lang.Object v2)
      • setTitleArguments

        public void setTitleArguments​(java.lang.Object v1,
                                      java.lang.Object v2,
                                      java.lang.Object v3)
      • setTitleArguments

        public void setTitleArguments​(java.lang.Object v1,
                                      java.lang.Object v2,
                                      java.lang.Object v3,
                                      java.lang.Object v4)
      • setTitleArguments

        public void setTitleArguments​(java.lang.Object[] valores)
      • createConfiguration

        public void createConfiguration()
        Since:
        6.5
      • saveConfiguration

        public void saveConfiguration()
      • getConfigurationsCount

        public int getConfigurationsCount()
        Since:
        6.5
      • getConfigurations

        public java.util.Collection<Tab.Configuration> getConfigurations()
      • setConfigurationId

        public void setConfigurationId​(int configurationId)
      • setConfigurationName

        public void setConfigurationName​(java.lang.String newName)
      • removeConfiguration

        public void removeConfiguration()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
        Since:
        5.7
      • isAllConfiguration

        public boolean isAllConfiguration()
        Since:
        6.5
      • setTitle

        public void setTitle​(java.lang.String title)
        Set the specific title as is.

        This title is used in list mode if the title is visible and as title for reports.
        If you want to use an i18n title use setTitleId(String titleId) instead.

        Since:
        4.6
      • getTitleI18n

        public static java.lang.String getTitleI18n​(java.util.Locale locale,
                                                    java.lang.String modelName,
                                                    java.lang.String tabName)
                                             throws XavaException
        Throws:
        XavaException
      • getBaseConditionForReference

        public java.lang.String getBaseConditionForReference()
      • setBaseConditionForReference

        public void setBaseConditionForReference​(java.lang.String baseConditionForReference)
      • addProperties

        public void addProperties​(java.util.List<java.lang.String> propertiesName,
                                  java.lang.String[] conditionValues,
                                  java.lang.String[] conditionValuesTo,
                                  java.lang.String[] conditionComparators)
                           throws XavaException
        Add properties without using old configuration.
        Throws:
        XavaException
        Since:
        7.1
      • setLabel

        public void setLabel​(java.lang.String propertyName,
                             java.lang.String label)
        Parameters:
        propertyName -
        label -
        Since:
        4.8
      • moveProperty

        public void moveProperty​(int from,
                                 int to)
        Since:
        5.2
      • isCustomizeAllowed

        public boolean isCustomizeAllowed()
        Since:
        4m5
      • setCustomizeAllowed

        public void setCustomizeAllowed​(boolean customizeAllowed)
        Since:
        4m5
      • isResizeColumns

        public boolean isResizeColumns()
        Since:
        4m5
      • setResizeColumns

        public void setResizeColumns​(boolean resizeColumns)
        Since:
        4m5
      • getTitleId

        public java.lang.String getTitleId()
      • setTitleId

        public void setTitleId​(java.lang.String titleId)
        Set the title from an i18n id.

        This title is used in list mode if the title is visible and as title for reports.

      • getStyle

        public java.lang.String getStyle​(int row)
        The CSS style associated to the specified row.

        Returns:
        A string with the CSS style suitable to use in a 'class' attribute in HTML.
      • setStyle

        public void setStyle​(int row,
                             java.lang.String style)
        Set the CSS style associated to the specified row.

        Parameters:
        row - Row number affected by this style.
        style - A string with the CSS style suitable to use in a 'class' attribute in HTML.
      • getSelectedKeys

        public java.util.Map[] getSelectedKeys()
      • getAllKeys

        public java.util.Map[] getAllKeys()
        An array with the keys (in Map format) of the all rows.

        Returns:
        Never null
      • hideRows

        public void hideRows()
      • showRows

        public void showRows()
      • isRowsHidden

        public boolean isRowsHidden()
      • setRowsHidden

        public void setRowsHidden​(boolean rowsHidden)
        If you like show or hide rows is better calling to showRows() and hideRows().

      • getPageRowCount

        public int getPageRowCount()
      • setPageRowCount

        public void setPageRowCount​(int pageRowCount)
      • getFilter

        public IFilter getFilter()
                          throws XavaException
        Filter used currently by this tab.

        By default the filter is the defined one in the <tab/> of the component or using the filter attribute of @Tab annotation.
        But, it's possible to assign in runtime other filter using the setFilter(IFilter) method.

        Returns:
        Can be null.
        Throws:
        XavaException
      • setFilter

        public void setFilter​(IFilter filter)
        Sets the filter for this tab in runtime.

        This override the filter defined using <tab> or @Tab.

      • setPropertiesNames

        public void setPropertiesNames​(java.lang.String propertiesNames)
                                throws XavaException
        Set the properties to be displayed by this Tab in runtime.

        This override the properties defined using <tab> or @Tab.

        Throws:
        XavaException
      • setDefaultOrder

        public void setDefaultOrder​(java.lang.String defaultOrder)
                             throws XavaException
        Set the default order for this Tab in runtime.

        This override the default order defined using <tab> or @Tab.

        Throws:
        XavaException
      • getCollectionView

        public View getCollectionView()
        If this tab represents a collection the collection view of that collection.

        If this tab does not represents a collection collectionView will be null.

      • setCollectionView

        public void setCollectionView​(View collectionView)
        If this tab represents a collection the collection view of that collection.

        If this tab does not represents a collection collectionView will be null.

      • isFilterVisible

        public boolean isFilterVisible()
      • setFilterVisible

        public void setFilterVisible​(boolean filterVisible)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • deselectAll

        public void deselectAll()
      • clearSelected

        public void clearSelected()
        Deprecated.
        Since v4.7, use deselectAll() instead
      • setConditionValue

        public void setConditionValue​(java.lang.String property,
                                      java.lang.Object value)
        Since:
        4m6
      • hasTotal

        public boolean hasTotal​(int column)
        Since:
        4.1
      • hasTotal

        public boolean hasTotal​(int row,
                                int column)
        Since:
        4.3
      • isTotalEditable

        public boolean isTotalEditable​(int row,
                                       int column)
        Since:
        5.9
      • addSumProperty

        public void addSumProperty​(java.lang.String property)
        Add total property.

        It was created in v4.1 with the name addTotalProperty()

        Since:
        4.3
      • removeSumProperty

        public void removeSumProperty​(java.lang.String property)
        Remove total property.

        It was created in v4.1 with the name removeTotalProperty()

        Since:
        4.1
      • getSumPropertiesNames

        public java.util.Set<java.lang.String> getSumPropertiesNames()
        Since:
        4.3
      • getTotalPropertiesNames

        public java.util.Collection<java.lang.String> getTotalPropertiesNames()
        Since:
        4.1
      • isTotalCapable

        public boolean isTotalCapable​(int column)
        Since:
        4.1
      • isTotalCapable

        public boolean isTotalCapable​(MetaProperty p)
        Since:
        4.8
      • isOrderCapable

        public boolean isOrderCapable​(MetaProperty p)
        Since:
        6.4
      • isFromCollection

        public boolean isFromCollection​(MetaProperty p)
        Since:
        6.4
      • isFixedTotal

        public boolean isFixedTotal​(int column)
        Since:
        4.3
      • getTotal

        public java.lang.Object getTotal​(int column)
        Since:
        4.1
      • getTotal

        public java.lang.Object getTotal​(int row,
                                         int column)
        Since:
        4.3
      • getTotalLabel

        public java.lang.String getTotalLabel​(int row,
                                              int column)
        Since:
        4.3
      • getTotalPropertyName

        public java.lang.String getTotalPropertyName​(int row,
                                                     int column)
        Since:
        5.9
      • getTotal

        public java.lang.Object getTotal​(java.lang.String qualifiedPropertyName)
        Since:
        4.1
      • getAdditionalTotalsCount

        public int getAdditionalTotalsCount()
        Since:
        4.3
      • setIgnorePageRowCount

        public void setIgnorePageRowCount​(boolean ignorePageRowCount)
      • isIgnorePageRowCount

        public boolean isIgnorePageRowCount()
      • getErrors

        public Messages getErrors()
      • setErrors

        public void setErrors​(Messages errors)
      • getEditor

        public java.lang.String getEditor()
      • setEditor

        public void setEditor​(java.lang.String editor)
      • clone

        public Tab clone()
        Overrides:
        clone in class java.lang.Object
        Since:
        5.9
      • isSaveConfigurationAllowed

        public boolean isSaveConfigurationAllowed()
        Since:
        6.5
      • isOptimizeChunkSize

        public boolean isOptimizeChunkSize()
      • setOptimizeChunkSize

        public void setOptimizeChunkSize​(boolean optimizeChunkSize)
      • getMessages

        public Messages getMessages()
      • setMessages

        public void setMessages​(Messages messages)