|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.webSvr.catalogue.PaginationBeanBase
org.hd.d.pg2k.webSvr.catalogue.PaginationBeanTree
public final class PaginationBeanTree
Provides pagination to be used in conjunction with (tree-structured) browsable exhibit collections. A specialisation of PaginationBeanBase that provides pagination for nodes created with the TreeFilterBean that creates alphanumeric labels based on distinguishing prefixes of the leaves of the node, intended to be as short as possible but give the user a large hint as to the full set of available choices even when only a tiny fraction of the choices (page buttons) can be shown.
TreeFilterBean,
PaginationBeanNumeric,
Serialized Form| Field Summary | |
|---|---|
static boolean |
LABEL_ALL_LC
If true, convert all page labels to lower-case rather than allowing mixed case. |
static int |
LABEL_MIN_LEN
Minimum letters in label, but only up to first word boundary. |
private Name |
nodePrefix
Store of prefix for the current node. |
private java.util.List<java.lang.CharSequence> |
prefixList
Store of prefix list. |
static java.lang.String |
SAFE_LABEL
Safe page value that will be interpreted as page 1. |
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
| Constructor Summary | |
|---|---|
PaginationBeanTree()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getPageLabel(int pageNum)
Return the page label as a String for the given page (1 upwards), never null; the page must be in range else the result is undefined. |
int |
getPageNumber(java.lang.String s)
Get the page number as a from the String label; in case of bad input return 1. |
void |
setNumberOfItems()
Don't call this directly; use setTreeNodeDetails() instead. |
void |
setTreeNodeDetails(java.lang.CharSequence prefix,
java.util.List<java.lang.CharSequence> prefixesAndShortExhibitName)
Given a List of CharSequence prefixes and Name.ExhibitShort short exhibit names as produced by TreeFilterBean, enables computation of the page labels. |
| Methods inherited from class org.hd.d.pg2k.webSvr.catalogue.PaginationBeanBase |
|---|
getEndIndex, getNumberOfItems, getNumberOfPages, getPageLabels, getPageNumbers, getPg, getStartIndex, setNumberOfItems, setPg, setPg |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean LABEL_ALL_LC
public static final int LABEL_MIN_LEN
private Name nodePrefix
private java.util.List<java.lang.CharSequence> prefixList
public static final java.lang.String SAFE_LABEL
Is not a valid prefix to avoid ambiguity.
private static final long serialVersionUID
| Constructor Detail |
|---|
public PaginationBeanTree()
| Method Detail |
|---|
public void setTreeNodeDetails(java.lang.CharSequence prefix,
java.util.List<java.lang.CharSequence> prefixesAndShortExhibitName)
This expects an (immutable) List of word-prefixes (as CharSequence) and short exhibit names (as Name.ExhibitShort), sorted in case-insensitive order, as produced by TreeFilterBean. Results are undefined if this is not the case.
All word-prefixes in the list must start with (case-insensitively) the supplied prefix for the node, the short-name part of each exhibit name must do too.
This caches the List that it is passed.
TreeFilterBeanpublic final void setNumberOfItems()
public java.lang.String getPageLabel(int pageNum)
(This may either be the shortest word prefix or the shortest character prefix.)
getPageLabel in class PaginationBeanBasepublic int getPageNumber(java.lang.String s)
getPageNumber in class PaginationBeanBase
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||