◆ CollectionNavigator()
◆ pages()
Definition at line 93 of file CollectionNavigator.java.
95 buttons =
new ArrayList<>();
97 current = Math.max(iterator.
current(), 0);
98 if(
pages < current ||
pages == 1)
return buttons;
100 boolean navbut =
pages > pageSpan * 2;
101 int start = 0, limit = pageSpan * 2;
104 buttons.add(
new DefaultNavigatorItem(
"1",
"?page=" + 1,
null, current == 0));
105 buttons.add(
new DefaultNavigatorItem(
"<<",
"?page=" + (current),
null));
107 start = Integer.max(1, current - (limit / 2));
108 start = Integer.min(start,
pages - (limit + 1));
111 for(
int i = start; i < (start + limit) && i <
pages; i++) {
112 buttons.add(
new DefaultNavigatorItem((i + 1) +
"",
"?page=" + (i + 1),
null, current == i));
116 buttons.add(
new DefaultNavigatorItem(
">>",
"?page=" + (current + 2),
null));
117 buttons.add(
new DefaultNavigatorItem(
pages +
"",
"?page=" + (
pages),
null, current ==
pages - 1));
Collection< DefaultNavigatorItem > pages()
◆ render()
void org.turro.collections.CollectionNavigator.render |
( |
| ) |
|
Definition at line 46 of file CollectionNavigator.java.
48 current = Math.max(iterator.
current(), 0);
50 html.
startTag(
"div",
"class='dao-navigator'");
53 if(current - pageSpan > 1) {
67 for(
int i = current - pageSpan; i < current + pageSpan; i++) {
68 if(i >= 0 && i <
pages) {
69 html.
startTag(
"li", current == i ?
"class='active'" :
null);
71 html.
write((i + 1) +
"");
83 if(current + pageSpan <
pages) {
HTMLGenerator startTag(String tag)
HTMLGenerator startAnchor(String url, String hint)
HTMLGenerator write(String value)
◆ setPageSpan()
void org.turro.collections.CollectionNavigator.setPageSpan |
( |
int |
pageSpan | ) |
|
The documentation for this class was generated from the following file: