info.joseluismartin.vaadin.ui.table
Class VaadinPaginator<T>

java.lang.Object
  extended by info.joseluismartin.vaadin.ui.AbstractView<Page<T>>
      extended by info.joseluismartin.vaadin.ui.table.VaadinPaginator<T>
All Implemented Interfaces:
Paginator, Binder<Page<T>>, ModelHolder<Page<T>>, View<Page<T>>, Serializable

public class VaadinPaginator<T>
extends AbstractView<Page<T>>
implements Paginator, Serializable

Paginator implementation for Vaadin framework

Author:
Jose Luis Martin - (jlm@joseluismartin.info)
See Also:
Serialized Form

Constructor Summary
VaadinPaginator()
          Creates a new paginator with default page size of 10 records
VaadinPaginator(Page<T> page)
          Creates a new paginator with current page
 
Method Summary
 void addPaginatorListener(PaginatorListener listener)
          
protected  com.vaadin.ui.Component buildPanel()
          Build the Component of view.
 void firstPage()
          
 int getCount()
          
 com.vaadin.ui.Button getFirst()
           
 com.vaadin.ui.Button getLast()
           
 com.vaadin.ui.Button getNext()
           
 int getPage()
          
 int getPageSize()
          
 String[] getPageSizes()
           
 com.vaadin.ui.Button getPrevious()
           
 int getStartIndex()
          
 int getTotalPages()
          
 boolean hasNext()
          
 boolean hasPage(int indexPage)
          
 boolean hasPrevious()
          
 void lastPage()
          
 void nextPage()
          
 void previousPage()
          
 void refresh()
          Update Component from model
 void removePaginatorListener(PaginatorListener listener)
          
 void setCount(int count)
          
 void setFirst(com.vaadin.ui.Button first)
           
 void setLast(com.vaadin.ui.Button last)
           
 void setNext(com.vaadin.ui.Button next)
           
 void setPage(int indexPage)
          
 void setPageSize(int pageSize)
          
 void setPageSizes(String[] pageSizes)
           
 void setPrevious(com.vaadin.ui.Button previous)
           
 void update()
          Update Model from Component
 
Methods inherited from class info.joseluismartin.vaadin.ui.AbstractView
getComponent, getModel, setModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VaadinPaginator

public VaadinPaginator()
Creates a new paginator with default page size of 10 records


VaadinPaginator

public VaadinPaginator(Page<T> page)
Creates a new paginator with current page

Parameters:
page - current page
Method Detail

buildPanel

protected com.vaadin.ui.Component buildPanel()
Build the Component of view.

Specified by:
buildPanel in class AbstractView<Page<T>>
Returns:

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Paginator

hasPrevious

public boolean hasPrevious()

Specified by:
hasPrevious in interface Paginator

hasPage

public boolean hasPage(int indexPage)

Specified by:
hasPage in interface Paginator

setPage

public void setPage(int indexPage)

Specified by:
setPage in interface Paginator

getPage

public int getPage()

Specified by:
getPage in interface Paginator

getTotalPages

public int getTotalPages()

Specified by:
getTotalPages in interface Paginator

nextPage

public void nextPage()

Specified by:
nextPage in interface Paginator

previousPage

public void previousPage()

Specified by:
previousPage in interface Paginator

lastPage

public void lastPage()

Specified by:
lastPage in interface Paginator

firstPage

public void firstPage()

Specified by:
firstPage in interface Paginator

getStartIndex

public int getStartIndex()

Specified by:
getStartIndex in interface Paginator

getPageSize

public int getPageSize()

Specified by:
getPageSize in interface Paginator

setPageSize

public void setPageSize(int pageSize)

Specified by:
setPageSize in interface Paginator

addPaginatorListener

public void addPaginatorListener(PaginatorListener listener)

Specified by:
addPaginatorListener in interface Paginator

removePaginatorListener

public void removePaginatorListener(PaginatorListener listener)

Specified by:
removePaginatorListener in interface Paginator

refresh

public void refresh()
Update Component from model

Specified by:
refresh in interface Binder<Page<T>>

getPageSizes

public String[] getPageSizes()

setPageSizes

public void setPageSizes(String[] pageSizes)

getNext

public com.vaadin.ui.Button getNext()

setNext

public void setNext(com.vaadin.ui.Button next)

getPrevious

public com.vaadin.ui.Button getPrevious()

setPrevious

public void setPrevious(com.vaadin.ui.Button previous)

getFirst

public com.vaadin.ui.Button getFirst()

setFirst

public void setFirst(com.vaadin.ui.Button first)

getLast

public com.vaadin.ui.Button getLast()

setLast

public void setLast(com.vaadin.ui.Button last)

update

public void update()
Update Model from Component

Specified by:
update in interface Binder<Page<T>>

getCount

public int getCount()

Specified by:
getCount in interface Paginator

setCount

public void setCount(int count)

Specified by:
setCount in interface Paginator


Copyright © 2012 JDAL. All Rights Reserved.