it.amattioli.applicate.browsing
Class PagedListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

Show UML class diagram
java.lang.Object
  extended by it.amattioli.applicate.browsing.ListBrowserImpl<I,T>
      extended by it.amattioli.applicate.browsing.PagedListBrowserImpl<I,T>
All Implemented Interfaces:
Browser<I,T>, ListBrowser<I,T>, PagedListBrowser<I,T>, CommandListener, Selector<T>, it.amattioli.dominate.util.PropertyChangeEmitter, EventListener

public class PagedListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
extends ListBrowserImpl<I,T>
implements PagedListBrowser<I,T>


Field Summary
protected  int currPage
           
 
Fields inherited from class it.amattioli.applicate.browsing.ListBrowserImpl
content, selectedIndex
 
Constructor Summary
PagedListBrowserImpl()
           
PagedListBrowserImpl(it.amattioli.dominate.Repository<I,T> repository)
           
 
Method Summary
protected  void findSelectedInPage()
           
 void firstPage()
           
 Long getCurrentPageNumber()
           
 boolean getHasNext()
          Indicate if there is an object next to the currently selected object.
 boolean getHasNextPage()
           
 boolean getHasPrevious()
          Indicate if there is an object previous to the currently selected object.
 boolean getHasPreviousPage()
           
 List<T> getList()
          Retrieves the list of the browsing objects.
 List<T> getListAll()
           
 int getPageSize()
           
 Long getTotalPages()
           
 void gotoPage(int page)
           
protected  void invalidateContent()
           
 void next()
          Move the selection to the object next to the currently selected object.
 void nextPage()
           
 void previous()
          Move the selection to the object previous to the currently selected object.
 void previousPage()
           
protected  void refreshPageLimits()
           
 void select(int index)
          Select an object using its index inside the list retrieved using ListBrowser.getList().
 void setFilter(it.amattioli.dominate.Filter filter)
          Set the criteria to be used to filter the browsing objects.
 void setPage(int page)
           
 void setPageSize(int size)
           
 
Methods inherited from class it.amattioli.applicate.browsing.ListBrowserImpl
addCommandListener, addCommandListener, addContentChangeListener, addOrder, addOrder, addPropertyChangeListener, addSelectionListener, commandDone, createFor, createFor, deselect, fillCollection, fireCommandEvent, fireContentChange, firePropertyChange, getFilter, getOrderProperty, getRepository, getReverseOrder, getSelectedIndex, getSelectedObject, getSelectedObjectBrowser, getSpecification, isEmptyList, isValidContent, isValidSelectionIndex, newObjectBrowser, refreshContent, refreshObject, release, removeContentChangeListener, removePropertyChangeListener, removeSelectionListener, select, select, setOrder, setOrder, setRepository, setSpecification, toString, useObjectBrowserClass, validateContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.amattioli.applicate.browsing.ListBrowser
addOrder, addPropertyChangeListener, deselect, fillCollection, getFilter, getOrderProperty, getReverseOrder, getSelectedIndex, getSelectedObjectBrowser, getSpecification, newObjectBrowser, removePropertyChangeListener, select, setOrder, setOrder, setSpecification, useObjectBrowserClass
 
Methods inherited from interface it.amattioli.applicate.browsing.Browser
addContentChangeListener, release, removeContentChangeListener
 
Methods inherited from interface it.amattioli.applicate.selection.Selector
addSelectionListener, getSelectedObject, removeSelectionListener
 
Methods inherited from interface it.amattioli.applicate.commands.CommandListener
commandDone
 

Field Detail

currPage

protected int currPage
Constructor Detail

PagedListBrowserImpl

public PagedListBrowserImpl()

PagedListBrowserImpl

public PagedListBrowserImpl(it.amattioli.dominate.Repository<I,T> repository)
Method Detail

findSelectedInPage

protected void findSelectedInPage()

firstPage

public void firstPage()

getList

public List<T> getList()
Description copied from interface: ListBrowser
Retrieves the list of the browsing objects. This list will be the content of the repository on which this browser is based, filtered using the criteria specified by setCriteria. The list will be sorted using the property specified by setOrder. If something causes the changing of the list of browsing objects a PropertyChange event will be fired.

Specified by:
getList in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
getList in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Returns:
the list of the browsing objects

refreshPageLimits

protected void refreshPageLimits()

invalidateContent

protected void invalidateContent()
Overrides:
invalidateContent in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

nextPage

public void nextPage()
Specified by:
nextPage in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getHasNextPage

public boolean getHasNextPage()
Specified by:
getHasNextPage in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

previousPage

public void previousPage()
Specified by:
previousPage in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getHasPreviousPage

public boolean getHasPreviousPage()
Specified by:
getHasPreviousPage in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

setPage

public void setPage(int page)
Specified by:
setPage in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

gotoPage

public void gotoPage(int page)
Specified by:
gotoPage in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getCurrentPageNumber

public Long getCurrentPageNumber()
Specified by:
getCurrentPageNumber in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getTotalPages

public Long getTotalPages()
Specified by:
getTotalPages in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

setPageSize

public void setPageSize(int size)
Specified by:
setPageSize in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

getPageSize

public int getPageSize()
Specified by:
getPageSize in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

setFilter

public void setFilter(it.amattioli.dominate.Filter filter)
Description copied from interface: ListBrowser
Set the criteria to be used to filter the browsing objects. The ListBrowser.getList() method will return only the objects that satisfy the specified criteria. The browser will listen on property changes of the filter bean so to refresh the browsing objects accordingly.

Specified by:
setFilter in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
setFilter in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Parameters:
filter - the criteria that will be used to filter the browsing objects

getHasNext

public boolean getHasNext()
Description copied from interface: ListBrowser
Indicate if there is an object next to the currently selected object.

Specified by:
getHasNext in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
getHasNext in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Returns:
true if there is an object next to the currently selected object, false if the currently selected object is the last in the list

getHasPrevious

public boolean getHasPrevious()
Description copied from interface: ListBrowser
Indicate if there is an object previous to the currently selected object.

Specified by:
getHasPrevious in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
getHasPrevious in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Returns:
true if there is an object previous to the currently selected object, false if the currently selected object is the first in the list

next

public void next()
Description copied from interface: ListBrowser
Move the selection to the object next to the currently selected object. If the currently selected object is the last of the list, nothing will happen.

Specified by:
next in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
next in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

previous

public void previous()
Description copied from interface: ListBrowser
Move the selection to the object previous to the currently selected object. If the currently selected object is the first of the list, nothing will happen.

Specified by:
previous in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
previous in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

select

public void select(int index)
Description copied from interface: ListBrowser
Select an object using its index inside the list retrieved using ListBrowser.getList(). After the selection a SelectionEvent will be notified to all the objects that has been registered using #addContentChangeListener(BrowserSelectionListener).

Specified by:
select in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Overrides:
select in class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Parameters:
index - the index inside the list retrieved using ListBrowser.getList() of the object to be selected

getListAll

public List<T> getListAll()
Specified by:
getListAll in interface PagedListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>


Copyright © 2011. All Rights Reserved.