org.alphadisplaytag.alphalist
Class AlphabeticList

java.lang.Object
  extended byorg.alphadisplaytag.alphalist.AlphabeticList

public class AlphabeticList
extends java.lang.Object

Utility class that slice and dice a List alphabetically into 37 sublist.
o List are broken up by the letter of the alphabet and place in a * map object keyed by the alphabetic letters to be navigated.
   For example to get the 'A' list use the A character as a key.
   36 sublist to capture the alphabet:[A][B] [C] ...... [X] [Y] [Z] [Full].
   There is the ability to revert to the [Full] list, instead of the broken list.
o The 37th sublist captures everything else and is keyd with ' ', like numbers, null and blanks.
   These are the beginning string that do not start with A-Z, such as number, null and blanks.
o There are CSS styled properties which are read first from the AlphaTableTag.properties file.
    If the properties are not found from this file, they are read from the define constants of the AlphaTableProperties.java file.

Version:
$Revision: 1.0 $ ($Author: pchauvet $)
Author:
Philip Jahmani Chauvet

Constructor Summary
AlphabeticList(java.util.List list)
          Creates an instance of this object that will help you chop up a list into 36 alphabetic list.
AlphabeticList(java.util.List list, java.lang.String column)
          Creates an instance of this object that will help you chop up a list into 36 alphabetic list with a defined column to create and sort the analphabetical list navigation bar.
 
Method Summary
 java.lang.String getAlphabeticFormattedBanner(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.PageContext pageContext)
          Get the alphabetic list display banner.
 java.util.List getAlphabeticList(char alphakey)
          Get an alphabetic list.
static char[] getAlphaCharList()
           
 java.lang.String getAlphaNavigateClass()
          Getter for the PROPERTY_ALPHANAVIGATE_DEFAULT_CLASS property.
 java.lang.String getAlphaNavigateFormat()
          Getter for the PROPERTY_ALPHANAVIGATE_FORMAT property.
 java.lang.String getAlphaNavigateHrefFullSelected()
          Getter for the PROPERTY_ALPHANAVIGATE_HREF_FULLSELECTED property.
 java.lang.String getAlphaNavigateHrefNotFullSelected()
          Getter for the PROPERTY_ALPHANAVIGATE_HREF_FULLNOTSELECTED property.
 java.lang.String getAlphaNavigateHrefNotSelected()
          Getter for the PROPERTY_ALPHANAVIGATE_HREF_NOTSELECTED property.
 java.lang.String getAlphaNavigateHrefSelected()
          Getter for the PROPERTY_ALPHANAVIGATE_HREF_SELECTED property.
 java.lang.String getAlphaNavigateStyle()
          Getter for the PROPERTY_ALPHANAVIGATE_DEFAULT_STYLE property.
protected  AlphaTableProperties getProperties()
          Returns the properties, configurations for the alphabetical navication bar.
 void setAlphaCharList(char[] charlist)
          Set the array of characters which starts the lists.
 void setNavivationtoFulllist(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.PageContext pageContext)
          Get the alphabetic list for all the entries - "full"
protected  java.lang.String setRequestURI(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.PageContext pageContext)
          Set the URI for the request.
 void setRequestURI(java.lang.String value)
          Setter for the "requestURI" attribute - handles Struts and Tiles actions which provide a difficult technique to get the base URI when using Struts and Tiles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphabeticList

public AlphabeticList(java.util.List list)
               throws java.lang.Exception
Creates an instance of this object that will help you chop up a list into 36 alphabetic list. The column name to be used as key to create and sort the list by will the first string column found.

Parameters:
list - Full list to slice and dice.

AlphabeticList

public AlphabeticList(java.util.List list,
                      java.lang.String column)
               throws java.lang.Exception
Creates an instance of this object that will help you chop up a list into 36 alphabetic list with a defined column to create and sort the analphabetical list navigation bar.

Parameters:
list - Full list to slice and dice.
column - The column name to be used as key to create and sort the list by.
Method Detail

getAlphabeticList

public java.util.List getAlphabeticList(char alphakey)
Get an alphabetic list.

Parameters:
alphakey - The 1st char defining the list to select.
Returns:
List an alphabetic list from the the full list based on a char as the key.

setNavivationtoFulllist

public void setNavivationtoFulllist(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.jsp.PageContext pageContext)
Get the alphabetic list for all the entries - "full"

Parameters:
request - The current HTTP request.
pageContext - The current page context.

getAlphabeticFormattedBanner

public java.lang.String getAlphabeticFormattedBanner(javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.jsp.PageContext pageContext)
Get the alphabetic list display banner.

Parameters:
request - Need the HTTP request for the URI in order to create the navigation banner.
pageContext - The current page context. Needed for creating the banner.
Returns:
String The navigation bar with the URI to access the created alphetic list.

getAlphaNavigateHrefSelected

public java.lang.String getAlphaNavigateHrefSelected()
Getter for the PROPERTY_ALPHANAVIGATE_HREF_SELECTED property.

Returns:
String The style for the alphabetic options when selected.

getAlphaNavigateHrefNotSelected

public java.lang.String getAlphaNavigateHrefNotSelected()
Getter for the PROPERTY_ALPHANAVIGATE_HREF_NOTSELECTED property.

Returns:
String The style for the alphabetic options when not selected.

getAlphaNavigateHrefFullSelected

public java.lang.String getAlphaNavigateHrefFullSelected()
Getter for the PROPERTY_ALPHANAVIGATE_HREF_FULLSELECTED property.

Returns:
String The style for the full href option when selected.

getAlphaNavigateHrefNotFullSelected

public java.lang.String getAlphaNavigateHrefNotFullSelected()
Getter for the PROPERTY_ALPHANAVIGATE_HREF_FULLNOTSELECTED property.

Returns:
String The style for the full option href when not selected.

getAlphaNavigateClass

public java.lang.String getAlphaNavigateClass()
Getter for the PROPERTY_ALPHANAVIGATE_DEFAULT_CLASS property.

Returns:
String The style class for the default href.

getAlphaNavigateStyle

public java.lang.String getAlphaNavigateStyle()
Getter for the PROPERTY_ALPHANAVIGATE_DEFAULT_STYLE property.

Returns:
String The style for the default href.

getAlphaNavigateFormat

public java.lang.String getAlphaNavigateFormat()
Getter for the PROPERTY_ALPHANAVIGATE_FORMAT property.

Returns:
String The full wrapper style format for the alphabetic banner.

getProperties

protected AlphaTableProperties getProperties()
Returns the properties, configurations for the alphabetical navication bar.

Returns:
AlphaTableProperties

setRequestURI

public void setRequestURI(java.lang.String value)
Setter for the "requestURI" attribute - handles Struts and Tiles actions which provide a difficult technique to get the base URI when using Struts and Tiles.

Parameters:
value - base URI for creating links. Example: anyaction.do.

setRequestURI

protected java.lang.String setRequestURI(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.jsp.PageContext pageContext)
Set the URI for the request.

Parameters:
request - The current HTTP request.
pageContext - The current page context. String A new response URI.

setAlphaCharList

public void setAlphaCharList(char[] charlist)
Set the array of characters which starts the lists. For example: ['A','B'....'Y','Z'].

Parameters:
charlist - The array of characters which will make up the alphabetical list.

getAlphaCharList

public static char[] getAlphaCharList()


Alphabetical Navigation Bar Java Display Tag Home Page. 

My Home Page. Contact me at: chauvetp@hotmail.com.
I am alway looking for Java/J2EE work and would appreciate the business. Some of my design is inspired by the original display tag <display:*> code. Please go to http://displaytag.sourceforge.net/ for details on the <display:*> tag.

Copyright © 2004 Aiki Innovations Inc. Permission is granted to reuse and distribute for commercial or personal use if no extensive monetary gain is received. Java and the Java Standard Tag Library are programming languages owed by Sun Microsystems, Inc: http://java.sun.com/products/jsp/jstl/