📄 pageselectionmodel.java
字号:
package com.component.pagination;
import java.util.Vector;
/**
* PageSelctionModel to work in the ListSelectionModel way, but this selection model
* has to take into account that selected elements need two indexing.
*
* 1) There will be many page, so first index the page. and
* 2) In the indexed page index the element which was selected.
*
*
* TODO Note : Ideas for implmenting 2-level paging.
*
* 1) The above logic needs to be modified slightly.
* Now with the 2-level paging there will one more index
* called sub page index after main page index
*
* 1) Main Page Index : this specifies the index in the 1-level pager.
* 2) Sub Page Index : this specifies the index in the 2-level pager.
* 3) Index in Sub Page : this specified the index of an element in the 2-level pager.
*
* 2) One more Change in PageSelectionModel is that now it should take into account the fix
* for Bug identified that is related to user selections lost after page resize due to factors like
* (Frame resized, elements per page changed, etc).
* Solution : Now the constructor of this class should take initial number of main pages,
* number of subpages for pages in 1-level pages
* Now the PageSelectionModel should listen to the page resize events happening in JPagination-PaginationModel-Pager
* classes and repond to it by updating its BitSet datastructure which keeps track of user selections in sync
* with page resize changes.
*
* @author chetan_bh
*/
public interface PageSelectionModel
{
@Deprecated
static int SINGLE_SELECTION = 1;
@Deprecated
static int MULTIPLE_SELECTION = 2;
public boolean isSelectedIndex(String pageIndex, int index);
public boolean isSelectionEmpty();
public int getSelectionMode();
public void setSelectionMode(int selectionMode);
//public void clearSelection();
//public int getMaxSelectionIndex();
//public int getMinSelectionIndex();
public void addPageSelectionListener(PageSelectionListener x);
public void removePageSelectionListener(PageSelectionListener x);
public void fireSelectionValueChanged(PageSelectionEvent selectionEvent);
public int getSelectionCount();
public void clearPage(String pageIndex);
public void selectPage(String pageIndex);
public void clearAll();
// TODO This may not work properly, because for selectAll doesn't have a list of all pages.
public void selectAll();
// TODO This may work properly.
public void invertPageSelection(String pageIndex);
// TODO This may not work properly.
//public void invertSelection();
public Vector<PageElementIndex> getSelectedPageIndices();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -