com.stratelia.webactiv.util.datapaginator
Class WADataPaginatorHeader

java.lang.Object
  extended by com.stratelia.webactiv.util.datapaginator.WADataPaginatorHeader

public class WADataPaginatorHeader
extends Object

The WADataPaginatorHeader is used by presentation components such as the ViewGenerator to help them manage their user interface. The hold all information that are needed by the rendering object to present table headers, namely:

  • Flags to help sorting data
  • Default sork jey
  • Routing address, that is, script code to which the column headers of data displayed are bound to

    This object is actually a collection of FieldDescriptor objects. One thus first creates an empty WADataPaginatorHeader, and then call the addField(java.lang.String, java.lang.String, int, java.lang.String) method as many times as there are columns to display.
    The rendering process, on the other hand, will get this list of fields back, and will, depending on the flags returned by the #getFlags() routine, output the header information of each field.

    Version:
    1.0
    Author:
    jpouyadou

    Field Summary
    static int FLAGS_ASCENDING
              ascending flag.
    static int FLAGS_SORT_KEY
              sort key.
    static int FLAGS_SORTABLE
              sortable flag.
     
    Constructor Summary
    WADataPaginatorHeader()
               
     
    Method Summary
     void addField(String field, String displayName, int flags, String routingAddress)
              This method adds a field at the end of list of fields for this header
     int getFieldCount()
              This method retuns the count of fields in this header.
     String getFieldDisplayName(int idx)
               
     String getFieldName(int idx)
               
     String getFieldRoutingAddress(int idx)
               
     String getSortKey()
               
     int getSortKeyIndex()
               
     boolean isFieldAscending(int idx)
               
     boolean isFieldDescending(int idx)
               
     boolean isFieldSortable(int idx)
               
     void toggleFieldSortOrder(int idx)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    FLAGS_SORTABLE

    public static final int FLAGS_SORTABLE
    sortable flag. This flag is set if the given column is sortable.

    See Also:
    Constant Field Values

    FLAGS_ASCENDING

    public static final int FLAGS_ASCENDING
    ascending flag. If the FLAGS_SORTABLE is set, this is set also if the column data is sorted in ascending order, and unset otherwise. THis flags must be preset by the creator or the object, and could be toggled by the rendering process

    See Also:
    Constant Field Values

    FLAGS_SORT_KEY

    public static final int FLAGS_SORT_KEY
    sort key. This is the current sort key for the table

    See Also:
    Constant Field Values
    Constructor Detail

    WADataPaginatorHeader

    public WADataPaginatorHeader()
    Method Detail

    getFieldCount

    public int getFieldCount()
    This method retuns the count of fields in this header. It should match the number of times the addField(java.lang.String, java.lang.String, int, java.lang.String) succeeded

    See Also:
    #addField()

    addField

    public void addField(String field,
                         String displayName,
                         int flags,
                         String routingAddress)
    This method adds a field at the end of list of fields for this header

    Parameters:
    field - The internal field name, presumably meaningful to the DataPaginator.
    displayName - The display name of the field, that would typically be output on the rendering device by presentation objects (in short, thisis the label of the column)
    flags - A combination of flags suchs as FLAGS_SORTABLE, FLAGS_ASCENDING and so on.
    routingAddress - A specification of the callback method used when the user selects this field If this value is NULL, the rendering device uses whatever is suitable for its default behaviour. If this value is empty, the rendering device should NOT associate a routing address to this field. In other words, this field will not be 'clickable'. In all other cases, the rendering process will use the value. Typically, one would use an URL as a routingAddress.

    toggleFieldSortOrder

    public void toggleFieldSortOrder(int idx)

    isFieldSortable

    public boolean isFieldSortable(int idx)

    isFieldAscending

    public boolean isFieldAscending(int idx)

    isFieldDescending

    public boolean isFieldDescending(int idx)

    getFieldRoutingAddress

    public String getFieldRoutingAddress(int idx)

    getSortKey

    public String getSortKey()

    getSortKeyIndex

    public int getSortKeyIndex()

    getFieldDisplayName

    public String getFieldDisplayName(int idx)

    getFieldName

    public String getFieldName(int idx)


    Copyright © 2016 Silverpeas. All Rights Reserved.