📄 numericpager.java
字号:
package com.component.pagination;
import java.util.Vector;
/**
* Performs Numeric pagination of the page elements.
* This functionality is implemented in AbstractPager class.
*
* Hence, this class actually does nothing.
*
* @author chetan_bh
*/
public class NumericPager extends AbstractPager {
private String pagerName = PaginationConstants.NUMERIC_PAGER;
public NumericPager(Vector data) {
super(data);
}
public NumericPager(Vector data, int elementsPerPage) {
super(data, elementsPerPage);
}
public NumericPager(PageElement[] elements) {
super(elements);
}
public int getElementsPerPage()
{
return elementsPerPage;
}
// TODO Yet to fully implement this function.
public void setElementsPerPage(int newValue)
{
if(this.elementsPerPage != newValue && newValue > 0)
{
this.elementsPerPage = newValue;
pageIndices = new Vector();
// TODO update other variables like number of pages, etc.
pageMap = this.page(rawData);
numberOfPages = pageIndices.size();
}
}
/**
* Returns the pager name.
*/
public String getPagerName()
{
return pagerName;
}
/**
* @param args
*/
public static void main(String[] args) {
Vector elements = new Vector();
for(int i = 0; i < 12; i++)
{
PageElement element = new PageElementImpl();
element.setDisplayName("ABC-"+i);
elements.add(element);
}
NumericPager numPager = new NumericPager(elements);
System.out.println("numPage "+numPager);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -