亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? smartlisthelper.java

?? dispalytag的源碼
?? JAVA
字號:
/** * Licensed under the Artistic License; you may not use this file * except in compliance with the License. * You may obtain a copy of the License at * *      http://displaytag.sourceforge.net/license.html * * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */package org.displaytag.pagination;import java.text.MessageFormat;import java.util.List;import org.apache.commons.lang.builder.ToStringBuilder;import org.apache.commons.lang.builder.ToStringStyle;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.displaytag.Messages;import org.displaytag.properties.TableProperties;import org.displaytag.util.Href;/** * <p> * Utility class that chops up a List of objects into small bite size pieces that are more suitable for display. * </p> * <p> * This class is a stripped down version of the WebListHelper from Tim Dawson (tdawson@is.com) * </p> * @author epesh * @author Fabrizio Giustina * @version $Revision: 1138 $ ($Author: fgiust $) */public class SmartListHelper{    /**     * logger.     */    private static Log log = LogFactory.getLog(SmartListHelper.class);    /**     * full list.     */    private List fullList;    /**     * sixe of the full list.     */    private int fullListSize;    /**     * number of items in a page.     */    private int pageSize;    /**     * number of pages.     */    private int pageCount;    /**     * the list we hold is only part of the full dataset     */    private boolean partialList;    /**     * index of current page.     */    private int currentPage;    /**     * TableProperties.     */    private TableProperties properties;    /**     * Creates a SmarListHelper instance that will help you chop up a list into bite size pieces that are suitable for     * display.     * @param list List     * @param fullSize size of the full list     * @param itemsInPage number of items in a page (int > 0)     * @param tableProperties TableProperties     */    public SmartListHelper(        List list,        int fullSize,        int itemsInPage,        TableProperties tableProperties,        boolean partialList)    {        if (log.isDebugEnabled())        {            log.debug(Messages.getString("SmartListHelper.debug.instantiated", //$NON-NLS-1$                new Object[]{new Integer(list.size()), new Integer(itemsInPage), new Integer(fullSize)}));        }        this.properties = tableProperties;        this.pageSize = itemsInPage;        this.fullList = list;        this.fullListSize = fullSize;        this.pageCount = computedPageCount();        this.currentPage = 1;        this.partialList = partialList;    }    /**     * Constructor that can be used by subclasses. Subclasses that use this constructor must also override all the     * public methods, since this constructor does nothing.     */    protected SmartListHelper()    {    }    /**     * Returns the computed number of pages it would take to show all the elements in the list given the pageSize we are     * working with.     * @return int computed number of pages     */    protected int computedPageCount()    {        int size = this.fullListSize;        int div = size / this.pageSize;        int result = (size % this.pageSize == 0) ? div : div + 1;        return result;    }    /**     * Returns the index into the master list of the first object that should appear on the current page that the user     * is viewing.     * @return int index of the first object that should appear on the current page     */    public int getFirstIndexForCurrentPage()    {        return getFirstIndexForPage(this.currentPage);    }    /**     * Returns the index into the master list of the last object that should appear on the current page that the user is     * viewing.     * @return int     */    protected int getLastIndexForCurrentPage()    {        return getLastIndexForPage(this.currentPage);    }    /**     * Returns the index into the master list of the first object that should appear on the given page.     * @param pageNumber page number     * @return int index of the first object that should appear on the given page     */    protected int getFirstIndexForPage(int pageNumber)    {        int retval = (pageNumber - 1) * this.pageSize;        return retval >= 0 ? retval : 0;    }    /**     * Returns the index into the master list of the last object that should appear on the given page.     * @param pageNumber page number     * @return int index of the last object that should appear on the given page     */    protected int getLastIndexForPage(int pageNumber)    {        int firstIndex = getFirstIndexForPage(pageNumber);        int pageIndex = this.pageSize - 1;        int lastIndex = this.fullListSize - 1;        return Math.min(firstIndex + pageIndex, lastIndex);    }    /**     * Returns a subsection of the list that contains just the elements that are supposed to be shown on the current     * page the user is viewing.     * @return List subsection of the list that contains the elements that are supposed to be shown on the current page     */    public List getListForCurrentPage()    {        return getListForPage(this.currentPage);    }    /**     * Returns a subsection of the list that contains just the elements that are supposed to be shown on the given page.     * @param pageNumber page number     * @return List subsection of the list that contains just the elements that are supposed to be shown on the given     * page     */    protected List getListForPage(int pageNumber)    {        if (log.isDebugEnabled())        {            log.debug(Messages.getString("SmartListHelper.debug.sublist", //$NON-NLS-1$                new Object[]{new Integer(pageNumber)}));        }        int firstIndex = getFirstIndexForPage(pageNumber);        int lastIndex = getLastIndexForPage(pageNumber);        if (this.partialList)        {            firstIndex = 0;            // use the min of pageSize or list size on the off chance they gave us more data than pageSize allows            lastIndex = Math.min(this.pageSize - 1, this.fullList.size() - 1);        }        return this.fullList.subList(firstIndex, lastIndex + 1);    }    /**     * Set's the page number that the user is viewing.     * @param pageNumber page number     */    public void setCurrentPage(int pageNumber)    {        if (log.isDebugEnabled())        {            log.debug(Messages.getString("SmartListHelper.debug.currentpage", //$NON-NLS-1$                new Object[]{new Integer(pageNumber), new Integer(this.pageCount)}));        }        if (pageNumber < 1)        {            // invalid page: better don't throw an exception, since this could easily happen            // (list changed, user bookmarked the page)            this.currentPage = 1;        }        else if (pageNumber != 1 && pageNumber > this.pageCount)        {            // invalid page: set to last page            this.currentPage = this.pageCount;        }        else        {            this.currentPage = pageNumber;        }    }    /**     * Return the little summary message that lets the user know how many objects are in the list they are viewing, and     * where in the list they are currently positioned. The message looks like: nnn [item(s)] found, displaying nnn to     * nnn. [item(s)] is replaced by either itemName or itemNames depending on if it should be signular or plural.     * @return String     */    public String getSearchResultsSummary()    {        Object[] objs;        String message;        if (this.fullListSize == 0)        {            objs = new Object[]{this.properties.getPagingItemsName()};            message = this.properties.getPagingFoundNoItems();        }        else if (this.fullListSize == 1)        {            objs = new Object[]{this.properties.getPagingItemName()};            message = this.properties.getPagingFoundOneItem();        }        else if (computedPageCount() == 1)        {            objs = new Object[]{                new Integer(this.fullListSize),                this.properties.getPagingItemsName(),                this.properties.getPagingItemsName()};            message = this.properties.getPagingFoundAllItems();        }        else        {            objs = new Object[]{                new Integer(this.fullListSize),                this.properties.getPagingItemsName(),                new Integer(getFirstIndexForCurrentPage() + 1),                new Integer(getLastIndexForCurrentPage() + 1),                new Integer(this.currentPage),                new Integer(this.pageCount)};            message = this.properties.getPagingFoundSomeItems();        }        return MessageFormat.format(message, objs);    }    /**     * Returns a string containing the nagivation bar that allows the user to move between pages within the list. The     * urlFormatString should be a URL that looks like the following: somepage.page?page={0}     * @param baseHref Href used for links     * @param pageParameter name for the page parameter     * @return String     */    public String getPageNavigationBar(Href baseHref, String pageParameter)    {        int groupSize = this.properties.getPagingGroupSize();        int startPage;        int endPage;        Pagination pagination = new Pagination(baseHref, pageParameter, this.properties);        pagination.setCurrent(new Integer(this.currentPage));        // if no items are found still add pagination?        if (this.pageCount == 0)        {            pagination.addPage(1, true);        }        // center the selected page, but only if there are {groupSize} pages available after it, and check that the        // result is not < 1        startPage = Math.max(Math.min(this.currentPage - groupSize / 2, this.pageCount - (groupSize - 1)), 1);        endPage = Math.min(startPage + groupSize - 1, this.pageCount);        if (log.isDebugEnabled())        {            log.debug("Displaying pages from " + startPage + " to " + endPage);        }        if (this.currentPage != 1)        {            pagination.setFirst(new Integer(1));            pagination.setPrevious(new Integer(this.currentPage - 1));        }        for (int j = startPage; j <= endPage; j++)        {            if (log.isDebugEnabled())            {                log.debug("adding page " + j); //$NON-NLS-1$            }            pagination.addPage(j, (j == this.currentPage));        }        if (this.currentPage != this.pageCount)        {            pagination.setNext(new Integer(this.currentPage + 1));            pagination.setLast(new Integer(this.pageCount));        }        // format for previous/next banner        String bannerFormat;        if (pagination.isOnePage())        {            bannerFormat = this.properties.getPagingBannerOnePage();        }        else if (pagination.isFirst())        {            bannerFormat = this.properties.getPagingBannerFirst();        }        else if (pagination.isLast())        {            bannerFormat = this.properties.getPagingBannerLast();        }        else        {            bannerFormat = this.properties.getPagingBannerFull();        }        return pagination.getFormattedBanner(this.properties.getPagingPageLink(), this.properties            .getPagingPageSelected(), this.properties.getPagingPageSeparator(), bannerFormat);    }    /**     * @see java.lang.Object#toString()     */    public String toString()    {        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //            .append("fullList", this.fullList) //$NON-NLS-1$            .append("fullListSize", this.fullListSize) //$NON-NLS-1$            .append("pageSize", this.pageSize) //$NON-NLS-1$            .append("pageCount", this.pageCount) //$NON-NLS-1$            .append("properties", this.properties) //$NON-NLS-1$            .append("currentPage", this.currentPage) //$NON-NLS-1$            .append("partialList", this.partialList) //$NON-NLS-1$            .toString();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情91久久精品导航| 91丨porny丨国产入口| 99这里都是精品| 91精品国产综合久久久蜜臀粉嫩| 久久久蜜桃精品| 五月天久久比比资源色| 成人污污视频在线观看| 欧美一区二区三区视频在线 | 九一九一国产精品| 91美女在线观看| 日韩免费视频线观看| 伊人婷婷欧美激情| 成人永久免费视频| 久久这里只有精品视频网| 亚洲.国产.中文慕字在线| 成年人网站91| 久久精品一级爱片| 国产在线播精品第三| 91精品免费在线观看| 一二三四社区欧美黄| 97久久精品人人爽人人爽蜜臀| 精品国产免费久久| 久久黄色级2电影| 日韩一级片在线观看| 天天综合日日夜夜精品| 日本丶国产丶欧美色综合| 亚洲手机成人高清视频| 波多野结衣91| 亚洲男同性视频| 色偷偷88欧美精品久久久| 亚洲视频资源在线| 国产91精品一区二区| 久久日韩粉嫩一区二区三区 | 精品乱人伦小说| 久久精品国产99国产| 欧美一区二区成人6969| 美女视频网站黄色亚洲| 日韩美一区二区三区| 中文字幕欧美区| 亚洲宅男天堂在线观看无病毒| 亚洲蜜臀av乱码久久精品| 免费成人深夜小野草| 日韩一区二区三区在线视频| 日韩成人免费看| 日韩欧美精品三级| 国产美女一区二区三区| 国产亚洲欧美激情| 91亚洲男人天堂| 亚洲成人中文在线| 日韩一区和二区| 国产成人日日夜夜| 亚洲伦在线观看| 欧美日韩视频在线一区二区 | 99热这里都是精品| 亚洲女女做受ⅹxx高潮| 欧美人体做爰大胆视频| 久久66热偷产精品| 成人欧美一区二区三区白人 | 国产91精品欧美| 国产精品久久久久婷婷| 欧美日韩一区二区三区在线看| 性感美女极品91精品| 精品国产乱码久久久久久影片| 国产成人精品一区二| 亚洲一区二区三区激情| 欧美精品一区二区三区一线天视频| 国产大陆a不卡| 亚洲国产精品麻豆| 久久麻豆一区二区| 欧洲精品一区二区三区在线观看| 蜜桃精品在线观看| **欧美大码日韩| 欧美一区二区在线看| 91首页免费视频| 久久99国产精品麻豆| 亚洲乱码国产乱码精品精98午夜| 欧美成人艳星乳罩| 欧美性高清videossexo| 国产不卡视频一区二区三区| 五月天一区二区| 中文字幕在线播放不卡一区| 欧美精品日韩精品| 99re这里都是精品| 国产毛片精品一区| 午夜激情一区二区| 亚洲欧美一区二区不卡| 精品嫩草影院久久| 欧美高清你懂得| 一本久道中文字幕精品亚洲嫩| 蜜臀av一区二区在线免费观看| 亚洲人成网站精品片在线观看| 欧美tk丨vk视频| 精品视频在线视频| av网站一区二区三区| 激情文学综合网| 天堂va蜜桃一区二区三区漫画版| 成人欧美一区二区三区视频网页| 久久精品人人爽人人爽| 精品免费视频一区二区| 91精品欧美综合在线观看最新| 91日韩一区二区三区| www.成人网.com| 成人黄色a**站在线观看| 国内精品免费**视频| 六月丁香婷婷久久| 日本午夜精品视频在线观看| 亚洲va欧美va人人爽| 洋洋成人永久网站入口| 亚洲男人的天堂在线aⅴ视频| 国产精品婷婷午夜在线观看| 久久尤物电影视频在线观看| 欧美不卡123| 欧美va亚洲va| 久久综合五月天婷婷伊人| 精品久久久久一区二区国产| 日韩欧美成人午夜| 欧美成人vps| 久久综合色播五月| 国产亚洲欧美日韩在线一区| 国产女同性恋一区二区| 国产精品三级av| 国产精品乱码久久久久久| 国产精品女上位| 亚洲日本va午夜在线电影| 亚洲另类一区二区| 一区二区三区影院| 亚洲高清在线精品| 日本亚洲欧美天堂免费| 韩国三级中文字幕hd久久精品| 九九热在线视频观看这里只有精品| 久久精品国产精品亚洲精品| 国产酒店精品激情| 成人av资源在线| 91久久线看在观草草青青| 精品视频999| 日韩精品中文字幕一区| 久久久久国产精品麻豆ai换脸 | 成人污污视频在线观看| 99国产精品久| 91精品久久久久久久91蜜桃| 2024国产精品| 亚洲手机成人高清视频| 视频一区视频二区中文| 国产一区二区三区日韩| 99精品久久久久久| 欧美剧情片在线观看| 久久伊人中文字幕| 亚洲欧美激情在线| 老司机午夜精品| 99国产精品国产精品毛片| 69成人精品免费视频| 国产喂奶挤奶一区二区三区| 亚洲美女少妇撒尿| 久草中文综合在线| 一本色道久久综合亚洲91| 日韩亚洲欧美高清| 最好看的中文字幕久久| 全部av―极品视觉盛宴亚洲| av影院午夜一区| 精品噜噜噜噜久久久久久久久试看| 国产精品国产三级国产普通话三级| 性做久久久久久久免费看| 国内精品国产成人国产三级粉色| 色狠狠色噜噜噜综合网| 久久一区二区视频| 午夜精品久久久久影视| 成人免费看的视频| 日韩三级av在线播放| 亚洲人成7777| 国产精品一区二区视频| 91精品蜜臀在线一区尤物| 亚洲欧美在线高清| 国产成人丝袜美腿| 欧美成人r级一区二区三区| 一区二区三区精品在线| 国产69精品一区二区亚洲孕妇| 91麻豆精品国产91久久久更新时间 | 2020日本不卡一区二区视频| 亚洲福利视频一区| 99精品国产99久久久久久白柏| 欧美成人激情免费网| 日韩成人一级大片| 欧美自拍丝袜亚洲| 亚洲精品免费视频| 成人av在线网站| 亚洲国产精品二十页| 黄色日韩三级电影| 日韩美女在线视频| 美女任你摸久久| 777xxx欧美| 亚洲成人av一区二区| 在线精品视频免费观看| 亚洲人成网站影音先锋播放| 成人中文字幕在线| 国产日产欧美一区二区三区| 国产黑丝在线一区二区三区| 日本一区二区免费在线观看视频| 精品无人码麻豆乱码1区2区| 日韩免费视频线观看| 国产专区综合网|